Skip to content

Missing support for building position independent code #7189

Description

@jnohlgard

Adding support for building position independent code would make it easier to build images for online firmware updates, since the binary can be relocated by the bootloader to a suitable location depending on available memory. Running binaries from RAM should also be possible without any special linker scripts.

I have not investigated the details but the a rough draft of the changes needed are:

  • Add -fPIC to CFLAGS, possibly -fpie as well.
  • add linker script handling of .got (global offset table) and .got.plt (procedure linkage table)
  • fill GOT during boot (I don't know if gcc provides code for this or if we need to write our own)

Metadata

Metadata

Assignees

No one assigned

    Labels

    State: staleState: The issue / PR has no activity for >185 daysType: new featureThe issue requests / The PR implemements a new feature for RIOT

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions