Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ELF] Always set _GLOBAL_OFFSET_TABLE_ to the beginning of .got
Previously, we set the address of `_GLOBAL_OFFSET_TABLE_` to `.got.plt` on i386 and x86-64 and to `.got` on other targets. But it looks like this special treament of x86 isn't necessary. The x86-64 psABI said that the symbol can even be in the middle of `.got` (*1). If `.got.plt` is missing, GNU linker set it to `.got`. This commit unconditionally set the symbol value to `.got`. (*1) x86-64 psABI 1.0 p.77: "The symbol _GLOBAL_OFFSET_TABLE_ may reside in the middle of the .got section, allowing both negative and non-negative offsets into the array of addresses."
- Loading branch information