summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2014-02-06 07:35:16 +0000
committerSimon Atanasyan <simon@atanasyan.com>2014-02-06 07:35:16 +0000
commit0743a72caac082e6fa4e12c4c830fcd1e09fae40 (patch)
tree70c101470f01694716503500524a6e8217ef725a
parent1f5d17c57d2450c5abfdbe4cf96417308c4930a8 (diff)
downloadbcm5719-llvm-0743a72caac082e6fa4e12c4c830fcd1e09fae40.tar.gz
bcm5719-llvm-0743a72caac082e6fa4e12c4c830fcd1e09fae40.zip
Accept and handle absolute symbols with empty name.
llvm-svn: 200911
-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