0

One can use the ALIGN and SUBALIGN directives to align sections within a linker script for an ELF. However, is it possible to pad a section to a particular alignment, so the size of the section in the ELF is correct? Thanks in advance.

MateoConLechuga
  • 561
  • 4
  • 23

1 Answers1

1

On second thought:

. actually refers to the byte offset from the start of the current containing object.

So, this would work just fine:

.text : {
  ./crt.o(.text)
  . = ALIGN(16);
}
MateoConLechuga
  • 561
  • 4
  • 23