That's what ld64 uses for 64-bit targets. I figured it's best
to make this change sooner rather than later since a bunch of our tests
are relying on hardcoded addresses that depend on this value.
Depends on D80169.
Differential D80177
[lld-macho] Set __PAGEZERO size to 4GB int3 on May 18 2020, 9:09 PM. Authored by
Details That's what ld64 uses for 64-bit targets. I figured it's best Depends on D80169.
Diff Detail
Unit Tests Event TimelineComment Actions Thanks for fixing this! It'll make it way easier to compare results with ld64. Requesting changes cos I think we're gonna mess up entryoff as this stands, and we definitely need to add test coverage for that.
Comment Actions Looks great, thanks!
Comment Actions Thanks for the heads up, just pushed a likely fix and will monitor http://lab.llvm.org:8011/builders/lld-x86_64-win. I'll set up a local Windows VM to catch future such issues earlier... Comment Actions @int3, can you please point out the fix you pushed? The tests are failing downstream, and I am looking for the commit that fixes it. Moreover, in the head llvm-project there are still issues for 32-bit host builds: enum : uint64_t { ... PageZeroSize = 1ull << 32, // XXX should be 4096 for 32-bit targets ... }; PageZeroSize is a 64-bit constant, but it is being returned as size_t, which is 4 bytes for 32-bit hosts: class PageZeroSection : public SyntheticSection { ... size_t getSize() const override { return PageZeroSize; } ... Could you please fix this? Comment Actions rGd767de44bf9527cb5058f5fe16aac2f23c21977c was the referenced fix. Good point about size_t, I'll change that Comment Actions Thanks. The enum change does not fix the fails on my side. I guess it has to be the size_t issue. |
This is *definitely* follow-up territory, but we should figure out if it ever makes sense for getFileOffset to be called on a non-defined symbol, and if not, just fail loudly in that case instead of silently returning 0.