summaryrefslogtreecommitdiffstats
path: root/lld/COFF/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/COFF/Writer.cpp')
-rw-r--r--lld/COFF/Writer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp
index 03e5d4d675b..d32577b361f 100644
--- a/lld/COFF/Writer.cpp
+++ b/lld/COFF/Writer.cpp
@@ -215,6 +215,8 @@ uint32_t Defined::getSecrel() {
switch (kind()) {
case DefinedRegularKind:
return cast<DefinedRegular>(this)->getSecrel();
+ case DefinedCommonKind:
+ return cast<DefinedCommon>(this)->getSecrel();
case DefinedSyntheticKind:
return cast<DefinedSynthetic>(this)->getSecrel();
default:
@@ -235,6 +237,8 @@ uint16_t Defined::getSectionIndex() {
return D->getChunk()->getOutputSection()->SectionIndex;
if (isa<DefinedAbsolute>(this))
return DefinedAbsolute::OutputSectionIndex;
+ if (auto *D = dyn_cast<DefinedCommon>(this))
+ return D->getSectionIndex();
if (auto *D = dyn_cast<DefinedSynthetic>(this)) {
if (!D->getChunk())
return 0;
@@ -244,6 +248,10 @@ uint16_t Defined::getSectionIndex() {
toString(*this));
}
+uint16_t DefinedCommon::getSectionIndex() {
+ return Data->getOutputSection()->SectionIndex;
+}
+
bool Defined::isExecutable() {
const auto X = IMAGE_SCN_MEM_EXECUTE;
if (auto *D = dyn_cast<DefinedRegular>(this))
OpenPOWER on IntegriCloud