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

make DEFAULT_HANDLER an undefined symbol #62

Closed
wants to merge 1 commit into from
Closed

make DEFAULT_HANDLER an undefined symbol #62

wants to merge 1 commit into from

Conversation

japaric
Copy link
Member

@japaric japaric commented Mar 27, 2018

fixes #58

I found out that this fixes #58 while writing the embedonomicon

@japaric
Copy link
Member Author

japaric commented Mar 27, 2018

@crawford could you give this a spin? I tested with the example code you posted in #58 but perhaps you should try this out with some more complex program.

cc @pftbest you may want to include this in msp430-rt

@pftbest
Copy link
Contributor

pftbest commented Mar 27, 2018

@japaric Sorry, but looks like this fix doesn't work for me. Are you sure it fixed the issue on your side? I still see that EXCEPTIONS array is wrong both in debug and non-lto release.

@crawford
Copy link
Contributor

@japaric Gah! I didn't see your note since GitHub doesn't always send me email alerts... I tried this out on my application (rustc 1.27.0-nightly-7360d6dd6 with LLD) and it seems to work. It looks like @pftbest's patch might be more complete though.

@pftbest
Copy link
Contributor

pftbest commented Apr 18, 2018

lld may not have this issue, it is probably GNU ld specific.

I've created a bug report for binutils, will see what they say.

@crawford
Copy link
Contributor

@pftbest Uh oh. I'm not seeing the original issue anymore (even with GNU ld).

@pftbest
Copy link
Contributor

pftbest commented Apr 18, 2018

@crawford In your bug report you have posted an example project called "simple". Just now I took it's source code, modified it to work with cargo on a recent nightly (updated cortex-m-rt to version 4 and removed Xargo.toml) and then changed the linker script to be the same as in this PR.

Here is what i got: updated.tar.gz

Then I build it and look at the output

cargo build
arm-none-eabi-objdump -d -j .text -j .vector_table target/thumbv7m-none-eabi/debug/default-test

And I see that the output is incorrect:

00000008 <EXCEPTIONS>:
   8:	000004df 000004df 000004df 000004df     ................
  18:	000004df 00000000 00000000 00000000     ................
  28:	00000000 000004df 000004df 00000000     ................
  38:	000004df 000004df                       ........

...

000004de <BUS_FAULT>:
 4de:	f3ef 8008 	mrs	r0, MSP
 4e2:	f7ff bff5 	b.w	4d0 <_ZN11cortex_m_rt15default_handler17h73065f5c8934a2c2E>
 4e6:	defe      	udf	#254	; 0xfe

Can you please build this project on your side to compare?

@crawford
Copy link
Contributor

@pftbest I'm seeing the same behavior as you for the example code, but not for my application. My application seems to link properly. I wonder if it is because I don't have a direct dependency on cortex-m-rt.

@japaric
Copy link
Member Author

japaric commented May 13, 2018

Subsumed by #69

@japaric japaric closed this May 13, 2018
@jonas-schievink jonas-schievink deleted the gh58 branch January 13, 2020 21:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

default_handler! doesn't work
3 participants