assembly - GNU Assembler adds uncessary padding to the end of the section -
consider following assembler code snipper gnu assembler:
.section .text .align 4 .string "text"
without padding, result in section of 5 bytes alignment of 2^4 = 16. however, verified gnu assembler (arm target) adds padding end of section such section's length multiple of 16. seems unnecessary alignment guarantee beginning of section, not end. why assembler add padding @ end? can disabled?
put above assembler snipper in file called test.s , run following:
arm-none-eabi-gcc -c -o test.o test.s arm-none-eabi-objdump -x test.o
observe alignment of text section 2^4=16 requested , size of .text section 0x10 instead of 5.
Comments
Post a Comment