OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 11:04 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Relocatable ELF Object Help
PostPosted: Fri Aug 06, 2021 3:34 pm 
Offline
Member
Member
User avatar

Joined: Tue Sep 15, 2020 8:07 am
Posts: 264
Location: London, UK
Since position independent executables do work when using C code, but I can’t get the linker to output relocation information,my solution is to use gcc’s variable __attribute__ ( (section(.reloc))) tag to place the pointer I want to relocate into its own ELF section, this is obviously easy for my Loader to locate and then write the correct value to.

This feels a little hacky, but it works really well.

_________________
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 224 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