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
Unknown Object (File)
Mon, Dec 16, 5:39 PM
Unknown Object (File)
Oct 14 2024, 8:41 PM
Unknown Object (File)
Oct 14 2024, 8:09 PM
Unknown Object (File)
Oct 5 2024, 6:04 AM
Unknown Object (File)
Oct 5 2024, 3:25 AM
Unknown Object (File)
Oct 4 2024, 1:41 AM
Unknown Object (File)
Oct 2 2024, 5:51 AM
Unknown Object (File)
Oct 2 2024, 1:56 AM
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.