[PATCH] D60785: [ELF] Align file offset for .bss if first section in a PT_LOAD

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 08:18:52 PDT 2019


MaskRay added a comment.

Sorry I didn't compare the results carefully, but I ran into a similar issue with PPC32 BSS PLT.

Have you tried this diff?

  -  if (OS->Type == SHT_NOBITS)
  +  if (OS->Type == SHT_NOBITS && !(OS->PtLoad && OS->PtLoad->FirstSec == OS))
       return Off;
  
    // If the section is not in a PT_LOAD, we just have to align it.
    if (!OS->PtLoad)
      return alignTo(Off, OS->Alignment);


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60785





More information about the llvm-commits mailing list