Created
November 28, 2018 17:25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp | |
index 9f4554e1d63d..8df7926ac63c 100644 | |
--- a/lld/ELF/SyntheticSections.cpp | |
+++ b/lld/ELF/SyntheticSections.cpp | |
@@ -1955,9 +1955,13 @@ static uint32_t getSymSectionIndex(Symbol *Sym) { | |
return SHN_COMMON; | |
if (!isa<Defined>(Sym) || Sym->NeedsPltAddr) | |
return SHN_UNDEF; | |
- if (const OutputSection *OS = Sym->getOutputSection()) | |
- return OS->SectionIndex >= SHN_LORESERVE ? (uint32_t)SHN_XINDEX | |
- : OS->SectionIndex; | |
+ if (const OutputSection *OS = Sym->getOutputSection()) { | |
+ if (OS->SectionIndex == UINT32_MAX) | |
+ return 1; | |
+ if (OS->SectionIndex >= SHN_LORESERVE) | |
+ return (uint32_t)SHN_XINDEX; | |
+ return OS->SectionIndex; | |
+ } | |
return SHN_ABS; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment