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

--- Comment #2 from Rainer Orth <ro at gcc dot gnu.org> ---
Actually, for the link with /bin/ld to succeed one needs -z textoff, otherwise
one gets

Text relocation remains                         referenced
    against symbol                  offset      in file
func_p                              0x16        tmpdir/no-plt-check1.o
ld: fatal: relocations remain against allocatable but non-writable sections

The original attempt used -pie unmodified, which with /bin/ld is not what one
thinks (it's -p <auditlib> instead).  The above happens with the correct 
-z type=pie.

For the failing cmp, ld emits

   [11]  R_AMD64_PC32         0x12c6     0 0xfffffffffffffffc  .text      
func_p

while gld produces

   [11]  R_AMD64_COPY       0x100f68        0        0  .bss        func_p

When linking with gld -z nocopyreloc -z notext, the link succeeds and the 
test PASSes.

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

Reply via email to