Revert "gen_addrpc32: absolute ptr needs *ABS* relocation"

This reverts commit 870271ea07.

The commit is broken, you can't unconditionally emit a PC-relative
relocation without a symbol.  And if there's a symbol the addend
need to be in the relocation, not the section.
master
Michael Matz 2017-11-14 16:43:22 +01:00
parent 32c9b51401
commit 74463eb954
1 changed files with 2 additions and 1 deletions

View File

@ -257,7 +257,8 @@ ST_FUNC void gen_addr64(int r, Sym *sym, int64_t c)
/* output constant with relocation if 'r & VT_SYM' is true */
ST_FUNC void gen_addrpc32(int r, Sym *sym, int c)
{
greloca(cur_text_section, sym, ind, R_X86_64_PC32, 0);
if (r & VT_SYM)
greloca(cur_text_section, sym, ind, R_X86_64_PC32, c-4), c=4;
gen_le32(c-4);
}