[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 08:16:00 PDT 2013
Am I doing it right? :-)
The code was generated via "clang++ -S -emit-llvm a.cpp"
test/MC/ELF/comdat-reloc.ll:
; RUN: llc -filetype=obj -mtriple x86_64-pc-linux-gnu %s -o - |
llvm-readobj -s -section-symbols | FileCheck %s
%struct.S = type { i8 }
define void @_Z3bazv() #0 {
entry:
%call = call i32 @_Z3barIiEiT_(i32 10)
ret void
}
define linkonce_odr i32 @_Z3barIiEiT_(i32 %t) #0 {
entry:
%t.addr = alloca i32, align 4
%s = alloca %struct.S, align 1
%cleanup.dest.slot = alloca i32
store i32 %t, i32* %t.addr, align 4
%0 = load i32* %t.addr, align 4
%mul = mul nsw i32 %0, 3
store i32 1, i32* %cleanup.dest.slot
call void @_ZN1SD1Ev(%struct.S* %s)
ret i32 %mul
}
declare void @_ZN1SD1Ev(%struct.S*) #0
; CHECK: Section {
; CHECK: Index: 6
; CHECK-NEXT: Name: .text._Z3barIiEiT_ (92)
; CHECK-NEXT: Type: SHT_PROGBITS (0x1)
; CHECK-NEXT: Flags [ (0x206)
; CHECK-NEXT: SHF_ALLOC (0x2)
; CHECK-NEXT: SHF_EXECINSTR (0x4)
; CHECK-NEXT: SHF_GROUP (0x200)
; CHECK-NEXT: ]
; CHECK-NEXT: Address: 0x0
; CHECK-NEXT: Offset: 0x60
; CHECK-NEXT: Size: 38
; CHECK-NEXT: Link: 0
; CHECK-NEXT: Info: 0
; CHECK-NEXT: AddressAlignment: 16
; CHECK-NEXT: EntrySize: 0
; CHECK-NEXT: Symbols [
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Name: .text._Z3barIiEiT_ (0)
; CHECK-NEXT: Value: 0x0
; CHECK-NEXT: Size: 0
; CHECK-NEXT: Binding: Local (0x0)
; CHECK-NEXT: Type: Section (0x3)
; CHECK-NEXT: Other: 0
; CHECK-NEXT: Section: .text._Z3barIiEiT_ (0x6)
; CHECK-NEXT: }
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Name: _Z3barIiEiT_ (37)
; CHECK-NEXT: Value: 0x0
; CHECK-NEXT: Size: 38
; CHECK-NEXT: Binding: Weak (0x2)
; CHECK-NEXT: Type: Function (0x2)
; CHECK-NEXT: Other: 0
; CHECK-NEXT: Section: .text._Z3barIiEiT_ (0x6)
; CHECK-NEXT: }
; CHECK-NEXT: ]
; CHECK-NEXT: }
; CHECK-NEXT: Section {
; CHECK-NEXT: Index: 7
; CHECK-NEXT: Name: .rela.text._Z3barIiEiT_ (87)
; CHECK-NEXT: Type: SHT_RELA (0x4)
; CHECK-NEXT: Flags [ (0x200)
; CHECK-NEXT: SHF_GROUP (0x200)
; CHECK-NEXT: ]
; CHECK-NEXT: Address: 0x0
; CHECK-NEXT: Offset: 0x638
; CHECK-NEXT: Size: 24
; CHECK-NEXT: Link: 12
; CHECK-NEXT: Info: 6
; CHECK-NEXT: AddressAlignment: 8
; CHECK-NEXT: EntrySize: 24
; CHECK-NEXT: Symbols [
; CHECK-NEXT: ]
; CHECK-NEXT: }
More information about the llvm-commits
mailing list