Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newt: Extend link tables filter #558

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented May 16, 2024

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.

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.
@kasjer kasjer requested a review from sjanc May 16, 2024 07:45
@kasjer kasjer merged commit b2468d9 into apache:master Sep 6, 2024
59 checks passed
@kasjer kasjer deleted the kasjer/link-tables-filter-extension branch September 6, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants