bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/18182] New: sh_info of .rel.plt/.rela.plt sections isn't corre


From: hjl.tools at gmail dot com
Subject: [Bug gold/18182] New: sh_info of .rel.plt/.rela.plt sections isn't correct
Date: Mon, 30 Mar 2015 12:52:52 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=18182

            Bug ID: 18182
           Summary: sh_info of .rel.plt/.rela.plt sections isn't correct
           Product: binutils
           Version: 2.26 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: hjl.tools at gmail dot com
                CC: ian at airs dot com

address@hidden pr18169]$ make LD=ld.gold
cc -m32 -O2 -fPIC   -c -o x.o x.c
ld.gold -m elf_i386 --emit-relocs -shared -o x.so x.o
readelf -SW x.so #| grep REL
There are 20 section headers, starting at offset 0x4e0:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf
Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0 
0
  [ 1] .dynsym           DYNSYM          000000d4 0000d4 000060 10   A  2   1 
4
  [ 2] .dynstr           STRTAB          00000134 000134 000021 00   A  0   0 
1
  [ 3] .hash             HASH            00000158 000158 00002c 04   A  1   0 
4
  [ 4] .rel.plt          REL             00000184 000184 000008 08  AI  1   5 
4
                                                                            ^^
5 points to .plt section.

  [ 5] .plt              PROGBITS        00000190 000190 000020 04  AX  0   0
16
  [ 6] .text             PROGBITS        000001b0 0001b0 00001d 00  AX  0   0
16
  [ 7] .eh_frame         PROGBITS        000001d0 0001d0 000074 00   A  0   0 
4
  [ 8] .dynamic          DYNAMIC         00001244 000244 000078 08  WA  2   0 
4
  [ 9] .got              PROGBITS        000012bc 0002bc 000000 00  WA  0   0 
4
  [10] .got.plt          PROGBITS        000012bc 0002bc 000010 00  WA  0   0 
4
  [11] .data             PROGBITS        000012cc 0002cc 000000 00  WA  0   0 
1
  [12] .bss              NOBITS          000012cc 0002cc 000000 00  WA  0   0 
1
  [13] .comment          PROGBITS        00000000 0002cc 00002d 01  MS  0   0 
1
  [14] .rel.text         REL             00000000 0002fc 000018 08   I 17   6 
4
  [15] .rel.eh_frame     REL             00000000 000314 000010 08   I 17   7 
4
  [16] .note.gnu.gold-version NOTE            00000000 000324 00001c 00      0 
 0  4
  [17] .symtab           SYMTAB          00000000 000340 0000b0 10     18   6 
4
  [18] .strtab           STRTAB          00000000 0003f0 00005a 00      0   0 
1
  [19] .shstrtab         STRTAB          00000000 00044a 000094 00      0   0 
1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)
address@hidden pr18169]$ 

ld generates:

address@hidden pr18169]$ make
./ld -m elf_i386 --emit-relocs -shared -o x.so x.o
readelf -SW x.so #| grep REL
There are 18 section headers, starting at offset 0x540:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf
Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0 
0
  [ 1] .hash             HASH            000000b4 0000b4 00002c 04   A  2   0 
4
  [ 2] .dynsym           DYNSYM          000000e0 0000e0 000060 10   A  3   1 
4
  [ 3] .dynstr           STRTAB          00000140 000140 000021 00   A  0   0 
1
  [ 4] .rel.plt          REL             00000164 000164 000008 08  AI  2  11 
4
                                                                           ^^
11 points to .got.plt section.

  [ 5] .plt              PROGBITS        00000170 000170 000020 04  AX  0   0
16
  [ 6] .text             PROGBITS        00000190 000190 00001d 00  AX  0   0
16
  [ 7] .rel.text         REL             00000000 000518 000018 08   I 16   6 
4
  [ 8] .eh_frame         PROGBITS        000001b0 0001b0 000070 00   A  0   0 
4
  [ 9] .rel.eh_frame     REL             00000000 000530 000010 08   I 16   8 
4
  [10] .dynamic          DYNAMIC         00001220 000220 000078 08  WA  3   0 
4
  [11] .got.plt          PROGBITS        00001298 000298 000010 04  WA  0   0 
4
  [12] .data             PROGBITS        000012a8 0002a8 000000 00  WA  0   0 
1
  [13] .bss              NOBITS          000012a8 0002a8 000000 00  WA  0   0 
1
  [14] .comment          PROGBITS        00000000 0002a8 00002c 01  MS  0   0 
1
  [15] .shstrtab         STRTAB          00000000 0002d4 000078 00      0   0 
1
  [16] .symtab           SYMTAB          00000000 00034c 000170 10     17  18 
4
  [17] .strtab           STRTAB          00000000 0004bc 00005a 00      0   0 
1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)
address@hidden pr18169]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]