aboutsummaryrefslogtreecommitdiffstats
path: root/src/declfunc.lds.S
blob: 1f17864312c37133663faa584e9020f825765630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// 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)                       \
    __PASTE(DECL_SECTION, NAME) : SUBALIGN(1) { \
        NAME ## _start = . ;                    \
        *( .rodata. ## NAME ##.pre* )           \
        *( .rodata. ## NAME ##* )               \
        *( .rodata. ## NAME ##.post* )          \
        NAME ## _end = . ;                      \
    }

SECTIONS
{
    DECLWRAPPER(taskfuncs)
    DECLWRAPPER(initfuncs)
    DECLWRAPPER(shutdownfuncs)

    .compile_time_request.static_strings 0 (INFO) : {
        *( .compile_time_request.static_strings )
    }
    .compile_time_request.parsers 0 (INFO) : {
        *( .compile_time_request.parsers )
    }
}