Is it normal that ld promote a section size
Terry Guo
flameroc@gmail.com
Mon Feb 16 03:51:00 GMT 2015
Hi there,
In assembly code, I have below two sections generated with gcc lto:
.section .bss.usb_qh,"aw",%nobits
.align 11
.set .LANCHOR8,. + 0
.type usb_qh, %object
.size usb_qh, 768
usb_qh:
.space 768
.section .bss.USB_EpStatus,"aw",%nobits
.align 1
.set .LANCHOR3,. + 0
.type USB_EpStatus, %object
.size USB_EpStatus, 2
USB_EpStatus:
.space 2
Then after link, in final map file, I got:
.bss.USB_CurrentInterface
0x2000e9aa 0x1 airspy_m0.elf.ltrans1.ltrans.o
*fill* 0x2000e9ab 0x655
.bss.usb_qh 0x2000f000 0x800 airspy_m0.elf.ltrans1.ltrans.o
0x2000f000 usb_qh
.bss.USB_EpStatus
0x2000f800 0x2 airspy_m0.elf.ltrans1.ltrans.o
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?
BR,
Terry
More information about the Binutils
mailing list