[PATCH] Bug 12843: put ELF reloc section against section with template function instantiation in the same COMDAT group

Игорь Пашев pashev.igor at gmail.com
Mon Jul 8 09:58:05 PDT 2013


test/MC/ELF/comdat-reloc.s:


// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - |
llvm-readobj -s -sd | FileCheck %s

  .text
  .globl  hello
  .type  hello, at function
hello:
  call  world
  ret

  .section  .text.world,"axG", at progbits,world,comdat
  .type  world, at function
world:
  call  doctor
  ret

// CHECK:  Name: .group
// CHECK-NOT: SectionData
// CHECK: SectionData
// CHECK-NEXT: 0000: 01000000 06000000 07000000

// CHECK: Index: 6
// CHECK-NEXT: Name: .text.world
// CHECK-NOT: Section {
// CHECK: SHF_GROUP

// CHECK: Index: 7
// CHECK-NEXT: Name: .rela.text.world
// CHECK-NOT: Section {
// CHECK: SHF_GROUP


GNU as:
# elfdump -g a.out

Group Section:  .group
     index    flags / section         signature symbol
       [0]   [ COMDAT ]               world
       [1]   .text.world [6]



llvm-mc:
# elfdump -g a.o

Group Section:  .group
     index    flags / section         signature symbol
       [0]   [ COMDAT ]               world
       [1]   .text.world [6]
       [2]   .rel.text.world [7]



More information about the llvm-commits mailing list