bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU ld bug


From: Ian Lance Taylor
Subject: Re: GNU ld bug
Date: 20 Dec 2000 14:31:31 -0800

   From: address@hidden
   Date: Wed, 20 Dec 2000 17:16:07 -0500 (EST)

   The documentation thus states:
   > For example,
   > .text . : { *(.text) }
   >
   > and
   > .text : { *(.text) }
   >
   > are subtly different.  The first will set the address of the `.text'
   > output section to the current value of the location counter.  The
   > second will set it to the current value of the location counter aligned
   > to the strictest alignment of a `.text' input section.



   I get this from the linker
   >user_text_0
   >                0x0000000000001000     0x3008
   > *(.user_text_0)
   > *fill*         0x0000000000001000 0x100081010100
   > user_text_0
   >                0x0000000000002000     0x2008 converted.o
   >                0x0000000000007000                .=0x7000
   >
   >user_text_1
   >                0x0000000000008000     0x2008
   > *(.user_text_1)
   > user_text_1
   >                0x0000000000008000     0x2008 converted.o


   It was my understanding that the linker should have ignored the
   alignment field for the input section in the case of user_text_0.
   Instead, as you can see, it started the new output section at the
   correct address but padded it up to the alignment and then inserted my
   section.  Instead, I was expecting that my input section be copied into
   the address range 0x1000-0x3008 without leading padding.

I think you are confusing the input section and the output section.  I
believe the behaviour matches the documentation: the linker script
controls the output section.  The linker then proceeds to align the
input section within the output section, according to the required
alignment of the input section.  That is normal and expected.

I don't think there is any way to tell the linker to not align an
input section to the alignment required by the input section.  It's
not a feature most people look for.

   If this is not a bug, perhaps the behaviour should be described more
   clearly in the documentation.

Please send in suggested changes.

   Interestingly enough, it seems that Sun's linker always ignores the
   alignment field.

Sounds like a bug.

Ian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]