bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/26583] R_X86_64_PC32 relocation against data symbol is mishandle


From: minnowware at hotmail dot com
Subject: [Bug ld/26583] R_X86_64_PC32 relocation against data symbol is mishandled
Date: Thu, 10 Sep 2020 18:32:18 +0000

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

--- Comment #8 from Kilian Kegel <minnowware at hotmail dot com> ---
Hi H.J.Lu,

thank you for your quick response.

Regrettably I had a lot of trouble building your branch 

https://gitlab.com/x86-binutils/binutils-gdb/-/commits/users/hjl/pr26583/master

because of missing, bison, m4 in my UBUNTU 20.04 build environment.

So could you please do the testing? In the ldBugDemo0 directory just type

   ld --output=program.elf -Map=program.elf.map --entry="begin" *.obj

and 

   objdump -d program.elf

(from M.BAT batch file included in the directory)
and check if ...

0000000000401000 <getaddr1>:
  401000:       48 8d 05 0c 20 00 00    lea    0x200c(%rip),%rax #403013
<begin+0x1ff3>
  401007:       c3                      retq   
  401008:       0f 1f 84 00 00 00 00    nopl   0x0(%rax,%rax,1)
  40100f:       00 

0000000000401010 <getaddr2>:
  401010:       48 8d 05 fd 1f 00 00    lea    0x1ffd(%rip),%rax #403014
<__bss_start>
  401017:       c3                      retq   
  401018:       0f 1f 84 00 00 00 00    nopl   0x0(%rax,%rax,1)
  40101f:       00 

... the LEA instruction in getaddr1() and getaddr2() loads the SAME address. 
In the sample above they return 403013 vs 403014. 
This is different and THIS IS THE .BSS RELOCATION BUG!

Instead I have downloaded the binutils source from GNU (2.35, 2.34 and 2.21)
and I was able to build and test, but all of them report:

   "getaddr1.obj: file not recognized: file format not recognized"

Afterwards I checked recent versions of Debian, RedHat, Suse and Ubuntu
with different versions of binutils included in each particular distribution
and ALL OF THEM were able to link .OBJ to .ELF, but regrettably
with the .BSS relocation error we are talking about.

Regards,
Kilian

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