Skip to content

Commit 3a90cde

Browse files
authored
Merge pull request #3676 from c1728p9/add_mbed_section_attribute
Add MBED_SECTION attribute
2 parents 2c54177 + 605614a commit 3a90cde

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

platform/toolchain.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,16 @@
268268
#endif
269269
#endif
270270

271+
#ifndef MBED_SECTION
272+
#if (defined(__GNUC__) || defined(__clang__)) || defined(__CC_ARM)
273+
#define MBED_SECTION(name) __attribute__ ((section (name)))
274+
#elif defined(__ICCARM__)
275+
#define MBED_SECTION(name) _Pragma(MBED_STRINGIFY(location=name))
276+
#else
277+
#error "Missing MBED_SECTION directive"
278+
#endif
279+
#endif
280+
271281
// FILEHANDLE declaration
272282
#if defined(TOOLCHAIN_ARM)
273283
#include <rt_sys.h>

0 commit comments

Comments
 (0)