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

Tim Northover t.p.northover at gmail.com
Mon Jul 8 08:41:55 PDT 2013


> Since the relocation is created at the MC level, it should be possible
> to write a test that uses llvm-mc to produce a .o from a .s instead of
> using llc.

And I'm not sure the test actually proves it's in the right section
(that depends on the contents of the .group section). I'd probably run
llvm-readobj with -section-data and check for something like:

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

; CHECK: Index: 6
; CHECK-NEXT: Name: .text._Z3barIiEiT_
; CHECK-NOT: Section {
; CHECK: SHF_GROUP

; CHECK: Index: 7
; CHECK-NEXT: Name: .rela.text._Z3barIiEiT_
; CHECK-NOT: Section {
; CHECK: SHF_GROUP

That seems to capture the fact that the two sections we care about are
in the same COMDAT group. Bonus points (or maybe not) for making the
"6" and "7" checked regular expressions in case extra sections are
added.

Cheers.

Tim.



More information about the llvm-commits mailing list