Page MenuHomeFreeBSD

Align .data segment with DATA_SEGMENT_ALIGN(0x1000, 0x1000) instead ofALIGN(0x1000) + (. & (0x1000 - 1)).
AbandonedPublic

Authored by ray on Sep 21 2019, 9:09 PM.
Tags
None
Referenced Files
F132034629: D21742.id62401.diff
Mon, Oct 13, 3:09 AM
Unknown Object (File)
Wed, Sep 17, 1:34 PM
Unknown Object (File)
Tue, Sep 16, 3:15 AM
Unknown Object (File)
Tue, Sep 16, 2:43 AM
Unknown Object (File)
Sep 9 2025, 6:19 AM
Unknown Object (File)
Jul 23 2025, 6:27 AM
Unknown Object (File)
Jul 2 2025, 4:07 PM
Unknown Object (File)
Jul 1 2025, 12:49 PM
Subscribers

Details

Reviewers
None
Group Reviewers
ARM
Summary

Seems due some bug in llvm linker 'ALIGN(0x1000) + (. & (0x1000 - 1))'
trick produce kernel with wrong alignment:
[28] .data PROGBITS c0753d00 752d00 06f1d8 00 WA 0 0 64
That breaks boot on early stage with loaders unaware of ELF format.
In my case, kernel can't mach FDT methods on init of OFW.
DATA_SEGMENT_ALIGN special attribute that make job right:
[28] .data PROGBITS c0753000 753000 06f1d8 00 WA 0 0 64

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26606
Build 24985: arc lint + arc unit

Event Timeline

ray retitled this revision from Align .data segment with DATA_SEGMENT_ALIGN(0x1000, 0x1000) instead of ALIGN(0x1000) + (. & (0x1000 - 1)). to Align .data segment with DATA_SEGMENT_ALIGN(0x1000, 0x1000) instead ofALIGN(0x1000) + (. & (0x1000 - 1))..Sep 21 2019, 9:10 PM
ray added a reviewer: ARM.

It is wrong way to fix elfcopy bug.
Thanks to @strejda for pointing that.