Hello, I'm getting Linker Syntax Error on Line 21. What is the solution for the error I will write the code here?
ENTRY(loader)
OUTPUT_FORMAT(elf32-i386)
OUTPUT_ARCH(i386:i386)
SECTIONS
{
. = 0x0100000;
.text :
{
*(.multiboot)
*(.text*)
*(.rodata)
}
.data :
{
start_ctors = .;
KEEP(*( .init_array ));
KEEP(*(SORT_BY_INIT_PRIOTRY( .init_array.* )));
end_ctors = .;
*(.data)
}
.bss :
{
*(.bss)
}
/DISCARD/ :
}
*(.fini_array*)
*(.comment)
}
}
Linker Syntax Error
-
- Posts: 23
- Joined: Fri Apr 01, 2022 10:06 am
- Location: Türkiye, Uşak/Merkez
Re: Linker Syntax Error
Please try to use the [code] markup when posting code snippets.
You have a typo that I suspect is the source of the issue: SORT_BY_INIT_PRIOTRY should be SORT_BY_INIT_PRIORITY
You have a typo that I suspect is the source of the issue: SORT_BY_INIT_PRIOTRY should be SORT_BY_INIT_PRIORITY
-
- Posts: 23
- Joined: Fri Apr 01, 2022 10:06 am
- Location: Türkiye, Uşak/Merkez
Re: Linker Syntax Error
Code: Select all
ENTRY(loader)
OUTPUT_FORMAT(elf32-i386)
OUTPUT_ARCH(i386:i386)
SECTIONS
{
. = 0x0100000;
.text :
{
*(.multiboot)
*(.text*)
*(.rodata)
}
.data :
{
start_ctors = .;
KEEP(*( .init_array ));
KEEP(*(SORT_BY_INIT_PRIORITY( .init_array.* )));
end_ctors = .;
*(.data)
}
.bss :
{
*(.bss)
}
/DISCARD/ :
}
*(.fini_array*)
*(.comment)
}
}
M. Alp
Re: Linker Syntax Error
On the line after "/DISCARD/ :" you have a closing curly brace } when you want an opening one {
I would have thought binutils ld would print better messages than just "syntax error" and I wonder if something is wrong with your language configuration since it looks like you're using Turkish? Before you fix the above issue, can you try putting LANG=C before your make command? I want to see if this produces more useful output.
I would have thought binutils ld would print better messages than just "syntax error" and I wonder if something is wrong with your language configuration since it looks like you're using Turkish? Before you fix the above issue, can you try putting LANG=C before your make command? I want to see if this produces more useful output.