[lld] r244477 - Add a test for our handling of shndx.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 11:28:24 PDT 2015


Author: rafael
Date: Mon Aug 10 13:28:24 2015
New Revision: 244477

URL: http://llvm.org/viewvc/llvm-project?rev=244477&view=rev
Log:
Add a test for our handling of shndx.

It was already working, but missing a test.

Added:
    lld/trunk/test/elf/Inputs/shndx.o-x86_64
    lld/trunk/test/elf/shndx.test

Added: lld/trunk/test/elf/Inputs/shndx.o-x86_64
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Inputs/shndx.o-x86_64?rev=244477&view=auto
==============================================================================
Binary files lld/trunk/test/elf/Inputs/shndx.o-x86_64 (added) and lld/trunk/test/elf/Inputs/shndx.o-x86_64 Mon Aug 10 13:28:24 2015 differ

Added: lld/trunk/test/elf/shndx.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/shndx.test?rev=244477&view=auto
==============================================================================
--- lld/trunk/test/elf/shndx.test (added)
+++ lld/trunk/test/elf/shndx.test Mon Aug 10 13:28:24 2015
@@ -0,0 +1,18 @@
+Test that we can handle shndx. The test file has a shndx despite having only
+a few sections. One might consider it invalid, but it has a clear interpretation
+and avoids needing 65K sections to test the corresponding code path.
+
+RUN: lld -flavor gnu %p/Inputs/shndx.o-x86_64 -o %t.so -shared
+RUN: llvm-readobj -s -t %t.so | FileCheck %s
+
+CHECK:       Name: .text
+CHECK-NEXT:  Type: SHT_PROGBITS (0x1)
+CHECK-NEXT:  Flags [ (0x6)
+CHECK-NEXT:    SHF_ALLOC (0x2)
+CHECK-NEXT:    SHF_EXECINSTR (0x4)
+CHECK-NEXT:  ]
+CHECK-NEXT:  Address: [[ADDR:.*]]
+
+// CHECK:      Symbol {
+// CHECK:        Name: foo
+// CHECK-NEXT:   Value: [[ADDR]]




More information about the llvm-commits mailing list