This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: VMA section overlap warnings for overlays
On Fri, Feb 25, 2011 at 8:22 AM, Andreas Schwab <schwab@redhat.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> diff --git a/ld/testsuite/ld-elf/dynamic1.d b/ld/testsuite/ld-elf/dynamic1.d
>> new file mode 100644
>> index 0000000..6a8ba55
>> --- /dev/null
>> +++ b/ld/testsuite/ld-elf/dynamic1.d
>> @@ -0,0 +1,10 @@
>> +#ld: -shared -T dynamic1.ld
>> +#readelf: -l --wide
>> +#target: *-*-linux* *-*-gnu*
>> +
>> +#...
>> + Section to Segment mapping:
>> + ?Segment Sections...
>> +#...
>> + ? 0[1-9] ? ? .dynamic[ ? ? ?]*
>> +#pass
>
> I don't see how that tests anything, this bug is about objcopy.
>
Both readelf and objcpy use ELF_SECTION_IN_SEGMENT_1.
Before the fix:
readelf -l x.so
Elf file type is DYN (Shared object file)
Entry point 0xb0
There are 2 program headers, starting at offset 64
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x00000000000001b0 0x00000000000001b0 RW 200000
DYNAMIC 0x0000000000000100 0x0000000000000100 0x0000000000000100
0x00000000000000b0 0x00000000000000b0 RW 8
Section to Segment mapping:
Segment Sections...
00 .dynsym .dynstr .hash .data1 .dynamic
01 .data1 .dynamic
^^^^^^^
That is equivalent to "The first section in the PT_DYNAMIC segment is
not the .dynamic section".
--
H.J.