Skip to content

Backport changelog from 0.6.x #323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2021
Merged

Backport changelog from 0.6.x #323

merged 1 commit into from
Jan 27, 2021

Conversation

adamgreig
Copy link
Member

No description provided.

@rust-highfive
Copy link

r? @jonas-schievink

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m labels Jan 26, 2021
Copy link
Contributor

@therealprof therealprof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 27, 2021

Build succeeded:

@bors bors bot merged commit c714cdf into master Jan 27, 2021
@bors bors bot deleted the update-changelog branch January 27, 2021 00:01
adamgreig pushed a commit that referenced this pull request Jan 12, 2022
323: link.x.in: put most __[se] symbols back into sections r=adamgreig a=jordens

This puts most start/end address symbols back into the sections.

Only `__ebss` and `__edata` are kept outside their sections so that
potential user code with external libraries can inject stuff using
`INSERT AFTER .bss/.data` and profit from the .bss/.data zeroing/loading
mechanism. This also leads to the `__sbss` and `__veneer_base` symbols
having the right section type (bss is B not D in nm).

Also the trust zone start and end address are aligned to 32 bytes as per
the requirements. That section does cost up to 28 byte of padding at the end of FLASH due to
that alignment even if empty. But since flash is typically a multiple of 32 bytes and since the padding is at the end, there is no downside.

The .rodata start is kept free for the linker to allocate it after .text.
This enables users to inject sections between .text and .rodata and
removes the chance to get overlapping address errors. With this the
linker will by default place .rodata after .text as before.

This commit also adds and exposes a few more stable address start/end symbols
(__[se]uninit, __stext, __srodata) that are usefull for debugging and hooking
into.

See
rust-embedded/cortex-m-rt#287 (comment)
for discussion of the issues and description of this compromise solution.

Tested:

* [x] [stm32h7 ITCM](quartiq/stabilizer#322)
* [x] [sgstubs](rust-embedded/cortex-m-rt#323 (comment))
* [x] `INSERT AFTER` for bss/data still works (rust-embedded/cortex-m-rt#323 (comment))

Topics:

* [x] `sgstubs` moved to be the last section in FLASH to minimize the impact of the 32 byte alignment. (Padding flash to 32 byte is considered benign.)
* [ ] `INSERT AFTER` with binutils ld doesn't work. But that's independent of these changes. This is the `sgstubs`-in `memory.x` use case. Currently the `sgstubs` section is kept in `link.x`.

Co-authored-by: Robert Jördens <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants