When generating an executable or shared library, mark it to tell the dynamic linker to resolve all symbols when the program is started, or when the shared library is linked to using dlopen, instead of deferring function call resolution to the point when the function is first called.
Details
Diff Detail
Event Timeline
ELF/Options.td | ||
---|---|---|
82 | Should this be JoinedOrSeparate? While trying the FreeBSD base system build with LLD I see that -znodelete is passed to the linker. |
ELF/Options.td | ||
---|---|---|
82 | Looks like ld/gold accepts both variants. -help indicates to separate syntax thought. |
ELF/Config.h | ||
---|---|---|
38 | Name this ZNow so that -z foo would get different name than -foo. | |
ELF/Driver.cpp | ||
143–145 | If doesn't have {} and else has? Please make this consistent. | |
144 | Let's not warn on unknown options for now. They were silently ignored before this patch. | |
ELF/OutputSections.cpp | ||
346–351 | if (Config->Now) WriteVal(DT_FLAGS_1, DF_1_NOW); |
ELF/Driver.cpp | ||
---|---|---|
144 | Ultimately we will want to warn on unknown options, but for now we ignore lots of options for ease of development, and I think -z is not an exception. | |
ELF/OutputSections.cpp | ||
346–351 | I'd want you to update the code to use a variable when you need the variable. Currently it can be written without that. |
LGTM with a nit.
ELF/Driver.cpp | ||
---|---|---|
139–143 | This can be for (auto *Arg : Args.filtered(OPT_z)) if (Arg->getValue() == "now") Config->ZNow = true; |
ELF/Driver.cpp | ||
---|---|---|
139–143 | Unfortunately no because getValue() returns char*. I'll rewrite to: if (Arg->getValue() == StringRef("now")) Config->ZNow = true; |
Name this ZNow so that -z foo would get different name than -foo.