[lld] [LLD]lld incorrectly handles .eh_frame when it has a non-zero offset within its output section. (PR #65966)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 30 10:13:15 PDT 2023


================
@@ -770,6 +770,10 @@ void AArch64::relocateAlloc(InputSectionBase &sec, uint8_t *buf) const {
   uint64_t secAddr = sec.getOutputSection()->addr;
   if (auto *s = dyn_cast<InputSection>(&sec))
     secAddr += s->outSecOff;
+  else if (auto *ehIn = dyn_cast<EhInputSection>(&sec)) {
+    SyntheticSection *ehFrame = ehIn->getParent();
----------------
MaskRay wrote:

`ehFrame` is used only once. Just inline its use and drop the braces. Ditto everywhere.

https://github.com/llvm/llvm-project/pull/65966


More information about the llvm-commits mailing list