Comments (4)
FWIW this is on K210 and all memory regions are simply aliased to SRAM, sections are not treated any differently there:
MEMORY
{
SRAM : ORIGIN = 0x80000000, LENGTH = 6M
…
}
REGION_ALIAS("REGION_TEXT", SRAM);
REGION_ALIAS("REGION_RODATA", SRAM);
REGION_ALIAS("REGION_DATA", SRAM);
REGION_ALIAS("REGION_BSS", SRAM);
REGION_ALIAS("REGION_HEAP", SRAM);
REGION_ALIAS("REGION_STACK", SRAM);
from riscv-rt.
To be honest, I'm not good at writing linker scripts and almost sure we can do better. However, I have no idea how to achieve this. The output you see is probably due to the .stack
section existence, and I added this section to be able to check for the total stack size like this:
Lines 159 to 161 in 2d05df6
from riscv-rt.
Pretty sure that that should work.
I looked into it a bit yesterday (even as far as looking into the lld
ELF generation code) and I'm baffled. From everything I saw, (NOLOAD)
should be enough to get both no PT_LOAD
flag a SHT_NOBITS
section, the same combination as .bss
. However while PT_LOAD
is successfully disabled (so this doesn't actually affect anything),, it is a SHT_PROGBITS
section. This combination is sometimes used for metadata and such. But it's obviously not what we want here.
So I'm starting to think it could be some lld
issue. But not sure.
Separately from this, we could consider making the section only as big as needed instead of cover all of memory. Make it start AT((_stack_start - _hart_stack_size, * (_max_hart_id + 1)
) and be exactly _hart_stack_size, * (_max_hart_id + 1)
bytes large.
But I'm not sure that can be expressed.
from riscv-rt.
This seems to be a known (and fixed) issue: rust-lang/rust#73201
Introduced in nightly-2020-05-22
by LLVM update rust-lang/rust#67759, fixed in nightly-2020-06-08
by rust-lang/rust#73072
Present in stable 1.45.0 and 1.45.1, fixed in beta 1.46.0.
from riscv-rt.
Related Issues (20)
- Support for lld HOT 2
- Build on stable
- rust produces a 2.1G executable HOT 7
- build using -mcmodel = medany HOT 18
- Implement multi-core support
- Bizarre warning behavior around #[entry] macro and `&mut FnMut`
- LiteX/VexRiscv support HOT 4
- Execution start address varies. HOT 3
- Update r0 to 1.0 HOT 1
- Relocation R_RISCV_ALIGN linker error
- RAM init code violates pointer provenance and aliasing rules HOT 1
- Migration to GitHub Actions HOT 1
- sp may not be aligned to 16 bytes
- Lots of rust-lld errors HOT 3
- New crates.io release HOT 4
- Accessing parameters passed in register by the previous boot stage HOT 8
- Doesn't compile with the latest nightly toolchain. HOT 4
- Reimplement `r0`, since it is deprecated HOT 7
- asm: Startup code traps into an illegal instruction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riscv-rt.