[lld] r200911 - Accept and handle absolute symbols with empty name.

Simon Atanasyan simon at atanasyan.com
Wed Feb 5 23:35:16 PST 2014


Author: atanasyan
Date: Thu Feb  6 01:35:16 2014
New Revision: 200911

URL: http://llvm.org/viewvc/llvm-project?rev=200911&view=rev
Log:
Accept and handle absolute symbols with empty name.

Added:
    lld/trunk/test/elf/abs-dup.objtxt
Modified:
    lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp

Modified: lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp?rev=200911&r1=200910&r2=200911&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp Thu Feb  6 01:35:16 2014
@@ -96,7 +96,8 @@ public:
       buildDuplicateNameMap(*shlibAtom);
     }
     for (const lld::AbsoluteAtom *absAtom : file.absolute()) {
-      buildDuplicateNameMap(*absAtom);
+      if (!absAtom->name().empty())
+        buildDuplicateNameMap(*absAtom);
     }
   }
 

Added: lld/trunk/test/elf/abs-dup.objtxt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/abs-dup.objtxt?rev=200911&view=auto
==============================================================================
--- lld/trunk/test/elf/abs-dup.objtxt (added)
+++ lld/trunk/test/elf/abs-dup.objtxt Thu Feb  6 01:35:16 2014
@@ -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





More information about the llvm-commits mailing list