This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git


The following commit(s) were added to refs/heads/master by this push:
     new b2468d97 newt: Extend link tables filter
b2468d97 is described below

commit b2468d970cb73b3276c6ea2bf684a5f6bf752c79
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Thu May 16 09:42:41 2024 +0200

    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.
---
 newt/builder/extcmd.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newt/builder/extcmd.go b/newt/builder/extcmd.go
index e75530f8..dcad7a40 100644
--- a/newt/builder/extcmd.go
+++ b/newt/builder/extcmd.go
@@ -189,6 +189,7 @@ func getLinkTableEntry(name string) string {
 
        entry := indent + "__" + name + "_start__ = .;\n" +
                indent + "KEEP(*(." + name + "))\n" +
+               indent + "KEEP(*(SORT(." + name + ".*)))\n" +
                indent + "__" + name + "_end__ = .;\n\n"
 
        return entry

Reply via email to