forked from seL4/seL4
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "ax" flags to .section directives in assembly
This commit fixes a linking error when using LLVM's lld. llvm-as doesn't assume or assign section flags for input section if not specified. This will make the section non-allocatable and put into a none segment and trigger relocation linking errors against symbols in non-allocatble sections. For example, when building with LLVM/lld for AArch64, the following error occurs: (traps.S.obj:(function arm_vector_table: .vectors+0x0): has non-ABS relocation R_AARCH64_JUMP26 against symbol 'invalid_vector_entry') This does not happen with ld.bfd (GNU's linker) as it seems to allow relocations against symbols in non-allocatable sections. The GNU's assembler documentation states that: "If no flags are specified, the default flags depend upon the section name. If the section name is not recognized, the default will be for the section to have none of the above flags: it will not be allocated in memory, nor writable, nor executable. The section will contain data. [1]" This commit explicitly sets .section flags in assembly to avoid this error and for better intentionality (and good practice) without relying on toolchains handling flags and linkage differently. [1] https://sourceware.org/binutils/docs/as/Section.html Sponsored by: DARPA. Signed-off-by: Hesham Almatary <hesham.almatary@cl.cam.ac.uk>
- Loading branch information
1 parent
b9b36e5
commit 5b4fb3e
Showing
8 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters