Page MenuHomePhabricator

[ELF] Default to --no-allow-shlib-undefined for executables

Authored by MaskRay on Feb 1 2019, 12:32 AM.



This follows the ld.bfd/gold behavior.

The error check is useful as it turns a common type of undefined symbol errors into link-time errors:

// => (not linked with -z defs)
void f(); // f is undefined
void g() { f(); }

// => executable with a DT_NEEDED entry on
void g();
int main() { g(); }

// errors when g() is executed (lazy binding) or when the program is started (LD_BIND_NOW)
// symbol lookup error: ... undefined symbol: f

Diff Detail


Event Timeline

MaskRay created this revision.Feb 1 2019, 12:32 AM
Herald added a project: Restricted Project. · View Herald Transcript
ruiu added a comment.Feb 1 2019, 11:07 AM

Could you also update the man page? The file is lld/docs/ld.lld.1.

MaskRay updated this revision to Diff 184861.Feb 1 2019, 3:31 PM

Update docs/ld.lld.1

ruiu accepted this revision.Feb 1 2019, 3:36 PM


51 ↗(On Diff #184861)

an -> a

This revision is now accepted and ready to land.Feb 1 2019, 3:36 PM
This revision was automatically updated to reflect the committed changes.