[PATCH] D152944: [BOLT] Set IsRelro section attribute based on PT_GNU_RELRO segment

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 14:28:46 PDT 2023


Amir added inline comments.


================
Comment at: bolt/lib/Rewrite/RewriteInstance.cpp:476
+    BinarySection *BinarySection = BC->getSectionForSectionRef(SecRef);
+    if (!BinarySection || BinarySection->isTBSS())
+      continue;
----------------
maksfb wrote:
> I realized TBSS sections are specifically excluded from `isAllocatable()`. We are not interested in other non-allocatable sections either, right?
I realized I may have misunderstood the special treatment of TBSS in readelf segment->section mapping:
https://github.com/llvm/llvm-project/blob/e28bb6c3c797e06b2746e5b6dcba6fbb5e20a61b/llvm/tools/llvm-readobj/ELFDumper.cpp#L4498.

It basically says that TBSS section is treated as an empty section when it's in non-TLS segment. Let me adjust the check.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152944/new/

https://reviews.llvm.org/D152944



More information about the llvm-commits mailing list