[llvm] r204584 - Teach llvm-readobj to print human friendly description of reserved sections.

Rafael Espindola rafael.espindola at gmail.com
Sun Mar 23 22:00:35 PDT 2014


Author: rafael
Date: Mon Mar 24 00:00:34 2014
New Revision: 204584

URL: http://llvm.org/viewvc/llvm-project?rev=204584&view=rev
Log:
Teach llvm-readobj to print human friendly description of reserved sections.

Modified:
    llvm/trunk/test/MC/ARM/arm-elf-symver.s
    llvm/trunk/test/MC/ELF/abs.s
    llvm/trunk/test/MC/ELF/alias-reloc.s
    llvm/trunk/test/MC/ELF/alias.s
    llvm/trunk/test/MC/ELF/comdat.s
    llvm/trunk/test/MC/ELF/common.s
    llvm/trunk/test/MC/ELF/file-double.s
    llvm/trunk/test/MC/ELF/file.s
    llvm/trunk/test/MC/ELF/pic-diff.s
    llvm/trunk/test/MC/ELF/pr9292.s
    llvm/trunk/test/MC/ELF/set.s
    llvm/trunk/test/MC/ELF/symref.s
    llvm/trunk/test/MC/ELF/tls-i386.s
    llvm/trunk/test/MC/ELF/tls.s
    llvm/trunk/test/MC/ELF/type-propagate.s
    llvm/trunk/test/MC/ELF/undef.s
    llvm/trunk/test/MC/ELF/weak.s
    llvm/trunk/test/MC/ELF/weakref-reloc.s
    llvm/trunk/test/MC/ELF/weakref.s
    llvm/trunk/test/Object/readobj-elf-versioning.test
    llvm/trunk/test/Object/readobj-shared-object.test
    llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml
    llvm/trunk/test/tools/llvm-readobj/symbols.test
    llvm/trunk/tools/llvm-readobj/ELFDumper.cpp

Modified: llvm/trunk/test/MC/ARM/arm-elf-symver.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/arm-elf-symver.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/arm-elf-symver.s (original)
+++ llvm/trunk/test/MC/ARM/arm-elf-symver.s Mon Mar 24 00:00:34 2014
@@ -138,7 +138,7 @@ global1:
 @ CHECK-NEXT:     Binding: Global (0x1)
 @ CHECK-NEXT:     Type: None (0x0)
 @ CHECK-NEXT:     Other: 0
-@ CHECK-NEXT:     Section:  (0x0)
+@ CHECK-NEXT:     Section: Undefined (0x0)
 @ CHECK-NEXT:   }
 @ CHECK-NEXT:   Symbol {
 @ CHECK-NEXT:     Name: bar6 at zed (66)
@@ -147,6 +147,6 @@ global1:
 @ CHECK-NEXT:     Binding: Global (0x1)
 @ CHECK-NEXT:     Type: None (0x0)
 @ CHECK-NEXT:     Other: 0
-@ CHECK-NEXT:     Section:  (0x0)
+@ CHECK-NEXT:     Section: Undefined (0x0)
 @ CHECK-NEXT:   }
 @ CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/ELF/abs.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/abs.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/abs.s (original)
+++ llvm/trunk/test/MC/ELF/abs.s Mon Mar 24 00:00:34 2014
@@ -13,5 +13,5 @@
 // CHECK-NEXT:     Binding: Local
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0xFFF1)
+// CHECK-NEXT:     Section: Absolute (0xFFF1)
 // CHECK-NEXT:   }

Modified: llvm/trunk/test/MC/ELF/alias-reloc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/alias-reloc.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/alias-reloc.s (original)
+++ llvm/trunk/test/MC/ELF/alias-reloc.s Mon Mar 24 00:00:34 2014
@@ -32,7 +32,7 @@ foo2:
 // CHECK-NEXT:     Binding: Local (0x0)
 // CHECK-NEXT:     Type: None (0x0)
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section:  (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: bar

Modified: llvm/trunk/test/MC/ELF/alias.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/alias.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/alias.s (original)
+++ llvm/trunk/test/MC/ELF/alias.s Mon Mar 24 00:00:34 2014
@@ -28,7 +28,7 @@ bar5 = bar4
 // CHECK-NEXT:     Binding: Local (0x0)
 // CHECK-NEXT:     Type: None (0x0)
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section:  (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: bar
@@ -109,6 +109,6 @@ bar5 = bar4
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/ELF/comdat.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/comdat.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/comdat.s (original)
+++ llvm/trunk/test/MC/ELF/comdat.s Mon Mar 24 00:00:34 2014
@@ -74,7 +74,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 
 

Modified: llvm/trunk/test/MC/ELF/common.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/common.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/common.s (original)
+++ llvm/trunk/test/MC/ELF/common.s Mon Mar 24 00:00:34 2014
@@ -60,7 +60,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: Object
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0xFFF2)
+// CHECK-NEXT:     Section: Common (0xFFF2)
 // CHECK-NEXT:   }
 
 
@@ -82,7 +82,7 @@ foo:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: Object
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0xFFF2)
+// CHECK-NEXT:     Section: Common (0xFFF2)
 // CHECK-NEXT:   }
 
 
@@ -95,5 +95,5 @@ foo:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: Object
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0xFFF2)
+// CHECK-NEXT:     Section: Common (0xFFF2)
 // CHECK-NEXT:   }

Modified: llvm/trunk/test/MC/ELF/file-double.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/file-double.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/file-double.s (original)
+++ llvm/trunk/test/MC/ELF/file-double.s Mon Mar 24 00:00:34 2014
@@ -17,7 +17,7 @@ bar.c:
 // CHECK-NEXT:     Binding: Local
 // CHECK-NEXT:     Type: File
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0xFFF1)
+// CHECK-NEXT:     Section: Absolute (0xFFF1)
 // CHECK-NEXT:   }
 // CHECK:          Name: bar.c (7)
 // CHECK-NEXT:     Value: 0x0
@@ -25,7 +25,7 @@ bar.c:
 // CHECK-NEXT:     Binding: Local
 // CHECK-NEXT:     Type: File
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0xFFF1)
+// CHECK-NEXT:     Section: Absolute (0xFFF1)
 // CHECK-NEXT:   }
 // CHECK:        Symbol {
 // CHECK:        Name: bar.c (7)

Modified: llvm/trunk/test/MC/ELF/file.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/file.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/file.s (original)
+++ llvm/trunk/test/MC/ELF/file.s Mon Mar 24 00:00:34 2014
@@ -12,7 +12,7 @@ foa:
 // CHECK-NEXT:     Binding: Local
 // CHECK-NEXT:     Type: File
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0xFFF1)
+// CHECK-NEXT:     Section: Absolute (0xFFF1)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foa (5)

Modified: llvm/trunk/test/MC/ELF/pic-diff.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/pic-diff.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/pic-diff.s (original)
+++ llvm/trunk/test/MC/ELF/pic-diff.s Mon Mar 24 00:00:34 2014
@@ -13,7 +13,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 
 .zero 4

Modified: llvm/trunk/test/MC/ELF/pr9292.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/pr9292.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/pr9292.s (original)
+++ llvm/trunk/test/MC/ELF/pr9292.s Mon Mar 24 00:00:34 2014
@@ -14,7 +14,7 @@ mov %eax,bar
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo (1)
@@ -23,5 +23,5 @@ mov %eax,bar
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }

Modified: llvm/trunk/test/MC/ELF/set.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/set.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/set.s (original)
+++ llvm/trunk/test/MC/ELF/set.s Mon Mar 24 00:00:34 2014
@@ -11,7 +11,7 @@
 // CHECK-NEXT:     Binding: Local
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0xFFF1)
+// CHECK-NEXT:     Section: Absolute (0xFFF1)
 // CHECK-NEXT:   }
 
 // Test that we accept .set of a symbol after it has been used in a statement.
@@ -32,5 +32,5 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }

Modified: llvm/trunk/test/MC/ELF/symref.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/symref.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/symref.s (original)
+++ llvm/trunk/test/MC/ELF/symref.s Mon Mar 24 00:00:34 2014
@@ -128,7 +128,7 @@ global1:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: bar6 at zed (57)
@@ -137,6 +137,6 @@ global1:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/ELF/tls-i386.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/tls-i386.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/tls-i386.s (original)
+++ llvm/trunk/test/MC/ELF/tls-i386.s Mon Mar 24 00:00:34 2014
@@ -24,7 +24,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo2 (6)
@@ -33,7 +33,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo3 (11)
@@ -42,7 +42,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo4 (16)
@@ -51,7 +51,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo5 (21)
@@ -60,7 +60,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo6 (26)
@@ -69,7 +69,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo7 (31)
@@ -78,7 +78,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo8 (36)
@@ -87,7 +87,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo9 (41)
@@ -96,7 +96,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: fooA (46)
@@ -105,7 +105,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: fooB (51)
@@ -114,7 +114,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: fooC (56)
@@ -123,7 +123,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: fooD (61)
@@ -132,7 +132,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: fooE (66)
@@ -141,5 +141,5 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }

Modified: llvm/trunk/test/MC/ELF/tls.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/tls.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/tls.s (original)
+++ llvm/trunk/test/MC/ELF/tls.s Mon Mar 24 00:00:34 2014
@@ -29,7 +29,7 @@ foobar:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo2 (6)
@@ -38,7 +38,7 @@ foobar:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo3 (11)
@@ -47,7 +47,7 @@ foobar:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo4 (16)
@@ -56,7 +56,7 @@ foobar:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo5 (21)
@@ -65,7 +65,7 @@ foobar:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo6 (26)
@@ -74,5 +74,5 @@ foobar:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: TLS
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }

Modified: llvm/trunk/test/MC/ELF/type-propagate.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/type-propagate.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/type-propagate.s (original)
+++ llvm/trunk/test/MC/ELF/type-propagate.s Mon Mar 24 00:00:34 2014
@@ -84,7 +84,7 @@ sym10:
 // CHECK-NEXT:    Binding: Local (0x0)
 // CHECK-NEXT:    Type: None (0x0)
 // CHECK-NEXT:    Other: 0
-// CHECK-NEXT:    Section:  (0xFFF1)
+// CHECK-NEXT:    Section: Absolute (0xFFF1)
 // CHECK-NEXT:  }
 // CHECK-NEXT:  Symbol {
 // CHECK-NEXT:    Name: sym07
@@ -93,7 +93,7 @@ sym10:
 // CHECK-NEXT:    Binding: Local (0x0)
 // CHECK-NEXT:    Type: None (0x0)
 // CHECK-NEXT:    Other: 0
-// CHECK-NEXT:    Section:  (0xFFF1)
+// CHECK-NEXT:    Section: Absolute (0xFFF1)
 // CHECK-NEXT:  }
 // CHECK-NEXT:  Symbol {
 // CHECK-NEXT:    Name: sym08

Modified: llvm/trunk/test/MC/ELF/undef.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/undef.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/undef.s (original)
+++ llvm/trunk/test/MC/ELF/undef.s Mon Mar 24 00:00:34 2014
@@ -34,6 +34,6 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: Object
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/ELF/weak.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/weak.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/weak.s (original)
+++ llvm/trunk/test/MC/ELF/weak.s Mon Mar 24 00:00:34 2014
@@ -25,6 +25,6 @@ bar:
 // CHECK-NEXT:     Binding: Weak
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:  ]

Modified: llvm/trunk/test/MC/ELF/weakref-reloc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/weakref-reloc.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/weakref-reloc.s (original)
+++ llvm/trunk/test/MC/ELF/weakref-reloc.s Mon Mar 24 00:00:34 2014
@@ -22,7 +22,7 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: foo (1)
@@ -31,7 +31,7 @@
 // CHECK-NEXT:     Binding: Weak
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: zed (5)
@@ -40,5 +40,5 @@
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }

Modified: llvm/trunk/test/MC/ELF/weakref.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/weakref.s?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/weakref.s (original)
+++ llvm/trunk/test/MC/ELF/weakref.s Mon Mar 24 00:00:34 2014
@@ -77,7 +77,7 @@ bar15:
 // CHECK-NEXT:     Binding: Local (0x0)
 // CHECK-NEXT:     Type: None (0x0)
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section:  (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: bar6 (21)
@@ -203,7 +203,7 @@ bar15:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: bar3 (6)
@@ -212,7 +212,7 @@ bar15:
 // CHECK-NEXT:     Binding: Weak
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: bar4 (11)
@@ -221,7 +221,7 @@ bar15:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: bar5 (16)
@@ -230,6 +230,6 @@ bar15:
 // CHECK-NEXT:     Binding: Global
 // CHECK-NEXT:     Type: None
 // CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: (0x0)
+// CHECK-NEXT:     Section: Undefined (0x0)
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]

Modified: llvm/trunk/test/Object/readobj-elf-versioning.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/readobj-elf-versioning.test?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/Object/readobj-elf-versioning.test (original)
+++ llvm/trunk/test/Object/readobj-elf-versioning.test Mon Mar 24 00:00:34 2014
@@ -33,7 +33,7 @@ ELF32:   Symbol {
 ELF32:     Name: puts at GLIBC_2.0
 ELF32:     Binding: Global
 ELF32:     Type: Function
-ELF32:     Section:  (0x0)
+ELF32:     Section: Undefined (0x0)
 ELF32:   }
 ELF32: ]
 ELF64: DynamicSymbols [
@@ -41,6 +41,6 @@ ELF64:   Symbol {
 ELF64:     Name: puts at GLIBC_2.2.5
 ELF64:     Binding: Global
 ELF64:     Type: Function
-ELF64:     Section:  (0x0)
+ELF64:     Section: Undefined (0x0)
 ELF64:   }
 ELF64: ]

Modified: llvm/trunk/test/Object/readobj-shared-object.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/readobj-shared-object.test?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/Object/readobj-shared-object.test (original)
+++ llvm/trunk/test/Object/readobj-shared-object.test Mon Mar 24 00:00:34 2014
@@ -191,7 +191,7 @@ ELF:   Symbol {
 ELF:     Name: shared.ll
 ELF:     Binding: Local
 ELF:     Type: File
-ELF:     Section: (0xFFF1)
+ELF:     Section: Absolute (0xFFF1)
 ELF:   }
 ELF:   Symbol {
 ELF:     Name: local_func
@@ -203,13 +203,13 @@ ELF:   Symbol {
 ELF:     Name: _GLOBAL_OFFSET_TABLE_
 ELF:     Binding: Local
 ELF:     Type: Object
-ELF:     Section: (0xFFF1)
+ELF:     Section: Absolute (0xFFF1)
 ELF:   }
 ELF:   Symbol {
 ELF:     Name: _DYNAMIC
 ELF:     Binding: Local
 ELF:     Type: Object
-ELF:     Section: (0xFFF1)
+ELF:     Section: Absolute (0xFFF1)
 ELF:   }
 ELF:   Symbol {
 ELF:     Name: common_sym
@@ -233,13 +233,13 @@ ELF:   Symbol {
 ELF:     Name: __bss_start
 ELF:     Binding: Global
 ELF:     Type: None
-ELF:     Section: (0xFFF1)
+ELF:     Section: Absolute (0xFFF1)
 ELF:   }
 ELF:   Symbol {
 ELF:     Name: _end
 ELF:     Binding: Global
 ELF:     Type: None
-ELF:     Section: (0xFFF1)
+ELF:     Section: Absolute (0xFFF1)
 ELF:   }
 ELF:   Symbol {
 ELF:     Name: global_func
@@ -251,7 +251,7 @@ ELF:   Symbol {
 ELF:     Name: _edata
 ELF:     Binding: Global
 ELF:     Type: None
-ELF:     Section: (0xFFF1)
+ELF:     Section: Absolute (0xFFF1)
 ELF:   }
 ELF: ]
 
@@ -278,13 +278,13 @@ ELF:   Symbol {
 ELF:     Name: __bss_start
 ELF:     Binding: Global
 ELF:     Type: None
-ELF:     Section: (0xFFF1)
+ELF:     Section: Absolute (0xFFF1)
 ELF:   }
 ELF:   Symbol {
 ELF:     Name: _end
 ELF:     Binding: Global
 ELF:     Type: None
-ELF:     Section: (0xFFF1)
+ELF:     Section: Absolute (0xFFF1)
 ELF:   }
 ELF:   Symbol {
 ELF:     Name: global_func
@@ -296,7 +296,7 @@ ELF:   Symbol {
 ELF:     Name: _edata
 ELF:     Binding: Global
 ELF:     Type: None
-ELF:     Section: (0xFFF1)
+ELF:     Section: Absolute (0xFFF1)
 ELF:   }
 ELF: ]
 

Modified: llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml Mon Mar 24 00:00:34 2014
@@ -37,4 +37,4 @@ Symbols:
 # CHECK:          Section: .text
 # CHECK:        Symbol {
 # CHECK:          Name: undefined_symbol
-# CHECK:          Section:  (0x0)
+# CHECK:          Section: Undefined (0x0)

Modified: llvm/trunk/test/tools/llvm-readobj/symbols.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/symbols.test?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/symbols.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/symbols.test Mon Mar 24 00:00:34 2014
@@ -49,7 +49,7 @@ ELF-NEXT:     Size: 0
 ELF-NEXT:     Binding: Local (0x0)
 ELF-NEXT:     Type: None (0x0)
 ELF-NEXT:     Other: 0
-ELF-NEXT:     Section:  (0x0)
+ELF-NEXT:     Section: Undefined (0x0)
 ELF-NEXT:   }
 ELF-NEXT:   Symbol {
 ELF-NEXT:     Name: trivial.ll (1)
@@ -58,7 +58,7 @@ ELF-NEXT:     Size: 0
 ELF-NEXT:     Binding: Local (0x0)
 ELF-NEXT:     Type: File (0x4)
 ELF-NEXT:     Other: 0
-ELF-NEXT:     Section:  (0xFFF1)
+ELF-NEXT:     Section: Absolute (0xFFF1)
 ELF-NEXT:   }
 ELF-NEXT:   Symbol {
 ELF-NEXT:     Name: .L.str (39)

Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=204584&r1=204583&r2=204584&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Mon Mar 24 00:00:34 2014
@@ -625,8 +625,28 @@ void ELFDumper<ELFT>::printDynamicSymbol
 template <class ELFT>
 void ELFDumper<ELFT>::printSymbol(typename ELFO::Elf_Sym_Iter Symbol) {
   StringRef SymbolName = errorOrDefault(Obj->getSymbolName(Symbol));
-  const Elf_Shdr *Sec = Obj->getSection(&*Symbol);
-  StringRef SectionName = Sec ? errorOrDefault(Obj->getSectionName(Sec)) : "";
+
+  unsigned SectionIndex = Obj->getSymbolTableIndex(&*Symbol);
+  StringRef SectionName;
+  if (SectionIndex == SHN_UNDEF) {
+    SectionName = "Undefined";
+  } else if (SectionIndex >= SHN_LOPROC && SectionIndex <= SHN_HIPROC) {
+    SectionName = "Processor Specific";
+  } else if (SectionIndex >= SHN_LOOS && SectionIndex <= SHN_HIOS) {
+    SectionName = "Operating System Specific";
+  } else if (SectionIndex > SHN_HIOS && SectionIndex < SHN_ABS) {
+    SectionName = "Reserved";
+  } else if (SectionIndex == SHN_ABS) {
+    SectionName = "Absolute";
+  } else if (SectionIndex == SHN_COMMON) {
+    SectionName = "Common";
+  } else {
+    assert(SectionIndex != SHN_XINDEX &&
+           "getSymbolTableIndex should handle this");
+    const Elf_Shdr *Sec = Obj->getSection(SectionIndex);
+    SectionName = errorOrDefault(Obj->getSectionName(Sec));
+  }
+
   std::string FullSymbolName(SymbolName);
   if (Symbol.isDynamic()) {
     bool IsDefault;





More information about the llvm-commits mailing list