bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/26936] [ld, PIE] ld drops relocation for .text.__x86.get_pc_thun


From: vries at gcc dot gnu.org
Subject: [Bug ld/26936] [ld, PIE] ld drops relocation for .text.__x86.get_pc_thunk.bx
Date: Tue, 24 Nov 2020 16:08:30 +0000

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

--- Comment #13 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #12)
> (In reply to Tom de Vries from comment #11)
> > (In reply to Tom de Vries from comment #10)
> > > And, reproduced:
> > 
> > To put it in gdb terms:
> > ...
> > $ gdb -q a.out
> > Reading symbols from a.out...
> > (gdb) b  __x86.get_pc_thunk.bx
> > Breakpoint 1 at 0x11d0: file ../sysdeps/i386/crti.S, line 66.
> > (gdb) r
> > Starting program: a.out 
> > Missing separate debuginfos, use: zypper install
> > glibc-32bit-debuginfo-2.26-lp152.26.3.1.x86_64
> > 
> > Breakpoint 1, __x86.get_pc_thunk.bx () at ../sysdeps/i386/crti.S:66
> > 66      ../sysdeps/i386/crti.S: No such file or directory.
> > Missing separate debuginfos, use: zypper install
> > libgcc_s1-gcc11-32bit-debuginfo-11.0.0+git181412-lp152.1.1.x86_64
> > ...
> > 
> > Breakpoint has correct address, but wrong file and wrong line.
> 
> [hjl@gnu-cfl-2 libgcc]$ nm /lib/crti.o
> 00000000 T _fini
>          U _GLOBAL_OFFSET_TABLE_
>          w __gmon_start__
> 00000000 T _init
> 00000000 T __x86.get_pc_thunk.bx
> [hjl@gnu-cfl-2 libgcc]$ 
> 
> 
> You got the right file.

Ah, I see.

So we have __x86.get_pc_thunk.bx in two object files, each with corresponding
debug info.  Due to linkonce in one of them, we only keep one.  The debuginfo
for one object is filled in correctly:
...
crti.S  66              0x11d0               x
crti.S   -              0x11d4
...
the debuginfo for the other becomes incorrect:
...
morestack.S  636                   0               x
morestack.S  637                 0x3               x
morestack.S    -                 0x4
...

However, if we look at the non-PIE result we have correct debuginfo for both:
...
crti.S  66           0x8048880               x
crti.S   -           0x8048884
...
and:
...
morestack.S  636           0x8048880               x
morestack.S  637           0x8048883               x
morestack.S    -           0x8048884
...

So, AFAIU there's a linker bug here.

-- 
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]