This is an archive of the discontinued LLVM Phabricator instance.

[ELF2] Make the system page size a target-dependent property
ClosedPublic

Authored by hfinkel on Oct 8 2015, 9:58 AM.

Details

Summary

The required page alignment is different on different targets. On PowerPC, for example, we need 64K pages (the loader won't set different permissions on a finer granularity than that). I've set the existing targets to what I believe to be the correct values, and have updated the regression tests accordingly.

Diff Detail

Event Timeline

hfinkel updated this revision to Diff 36868.Oct 8 2015, 9:58 AM
hfinkel retitled this revision from to [ELF2] Make the system page size a target-dependent property.
hfinkel updated this object.
hfinkel added reviewers: ruiu, rafael.
hfinkel added a project: lld.
hfinkel added a subscriber: llvm-commits.
ruiu added inline comments.Oct 8 2015, 10:11 AM
ELF/Target.cpp
352

Is 64KB page size standard on MIPS? (I'm not familiar with the platform.)

ELF/Target.h
43

This is the same -- you want to set 0x1000 as default and assign only when a platform uses a different value. (I found I slightly prefer 4096 over 0x1000, but I can't explain why.)

hfinkel added inline comments.Oct 8 2015, 2:41 PM
ELF/Target.cpp
352

I'm not really familiar either, but I checked what ld.gold does, and that's its default ABI page size for MIPS.

ELF/Target.h
43

Will do.

ruiu added inline comments.Oct 8 2015, 2:44 PM
ELF/Target.cpp
352

Thanks for the investigation. Doing what gold does sounds reasonable.

hfinkel updated this revision to Diff 36898.Oct 8 2015, 3:00 PM

Rebased, made 4096 the default (and use decimal values for easier reading).

ruiu edited edge metadata.Oct 8 2015, 3:02 PM

It's already signed off. Feel free to submit.

hfinkel accepted this revision.Oct 8 2015, 3:26 PM
hfinkel added a reviewer: hfinkel.
This revision is now accepted and ready to land.Oct 8 2015, 3:26 PM
hfinkel closed this revision.Oct 8 2015, 3:26 PM

r249760, thanks!