3 gold testcases...
Ian Lance Taylor
Tue Apr 8 23:04:00 GMT 2008
David Miller <email@example.com> writes:
> I've analyzed each one, and they really aren't sparc target
> bugs per-se, but rather testcases that need some tweaks of
> some sort:
Yes, the linker script tests are definitely touchy.
> 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?
> 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
> 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
> Actually, if I run the program as:
> bash$ /lib/ld-linux.so.2 ./script_test_3
> it works, so I suppose the PT_LOAD mapping rules of the dynamic
> linker are more relaxed than that of the kernel.
> Section Headers:
> [Nr] Name Type Addr Off Size ES Flg Lk Inf Al
> [ 0] NULL 00000000 000000 000000 00 0 0 0
> [ 1] .interp PROGBITS 10000000 010000 000013 00 A 0 0 1
>  .text PROGBITS 100004e0 0104e0 000b48 00 AX 0 0 32
>  .text PROGBITS 10001028 011028 0002a8 00 AX 0 0 4
> Program Headers:
> Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
> INTERP 0x010000 0x10000000 0x10000000 0x004c8 0x004c8 R 0x8
> [Requesting program interpreter: /lib/ld-linux.so.2]
> LOAD 0x000000 0x0fff0000 0x0fff0000 0x11398 0x11398 R E 0x2000
> LOAD 0x011400 0x10101400 0x10101400 0x001e0 0x001e0 RWE 0x2000
> LOAD 0x011600 0x10201600 0x10201600 0x00000 0x00088 RW 0x2000
> DYNAMIC 0x011400 0x10101400 0x10101400 0x000d0 0x000d0 R 0x4
More information about the Binutils