bug-binutils
[Top][All Lists]
Advanced

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

Re: ld 2.16 bug in linker script ?


From: Philippe Biondi
Subject: Re: ld 2.16 bug in linker script ?
Date: Tue, 11 Oct 2005 19:27:45 +0200 (CEST)

On Mon, 10 Oct 2005, Alan Modra wrote:

On Sun, Oct 09, 2005 at 05:28:15PM +0200, Philippe Biondi wrote:
but I think these two linker scripts should be equivalent.

No, you haven't specified where .got should go (*).  ld is free to place
unspecified sections where it likes.

*) Which is quite foolish, given that you defined a symbol that belongs
in .got, __GLOBAL_OFFSET_TABLE__.

For me _GLOBAL_OFFSET_TABLE_ is only a linker symbol. It will not be present in the GOT. I don't understand why setting its value to "." would not be taken into account (maybe is it a special symbol ?). And I don't see any semantic difference between the 2 linker scripts, so that I'm a bit confused they are interpreted differently.

As a side note, this script also fails to work as I would expect (but I'm not an expert on this) :

SECTIONS {
        /DISCARD/ : {
                *(.stab*)
                *(.comment)
                *(.note)
        }
        _GLOBAL_OFFSET_TABLE_ = .;
        all : {*(.got, .text, .rodata, .rdata, .data, .bss) }
}


--
Philippe Biondi <phil@ secdev.org>      SecDev.org
Computer Security/R&D                   http://www.secdev.org
PGP KeyID:3D9A43E2  FingerPrint:C40A772533730E39330DC0985EE8FF5F3D9A43E2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]