Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Linker error: "no memory region specified for section '.ARM.extab'" #157

Closed
phil-opp opened this issue Dec 7, 2018 · 4 comments
Closed

Comments

@phil-opp
Copy link
Contributor

phil-opp commented Dec 7, 2018

I'm working with generators and async/await. I tried to move some more complex function into a generator, but I got the following linker error when compiling in debug mode:

rust-lld: error: no memory region specified for section '.ARM.extab'

I looked for other mentions of .ARM.extab on GitHub and found this PR from 2014: hackndev/zinc#238. It seems like this section is used for unwinding and can be discarded. When I compile in release mode with LTO the error disappears, so it really seems like the section isn't needed.

I think we could fix this problem by either discarding or including .ARM.extab in link.x.in.

My rust version is: rustc 1.32.0-nightly (edaac35d6 2018-11-24).

@thejpster
Copy link
Contributor

If you run against a fork of cortex-m-rt and hack the link.x.in to discard the .ARM.extab section, does your debug build then work?

@phil-opp
Copy link
Contributor Author

@thejpster Sorry for the delay! I tried it again with a modified link.x.in, but the same error occurs. Not sure why…

@phil-opp
Copy link
Contributor Author

phil-opp commented Jan 21, 2019

@thejpster Turns out a dependency was still using the crates.io version of cortex-m-rt. When I override the crate in all dependencies with through a patch section, it compiles again. I opened #169 with this fix.

Edit: I was compiling with some code commented out. Sorry for the noise.

@phil-opp
Copy link
Contributor Author

@thejpster Ok, I did some more investigation and was able to fix this by discarding *(.ARM.extab.*); instead of *(.ARM.extab);. I also made sure that no code is commented out this time :).

I opened a new PR in #170.

bors bot added a commit that referenced this issue Jan 22, 2019
170: Discard .ARM.extab.* r=japaric a=phil-opp

Fixes #157 

Co-authored-by: Philipp Oppermann <dev@phil-opp.com>
@bors bors bot closed this as completed in #170 Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants