Comments (17)
Well that solves it, that padding is the one messing the assert.
from xnu.
@aBradleyUno do we need to add some extra sectcreate arguments in the arm64 ldflags?
Line 364 in 1eb20fd
from xnu.
Done, still, there is a panic every 15 LoC.
from xnu.
@aBradleyUno It seems that that isn't the right way to add a __DATA_CONST: https://github.com/apple-opensource/ld64/blob/master/src/ld/Options.cpp#L3808 says to pass in -data_const
to the linker. Also, passing in -text_exec
enables __TEXT_EXEC. https://github.com/apple-opensource/ld64/blob/master/src/ld/Options.cpp#L3816
My bad. :(
It looks like kexts are automatically compiled with these enabled (https://github.com/apple-opensource/ld64/blob/master/src/ld/Options.cpp#L4601), but there's no equivalent check for the kernel.
from xnu.
There is still the problem with the hardcoded offset. The assert still fails.
Line 1338 in 1eb20fd
from xnu.
@aBradleyUno we could try using -segment_order
to reorder the segments manually
from xnu.
@zhuowei or -sectalign, I'm going to try both
from xnu.
-Wl,-segment_order,__TEXT:__DATA_CONST:__TEXT_EXEC:__KLD:__LAST:__DATA:__PRELINK_TEXT:__PLK_TEXT_EXEC:__PLK_DATA_CONST:__PRELINK_DATA:__PLK_LLVM_COV:__PLK_LINKEDIT:__PRELINK_INFO \
Am I missing something? @zhuowei
from xnu.
@aBradleyUno that looks fine.
from xnu.
@zhuowei still panics
from xnu.
@aBradleyUno What's the message now?
from xnu.
@zhuowei is still on the assert, the only difference are the value on the variables
Also check the segments, what does `__TEXT,initcode does?
Left Darm64 - Right iOS 11.2.5
from xnu.
There's only two mentions of initcode in darwin-xnu: both are in kern_memorystatus.h
Edit: can I see the compiled kernel?
from xnu.
Maybe XNU_KERNEL_PRIVATE?
from xnu.
So, if I comment out the first assert the second one works like a charm
from xnu.
from xnu.
@aBradleyUno The __TEXT section ends at 0xfffffff007204000, but the __DATA_CONST starts at 0xfffffff007400000 - this gap is causing the first assert to fire. It's interesting that __data_const aligned itself to the nearest 0x200000 byte; there's this in the makefile that seems relevant:
Line 460 in c099cbf
from xnu.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xnu.