OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 16, 2024 1:45 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Relocation R_X86_64_32 against undefined symbol
PostPosted: Thu Nov 09, 2017 10:05 am 
Offline

Joined: Tue Feb 28, 2012 6:14 am
Posts: 9
Hi,

I am working on a hypervisor (https://github.com/hschauhan/xvisor-x86_64). While it compiles fine with GCC 6.3, it doesn't compile with GCC 7.2 that comes preinstalled with ubuntu 17.10. I get the following error:

/usr/bin/ld: /home/hchauhan/sandbox/xvisor-x86_64/build/arch/x86/cpu/cpu.o: relocation R_X86_64_32 against undefined symbol `_bootstrap_stack_start' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:344: recipe for target '/home/hchauhan/sandbox/xvisor-x86_64/build/vmm_tmp1.elf' failed

_bootstrap_stack_start is a symbol defined in linker script with PROVIDE. Previous GCC is able to link but new one is unable to do so. _bootstrap_stack_start is used to load %esp under .code32

I searched the internet for the failure and it looks like it has something to do with default visibility of symbols in gcc 7.2. I have tried -fvisibility etc but to no avail.

Any pointer would be of help.

Regards
Himanshu


Top
 Profile  
 
 Post subject: Re: Relocation R_X86_64_32 against undefined symbol
PostPosted: Thu Mar 15, 2018 9:00 pm 
Offline

Joined: Tue Feb 28, 2012 6:14 am
Posts: 9
I had solved this problem but didn't post a reply. I am posting it here in case somebody needs it.

you will need to use -fno-pie as your compiler flags.

Regards
Himanshu


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 54 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