aboutsummaryrefslogtreecommitdiff
path: root/ld/Makefile.in
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-09-09 23:07:35 +0930
committerAlan Modra <amodra@gmail.com>2019-09-11 13:44:22 +0930
commitd871d478061f10b0879c688e2fa941407e9137aa (patch)
tree4f564ccc452de8255f2eecfecfb931de03ad2093 /ld/Makefile.in
parentcb7f4b298e5e0a3ab4fb6b13aa89e970478597bc (diff)
downloadgdb-d871d478061f10b0879c688e2fa941407e9137aa.zip
gdb-d871d478061f10b0879c688e2fa941407e9137aa.tar.gz
gdb-d871d478061f10b0879c688e2fa941407e9137aa.tar.bz2
Move elf32.em and elf-generic.em functions
Many ELF linker targets support multiple "emulations" and thus have multiple copies of elf32.em being compiled and linked into ld. This patch moves much of elf32.em and elf-generic.em into files which will be compiled just once, resulting in a 20% decrease in ld size for --enable-targets=all. * Makefile.am (ALL_EMUL_EXTRA_OFILES): Add ldelf and ldelfgen. (CFILES, HFILES, EXTRA_ld_new_SOURCES): Likewise. * configure.tgt: Formatting. (targ_extra_ofiles): Init to ldelf.o ldelfgen.o, reset to just ldelfgen.o for generic ELF targets, and empty for non-ELF. * emultempl/aarch64elf.em (gldaarch64_layout_sections_again): Use ldelf_map_segments. (gld${EMULATION_NAME}_after_allocation): Likewise. (real_func, aarch64_for_each_input_file_wrapper), (aarch64_lang_for_each_input_file): Delete. (lang_for_each_input_file): Don't define. * emultempl/alphaelf.em (alpha_after_parse): Use ldelf_map_segments. * emultempl/armelf.em (gldarm_layout_sections_again): Likewise. (gld${EMULATION_NAME}_after_allocation): Likewise. (real_func, arm_for_each_input_file_wrapper), (arm_lang_for_each_input_file): Delete. (lang_for_each_input_file): Don't define. * emultempl/cr16elf.em (cr16elf_after_parse): Use ldelf_map_segments. * emultempl/crxelf.em (crxelf_after_parse): Likewise. Delete declaration. * emultempl/cskyelf.em (gldcsky_layout_sections_again): Use ldelf_map_segments. (gld${EMULATION_NAME}_after_allocation): Likewise. (real_func, csky_for_each_input_file_wrapper), (csky_lang_for_each_input_file): Delete. (lang_for_each_input_file): Don't define. * emultempl/genelf.em: Include ldelfgen.h. (gld${EMULATION_NAME}_before_allocation): Use ldelf_map_segments. * emultempl/hppaelf.em (hppaelf_after_parse): Likewise. (hppaelf_layout_sections_again): Likewise. (gld${EMULATION_NAME}_after_allocation): Likewise. (real_func, hppa_for_each_input_file_wrapper), (hppa_lang_for_each_input_file): Delete. (lang_for_each_input_file): Don't define. * emultempl/ia64elf.em (ia64elf_after_parse): Use ldelf_map_segments. * emultempl/m68hc1xelf.em (real_func), (m68hc11_for_each_input_file_wrapper), (m68hc11_lang_for_each_input_file): Delete. (lang_for_each_input_file): Don't define. * emultempl/metagelf.em (metagelf_layout_sections_again): Use ldelf_map_segments. (gld${EMULATION_NAME}_after_allocation): Likewise. (real_func, metag_for_each_input_file_wrapper), (metag_lang_for_each_input_file): Delete. (lang_for_each_input_file): Don't define. * emultempl/mipself.em (real_func), (mips_for_each_input_file_wrapper), (mips_lang_for_each_input_file): Delete. (lang_for_each_input_file): Don't define. * emultempl/mmo.em: Don't include elf-bfd.h, do include ldelfgen.h. (gld${EMULATION_NAME}_after_allocation): Use ldelf_map_segments. * emultempl/nds32elf.em (nds32_elf_after_parse): Use ldelf_after_parse. (nds32_elf_after_allocation): Comment fix. * emultempl/nios2elf.em (nios2elf_layout_sections_again): Use ldelf_map_segments. (gld${EMULATION_NAME}_after_allocation): Likewise. (real_func, nios2_for_each_input_file_wrapper), (nios2_lang_for_each_input_file): Delete. (lang_for_each_input_file): Don't define. * emultempl/ppc32elf.em (gld${EMULATION_NAME}_load_symbols): Delete declaration. (ppc_recognized_file): Call ldelf_load_symbols. * emultempl/ppc64elf.em (ppc_layout_sections_again): Likewise. (gld${EMULATION_NAME}_after_allocation): Likewise. (real_func, ppc_for_each_input_file_wrapper), (ppc_lang_for_each_input_file): Delete. (lang_for_each_input_file): Don't define. (gld${EMULATION_NAME}_load_symbols): Don't declare. (ppc64_recognized_file): Call ldelf_load_symbols. * emultempl/riscvelf.em (gld${EMULATION_NAME}_after_allocation): Use ldelf_map_segments. * emultempl/spuelf.em (spu_place_special_section): Use ldelf_place_orphan. * emultempl/tic6xdsbt.em (gld${EMULATION_NAME}_after_allocation): Use ldelf_map_segments. * emultempl/vms.em: Include ldelfgen.h. (gld${EMULATION_NAME}_after_allocation): Use ldelf_map_segments. * emultempl/elf32.em: Remove unnecessary headers, include ldelf.h and ldelfgen.h. Move much of file content to.. * ldelf.c: ..here. New file. * ldelf.h: New file. * emultempl/elf-generic.em: Move gld${EMULATION_NAME}_map_segments.. * ldelfgen.c: ..to here. * ldelfgen.h: New file. * ldlang.c (lang_for_each_input_file): Adjust to only call func on real files. (lang_for_each_file): Likewise. * po/SRC-POTFILES.in: Regenerate. * Makefile.in: Regenerate.
Diffstat (limited to 'ld/Makefile.in')
-rw-r--r--ld/Makefile.in15
1 files changed, 10 insertions, 5 deletions
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 9898392..d509f62 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -952,7 +952,9 @@ ALL_64_EMULATION_SOURCES = \
ALL_64_EMULATIONS = $(ALL_64_EMULATION_SOURCES:.c=.@OBJEXT@)
ALL_EMUL_EXTRA_OFILES = \
deffilep.@OBJEXT@ \
- pe-dll.@OBJEXT@
+ pe-dll.@OBJEXT@ \
+ ldelf.@OBJEXT@ \
+ ldelfgen.@OBJEXT@
ALL_64_EMUL_EXTRA_OFILES = \
pep-dll.@OBJEXT@
@@ -960,12 +962,12 @@ ALL_64_EMUL_EXTRA_OFILES = \
CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
mri.c ldcref.c pe-dll.c pep-dll.c ldlex-wrapper.c \
- $(PLUGIN_C) ldbuildid.c
+ $(PLUGIN_C) ldbuildid.c ldelf.c ldelfgen.c
HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
ldwrite.h mri.h deffile.h pe-dll.h pep-dll.h \
- elf-hints-local.h $(PLUGIN_H) ldbuildid.h
+ elf-hints-local.h $(PLUGIN_H) ldbuildid.h ldelf.h ldelfgen.h
GENERATED_CFILES = ldgram.c ldlex.c deffilep.c
GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
@@ -991,8 +993,9 @@ GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
# Allow dependency tracking to work for these files, too.
# Dependency tracking for the generated emulation files.
-EXTRA_ld_new_SOURCES = deffilep.y ldlex.l pep-dll.c pe-dll.c \
- $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES)
+EXTRA_ld_new_SOURCES = deffilep.y ldlex.l pep-dll.c pe-dll.c ldelf.c \
+ ldelfgen.c $(ALL_EMULATION_SOURCES) \
+ $(ALL_64_EMULATION_SOURCES)
ld_new_SOURCES = ldgram.y ldlex-wrapper.c lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c $(PLUGIN_C) \
ldbuildid.c
@@ -1491,6 +1494,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldbuildid.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldcref.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldctor.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldelf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldelfgen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldemul.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldexp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldfile.Po@am__quote@