aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2012-04-12 07:35:07 +0000
committerNick Clifton <nickc@redhat.com>2012-04-12 07:35:07 +0000
commit202e23565d36f4696d5e836ec06d4c685c30fb16 (patch)
treea6fc6863b9383d5611012636e9fc80c58c2330e6 /ld
parent81eb0a20fcefcddb5863de3b53ffdc93df2881be (diff)
downloadgdb-202e23565d36f4696d5e836ec06d4c685c30fb16.zip
gdb-202e23565d36f4696d5e836ec06d4c685c30fb16.tar.gz
gdb-202e23565d36f4696d5e836ec06d4c685c30fb16.tar.bz2
* configure.ac (ia64*-*-*vms*): Add support for ld.
* configure: Regenerate. * scripttempl/ia64vms.sc: New file. * emultempl/vms.em (_before_parse): Support for ia64. (elf64-ia64-vms): New fragment for ia64. * emulparams/elf64_ia64_vms.sh: New file. * configure.tgt (ia64-*-*vms*): Add. * Makefile.am (ALL_64_EMULATION_SOURCES): Add eelf64_ia64_vms.c (eelf64_ia64_vms.c): New rule. * Makefile.in: Regenerate. * elflink.c (elf_link_output_extsym): Add a guard. (bfd_elf_final_link): Remove assertion. (bfd_elf_final_link): Add a guard. * elfnn-ia64.c (INCLUDE_IA64_VMS): Removed. (elfNN_vms_section_from_shdr, elfNN_vms_object_p) (elfNN_vms_post_process_headers, elfNN_vms_section_processing) (elfNN_vms_final_write_processing, elfNN_vms_close_and_cleanup): Remove. (elfNN-ia64-vms target): Move to ... * elf64-ia64-vms.c: New file. * configure.in (bfd_elf64_ia64_vms_vec): Add elf64-ia64-vms.lo * Makefile.am (BFD64_BACKENDS): Add elf64-ia64-vms.lo. (BFD64_BACKENDS_CFILES): Ad elf64-ia64-vms.c. * configure: Regenerate. * Makefile.in: Regenerate.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog11
-rw-r--r--ld/Makefile.am5
-rw-r--r--ld/Makefile.in7
-rw-r--r--ld/configure.tgt1
-rw-r--r--ld/emulparams/elf64_ia64_vms.sh7
-rw-r--r--ld/emultempl/vms.em64
-rw-r--r--ld/scripttempl/ia64vms.sc129
7 files changed, 223 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index ebad05a..b97aa86 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,14 @@
+2012-04-11 Tristan Gingold <gingold@adacore.com>
+
+ * scripttempl/ia64vms.sc: New file.
+ * emultempl/vms.em (_before_parse): Support for ia64.
+ (elf64-ia64-vms): New fragment for ia64.
+ * emulparams/elf64_ia64_vms.sh: New file.
+ * configure.tgt (ia64-*-*vms*): Add.
+ * Makefile.am (ALL_64_EMULATION_SOURCES): Add eelf64_ia64_vms.c
+ (eelf64_ia64_vms.c): New rule.
+ * Makefile.in: Regenerate.
+
2012-04-06 Roland McGrath <mcgrathr@google.com>
* configure.in (AC_CHECK_HEADERS): Add locale.h.
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 524350e..df7ab98 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -467,6 +467,7 @@ ALL_64_EMULATION_SOURCES = \
eelf64_aix.c \
eelf64_ia64.c \
eelf64_ia64_fbsd.c \
+ eelf64_ia64_vms.c \
eelf64_s390.c \
eelf64_sparc.c \
eelf64_sparc_fbsd.c \
@@ -1928,6 +1929,10 @@ eelf64_ia64_fbsd.c: $(srcdir)/emulparams/elf64_ia64_fbsd.sh \
$(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_ia64_fbsd "$(tdir_elf64_ia64_fbsd)"
+eelf64_ia64_vms.c: $(srcdir)/emulparams/elf64_ia64_vms.sh \
+ $(srcdir)/emultempl/vms.em \
+ $(srcdir)/scripttempl/ia64vms.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf64_ia64_vms "$(tdir_elf64_ia64_vms)"
eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_s390 "$(tdir_elf64_s390)"
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 776a4e0..af27d3f 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -55,6 +55,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \
$(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/gettext-sister.m4 \
$(top_srcdir)/../config/largefile.m4 \
+ $(top_srcdir)/../config/lcmessage.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/nls.m4 \
$(top_srcdir)/../config/override.m4 \
@@ -772,6 +773,7 @@ ALL_64_EMULATION_SOURCES = \
eelf64_aix.c \
eelf64_ia64.c \
eelf64_ia64_fbsd.c \
+ eelf64_ia64_vms.c \
eelf64_s390.c \
eelf64_sparc.c \
eelf64_sparc_fbsd.c \
@@ -1176,6 +1178,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_aix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_fbsd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_ia64_vms.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_s390.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_sparc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64_sparc_fbsd.Po@am__quote@
@@ -3389,6 +3392,10 @@ eelf64_ia64_fbsd.c: $(srcdir)/emulparams/elf64_ia64_fbsd.sh \
$(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_ia64_fbsd "$(tdir_elf64_ia64_fbsd)"
+eelf64_ia64_vms.c: $(srcdir)/emulparams/elf64_ia64_vms.sh \
+ $(srcdir)/emultempl/vms.em \
+ $(srcdir)/scripttempl/ia64vms.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf64_ia64_vms "$(tdir_elf64_ia64_vms)"
eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_s390 "$(tdir_elf64_s390)"
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 6418768..abb4706 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -308,6 +308,7 @@ ia64-*-freebsd* | ia64-*-kfreebsd*-gnu)
targ_extra_emuls="elf64_ia64" ;;
ia64-*-netbsd*) targ_emul=elf64_ia64 ;;
ia64-*-linux*) targ_emul=elf64_ia64 ;;
+ia64-*-*vms*) targ_emul=elf64_ia64_vms ;;
ia64-*-aix*) targ_emul=elf64_aix
;;
ip2k-*-elf) targ_emul=elf32ip2k
diff --git a/ld/emulparams/elf64_ia64_vms.sh b/ld/emulparams/elf64_ia64_vms.sh
new file mode 100644
index 0000000..0688402
--- /dev/null
+++ b/ld/emulparams/elf64_ia64_vms.sh
@@ -0,0 +1,7 @@
+SCRIPT_NAME=ia64vms
+
+OUTPUT_FORMAT="elf64-ia64-vms"
+ARCH=ia64
+
+COMPILE_IN=yes
+EXTRA_EM_FILE=vms
diff --git a/ld/emultempl/vms.em b/ld/emultempl/vms.em
index 164f2e1..98837e3 100644
--- a/ld/emultempl/vms.em
+++ b/ld/emultempl/vms.em
@@ -31,6 +31,10 @@ gld${EMULATION_NAME}_before_parse (void)
ldfile_set_output_arch ("${ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
input_flags.dynamic = TRUE;
config.has_shared = FALSE; /* Not yet. */
+
+ /* For ia64, harmless for alpha. */
+ link_info.emit_hash = FALSE;
+ link_info.spare_dynamic_tags = 0;
}
/* This is called before the input files are opened. We add the
@@ -132,7 +136,8 @@ gld${EMULATION_NAME}_add_options
int nrl ATTRIBUTE_UNUSED,
struct option **really_longopts ATTRIBUTE_UNUSED)
{
- static const struct option xtra_long[] = {
+ static const struct option xtra_long[] =
+ {
{"identification", required_argument, NULL, OPTION_IDENTIFICATION},
{NULL, no_argument, NULL, 0}
};
@@ -166,6 +171,63 @@ gld${EMULATION_NAME}_handle_option (int optc)
EOF
+if test "$OUTPUT_FORMAT" = "elf64-ia64-vms"; then
+
+fragment <<EOF
+#include "elf-bfd.h"
+EOF
+
+source_em ${srcdir}/emultempl/elf-generic.em
+
+fragment <<EOF
+
+/* This is called after the sections have been attached to output
+ sections, but before any sizes or addresses have been set. */
+
+static void
+gld${EMULATION_NAME}_before_allocation (void)
+{
+ const struct elf_backend_data *bed;
+
+ if (!is_elf_hash_table (link_info.hash))
+ return;
+
+ bed = get_elf_backend_data (link_info.output_bfd);
+
+ /* The backend must work out the sizes of all the other dynamic
+ sections. */
+ if (elf_hash_table (&link_info)->dynamic_sections_created
+ && bed->elf_backend_size_dynamic_sections
+ && ! (*bed->elf_backend_size_dynamic_sections) (link_info.output_bfd,
+ &link_info))
+ einfo ("%P%F: failed to set dynamic section sizes: %E\n");
+
+ before_allocation_default ();
+}
+
+static void
+gld${EMULATION_NAME}_after_allocation (void)
+{
+ bfd_boolean need_layout = bfd_elf_discard_info (link_info.output_bfd,
+ &link_info);
+ gld${EMULATION_NAME}_map_segments (need_layout);
+}
+
+static void
+gld${EMULATION_NAME}_after_parse (void)
+{
+ link_info.relax_pass = 2;
+ after_parse_default ();
+}
+EOF
+
+LDEMUL_BEFORE_ALLOCATION=gld"$EMULATION_NAME"_before_allocation
+LDEMUL_AFTER_ALLOCATION=gld"$EMULATION_NAME"_after_allocation
+
+LDEMUL_AFTER_PARSE=gld${EMULATION_NAME}_after_parse
+source_em ${srcdir}/emultempl/needrelax.em
+fi
+
LDEMUL_PLACE_ORPHAN=vms_place_orphan
LDEMUL_BEFORE_PARSE=gld"$EMULATION_NAME"_before_parse
LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=gld"$EMULATION_NAME"_create_output_section_statements
diff --git a/ld/scripttempl/ia64vms.sc b/ld/scripttempl/ia64vms.sc
new file mode 100644
index 0000000..b0b1c42
--- /dev/null
+++ b/ld/scripttempl/ia64vms.sc
@@ -0,0 +1,129 @@
+# Linker script for Itanium VMS systems.
+# Tristan Gingold <gingold@adacore.com>.
+
+PAGESIZE=0x10000
+BLOCKSIZE=0x200
+
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+${LIB_SEARCH_DIRS}
+ENTRY(__entry)
+
+SECTIONS
+{
+ /* RW segment. */
+ ${RELOCATING+. = ${PAGESIZE};}
+
+ \$DATA\$ ALIGN (${BLOCKSIZE}) : {
+ *(\$DATA\$ .data .data.*)
+ *(\$BSS\$ .bss)
+ }
+
+ /* Code segment. Note: name must be \$CODE\$ */
+ ${RELOCATING+. = ALIGN (${PAGESIZE});}
+
+ \$CODE\$ ALIGN (${BLOCKSIZE}) : {
+ *(\$CODE\$ .text)
+ }
+ .plt ALIGN (8) : {
+ *(.plt)
+ }
+
+ /* RO segment. */
+ ${RELOCATING+. = ALIGN (${PAGESIZE});}
+
+ /* RO initialized data. */
+ \$LITERAL\$ ALIGN (${BLOCKSIZE}) : {
+ *(\$LITERAL\$)
+ *(\$READONLY\$ .rodata)
+ *(.jcr)
+ *(.ctors)
+ *(.dtors)
+ *(.opd)
+ *(.gcc_except_table)
+
+ /* LIB$INITIALIZE stuff. */
+ *(LIB\$INITIALIZDZ) /* Start marker. */
+ *(LIB\$INITIALIZD_) /* Hi priority. */
+ *(LIB\$INITIALIZE) /* User. */
+ *(LIB\$INITIALIZE$) /* End marker. */
+ }
+
+ /* Short segment. */
+ ${RELOCATING+. = ALIGN (${PAGESIZE});}
+
+ .srodata : {
+ *(.srodata)
+ }
+ .got ALIGN (8) : {
+ *(.got)
+ }
+ .IA_64.pltoff ALIGN (16) : {
+ *(.IA_64.pltoff)
+ }
+ \$TFR\$ ALIGN (16) : {
+ /* Tranfer vector. */
+ __entry = .;
+ *(.transfer)
+ }
+
+ ${RELOCATING+. = ALIGN (${PAGESIZE});}
+
+ \$RW_SHORT\$ ALIGN (${BLOCKSIZE}) : {
+ *(.sdata .sdata.*)
+ *(.sbss)
+ }
+
+ ${RELOCATING+. = ALIGN (${PAGESIZE});}
+
+ .IA_64.unwind ALIGN (${BLOCKSIZE}) : {
+ *(.IA_64.unwind .IA_64.unwind.*)
+ }
+
+ .IA_64.unwind_info ALIGN (8) : {
+ *(.IA_64.unwind_info .IA_64.unwind_info.*)
+ }
+
+ ${RELOCATING+. = ALIGN (${PAGESIZE});}
+
+ .dynamic /* \$DYNAMIC\$ */ ALIGN (${BLOCKSIZE}) : {
+ *(.dynamic)
+ *(.vmsdynstr)
+ *(.fixups)
+ }
+
+ ${RELOCATING+. = ALIGN (${PAGESIZE});}
+
+ .dynstr : { *(.dynstr) }
+
+ .dynsym ${RELOCATING-0} : { *(.dynsym) }
+ .rela.got : { *(.rela.got) }
+ .got.plt : { *(.got.plt) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rela.IA_64.pltoff : { *(.rela.IA_64.pltoff) }
+
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .trace_info 0 : { *(.trace_info) }
+ .trace_abbrev 0 : { *(.trace_abbrev) }
+ .trace_aranges 0 : { *(.trace_aranges) }
+
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+
+ .note : { *(.vms.note) }
+
+ /DISCARD/ : { *(.note) }
+}
+EOF