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.

1 Answer 1

2

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);
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.