Skip to content

lld does not seem to support __start and __stop #23280

@EdSchouten

Description

@EdSchouten
Bugzilla Link 22906
Resolution FIXED
Resolved on Feb 25, 2016 02:55
Version unspecified
OS All
Blocks #23588
CC @emaste

Extended Description

GNU ld supports the magic __start and __stop symbols as markers for the beginning/end of sections. For example:

int var1 attribute((section("foo")));
int var2 attribute((section("foo")));

extern int __start_foo[0];
extern int __stop_foo[0];

GNU ld automatically adds these symbols if undefined. They will point to the beginning/end of the section "foo". Couple of important things to keep in mind when implementing this:

  • Don't let --gc-sections reap these sections if __start_foo and __stop_foo are being used.
  • Don't inject these symbols if the section itself does not exist.

GNU ld also doesn't do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillalld

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions