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: Is it normal that ld promote a section size


On Mon, Feb 16, 2015 at 2:54 PM, Alan Modra <amodra@gmail.com> wrote:
> On Mon, Feb 16, 2015 at 11:51:05AM +0800, Terry Guo wrote:
>> It looks to me that the size of usb_qh is promoted from 0x300(768)
>> bytes to 0x800(2048) bytes. The section .bss.UBS_EpStatus can prove
>> this. IMHO this section should start from 0x2000f300 rather than
>> 0x2000f800. This causes waste of space. Is this normal?
>
> Have you looked at the relocatable object files?  I think it likely
> you'll find your assembler is responsible for adding padding.  If gas,
> see SUB_SEGMENT_ALIGN.
>
> --
> Alan Modra
> Australia Development Lab, IBM

Thanks Alan and you are right. It is gas that increased the section
size. I am trying to figure out why gas do so because nothing in the
assembly code tell gas to do so. My assembly code is generated with
gcc flto. If I disable gcc flto, gas won't add padding for the
assembly code.

BR,
Terry


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