Project

General

Profile

Feature #6590

request for link loader support for R_386_GOT32X, R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX as well as -z call-nop=

Added by Richard PALO over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2016-01-31
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

as indicated http://comments.gmane.org/gmane.comp.gnu.binutils/71437
and in particular https://sourceware.org/bugzilla/show_bug.cgi?id=19520
binutils gas has added R_386_GOT32X, R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX
and even a new ld option '-z call-nop'

According to Mr LU,

They are used to convert memory operand of test and binop into
immediate operand, where binop is one of adc, add, and, cmp, or,
sbb, sub, xor instructions, when position-independent code is disabled.
The new relocation tells linker that it should try such optimization
since binop is one of mentioned above.

as to the new ld option (patch 3/5)

The ld linker can transform indirect call to a locally defined function,
foo, via its GOT slot, to either "NOP call foo" or "call foo NOP" where
NOP is a 1-byte NOP padding.  This patch adds a "-z call-nop=PADDING" 
option to x86 ld to control 1-byte NOP padding for x86 call instruction.

PADDING is one of prefix-addr, prefix-nop, suffix-nop, prefix-NUMBER or
suffix-NUMBER.

No data to display

Also available in: Atom PDF