[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/18169] New: sh_info of .rel.plt/.rela.plt sections isn't correc
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/18169] New: sh_info of .rel.plt/.rela.plt sections isn't correct |
Date: |
Thu, 26 Mar 2015 16:56:26 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=18169
Bug ID: 18169
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: ld
Assignee: unassigned at sourceware dot org
Reporter: hjl.tools at gmail dot com
gABI says that sh_info of SHT_REL/SHT_RELA sections has the section header
index of the section to which the relocation applies.
address@hidden rel]$ cat x.c
extern void bar (void);
void
foo ()
{
bar ();
}
address@hidden rel]$ make
cc -m32 -O2 -fPIC -c -o x.o x.c
./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 5
4
[ 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 rel]$
sh_info of .rel.plt is 5 which points to .plt section. It should be 0.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/18169] New: sh_info of .rel.plt/.rela.plt sections isn't correct,
hjl.tools at gmail dot com <=