[llvm] r372087 - [llvm-readobj] - Fix a TODO in elf-reloc-zero-name-or-value.test.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 02:12:10 PDT 2019


Author: grimar
Date: Tue Sep 17 02:12:10 2019
New Revision: 372087

URL: http://llvm.org/viewvc/llvm-project?rev=372087&view=rev
Log:
[llvm-readobj] - Fix a TODO in elf-reloc-zero-name-or-value.test.

The "TODO" mentioned was:

"Add test for symbol with no name but with a value once yaml2obj allows
referencing symbols with no name from relocations."

We can do it now.

Differential revision: https://reviews.llvm.org/D67609

Modified:
    llvm/trunk/test/tools/llvm-readobj/elf-reloc-zero-name-or-value.test

Modified: llvm/trunk/test/tools/llvm-readobj/elf-reloc-zero-name-or-value.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-reloc-zero-name-or-value.test?rev=372087&r1=372086&r2=372087&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-reloc-zero-name-or-value.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-reloc-zero-name-or-value.test Tue Sep 17 02:12:10 2019
@@ -5,23 +5,23 @@
 # RUN: yaml2obj %s -o %t
 # RUN: llvm-readelf --relocations --dyn-relocations %t | FileCheck %s
 
-# CHECK:      Relocation section '.rela.text' at offset {{.*}} contains 2 entries:
+# CHECK:      Relocation section '.rela.text' at offset {{.*}} contains 3 entries:
 # CHECK-NEXT:     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
 # CHECK-NEXT: 0000000000000000  0000000000000000 R_X86_64_NONE                           1
 # CHECK-NEXT: 0000000000000000  0000000100000000 R_X86_64_NONE          0000000000000000 sym + 1
+# CHECK-NEXT: 0000000000000000  0000000200000000 R_X86_64_NONE          0000000000000123 456
 
-# CHECK:      Relocation section '.rela.dyn' at offset {{.*}} contains 2 entries:
+# CHECK:      Relocation section '.rela.dyn' at offset {{.*}} contains 3 entries:
 # CHECK-NEXT:     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
 # CHECK-NEXT: 0000000000000000  0000000000000000 R_X86_64_NONE                           1
 # CHECK-NEXT: 0000000000000000  0000000100000000 R_X86_64_NONE          0000000000000000 sym + 1
+# CHECK-NEXT: 0000000000000000  0000000200000000 R_X86_64_NONE          0000000000000123 456
 
 # CHECK:      'RELA' relocation section at offset {{.*}} contains 48 bytes:
 # CHECK-NEXT:     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
 # CHECK-NEXT: 0000000000000000  0000000000000000 R_X86_64_NONE                           1
 # CHECK-NEXT: 0000000000000000  0000000100000000 R_X86_64_NONE          0000000000000000 sym + 1
-
-# TODO: Add test for symbol with no name but with a value once yaml2obj allows
-# referencing symbols with no name from relocations.
+# CHECK-NEXT: 0000000000000000  0000000200000000 R_X86_64_NONE          0000000000000123 456
 
 --- !ELF
 FileHeader:
@@ -45,6 +45,10 @@ Sections:
         Type: R_X86_64_NONE
         Addend: 1
         Symbol: sym
+      - Offset: 0
+        Type: R_X86_64_NONE
+        Addend: 0x456
+        Symbol: 2
   - Name: .dynamic
     Type: SHT_DYNAMIC
     Flags: [SHF_ALLOC]
@@ -54,7 +58,7 @@ Sections:
       - Tag: DT_RELA
         Value: 0x1100
       - Tag: DT_RELASZ
-        Value: 48
+        Value: 72
       - Tag: DT_RELAENT
         Value: 24
       - Tag: DT_NULL
@@ -73,16 +77,26 @@ Sections:
         Type: R_X86_64_NONE
         Addend: 1
         Symbol: sym
+      - Offset: 0
+        Type: R_X86_64_NONE
+        Addend: 0x456
+        Symbol: 2
 Symbols:
   - Name:    sym
     Value:   0
     Section: .text
     Binding: STB_GLOBAL
+  - Value:   0x123
+    Section: .text
+    Binding: STB_GLOBAL
 DynamicSymbols:
   - Name:    sym
     Value:   0
     Section: .text
     Binding: STB_GLOBAL
+  - Value:   0x123
+    Section: .text
+    Binding: STB_GLOBAL
 ProgramHeaders:
   - Type: PT_LOAD
     VAddr: 0x1000




More information about the llvm-commits mailing list