Skip to content

Inline assembly shouldn't have .section .note.GNU-stack inside #2

Description

@imciner2

This assembly instruction changes the section which all future code is added to be the .note.GNU-stack section. This means that code following the inline assembly macro could be added to this section, which is discarded by the linker (the sole purpose of this section is to transmit information to the linker if the stack should be executable).

This can cause linker failures on GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93190), which I have observed while compiling KiCad.

This is needed in the standalone .S files to define that they should have a non-executable stack, but it appears that cpp files will have this section added by the compiler behind the scenes (alternatively, it can also be forced through the flag -z noexecstack or -Wa,--noexecstack).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions