Closed Bug 772974 Opened 10 years ago Closed 9 years ago
-z max-page-size doesn't have the expected effect when using gold
-z max-page-size is used in bug 723939 and bug 772886 to have a working alignment on some armv6 devices, such that the linker doesn't fail. It however doesn't affect PT_LOAD's p_align when linking with gold.
9 years ago
I just want to make sure: this bug manifests as a linker error on startup, right? Or could there be more subtle manifestations of this bug? My local builds of ARMv6 fennec with gcc-4.6 and gold start up fine so I want to know if this bug is still an issue.
(In reply to Kartikaya Gupta (email:email@example.com) from comment #1) > I just want to make sure: this bug manifests as a linker error on startup, > right? Or could there be more subtle manifestations of this bug? My local > builds of ARMv6 fennec with gcc-4.6 and gold start up fine so I want to know > if this bug is still an issue. The problem is that the bug may show up pretty much randomly depending how things align in PT_LOADs, and how lucky you are with mmap. Can you attach the output for readelf -l *.so ?
Here's the output from readelf -l *.so. Is the problem here that the alignment of the LOAD sections is 0x1000 instead of 0x4000?
Also, if that is indeed the problem, the attached patch makes the LOAD alignment 0x4000 when building with NDK r8c/gcc-4.6/gold-1.10. The build seems to work fine on my device, but I don't know if it will have other side-effects that are not obvious.
I know i've tried common-page-size before settling on max-page-size, and i remember there were problems with it, although i don't remember what specifically. However, I'm not sure i tried both at the same time. Anyways, it would be better to double check the resulting binaries.
When I tried it, common-page-size by itself didn't fix the alignment. Only when I set both does the alignment change. I'll do more thorough testing once NDK r8c is rolled out and I can build this on try.
Comment on attachment 695508 [details] [diff] [review] Set common-page-size as well Review of attachment 695508 [details] [diff] [review]: ----------------------------------------------------------------- The try build at https://tbpl.mozilla.org/?tree=Try&rev=2c0744d1d581 with this patch (plus one to work around the SIGILL thing from bug 803601) work fine with gold and gcc-4.6. Any objections to landing this patch? I also verified the alignment on the LOAD segments is 0x4000 on the .so files in the try build.
Attachment #695508 - Flags: review?(mh+mozilla)
Attachment #695508 - Flags: review?(mh+mozilla) → review+
9 years ago
Assignee: nobody → bugmail.mozilla
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.