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: jrtc27 at jrtc27 dot com
Subject: [Bug gold/22266] ld.gold produces invalid output when linking with --relocatable
Date: Tue, 14 Nov 2017 18:01:40 +0000

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

--- Comment #12 from James Clarke <jrtc27 at jrtc27 dot com> ---
(In reply to H.J. Lu from comment #9)
> Symbol table is wrong:
> 
> --- 2 2017-11-14 08:54:05.933477729 -0800
> +++ 1 2017-11-14 08:54:23.381514511 -0800
> @@ -84,7 +84,7 @@ Symbol table '.symtab' contains 10 entri
>       5: 00000000     0 SECTION LOCAL  DEFAULT    7 
>       6: 00000000     0 SECTION LOCAL  DEFAULT    9 
>       7: 00000000     0 FILE    LOCAL  DEFAULT  ABS pr22266_a.c
> -     8: fffffffc     4 OBJECT  LOCAL  DEFAULT    2 int_from_a_1
> ^^^^^^^^^^^^^^^^^^ Good
> 
> +     8: 00000000     4 OBJECT  LOCAL  DEFAULT    2 int_from_a_1
> ^^^^^^^^^^^^^^^^^^^ Bad
>       9: 00000000     4 OBJECT  GLOBAL DEFAULT    4 p_int_from_a_2

It's not that the symbol table was wrong. Your so-called "good" version is
wrong; the symbol is at offset 0 from its section .data, so it really should
have value 0 in the object file like it does now. The problem is that, it
seems, somewhere, the REL was accounting for this (which is probably why the
symbol value issue was not noticed earlier), and now that the symbol value is
fixed, the REL case is broken. You can see for yourself that the problem is
that the object file contents at "p_int_from_a_2" is 0x4, but this addend
should be 0.

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