ld - no diagnostic when the location counter moves backwards

Ron McCall ronald.mccall@snet.net
Tue Jul 25 21:41:00 GMT 2006


Hi,

I have run into what seems like a bug in ld 2.16.1 and
2.17.  I have managed to strip down my program to a
minimal example demonstrating the issue (attached).  I
am using gcc 4.0.3 with both binutils 2.16.1 and 2.17,
Solaris 9 host, powerpc-eabi target.

The final assignment in foo.ld moves the location
counter backwards (see foo.map) but I get no error
from ld.  Making just about any change to foo.ld makes
the error message appear (or the backward movement go
away).  The ld manual, section 3.10.4 "The Location
Counter" states that the location counter may never be
moved backwards.

We have a large program in which many different object
file sections are placed into various fixed size
memory regions and I want to be sure that the linker
will tell me when I overflow one of these regions.

Is this a bug?

Thanks!

Ron McCall
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldbug.tar.gz
Type: application/gzip
Size: 2306 bytes
Desc: 3708638176-ldbug.tar.gz
URL: <https://sourceware.org/pipermail/binutils/attachments/20060725/7e2e3180/attachment.gz>


More information about the Binutils mailing list