aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-06-10 21:11:04 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-06-14 14:00:57 -0400
commitda305e6b61efab8c16d324723859b318fb1979a9 (patch)
tree9ad776c48dc96fd85b22be3327bbba662b778b66 /src
parent343de9c454e0f68a1ff5a12d745575b2e5150897 (diff)
downloadkutter-da305e6b61efab8c16d324723859b318fb1979a9.tar.gz
kutter-da305e6b61efab8c16d324723859b318fb1979a9.tar.xz
kutter-da305e6b61efab8c16d324723859b318fb1979a9.zip
build: Update declfuncs.lds.S to only use progmem sections on AVR
On non-avr platforms the declfunc stuff still needs to be in the binary in a rodata section. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r--src/declfunc.lds.S19
-rw-r--r--src/sched.h2
2 files changed, 16 insertions, 5 deletions
diff --git a/src/declfunc.lds.S b/src/declfunc.lds.S
index 9bb5c8ad..2226300c 100644
--- a/src/declfunc.lds.S
+++ b/src/declfunc.lds.S
@@ -1,13 +1,21 @@
// Linker script that defines symbols around sections. The DECL_X()
// macros need this linker script to place _start and _end symbols
// around the list of declared items.
+#include "autoconf.h" // CONFIG_MACH_AVR
+#include "compiler.h" // __PASTE
+
+#if CONFIG_MACH_AVR
+#define DECL_SECTION .progmem.data.
+#else
+#define DECL_SECTION .rodata.
+#endif
#define DECLWRAPPER(NAME) \
- .progmem.data. ## NAME : SUBALIGN(1) { \
+ __PASTE(DECL_SECTION, NAME) : SUBALIGN(1) { \
NAME ## _start = . ; \
- *( .progmem.data. ## NAME ##.pre* ) \
- *( .progmem.data. ## NAME ##* ) \
- *( .progmem.data. ## NAME ##.post* ) \
+ *( .rodata. ## NAME ##.pre* ) \
+ *( .rodata. ## NAME ##* ) \
+ *( .rodata. ## NAME ##.post* ) \
NAME ## _end = . ; \
}
@@ -23,4 +31,7 @@ SECTIONS
.compile_time_request.parsers 0 (INFO) : {
*( .compile_time_request.parsers )
}
+ .compile_time_request (INFO) : {
+ *( .compile_time_request )
+ }
}
diff --git a/src/sched.h b/src/sched.h
index bdef5e4c..9685317f 100644
--- a/src/sched.h
+++ b/src/sched.h
@@ -42,7 +42,7 @@ struct callback_handler {
};
#define _DECL_CALLBACK(NAME, FUNC) \
const struct callback_handler _DECL_ ## NAME ## _ ## FUNC __visible \
- __section(".progmem.data." __stringify(NAME) ) = { .func = FUNC }
+ __section(".rodata." __stringify(NAME) ) = { .func = FUNC }
#define foreachdecl(ITER, NAME) \
extern typeof(*ITER) NAME ## _start[], NAME ## _end[]; \