|
@@ -514,12 +514,10 @@ static int text_section_informations(const int fd,
|
514
|
514
|
{
|
515
|
515
|
const int off_section_off = 0x18;
|
516
|
516
|
|
517
|
|
- off_t off;
|
518
|
|
- ssize_t rret;
|
519
|
517
|
int err;
|
520
|
518
|
unsigned long int strtab_offset, strtab_sz;
|
521
|
519
|
|
522
|
|
- if((off = lseek(fd, strtab_section_offset + off_section_off, SEEK_SET)) != \
|
|
520
|
+ if(lseek(fd, strtab_section_offset + off_section_off, SEEK_SET) != \
|
523
|
521
|
strtab_section_offset + off_section_off)
|
524
|
522
|
{
|
525
|
523
|
err=errno;
|
|
@@ -527,14 +525,14 @@ static int text_section_informations(const int fd,
|
527
|
525
|
errno = err;
|
528
|
526
|
return -1;
|
529
|
527
|
}
|
530
|
|
- if((rret = read(fd, &strtab_offset, 8)) != 8)
|
|
528
|
+ if(read(fd, &strtab_offset, 8) != 8)
|
531
|
529
|
{
|
532
|
530
|
err=errno;
|
533
|
531
|
asmsh_log_perror("Unable to read strtab offset");
|
534
|
532
|
errno = err;
|
535
|
533
|
return -1;
|
536
|
534
|
}
|
537
|
|
- if((rret = read(fd, &strtab_sz, 8)) != 8)
|
|
535
|
+ if(read(fd, &strtab_sz, 8) != 8)
|
538
|
536
|
{
|
539
|
537
|
err=errno;
|
540
|
538
|
asmsh_log_perror("Unable to read strtab size");
|
|
@@ -543,14 +541,14 @@ static int text_section_informations(const int fd,
|
543
|
541
|
}
|
544
|
542
|
|
545
|
543
|
char strtab[strtab_sz];
|
546
|
|
- if((off = lseek(fd, strtab_offset, SEEK_SET)) != strtab_offset)
|
|
544
|
+ if(lseek(fd, strtab_offset, SEEK_SET) != strtab_offset)
|
547
|
545
|
{
|
548
|
546
|
err=errno;
|
549
|
547
|
asmsh_log_perror("Unable to seek at strtab");
|
550
|
548
|
errno = err;
|
551
|
549
|
return -1;
|
552
|
550
|
}
|
553
|
|
- if((rret = read(fd, strtab, strtab_sz)) != strtab_sz)
|
|
551
|
+ if(read(fd, strtab, strtab_sz) != strtab_sz)
|
554
|
552
|
{
|
555
|
553
|
err=errno;
|
556
|
554
|
asmsh_log_perror("Unable to read strtab");
|
|
@@ -562,7 +560,7 @@ static int text_section_informations(const int fd,
|
562
|
560
|
for(unsigned short i=0; i<section_header_count; i++)
|
563
|
561
|
{
|
564
|
562
|
unsigned long int cur_off = section_header_off + i*section_header_sz;
|
565
|
|
- if((off = lseek(fd, cur_off, SEEK_SET)) != cur_off)
|
|
563
|
+ if(lseek(fd, cur_off, SEEK_SET) != cur_off)
|
566
|
564
|
{
|
567
|
565
|
err=errno;
|
568
|
566
|
asmsh_log_perror("Unable to seek section");
|
|
@@ -570,7 +568,7 @@ static int text_section_informations(const int fd,
|
570
|
568
|
return -1;
|
571
|
569
|
}
|
572
|
570
|
unsigned int name_off;
|
573
|
|
- if((rret = read(fd, &name_off, 4)) != 4)
|
|
571
|
+ if(read(fd, &name_off, 4) != 4)
|
574
|
572
|
{
|
575
|
573
|
err=errno;
|
576
|
574
|
asmsh_log_perror("Unable to read section's name offset");
|
|
@@ -593,7 +591,7 @@ static int text_section_informations(const int fd,
|
593
|
591
|
continue;
|
594
|
592
|
}
|
595
|
593
|
unsigned int type;
|
596
|
|
- if((rret = read(fd, &type, 4)) != 4)
|
|
594
|
+ if(read(fd, &type, 4) != 4)
|
597
|
595
|
{
|
598
|
596
|
err=errno;
|
599
|
597
|
asmsh_log_perror("Unable to read section type");
|
|
@@ -607,7 +605,7 @@ static int text_section_informations(const int fd,
|
607
|
605
|
return -1;
|
608
|
606
|
}
|
609
|
607
|
|
610
|
|
- if((off = lseek(fd, cur_off + off_section_off, SEEK_SET)) != \
|
|
608
|
+ if(lseek(fd, cur_off + off_section_off, SEEK_SET) != \
|
611
|
609
|
cur_off + off_section_off)
|
612
|
610
|
{
|
613
|
611
|
err=errno;
|
|
@@ -616,14 +614,14 @@ static int text_section_informations(const int fd,
|
616
|
614
|
return -1;
|
617
|
615
|
}
|
618
|
616
|
|
619
|
|
- if((rret = read(fd, text_off, 8)) != 8)
|
|
617
|
+ if(read(fd, text_off, 8) != 8)
|
620
|
618
|
{
|
621
|
619
|
err=errno;
|
622
|
620
|
asmsh_log_perror("Unable to read .text section offset");
|
623
|
621
|
errno = err;
|
624
|
622
|
return -1;
|
625
|
623
|
}
|
626
|
|
- if((rret = read(fd, text_sz, 8)) != 8)
|
|
624
|
+ if(read(fd, text_sz, 8) != 8)
|
627
|
625
|
{
|
628
|
626
|
err=errno;
|
629
|
627
|
asmsh_log_perror("Unable to read .text section size");
|