This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Difference in documentation vs implementation of R_X86_64_GOTPC32/64


On Mon, 18 Mar 2019, Siva Chandra via binutils wrote:

> Ah, is this what it is:
> 1. GOT spans .got and .got.plt.
> 2. Non-negative indices into the GOT are in .got.plt.
> 3. Negative indices into the GOT are in .got.
> 4. The first location of GOT, which is the zero-th entry in GOT, is
> If _this_ is the interpretation, then I am good with everything :)

Mostly, except the section names have no bearing.  There might be (and are 
in some configs) even more sections that happen to become part of the 
global offset table, so there's no inherent relation of index/offset sign 
and section, e.g. this still would be a valid layout:


The important part is that if the psABI talks about GOT then it means the 
address of the _GLOBAL_OFFSET_TABLE_ symbol, which in a non-relocatable 
file is simply some random address within the writable data segment, 
assigned by the link editor.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]