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.

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 OK
Unit
No Unit 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.