Skip to content

Commit b2468d9

Browse files
committed
newt: Extend link tables filter
So far for link time generated tables only exact section name was added to filter like in this example: pkg.link_tables: - foo would generate link_tables.ld.h with following content __foo_start__ = .; KEEP(*(.foo)) __foo_end__ = .; Now additional filter will be added __foo_start__ = .; KEEP(*(.foo)) KEEP(*(SORT(.foo.*))) __foo_end__ = .; This is general rule for many sections like .text or .data This is specifically required for xc32 compiler that adds variable name to section by itself even though __attribute__((section, "foo")) is used and arm gcc treats name in attribute verbatim and not as prefix.
1 parent f4cd7f2 commit b2468d9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

newt/builder/extcmd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ func getLinkTableEntry(name string) string {
189189

190190
entry := indent + "__" + name + "_start__ = .;\n" +
191191
indent + "KEEP(*(." + name + "))\n" +
192+
indent + "KEEP(*(SORT(." + name + ".*)))\n" +
192193
indent + "__" + name + "_end__ = .;\n\n"
193194

194195
return entry

0 commit comments

Comments
 (0)