umanovskis / baremetal-arm

An ebook about bare-metal programming for ARM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chapter 4: arm-none-eabi-ld -T linkscript.ld -o cenv.elf startup.o cstart.o

Jayzown opened this issue · comments

I have tried running this line of code and keep getting the error:
arm-none-eabi-ld:linkscript.ld:0: syntax error

I have this for my linkscript.ld file
ENTRY(_Reset)
MEMORY
{
ROM (rx) : ORIGIN = 0X60000000, LENGTH 1M
RAM (rwx): ORIGIN = 0X70000000, LENGTH 32M
}
SECTIONS
1 .text : {
2 startup.o (.vector_table)
3 *(.text)
4 *(.rodata)
5 } > ROM
6 _text_end = .;
7 .data : AT(ADDR(.text) + SIZEOF(.text))
8 {
9 _data_start = .;
10 *(.data)
11 . = ALIGN(8);
12 _data_end = .;
13 } > RAM
14 .bss : {
15 _bss_start = .;
16 *(.bss)
17 . = ALIGN(8);
18 _bss_end = .;
19 } > RAM

Please what could be the problem? I have searched online and can't find the issue

Hey @umanovskis , I am sorry. I copied that from my page and didn't take the numbers out. I didn't include the numbers in the code, the numbers to the lines just come with it when you copy