binutils-gdb/ld/emultempl
H.J. Lu caa65211bb Add "-z call-nop=PADDING" option to ld
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.

bfd/

	* elf32-i386.c (elf_i386_convert_load): Use call_nop_byte and
	check call_nop_as_suffix for 1-byte NOP padding to pad call.
	* elf64-x86-64.c (elf_x86_64_convert_load): Likewise.

include/

	* bfdlink.h (bfd_link_info): Add call_nop_as_suffix and
	call_nop_byte.

ld/

	* ld/ld.texinfo: Document "-z call-nop=PADDING" option.
	* emulparams/call_nop.sh: New file.
	* emulparams/elf_i386_be.sh: Source
	${srcdir}/emulparams/call_nop.sh.
	* emulparams/elf_i386_chaos.sh: Likewise.
	* emulparams/elf_i386_ldso.sh: Likewise.
	* emulparams/elf_i386_vxworks.sh: Likewise.
	* emulparams/elf_iamcu.sh: Likewise.
	* emulparams/elf_k1om.sh: Likewise.
	* emulparams/elf_l1om.sh: Likewise.
	* emulparams/elf_x86_64.sh: Likewise.
	* emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set
	link_info.call_nop_byte if $CALL_NOP_BYTE isn't empty.

ld/testsuite/

	* ld-i386/call3.s: New file.
	* ld-i386/call3a.d: Likewise.
	* ld-i386/call3b.d: Likewise.
	* ld-i386/call3c.d: Likewise.
	* ld-i386/call3d.d: Likewise.
	* ld-i386/call3e.d: Likewise.
	* ld-i386/call3f.d: Likewise.
	* ld-i386/call3g.d: Likewise.
	* ld-i386/call3h.d: Likewise.
	* ld-i386/load1-nacl.d: Likewise.
	* ld-x86-64/call1.s: Likewise.
	* ld-x86-64/call1a.d: Likewise.
	* ld-x86-64/call1b.d: Likewise.
	* ld-x86-64/call1c.d: Likewise.
	* ld-x86-64/call1d.d: Likewise.
	* ld-x86-64/call1e.d: Likewise.
	* ld-x86-64/call1f.d: Likewise.
	* ld-x86-64/call1g.d: Likewise.
	* ld-x86-64/call1h.d: Likewise.
	* ld-x86-64/call1i.d: Likewise.
	* ld-x86-64/load1a-nacl.d: Likewise.
	* ld-x86-64/load1b-nacl.d: Likewise.
	* ld-x86-64/load1c-nacl.d: Likewise.
	* ld-x86-64/load1d-nacl.d: Likewise.
2015-10-22 04:56:39 -07:00
..
aarch64elf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
aix.em Remove link_info.pic 2015-08-19 12:53:54 +09:30
alphaelf.em Set DF_1_PIE in gld${EMULATION_NAME}_after_parse 2015-09-22 06:08:55 -07:00
arclinux.em New ARC implementation. 2015-10-07 14:20:19 +01:00
armcoff.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
armelf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
astring.sed
avrelf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
beos.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
bfin.em ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
cr16elf.em Set DF_1_PIE in gld${EMULATION_NAME}_after_parse 2015-09-22 06:08:55 -07:00
crxelf.em Set DF_1_PIE in gld${EMULATION_NAME}_after_parse 2015-09-22 06:08:55 -07:00
elf32.em Add "-z call-nop=PADDING" option to ld 2015-10-22 04:56:39 -07:00
elf-generic.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
epiphanyelf_4x4.em ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
genelf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
generic.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
gld960.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
gld960c.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
hppaelf.em Set DF_1_PIE in gld${EMULATION_NAME}_after_parse 2015-09-22 06:08:55 -07:00
ia64elf.em Set DF_1_PIE in gld${EMULATION_NAME}_after_parse 2015-09-22 06:08:55 -07:00
irix.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
linux.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
lnk960.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
m68hc1xelf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
m68kcoff.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
m68kelf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
metagelf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
mipself.em Set DF_1_PIE in gld${EMULATION_NAME}_after_parse 2015-09-22 06:08:55 -07:00
mmix-elfnmmo.em ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
mmixelf.em ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
mmo.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
msp430.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
nds32elf.em Set DF_1_PIE in gld${EMULATION_NAME}_after_parse 2015-09-22 06:08:55 -07:00
needrelax.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
netbsd.em ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
nios2elf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
ostring.sed
pe.em Fix compile time warnings generated when compiling with clang. 2015-09-23 18:05:16 +01:00
pep.em Fix compile time warnings generated when compiling with clang. 2015-09-23 18:05:16 +01:00
ppc32elf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
ppc64elf.em Add PowerPC64 ld --tls-get-addr-optimize. 2015-09-18 16:38:03 +09:30
README ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
rxelf.em ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
scoreelf.em ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
sh64elf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
solaris2.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
spu_icache.o_c
spu_icache.S
spu_ovl.o_c
spu_ovl.S ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
spuelf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
sunos.em Remove link_info.pic 2015-08-19 12:53:54 +09:30
tic6xdsbt.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
ticoff.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
v850elf.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
vanilla.em ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
vms.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
vxworks.em Add output_type to bfd_link_info 2015-08-18 05:51:19 -07:00
xtensaelf.em ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
z80.em ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

The files in this directory are sourced by genscripts.sh, after
setting some variables to substitute in, to produce
C source files that contain jump tables for each emulation.

Copyright (C) 2012-2015 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.