Let .llvm_bb_addr_map section use the same unique id as its associated .text section.
authorRahman Lavaee <rahmanl@google.com>
Tue, 1 Dec 2020 17:20:34 +0000 (09:20 -0800)
committerRahman Lavaee <rahmanl@google.com>
Tue, 1 Dec 2020 17:21:00 +0000 (09:21 -0800)
commite0bf2349303f6b40e3ddd5377ea08a5c0867ece4
treea51faeac294913fdb224142642a12f1cff387524
parent54eab293f523956bdc4b1a98b6cf5abc0bd1ef3f
Let .llvm_bb_addr_map section use the same unique id as its associated .text section.

Currently, `llvm_bb_addr_map` sections are generated per section names because we use
the `LinkedToSymbol` argument of getELFSection. This will cause the address map tables of functions
grouped into the same section when `-function-sections=true -unique-section-names=false` which is not
the intended behaviour. This patch lets the unique id of every `.text` section propagate to the associated
`.llvm_bb_addr_map` section.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D92113
llvm/lib/MC/MCObjectFileInfo.cpp
llvm/test/CodeGen/X86/basic-block-sections-labels.ll