This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/3223: ld fails to link correct variables from linker script
On Tue, Sep 26, 2006 at 08:11:57PM +0930, Alan Modra wrote:
> I think it is quite reasonable to remove empty output sections, even
> those used to define symbols via the linker script (the symbols
> become absolute). The case for ignoring linker script VMA and LMA
> assignments isn't so strong, particularly since doing so can affect
> following sections. I think it would be safest if we went back to
> always obeying them, even for ALIGN expressions. Alternatively, we
> could completely ignore the VMA and LMA assignments on empty output
> sections. I agree that the current situation, where we take note of
> the VMA only within the section, is silly.
>
Obey ALIGN expressions on empty output sections will break x86-64. I
noticed that when I was building glibc on x86-64.
Constant VMA setting is used to load a section to a fixed address and
all sections after that. The value of nn expression for VMA can change.
"." is a possibility. We can document the linker as
.data EXPRESSSION : ...
If .data is empty and EXPRESSSION isn't a constant, EXPRESSSION = .;
H.J.