OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 5:33 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Error when trying to linking crtbeging.o [SOLVED]
PostPosted: Thu Dec 27, 2018 2:17 pm 
Offline

Joined: Thu Dec 27, 2018 1:45 pm
Posts: 4
Hi,

I'm a beginner in OS development. I just started few days ago and I'm in the firsts steps described in Bare Bones Kernel on osdev wiki.
Right now, I'm trying to link crtbegin.o and crtend.o, with the respective crti.o and crtn.o in my Kernel, but in linking time, with ld, the follow error is just aborting the process:

Code:
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1/32/crtbegin.o: direct GOT relocation R_386_GOT32X against `_ITM_deregisterTMCloneTable' without base register can not be used when making a shared object
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status

I found a solution that imply pass -no-pie option to ld, but if I link the kernel with that flag, the command "grub-file --is-x86-multiboot" return non-zero result, so I can't boot my kernel with qemu. What can I do to solve this?
I will attach my Makefile so you can see my GCC, ld and GNAS options. If another file is needed, just tell me.

EDIT:
GCC 8.2.1
GNU ld 2.31.1
GNAS 2.31.1
I'm using qemu-system-i386 with -kernel option to boot my system
Linux x86_64 4.19.2 in ArchLinux


Attachments:
File comment: .txt extenseion because I can't submit it without extension.
Makefile.txt [1.34 KiB]
Downloaded 14 times


Last edited by moige on Thu Dec 27, 2018 8:01 pm, edited 1 time in total.
Top
 Profile  
 
 Post subject: Re: Error when trying to linking crtbeging.o
PostPosted: Thu Dec 27, 2018 2:48 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
moige wrote:
I just started few days ago and I'm in the firsts steps described in Bare Bones Kernel on osdev wiki.

Do you mean this one? If so, you've skipped the section on building a cross-compiler. Go back and do that first.


Top
 Profile  
 
 Post subject: Re: Error when trying to linking crtbeging.o
PostPosted: Thu Dec 27, 2018 8:00 pm 
Offline

Joined: Thu Dec 27, 2018 1:45 pm
Posts: 4
Octocontrabass wrote:
moige wrote:
I just started few days ago and I'm in the firsts steps described in Bare Bones Kernel on osdev wiki.

Do you mean this one? If so, you've skipped the section on building a cross-compiler. Go back and do that first.

Problem solved. Thanks.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 73 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