Skip to content
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

.text section overflows rom region #190

Closed
saagarjha opened this issue Nov 25, 2019 · 5 comments · Fixed by #200
Closed

.text section overflows rom region #190

saagarjha opened this issue Nov 25, 2019 · 5 comments · Fixed by #200

Comments

@saagarjha
Copy link

I've been trying to build the firmware and I've been unable to successfully build a firmware that fits on my device. Building a release firmware gives me an error during the linking step both in the Docker image (with some munging to use the correct set of tools) and on my Mac with a manually-downloaded set of dependencies:

/opt/local/lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/ld: ../../bin/firmware.keepkey.elf section `.text' will not fit in region `rom'
/opt/local/lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/ld: region `rom' overflowed by 66760 bytes
collect2: error: ld returned 1 exit status
make[2]: *** [bin/firmware.keepkey.elf] Error 1
make[1]: *** [tools/firmware/CMakeFiles/firmware.keepkey.elf.dir/all] Error 2
make: *** [all] Error 2

A non-release build succeeds but does not install because it's "too large". Any ideas as to why this might be happening?

@saagarjha
Copy link
Author

saagarjha commented Nov 25, 2019

$ arm-none-eabi-nm --size-sort bin/firmware.keepkey.elf | tail
00003000 b msg.8271
00003000 B msg_resp.lto_priv.0
00003400 b decode_buffer.8255
00004000 b canvas_buffer
000040a4 t blake2b_compress
00005250 T tokens
00005350 T coins
00006000 T ge25519_niels_base_multiples
000090dc T nist256p1
000090dc T secp256k1

Enabling LTO and commenting out

#include "keepkey/firmware/ethereum_tokens.def"
fixed the problem. (Who needs Ethereum tokens anyways?)

@keepkeyjon
Copy link
Contributor

A non-release build succeeds but does not install because it's "too large". Any ideas as to why this might be happening?

Known issue. We're getting close to the max size firmware that will fit on the device. We'll have to do some size optimizations before the next release.

I recommend starting from one of our tagged releases, and building with the scripts in ./scripts/build/docker/device/{release,debug}.sh.

@keepkeyjon
Copy link
Contributor

also, re: removing ETH tokens: #68

@saagarjha
Copy link
Author

Thanks for the insight. Quick (but unrelated) question about building: the Docker images (v5-beta and v8) seem to default to the docker-v6 branch of libopencm3, and I couldn't get it to build with any of the other branches even though the Dockerfile seems to suggest otherwise. Is this expected?

@keepkeyjon
Copy link
Contributor

That's... strange. Good reminder to update that dependency though, since we haven't in a long time.

keepkeyjon added a commit that referenced this issue Dec 16, 2019
This brings the release build down to 492k from 630k.

Closes #190
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 a pull request may close this issue.

2 participants