Skip to content

Conversation

@bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Jun 23, 2023

This fixes a case where .data and .rwtext can overlap if .rwtext's length is not aligned (which might happen because not all instructions are 32bit)

See esp-rs/esp-mbedtls#8

What happened there

4037dacf:	f01d      	retw.n

3fc8dad0 A _data_start
3fc8dad0 d _ZN8esp_wifi4wifi10os_adapter14FAKE_SPIN_LOCK17h713b30e6a3223c01E

0x4037dacf is 0x1d
0x4037dad0 is 0xf0

0x4037dad0 and 3fc8dad0 map to the same location in SRAM - so we end up with an illegal instruction at 0x4037dacf

@bjoernQ bjoernQ marked this pull request as ready for review June 23, 2023 12:26
@bjoernQ bjoernQ requested a review from MabezDev June 23, 2023 12:26
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

Another nice find! Thanks for taking care of this! LGTM!

@bjoernQ bjoernQ merged commit 0d1d64d into esp-rs:main Jun 23, 2023
@bjoernQ bjoernQ deleted the avoid-overlapping-data-rwtext branch June 23, 2023 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants