Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22093

How can I put some memory section in particular memory

$
0
0

I am trying to understand the GCC link script and create a small demo to practice , however I got the "syntax error" from ld. I appreciate any comments or suggestions. Thank you so much!

hello.c

__attribute__((section(".testsection"))) volatile int testVariable;

hello.ld

MEMORY {
  TEST_SECTION: ORIGIN = 0x43840000  LENGTH = 0x50    
}
SECTIONS{
.testsection: > TEST_SECTION
}

compile command

gcc -T hello.ld -o hello hello.o
c:/gnu/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe:../hello.ld:20: syntax error
collect2.exe: error: ld returned 1 exit status

Viewing all articles
Browse latest Browse all 22093

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>