From 55ff71eac0ccaf10bd2860d15bb80f105e73e7dc Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Fri, 3 Jan 2020 23:06:18 +1100 Subject: [PATCH] Discard eh_frame section Newer linkers generate eh_frame sections. From the ld manual: Request creation of ".eh_frame" unwind info for linker generated code sections like PLT. I do not believe these are used by the OCC, so they can be discarded. This is what the Linux kernel does too. Signed-off-by: Joel Stanley --- src/occApplet/productApplet/linkProductApplet.cmd | 3 +++ src/occBootLoader/linkboot.cmd | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/occApplet/productApplet/linkProductApplet.cmd b/src/occApplet/productApplet/linkProductApplet.cmd index 934dfe21..9c769f4d 100755 --- a/src/occApplet/productApplet/linkProductApplet.cmd +++ b/src/occApplet/productApplet/linkProductApplet.cmd @@ -73,4 +73,7 @@ SECTIONS __WRITEABLE_DATA_LEN__ = . - __WRITEABLE_DATA_ADDR__; + /DISCARD/ : { + *(.eh_frame) + } } diff --git a/src/occBootLoader/linkboot.cmd b/src/occBootLoader/linkboot.cmd index 816cca7a..934af445 100755 --- a/src/occBootLoader/linkboot.cmd +++ b/src/occBootLoader/linkboot.cmd @@ -129,4 +129,9 @@ SECTIONS // writeable section length //////////////////////////////// __WRITEABLE_DATA_LEN__ = (__WRITEABLE_ADDR__ + SIZEOF(.sdata) + SIZEOF(.rela) + SIZEOF(.rwdata)) - __WRITEABLE_ADDR__; + + /DISCARD/ : { + *(.eh_frame) + } + }