[PATCH] D80859: [lld-macho] Ensure __bss sections we output have file offset of zero

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 30 16:58:20 PDT 2020


MaskRay added a comment.

> I'm not sure it's strictly necessary, but it's what ld64 does.

If no tool enforces this, then maybe this is unnecessary? I believe the ELF counterpart is SHT_NOBITS. sh_offset of a SHT_NOBITS section is ignored, but for aesthetic reasons and practical reasons (monotonic property), linkers reuses the previous section's offset.

BTW, `llvm-readobj -S` for ELF is so verbose that I stopped using it and switched to `llvm-readelf -S` for most new tests. If you find Mach-O output verbose, maybe it is time to add a compact style.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80859





More information about the llvm-commits mailing list