OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Jun 18, 2019 12:13 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: R_X86_64_REX_GOTP ?
PostPosted: Sun Nov 18, 2018 2:05 pm 
Offline
Member
Member
User avatar

Joined: Sat Oct 16, 2010 3:38 pm
Posts: 633
This relocation type is not documented anywhere that I could find (tried googling around, all i think is linker errors).

This code:
Code:
mov test@GOTPCREL, %rax


Produces this:

Code:
000000000004  000500000009 R_X86_64_GOTPCREL 0000000000000000 test + 0


Which is pretty much what I expected (I think?) but when I do this:

Code:
mov test@GOTPCREL(%rip), %rax


which AFAIK is the correct way of getting a pointer to "test" in PIC mode, the relocation I get is:

Code:
000000000003  00050000002a R_X86_64_REX_GOTP 0000000000000000 test - 4


Which, again, is not documented anywhere. By logic, I can tell that the calcultion for this would be (S + A - P), where S is the absolute address of the GOT entry for "test" (correct me if I'm wrong), but... why is this not documented anywhere?

EDIT: I notice that it's exactly the same as the calculation for R_X86_64_GOTPCREL... but then, isn't the first one incorrect?

_________________
Glidix: An x86_64 POSIX-compliant operating system, aiming to be as optimized as possible, especially in graphics.
https://glidix.madd-games.org/


Top
 Profile  
 
 Post subject: Re: R_X86_64_REX_GOTP ?
PostPosted: Mon Nov 19, 2018 4:55 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 3368
Location: Chichester, UK
Are you sure that your display is not truncating the type?

See https://groups.google.com/forum/#!topic ... 9AWHogmVY0

The latest specification, where the type R_X86_64_REX_GOTPCRELX is documented, is found here: https://github.com/hjl-tools/x86-psABI/ ... operty.pdf


Top
 Profile  
 
 Post subject: Re: R_X86_64_REX_GOTP ?
PostPosted: Mon Nov 19, 2018 6:03 pm 
Offline
Member
Member
User avatar

Joined: Sat Oct 16, 2010 3:38 pm
Posts: 633
iansjack wrote:
Are you sure that your display is not truncating the type?

See https://groups.google.com/forum/#!topic ... 9AWHogmVY0

The latest specification, where the type R_X86_64_REX_GOTPCRELX is documented, is found here: https://github.com/hjl-tools/x86-psABI/ ... operty.pdf


Yep, that was it - the display was truncating the name. Thank you

_________________
Glidix: An x86_64 POSIX-compliant operating system, aiming to be as optimized as possible, especially in graphics.
https://glidix.madd-games.org/


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: No registered users and 2 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