From 0e1ce411bad4875347befe5184bc2efbd686cdc4 Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Mon, 26 Oct 2015 16:33:39 -0700 Subject: [make] add ability to set EXTRA_LINKER_SCRIPTS in modules This allows for individual modules to extend the main linker script, primarily to add their own sections to interate over. Remove the main shared_* linker scripts. --- top/init.ld | 9 +++++++++ top/rules.mk | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 top/init.ld (limited to 'top') diff --git a/top/init.ld b/top/init.ld new file mode 100644 index 00000000..2c5de5c2 --- /dev/null +++ b/top/init.ld @@ -0,0 +1,9 @@ +SECTIONS { + .init ALIGN(8) : { + . = ALIGN(8); + __lk_init = .; + KEEP (*(.lk_init)) + __lk_init_end = .; + } +} +INSERT AFTER .rodata; diff --git a/top/rules.mk b/top/rules.mk index c3f8782c..746edb5a 100644 --- a/top/rules.mk +++ b/top/rules.mk @@ -13,4 +13,6 @@ MODULE_SRCS := \ $(LOCAL_DIR)/init.c \ $(LOCAL_DIR)/main.c \ +EXTRA_LINKER_SCRIPTS += $(LOCAL_DIR)/init.ld + include make/module.mk -- cgit v1.2.3