Skip to content

Commit cbaa907

Browse files
committed
newt: Extend link tables symbols
So far for link time generated tables two symbols were create for each table: pkg.link_tables: - foo would generate link_tables.ld.h with following content __foo_start__ = .; KEEP(*(.foo)) KEEP(*(SORT(.foo.*))) __foo_end__ = .; Now additional symbol foo will be generated it will make it more straightforward to use link-time tables in source code where table can be access directly by a name specified in yml __foo_start__ = .; foo = .; KEEP(*(.foo)) KEEP(*(SORT(.foo.*))) __foo_end__ = .;
1 parent 16449ee commit cbaa907

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
@@ -188,6 +188,7 @@ func getLinkTableEntry(name string) string {
188188
indent := " "
189189

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

0 commit comments

Comments
 (0)