HomePhabricator

[ELF] Don't crash on R_X86_64_GOTPCRELX for test/binop instructions

Authored by MaskRay on Oct 24 2020, 3:13 PM.

Description

[ELF] Don't crash on R_X86_64_GOTPCRELX for test/binop instructions

While MC did not produce R_X86_64_GOTPCRELX for test/binop instructions
(movl/adcl/addl/andl/...) before the previous commit, this code path has been
exercised by -fno-integrated-as for GNU as since 2016: -no-pie relaxing
may incorrectly access loc[-3] and produce a corrupted instruction.

Simply handle test/binop R_X86_64_GOTPCRELX like R_X86_64_GOTPCREL.

Details

Committed
MaskRayOct 24 2020, 3:14 PM
Parents
rGf04d92af94a8: [X86] Produce R_X86_64_GOTPCRELX for test/binop instructions (MOV32rm/TEST32rm/.
Branches
Unknown
Tags
Unknown