We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31b9774 commit 98c1cd9Copy full SHA for 98c1cd9
lld/ELF/Writer.cpp
@@ -433,9 +433,9 @@ static void markUsedLocalSymbolsImpl(ObjFile<ELFT> *file,
433
// The function ensures that the "used" field of local symbols reflects the fact
434
// that the symbol is used in a relocation from a live section.
435
template <class ELFT> static void markUsedLocalSymbols(Ctx &ctx) {
436
- // With --gc-sections, the field is already filled.
+ // With --gc-sections, the field is already filled, unless -r is specified.
437
// See MarkLive<ELFT>::resolveReloc().
438
- if (ctx.arg.gcSections)
+ if (ctx.arg.gcSections && !ctx.arg.relocatable)
439
return;
440
for (ELFFileBase *file : ctx.objectFiles) {
441
ObjFile<ELFT> *f = cast<ObjFile<ELFT>>(file);
0 commit comments