Is the current ld brolen? (Re: ld is broken on Linux/alpha)

Jakub Jelinek jakub@redhat.com
Tue Nov 13 06:17:00 GMT 2001


On Sat, Nov 24, 2001 at 11:24:39PM -0800, H . J . Lu wrote:
> Does your gcc support SHF_MERGE/STT_SECTION?

Surely I was.

> Did you see the linker messages during the build?

I missed them in the log but now I'm seeing there too:

        .section        .rodata.str1.1,"aMS",@progbits,1
.LC0:
        .string "."
...
        leal    5+.LC0@GOTOFF(%ebx), %ecx

No idea why it takes address 3 bytes beyond end of the string.
(in C there is strcpy(buf, "."); ).

Now the question is whether this should be allowed or not.
If yes, then gas will have to revert back to keeping .LC* symbols in some
cases. Worst case relocs against SHF_MERGE symbols could be optimized to
STT_SECTION + addend in debugging sections only, but the more they are, the
more we save in object files.

Is
char *p = "foo" + 20;
where p will be never dereferenced ok wrt. C standard?

	Jakub



More information about the Binutils mailing list