History

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

This reverts commit 870271ea071971002fa556e09e1873db316fa1a9. 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.

Michael Matz committed 9 years ago

Commit 74463eb1 parent 32c9b511 file · +2 −1Browse files

Unified · Split

x86_64-gen.c+2−1
@@ -257,7 +257,8 @@ ST_FUNC void gen_addr64(int r, Sym *sym, int64_t c) · 256 unmodified lines
257257 /* output constant with relocation if 'r & VT_SYM' is true */
258258 ST_FUNC void gen_addrpc32(int r, Sym *sym, int c)
259259 {
260− greloca(cur_text_section, sym, ind, R_X86_64_PC32, 0);
260+ if (r & VT_SYM)
261+ greloca(cur_text_section, sym, ind, R_X86_64_PC32, c-4), c=4;
261262 gen_le32(c-4);
262263 }
263264

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t