OSDev.org
https://forum.osdev.org/

R_X86_64_REX_GOTP ?
https://forum.osdev.org/viewtopic.php?f=13&t=33325
Page 1 of 1

Author:  mariuszp [ Sun Nov 18, 2018 2:05 pm ]
Post subject:  R_X86_64_REX_GOTP ?

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?

Author:  iansjack [ Mon Nov 19, 2018 4:55 am ]
Post subject:  Re: R_X86_64_REX_GOTP ?

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

Author:  mariuszp [ Mon Nov 19, 2018 6:03 pm ]
Post subject:  Re: R_X86_64_REX_GOTP ?

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

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/