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
- Repository
- rL LLVM
Event Timeline
ELF/Options.td | ||
---|---|---|
76 ↗ | (On Diff #36613) | 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 | ||
---|---|---|
76 ↗ | (On Diff #36613) | Looks like ld/gold accepts both variants. -help indicates to separate syntax thought. |
ELF/Config.h | ||
---|---|---|
37 ↗ | (On Diff #36613) | Name this ZNow so that -z foo would get different name than -foo. |
ELF/Driver.cpp | ||
142–144 ↗ | (On Diff #36613) | If doesn't have {} and else has? Please make this consistent. |
143 ↗ | (On Diff #36613) | Let's not warn on unknown options for now. They were silently ignored before this patch. |
ELF/OutputSections.cpp | ||
319–324 ↗ | (On Diff #36613) | if (Config->Now) WriteVal(DT_FLAGS_1, DF_1_NOW); |
ELF/Driver.cpp | ||
---|---|---|
143 ↗ | (On Diff #36613) | Yes, I know they were. But this is equals to ld behavior now. It shows warnings on unknown -z options. But if you wish I will remove. |
ELF/OutputSections.cpp | ||
319–324 ↗ | (On Diff #36613) | There are many possible -z options. And Flag is requred to combine them when at least one more will be added. |
ELF/Driver.cpp | ||
---|---|---|
143 ↗ | (On Diff #36613) | 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 | ||
319–324 ↗ | (On Diff #36613) | I'd want you to update the code to use a variable when you need the variable. Currently it can be written without that. |
All review comments addressed.
ELF/Options.td | ||
---|---|---|
76 ↗ | (On Diff #36613) | Changed to JoinedOrSeparate. |
LGTM with a nit.
ELF/Driver.cpp | ||
---|---|---|
139–143 ↗ | (On Diff #36710) | This can be for (auto *Arg : Args.filtered(OPT_z)) if (Arg->getValue() == "now") Config->ZNow = true; |
ELF/Driver.cpp | ||
---|---|---|
139–143 ↗ | (On Diff #36710) | Unfortunately no because getValue() returns char*. I'll rewrite to: if (Arg->getValue() == StringRef("now")) Config->ZNow = true; |