OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 1:51 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Linker Syntax Error
PostPosted: Fri Apr 01, 2022 10:15 am 
Offline

Joined: Fri Apr 01, 2022 10:06 am
Posts: 23
Location: Türkiye, Uşak/Merkez
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)
}
}


Attachments:
Ekran görüntüsü 2022-03-31 201702.png
Ekran görüntüsü 2022-03-31 201702.png [ 14.34 KiB | Viewed 1037 times ]

_________________
M. Alp
Top
 Profile  
 
 Post subject: Re: Linker Syntax Error
PostPosted: Sat Apr 02, 2022 10:22 pm 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 676
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

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
 Post subject: Re: Linker Syntax Error
PostPosted: Sun Apr 03, 2022 7:00 am 
Offline

Joined: Fri Apr 01, 2022 10:06 am
Posts: 23
Location: Türkiye, Uşak/Merkez
Code:
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)
}
}


Yes, This Solved My Code Error On Line 21, But Now Line 33 Has The Same Linker Error. I'm Posting the Screenshot.


Attachments:
Linker 33 Satırdakş Hata.png
Linker 33 Satırdakş Hata.png [ 42.82 KiB | Viewed 1002 times ]

_________________
M. Alp
Top
 Profile  
 
 Post subject: Re: Linker Syntax Error
PostPosted: Sun Apr 03, 2022 3:46 pm 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 676
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.

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 43 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group