summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp3
-rw-r--r--lld/test/elf/abs-dup.objtxt19
2 files changed, 21 insertions, 1 deletions
diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
index fab9e9100fc..f5cb351e229 100644
--- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
+++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
@@ -96,7 +96,8 @@ public:
buildDuplicateNameMap(*shlibAtom);
}
for (const lld::AbsoluteAtom *absAtom : file.absolute()) {
- buildDuplicateNameMap(*absAtom);
+ if (!absAtom->name().empty())
+ buildDuplicateNameMap(*absAtom);
}
}
diff --git a/lld/test/elf/abs-dup.objtxt b/lld/test/elf/abs-dup.objtxt
new file mode 100644
index 00000000000..7340a29b0f0
--- /dev/null
+++ b/lld/test/elf/abs-dup.objtxt
@@ -0,0 +1,19 @@
+# Tests handling an absolute symbol with no name
+# RUN: lld -flavor gnu -target x86_64 -r %s \
+# RUN: --output-filetype=yaml | FileCheck %s
+
+absolute-atoms:
+ - name: abs
+ scope: static
+ value: 0x10
+ - name: ''
+ scope: static
+ value: 0x15
+
+# CHECK: absolute-atoms:
+# CHECK: - name: abs
+# CHECK: scope: static
+# CHECK: value: 0x0000000000000010
+# CHECK: - name: ''
+# CHECK: scope: static
+# CHECK: value: 0x0000000000000015
OpenPOWER on IntegriCloud