binutils-gdb/ld/emultempl
Alan Modra 22b1ee183d Set dynamic_undefined_weak to zero for static PIEs
I believe we should be warning if ld is given both --no-dynamic-linker
and -z dynamic-undefined-weak.  The two options are contradictory, the
first says an executable has no dynamic interpreter to resolve dynamic
symbols, while the second is asking for dynamic symbols to be emitted.
(And even if a static PIE's relocation code, which is needed to
process R_*_RELATIVE relocs, could process symbols, there are no
DT_NEEDED dynamic objects to define such symbols.)

I also think that dynamic_undefined_weak is the right flag to control
whether undefined weaks are made dynamic, whether in static PIEs or
anywhere else.  So force it to 0 for static PIEs, fixing PR 22269 for
powerpc and any other target where the backend usually defaults to
undefined weaks being made dynamic.

This patch introduces regressions.  I'd normally not do that, but
these are all in very recently added test cases, or expose bugs in the
x86 backend.  The test cases were added after I'd made it known that
this patch or one like it was imminent.

	PR 22269
	* emultempl/elf32.em (after_parse): Warn on --no-dynamic-linker
	-z dynamic-undefined-weak combination.  Set dynamic_undefined_weak
	to zero when nointerp.
2017-10-12 14:37:11 +10:30
..
README Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
aarch64elf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
aix.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
alphaelf.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
arclinux.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
armcoff.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
armelf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
astring.sed * emultempl/ostring.sed: Rename from stringify.sed. 1999-08-06 22:46:03 +00:00
avrelf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
beos.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
bfin.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
cr16elf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
crxelf.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
elf-generic.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
elf32.em Set dynamic_undefined_weak to zero for static PIEs 2017-10-12 14:37:11 +10:30
epiphanyelf_4x4.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
genelf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
generic.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
gld960.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
gld960c.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
hppaelf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
ia64elf.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
irix.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
linux.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
lnk960.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
m68hc1xelf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
m68kcoff.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
m68kelf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
metagelf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
mipself.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
mmix-elfnmmo.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
mmixelf.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
mmo.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
msp430.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
nds32elf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
needrelax.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
netbsd.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
nios2elf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
ostring.sed * emultempl/ostring.sed: Rename from stringify.sed. 1999-08-06 22:46:03 +00:00
pe.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
pep.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
ppc32elf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
ppc64elf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
pruelf.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
riscvelf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
rxelf.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
s390.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
scoreelf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
sh64elf.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
solaris2.em Solaris2/LD: Fix anonymous version script acceptance bug 2017-01-24 12:53:52 +00:00
spu_icache.S bfd/ 2009-03-17 12:46:19 +00:00
spu_icache.o_c Regenerate spu overlay and icache manager files 2014-11-04 22:36:13 +10:30
spu_ovl.S Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
spu_ovl.o_c Regenerate spu_ovl.o_c 2016-10-15 12:53:57 +10:30
spuelf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
sunos.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
tic6xdsbt.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
ticoff.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
v850elf.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
vanilla.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
vms.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
vxworks.em ld internationalization fixes 2017-10-11 15:04:59 +10:30
xtensaelf.em Fix assertion failure for xtensa linker. 2017-08-02 11:48:07 +01:00
z80.em Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30

README

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-2017 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.