[PATCH] D92113: Let .llvm_bb_addr_map section use the same unique id as its associated .text section.
Rahman Lavaee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 1 09:30:10 PST 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe0bf2349303f: Let .llvm_bb_addr_map section use the same unique id as its associated .text… (authored by rahmanl).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92113/new/
https://reviews.llvm.org/D92113
Files:
llvm/lib/MC/MCObjectFileInfo.cpp
llvm/test/CodeGen/X86/basic-block-sections-labels.ll
Index: llvm/test/CodeGen/X86/basic-block-sections-labels.ll
===================================================================
--- llvm/test/CodeGen/X86/basic-block-sections-labels.ll
+++ llvm/test/CodeGen/X86/basic-block-sections-labels.ll
@@ -1,5 +1,6 @@
; Check the basic block sections labels option
-; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-sections=labels | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-sections=labels | FileCheck %s --check-prefix=UNIQ
+; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=false -basic-block-sections=labels | FileCheck %s --check-prefix=NOUNIQ
define void @_Z3bazb(i1 zeroext) personality i32 (...)* @__gxx_personality_v0 {
br i1 %0, label %2, label %7
@@ -28,6 +29,8 @@
declare i32 @__gxx_personality_v0(...)
+; UNIQ: .section .text._Z3bazb,"ax", at progbits{{$}}
+; NOUNIQ: .section .text,"ax", at progbits,unique,1
; CHECK-LABEL: _Z3bazb:
; CHECK-LABEL: .Lfunc_begin0:
; CHECK-LABEL: .LBB_END0_0:
@@ -39,7 +42,9 @@
; CHECK-LABEL: .LBB_END0_3:
; CHECK-LABEL: .Lfunc_end0:
-; CHECK: .section .llvm_bb_addr_map,"o", at llvm_bb_addr_map,.text
+; UNIQ: .section .llvm_bb_addr_map,"o", at llvm_bb_addr_map,.text._Z3bazb{{$}}
+;; Verify that with -unique-section-names=false, the unique id of the text section gets assigned to the llvm_bb_addr_map section.
+; NOUNIQ: .section .llvm_bb_addr_map,"o", at llvm_bb_addr_map,.text,unique,1
; CHECK-NEXT: .quad .Lfunc_begin0
; CHECK-NEXT: .byte 4
; CHECK-NEXT: .uleb128 .Lfunc_begin0-.Lfunc_begin0
Index: llvm/lib/MC/MCObjectFileInfo.cpp
===================================================================
--- llvm/lib/MC/MCObjectFileInfo.cpp
+++ llvm/lib/MC/MCObjectFileInfo.cpp
@@ -1014,7 +1014,9 @@
Flags |= ELF::SHF_GROUP;
}
+ // Use the text section's begin symbol and unique ID to create a separate
+ // .llvm_bb_addr_map section associated with every unique text section.
return Ctx->getELFSection(".llvm_bb_addr_map", ELF::SHT_LLVM_BB_ADDR_MAP,
- Flags, 0, GroupName, MCSection::NonUniqueID,
+ Flags, 0, GroupName, ElfSec.getUniqueID(),
cast<MCSymbolELF>(TextSec.getBeginSymbol()));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92113.308686.patch
Type: text/x-patch
Size: 2291 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201201/a994816e/attachment.bin>
More information about the llvm-commits
mailing list