3 gold testcases...
Tue Apr 8 23:18:00 GMT 2008
From: Ian Lance Taylor <firstname.lastname@example.org>
Date: Tue, 08 Apr 2008 16:03:54 -0700
> David Miller <email@example.com> writes:
> > 1) justsyms puts a string at 0x10000 hoping that will be
> > out of the way and not in some mapped region of the
> > executable image so that it will generate a segfault.
> > This happens to be where the .text gets mapped so the
> > segfault doesn't happen and the testcase fails.
> Ouch, bad luck. Really, though, the address can be anywhere. What if
> we change it to 0x100?
Yes, that works for me.
> > 2) script_test_2 fails because of the assertion:
> > assert(reinterpret_cast<uintptr_t>(start_test_area_1 + 48 + 7 + 4)
> > == reinterpret_cast<uintptr_t>(start_data));
> > It assumes that the string will only consume 7 bytes, but on
> > Sparc strings are emitted by the compiler with an ".align 8"
> > directive, and thus the size consumed by the string is rounded
> > up to 8 bytes.
> Would it work if we make both strings 8 characters long and adjust
Yes, that works here.
> > 3) script_test_3 fails because the PT_LOAD segments created overlap
> > within a page, and the kernel thus refuses to load the binary.
> I'm not sure I understand this one. It's normally OK for PT_LOAD
> segments to overlap within a page in the file. The segments here do
> not overlap in virtual address space, unless your pages are very
You're right, something else must be wrong, I'll try to figure out
what the problem is.
BTW, on x86 on current Fedora rawhide, script_test_2 won't even link
gcctestdir/ld: internal error in segment_precedes, at ../../src/gold/layout.cc:1530
Both 'flags1' and 'flags2' are equal to '4'. Perhaps it's some
side effect of what's in some system objects.
More information about the Binutils