binutils-gdb/ld/emultempl
Martin Storsjö 46bbc1c071 ld: pe: Fix linking against Microsoft import libraries with multiple DLLs
Initially, since c6c37250e9 (in 1999),
in order to fix linking against Microsoft import libraries, ld did
internally rename members of such libraries. At that point, the
criteria for being considered a Microsoft import library was that
every archive member had the same name (no regard for exactly what
that name was).

This was later amended in 44dbf3639f
(in 2003) to allow for Microsoft import libraries with intermixed
static object files. At this point, the criteria were extended, so
that all members following the first member named *.dll either had
the exact same member name, or be named *.obj. (Curiously, this would
allow members with any name if it precedes the first one named *.dll.)

In practice, Microsoft style import libraries can contain
members for linking against more than one DLL (built by merging
multiple regular import libraries into one).

Instead of trying to do validation of the whole archive before
considering it a Microsoft style import library, relax the criteria
for doing the member renaming: If an archive member is named *.dll
and it contains .idata sections, assume that that member is a
Microsoft import file, and apply the renaming scheme.

This works for imports for any number of DLLs in the same library,
intermixed with other static object files (regardless of their
names), and vastly simplifies the code.

LLVM generates Microsoft style import libraries, and Rust builds
seem to bundle up multiple import libraries together with some
Rust specific static objects. This fixes linking directly against
them with ld.bfd.
2022-08-30 23:49:08 +03:00
..
aarch64elf.em bit-rot in target before_parse function 2022-05-26 20:34:32 +09:30
aix.em Re: Get rid of fprintf_vma and sprintf_vma 2022-08-04 12:00:36 +09:30
alphaelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
arclinux.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
armelf.em Get rid of fprintf_vma and sprintf_vma 2022-08-01 13:52:18 +09:30
astring.sed
avrelf.em Add linker warning for when it creates an executable stack. 2022-04-20 13:39:05 +01:00
beos.em ld: Add emultempl/emulation.em 2022-02-06 06:25:41 -08:00
bfin.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
cr16elf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
crxelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
cskyelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
elf-generic.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
elf-x86.em Revert "PR28824, relro security issues, x86 keep COMMONPAGESIZE relro" 2022-02-14 17:39:34 -08:00
elf.em ld: add --package-metadata 2022-05-26 12:56:12 +09:30
emulation.em ld: Add a before_plugin_all_symbols_read hook 2022-03-09 18:23:43 -08:00
epiphanyelf_4x4.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
genelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
generic.em ld: Add emultempl/emulation.em 2022-02-06 06:25:41 -08:00
hppaelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ia64elf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
irix.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
loongarchelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
m68hc1xelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
m68kelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
metagelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
mipself.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
mmix-elfnmmo.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
mmixelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
mmo.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
msp430.em ld: Add emultempl/emulation.em 2022-02-06 06:25:41 -08:00
nds32elf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
needrelax.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
netbsd.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
nios2elf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ostring.sed
pdp11.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
pe.em ld: pe: Fix linking against Microsoft import libraries with multiple DLLs 2022-08-30 23:49:08 +03:00
pep.em ld: pe: Fix linking against Microsoft import libraries with multiple DLLs 2022-08-30 23:49:08 +03:00
ppc32elf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ppc64elf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
pruelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
README Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
riscvelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
rxelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
rxlinux.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
s390.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
scoreelf.em bit-rot in target before_parse function 2022-05-26 20:34:32 +09:30
solaris2-x86.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
solaris2.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
spu_icache.o_c
spu_icache.S
spu_ovl.o_c
spu_ovl.S Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
spuelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
tic6xdsbt.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ticoff.em ld: Add emultempl/emulation.em 2022-02-06 06:25:41 -08:00
v850elf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
vanilla.em ld: Add emultempl/emulation.em 2022-02-06 06:25:41 -08:00
vms.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
vxworks.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
xtensaelf.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
z80.em Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +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-2022 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.