bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/22266] ld.gold produces invalid output when linking with --rel


From: hjl.tools at gmail dot com
Subject: [Bug gold/22266] ld.gold produces invalid output when linking with --relocatable
Date: Tue, 14 Nov 2017 16:49:21 +0000

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

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to H.J. Lu from comment #7)
> Created attachment 10589 [details]
> A testcase
> 
> address@hidden tmp]$ ld.bfd -m elf_i386 -r -T
> /export/gnu/import/git/sources/binutils-gdb/gold/testsuite/pr22266_script.t
> -o pr22266_ar.o pr22266_a.o
> address@hidden tmp]$ gcc -m32 pr22266_main.o pr22266_ar.o
> address@hidden tmp]$ ./a.out
> address@hidden tmp]$
> /export/build/linux/binutils-x32/build-x86_64-linux-gnux32/gold/ld-new -m
> elf_i386 -r -T
> /export/gnu/import/git/sources/binutils-gdb/gold/testsuite/pr22266_script.t
> -o pr22266_ar.o pr22266_a.o
> address@hidden tmp]$ gcc -m32 pr22266_main.o pr22266_ar.o
> address@hidden tmp]$ ./a.out
> Aborted
> address@hidden tmp]$

Revert

    Fix problems with -r.

    The fix committed for PR gold/19291 ended up breaking other cases. The
    commit added adjustment code to write_local_symbols, but in many cases
    compute_final_local_value_internal had already subtracted the output
    section's address. To fix this, all other adjustments are now removed, so
    only the one in write_local_symbols is left.

    gold/
            PR gold/22266
            * object.cc
(Sized_relobj_file::compute_final_local_value_internal):
            Drop relocatable parameter and stop adjusting output value based on
            it.
            (Sized_relobj_file::compute_final_local_value): Stop passing
            relocatable to compute_final_local_value_internal.
            (Sized_relobj_file::do_finalize_local_symbols): Ditto.
            * object.h (Sized_relobj_file::compute_final_local_value_internal):
            Drop relocatable parameter.

fixed this testcase.

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