Skip to content

Commit

Permalink
vmlinux.lds.h: Allow EXCEPTION_TABLE to live in RO_DATA
Browse files Browse the repository at this point in the history
Many architectures have an EXCEPTION_TABLE that needs to be only
readable. As such, it should live in RO_DATA. Create a macro to identify
this case for the architectures that can move EXCEPTION_TABLE into
RO_DATA.

Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Acked-by: Will Deacon <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Michael Ellerman <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Rick Edgecombe <[email protected]>
Cc: Segher Boessenkool <[email protected]>
Cc: x86-ml <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
kees authored and suryasaimadhu committed Nov 4, 2019
1 parent c917404 commit b8c2f77
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/asm-generic/vmlinux.lds.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@
#define NOTES_HEADERS_RESTORE
#endif

/*
* Some architectures have non-executable read-only exception tables.
* They can be added to the RO_DATA segment by specifying their desired
* alignment.
*/
#ifdef RO_EXCEPTION_TABLE_ALIGN
#define RO_EXCEPTION_TABLE EXCEPTION_TABLE(RO_EXCEPTION_TABLE_ALIGN)
#else
#define RO_EXCEPTION_TABLE
#endif

/* Align . to a 8 byte boundary equals to maximum function alignment. */
#define ALIGN_FUNCTION() . = ALIGN(8)

Expand Down Expand Up @@ -513,6 +524,7 @@
__stop___modver = .; \
} \
\
RO_EXCEPTION_TABLE \
NOTES \
\
. = ALIGN((align)); \
Expand Down

0 comments on commit b8c2f77

Please sign in to comment.