This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SEC_NEVER_LOAD cleanup


On 16/10/2010 21:08, Kai Tietz wrote:
> 2010/10/16 Alan Modra <amodra@gmail.com>:
>> On Fri, Oct 15, 2010 at 09:54:18PM +0100, Dave Korn wrote:
>>>>   .gnu_debuglink_overlay ALIGN(__section_alignment__) (NOLOAD):
>>>>   {
>>>>     BYTE(0) /* c */

>> Using your script with a small tweak for ELF gave me the same error.
>>
>>>   I think (haven't checked yet) that this looks like a consequence of the
>>> ldlang.c changes.  Any thoughts on how to fix it?
>> Like this, I think, just as we discard input sections and padding in
>> noload sections.  Can you test this out for me on cygwin?
>>
>>        * ldwrite.c (build_link_order <lang_data_statement_enum>): Don't
>>        output when section has no contents.
>>        (build_link_order <lang_reloc_statement_enum>): Likewise.

> Well, this looks ok, too. But AFAICS it is touching just the surface.
> My recent patch took care that for PE-COFF the content of the
> debugging sections didn't got zero'ed. Maybe it is a general failure
> to assume (at least for pe-coff, but maybe for elf, too) that NOLOAD
> means to discard sections from linking?

  I'm seeing odd behaviour.  If I build the cygwin dll with the
map_input_to_output_sections reverted, I get this:

> $ objdump -h cygwin0.dll
> 
> cygwin0.dll:     file format pei-i386
> 
> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn

>   9 .gnu_debuglink_overlay 00000010  61239000  61239000  001fee00  2**2
>                   CONTENTS, EXCLUDE

  ... and this:

> $ objdump -s -j .gnu_debuglink_overlay  cygwin0.dll
> 
> cygwin0.dll:     file format pei-i386
> 
> Contents of section .gnu_debuglink_overlay:
>  61239000 00000000 00000000 00000000 00000000  ................
> 
> $

  With the build_link_order change instead, I get this:

> $ objdump -h cygwin0.dll
> 
> cygwin0.dll:     file format pei-i386
> 
> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn

>   9 .gnu_debuglink_overlay 00000010  61239000  61239000  00000000  2**2
>                   EXCLUDE

  ... and this:

> $ objdump -s -j .gnu_debuglink_overlay  cygwin0.dll
> 
> cygwin0.dll:     file format pei-i386
> 
> objdump: section '.gnu_debuglink_overlay' mentioned in a -j option, but not
> found in any input file

  I think it really needs that CONTENTS flag.  Can look closer at it later, I
have to go offline for a while now.

    cheers,
      DaveK


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]