<re_irc>
< (@Ericson2314:matrix.org)> Can one set a symbol to an arbitrary value by making a ZST global at a certain address?
<re_irc>
< (@Ericson2314:matrix.org)> or is there a better way?
<re_irc>
< (@Ericson2314:matrix.org)> oh hmm confusing I thought I could specify the address of a global but not seeing that either
<re_irc>
< (@Ericson2314:matrix.org)> I guess extern and do via linker script?
<re_irc>
< (@jamesmunns:beeper.com)> > Can one set a symbol to an arbitrary value by making a ZST global at a certain address?
<re_irc>
could you maybe explain what you're actually trying to do here? I feel like this is a bit of an X/Y question
<re_irc>
< (@jamesmunns:beeper.com)> In general, you can't specify the location (address) of anything in Rust, you can only specify it's link section (and have the linker resolve the specific location).
<re_irc>
You _can_ create a pointer to an arbitrary location, but not create a variable/static at a given location.
<re_irc>
< (@jamesmunns:beeper.com)> (also mixing ZSTs and the linker I think is a little sketchy, but I don't remember exactly the rules here, I'd have to read one of the nomicons)
starblue has joined #rust-embedded
<re_irc>
< (@Ericson2314:matrix.org)> : very fun hacks :)
<re_irc>
< (@Ericson2314:matrix.org)> this device doesn't have proper loader, so we are obj copying in the relocations and running them by hand
<re_irc>
< (@Ericson2314:matrix.org)> getting around ropi limitations
<re_irc>
< (@Ericson2314:matrix.org)> and we leave some space in the original linker script for the relocations
<re_irc>
< (@Ericson2314:matrix.org)> (because trying put directly have hte main linker script put the relocations in there does not work, I guess because that could be causality loop)
<re_irc>
< (@Ericson2314:matrix.org)> so we want the app to specify a symbol which is not an address but a length, now much room to leave for the relocations to be object coppied in later
<re_irc>
< (@Ericson2314:matrix.org)> we're just going to do through something in the build.rs