* 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.
This commit is contained in:
parent
81eb0a20fc
commit
202e23565d
18 changed files with 5868 additions and 375 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-03-19 Tristan Gingold <gingold@adacore.com>
|
||||
|
||||
* configure.ac (ia64*-*-*vms*): Add support for ld.
|
||||
* configure: Regenerate.
|
||||
|
||||
2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||
|
||||
* configure.ac (enable_libgomp): Remove *-*-irix6*.
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
2012-04-12 Tristan Gingold <gingold@adacore.com>
|
||||
|
||||
* 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.
|
||||
|
||||
2012-04-11 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/13897
|
||||
|
|
|
@ -619,6 +619,7 @@ BFD64_BACKENDS = \
|
|||
elf64-gen.lo \
|
||||
elf64-hppa.lo \
|
||||
elf64-ia64.lo \
|
||||
elf64-ia64-vms.lo \
|
||||
elf64-mips.lo \
|
||||
elf64-mmix.lo \
|
||||
elf64-ppc.lo \
|
||||
|
@ -654,6 +655,7 @@ BFD64_BACKENDS_CFILES = \
|
|||
elf64-alpha.c \
|
||||
elf64-gen.c \
|
||||
elf64-hppa.c \
|
||||
elf64-ia64-vms.c \
|
||||
elf64-mips.c \
|
||||
elf64-mmix.c \
|
||||
elf64-ppc.c \
|
||||
|
|
|
@ -920,6 +920,7 @@ BFD64_BACKENDS = \
|
|||
elf64-gen.lo \
|
||||
elf64-hppa.lo \
|
||||
elf64-ia64.lo \
|
||||
elf64-ia64-vms.lo \
|
||||
elf64-mips.lo \
|
||||
elf64-mmix.lo \
|
||||
elf64-ppc.lo \
|
||||
|
@ -955,6 +956,7 @@ BFD64_BACKENDS_CFILES = \
|
|||
elf64-alpha.c \
|
||||
elf64-gen.c \
|
||||
elf64-hppa.c \
|
||||
elf64-ia64-vms.c \
|
||||
elf64-mips.c \
|
||||
elf64-mmix.c \
|
||||
elf64-ppc.c \
|
||||
|
@ -1416,6 +1418,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-alpha.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-gen.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-hppa.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-ia64-vms.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-ia64.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-mips.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-mmix.Plo@am__quote@
|
||||
|
|
2
bfd/configure
vendored
2
bfd/configure
vendored
|
@ -15341,7 +15341,7 @@ do
|
|||
bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_vms_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_vms_vec) tb="$tb elf64-ia64-vms.lo elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
|
||||
bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
|
||||
|
|
|
@ -827,7 +827,7 @@ do
|
|||
bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_vms_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_ia64_vms_vec) tb="$tb elf64-ia64-vms.lo elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
|
||||
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
|
||||
bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
|
||||
|
|
5601
bfd/elf64-ia64-vms.c
Normal file
5601
bfd/elf64-ia64-vms.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -8908,7 +8908,8 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
|
|||
/* If this symbol should be put in the .dynsym section, then put it
|
||||
there now. We already know the symbol index. We also fill in
|
||||
the entry in the .hash section. */
|
||||
if (h->dynindx != -1
|
||||
if (finfo->dynsym_sec != NULL
|
||||
&& h->dynindx != -1
|
||||
&& elf_hash_table (finfo->info)->dynamic_sections_created)
|
||||
{
|
||||
bfd_byte *esym;
|
||||
|
@ -10305,7 +10306,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
|
|||
{
|
||||
finfo.dynsym_sec = bfd_get_section_by_name (dynobj, ".dynsym");
|
||||
finfo.hash_sec = bfd_get_section_by_name (dynobj, ".hash");
|
||||
BFD_ASSERT (finfo.dynsym_sec != NULL);
|
||||
/* Note that dynsym_sec can be NULL (on VMS). */
|
||||
finfo.symver_sec = bfd_get_section_by_name (dynobj, ".gnu.version");
|
||||
/* Note that it is OK if symver_sec is NULL. */
|
||||
}
|
||||
|
@ -10825,6 +10826,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
|
|||
symtab_hdr->sh_info = bfd_get_symcount (abfd);
|
||||
|
||||
if (dynamic
|
||||
&& finfo.dynsym_sec != NULL
|
||||
&& finfo.dynsym_sec->output_section != bfd_abs_section_ptr)
|
||||
{
|
||||
Elf_Internal_Sym sym;
|
||||
|
|
364
bfd/elfnn-ia64.c
364
bfd/elfnn-ia64.c
|
@ -1,6 +1,6 @@
|
|||
/* IA-64 support for 64-bit ELF
|
||||
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
|
||||
2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
@ -41,14 +41,6 @@
|
|||
#define LOG_SECTION_ALIGN 2
|
||||
#endif
|
||||
|
||||
/* Only add code for vms when the vms target is enabled. This is required
|
||||
because it depends on vms-lib.c for its archive format and we don't want
|
||||
to compile that code if it is not used. */
|
||||
#if ARCH_SIZE == 64 && \
|
||||
(defined (HAVE_bfd_elf64_ia64_vms_vec) || defined (HAVE_all_vecs))
|
||||
#define INCLUDE_IA64_VMS
|
||||
#endif
|
||||
|
||||
typedef struct bfd_hash_entry *(*new_hash_entry_func)
|
||||
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
|
||||
|
||||
|
@ -4978,277 +4970,6 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef INCLUDE_IA64_VMS
|
||||
|
||||
static bfd_boolean
|
||||
elfNN_vms_section_from_shdr (bfd *abfd,
|
||||
Elf_Internal_Shdr *hdr,
|
||||
const char *name,
|
||||
int shindex)
|
||||
{
|
||||
switch (hdr->sh_type)
|
||||
{
|
||||
case SHT_IA_64_VMS_TRACE:
|
||||
case SHT_IA_64_VMS_DEBUG:
|
||||
case SHT_IA_64_VMS_DEBUG_STR:
|
||||
break;
|
||||
|
||||
default:
|
||||
return elfNN_ia64_section_from_shdr (abfd, hdr, name, shindex);
|
||||
}
|
||||
|
||||
if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
elfNN_vms_object_p (bfd *abfd)
|
||||
{
|
||||
Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd);
|
||||
Elf_Internal_Phdr *i_phdr = elf_tdata (abfd)->phdr;
|
||||
unsigned int i;
|
||||
unsigned int num_text = 0;
|
||||
unsigned int num_data = 0;
|
||||
unsigned int num_rodata = 0;
|
||||
char name[16];
|
||||
|
||||
if (!elfNN_ia64_object_p (abfd))
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < i_ehdrp->e_phnum; i++, i_phdr++)
|
||||
{
|
||||
/* Is there a section for this segment? */
|
||||
bfd_vma base_vma = i_phdr->p_vaddr;
|
||||
bfd_vma limit_vma = base_vma + i_phdr->p_filesz;
|
||||
|
||||
if (i_phdr->p_type != PT_LOAD)
|
||||
continue;
|
||||
|
||||
again:
|
||||
while (base_vma < limit_vma)
|
||||
{
|
||||
bfd_vma next_vma = limit_vma;
|
||||
asection *nsec;
|
||||
asection *sec;
|
||||
flagword flags;
|
||||
char *nname = NULL;
|
||||
|
||||
/* Find a section covering [base_vma;limit_vma) */
|
||||
for (sec = abfd->sections; sec != NULL; sec = sec->next)
|
||||
{
|
||||
/* Skip uninteresting sections (either not in memory or
|
||||
below base_vma. */
|
||||
if ((sec->flags & (SEC_ALLOC | SEC_LOAD)) == 0
|
||||
|| sec->vma + sec->size <= base_vma)
|
||||
continue;
|
||||
if (sec->vma <= base_vma)
|
||||
{
|
||||
/* This section covers (maybe partially) the beginning
|
||||
of the range. */
|
||||
base_vma = sec->vma + sec->size;
|
||||
goto again;
|
||||
}
|
||||
if (sec->vma < next_vma)
|
||||
{
|
||||
/* This section partially covers the end of the range.
|
||||
Used to compute the size of the hole. */
|
||||
next_vma = sec->vma;
|
||||
}
|
||||
}
|
||||
|
||||
/* No section covering [base_vma; next_vma). Create a fake one. */
|
||||
flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
|
||||
if (i_phdr->p_flags & PF_X)
|
||||
{
|
||||
flags |= SEC_CODE;
|
||||
if (num_text++ == 0)
|
||||
nname = ".text";
|
||||
else
|
||||
sprintf (name, ".text$%u", num_text);
|
||||
}
|
||||
else if ((i_phdr->p_flags & (PF_R | PF_W)) == PF_R)
|
||||
{
|
||||
flags |= SEC_READONLY;
|
||||
sprintf (name, ".rodata$%u", num_rodata++);
|
||||
}
|
||||
else
|
||||
{
|
||||
flags |= SEC_DATA;
|
||||
sprintf (name, ".data$%u", num_data++);
|
||||
}
|
||||
|
||||
/* Allocate name. */
|
||||
if (nname == NULL)
|
||||
{
|
||||
size_t name_len = strlen (name) + 1;
|
||||
nname = bfd_alloc (abfd, name_len);
|
||||
if (nname == NULL)
|
||||
return FALSE;
|
||||
memcpy (nname, name, name_len);
|
||||
}
|
||||
|
||||
/* Create and fill new section. */
|
||||
nsec = bfd_make_section_anyway_with_flags (abfd, nname, flags);
|
||||
if (nsec == NULL)
|
||||
return FALSE;
|
||||
nsec->vma = base_vma;
|
||||
nsec->size = next_vma - base_vma;
|
||||
nsec->filepos = i_phdr->p_offset + (base_vma - i_phdr->p_vaddr);
|
||||
|
||||
base_vma = next_vma;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
elfNN_vms_post_process_headers (bfd *abfd,
|
||||
struct bfd_link_info *info ATTRIBUTE_UNUSED)
|
||||
{
|
||||
Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd);
|
||||
|
||||
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_OPENVMS;
|
||||
i_ehdrp->e_ident[EI_ABIVERSION] = 2;
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
elfNN_vms_section_processing (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
Elf_Internal_Shdr *hdr)
|
||||
{
|
||||
if (hdr->bfd_section != NULL)
|
||||
{
|
||||
const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
|
||||
|
||||
if (strcmp (name, ".text") == 0)
|
||||
hdr->sh_flags |= SHF_IA_64_VMS_SHARED;
|
||||
else if ((strcmp (name, ".debug") == 0)
|
||||
|| (strcmp (name, ".debug_abbrev") == 0)
|
||||
|| (strcmp (name, ".debug_aranges") == 0)
|
||||
|| (strcmp (name, ".debug_frame") == 0)
|
||||
|| (strcmp (name, ".debug_info") == 0)
|
||||
|| (strcmp (name, ".debug_loc") == 0)
|
||||
|| (strcmp (name, ".debug_macinfo") == 0)
|
||||
|| (strcmp (name, ".debug_pubnames") == 0)
|
||||
|| (strcmp (name, ".debug_pubtypes") == 0))
|
||||
hdr->sh_type = SHT_IA_64_VMS_DEBUG;
|
||||
else if ((strcmp (name, ".debug_line") == 0)
|
||||
|| (strcmp (name, ".debug_ranges") == 0))
|
||||
hdr->sh_type = SHT_IA_64_VMS_TRACE;
|
||||
else if (strcmp (name, ".debug_str") == 0)
|
||||
hdr->sh_type = SHT_IA_64_VMS_DEBUG_STR;
|
||||
else if (strcmp (name, ".vms_display_name_info") == 0)
|
||||
{
|
||||
int idx, symcount;
|
||||
asymbol **syms;
|
||||
struct elf_obj_tdata *t = elf_tdata (abfd);
|
||||
int buf[2];
|
||||
int demangler_sym_idx = -1;
|
||||
|
||||
symcount = bfd_get_symcount (abfd);
|
||||
syms = bfd_get_outsymbols (abfd);
|
||||
for (idx = 0; idx < symcount; idx++)
|
||||
{
|
||||
asymbol *sym;
|
||||
sym = syms[idx];
|
||||
if ((sym->flags & (BSF_DEBUGGING | BSF_DYNAMIC))
|
||||
&& strchr (sym->name, '@')
|
||||
&& (strcmp (sym->section->name, BFD_ABS_SECTION_NAME) == 0))
|
||||
{
|
||||
demangler_sym_idx = sym->udata.i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
hdr->sh_type = SHT_IA_64_VMS_DISPLAY_NAME_INFO;
|
||||
hdr->sh_entsize = 4;
|
||||
hdr->sh_addralign = 0;
|
||||
hdr->sh_link = t->symtab_section;
|
||||
|
||||
/* Find symtab index of demangler routine and stuff it in
|
||||
the second long word of section data. */
|
||||
|
||||
if (demangler_sym_idx > -1)
|
||||
{
|
||||
bfd_seek (abfd, hdr->sh_offset, SEEK_SET);
|
||||
bfd_bread (buf, hdr->sh_size, abfd);
|
||||
buf [1] = demangler_sym_idx;
|
||||
bfd_seek (abfd, hdr->sh_offset, SEEK_SET);
|
||||
bfd_bwrite (buf, hdr->sh_size, abfd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* The final processing done just before writing out a VMS IA-64 ELF
|
||||
object file. */
|
||||
|
||||
static void
|
||||
elfNN_vms_final_write_processing (bfd *abfd,
|
||||
bfd_boolean linker ATTRIBUTE_UNUSED)
|
||||
{
|
||||
Elf_Internal_Shdr *hdr;
|
||||
asection *s;
|
||||
int unwind_info_sect_idx = 0;
|
||||
|
||||
for (s = abfd->sections; s; s = s->next)
|
||||
{
|
||||
hdr = &elf_section_data (s)->this_hdr;
|
||||
|
||||
if (strcmp (bfd_get_section_name (abfd, hdr->bfd_section),
|
||||
".IA_64.unwind_info") == 0)
|
||||
unwind_info_sect_idx = elf_section_data (s)->this_idx;
|
||||
|
||||
switch (hdr->sh_type)
|
||||
{
|
||||
case SHT_IA_64_UNWIND:
|
||||
/* VMS requires sh_info to point to the unwind info section. */
|
||||
hdr->sh_info = unwind_info_sect_idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! elf_flags_init (abfd))
|
||||
{
|
||||
unsigned long flags = 0;
|
||||
|
||||
if (abfd->xvec->byteorder == BFD_ENDIAN_BIG)
|
||||
flags |= EF_IA_64_BE;
|
||||
if (bfd_get_mach (abfd) == bfd_mach_ia64_elf64)
|
||||
flags |= EF_IA_64_ABI64;
|
||||
|
||||
elf_elfheader(abfd)->e_flags = flags;
|
||||
elf_flags_init (abfd) = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
elfNN_vms_close_and_cleanup (bfd *abfd)
|
||||
{
|
||||
if (bfd_get_format (abfd) == bfd_object)
|
||||
{
|
||||
long isize, irsize;
|
||||
|
||||
if (elf_shstrtab (abfd) != NULL)
|
||||
_bfd_elf_strtab_free (elf_shstrtab (abfd));
|
||||
|
||||
/* Pad to 8 byte boundary for IPF/VMS. */
|
||||
isize = bfd_get_size (abfd);
|
||||
if ((irsize = isize/8*8) < isize)
|
||||
{
|
||||
int ishort = (irsize + 8) - isize;
|
||||
bfd_seek (abfd, isize, SEEK_SET);
|
||||
bfd_bwrite (bfd_zmalloc (ishort), ishort, abfd);
|
||||
}
|
||||
}
|
||||
|
||||
return _bfd_generic_close_and_cleanup (abfd);
|
||||
}
|
||||
#endif /* INCLUDE_IA64_VMS */
|
||||
|
||||
#define TARGET_LITTLE_SYM bfd_elfNN_ia64_little_vec
|
||||
#define TARGET_LITTLE_NAME "elfNN-ia64-little"
|
||||
|
@ -5381,86 +5102,3 @@ elfNN_vms_close_and_cleanup (bfd *abfd)
|
|||
#define elfNN_bed elfNN_ia64_hpux_bed
|
||||
|
||||
#include "elfNN-target.h"
|
||||
|
||||
/* VMS-specific vectors. */
|
||||
#ifdef INCLUDE_IA64_VMS
|
||||
|
||||
#undef TARGET_LITTLE_SYM
|
||||
#define TARGET_LITTLE_SYM bfd_elfNN_ia64_vms_vec
|
||||
#undef TARGET_LITTLE_NAME
|
||||
#define TARGET_LITTLE_NAME "elfNN-ia64-vms"
|
||||
#undef TARGET_BIG_SYM
|
||||
#undef TARGET_BIG_NAME
|
||||
|
||||
/* These are VMS specific functions. */
|
||||
|
||||
#undef elf_backend_object_p
|
||||
#define elf_backend_object_p elfNN_vms_object_p
|
||||
|
||||
#undef elf_backend_section_from_shdr
|
||||
#define elf_backend_section_from_shdr elfNN_vms_section_from_shdr
|
||||
|
||||
#undef elf_backend_post_process_headers
|
||||
#define elf_backend_post_process_headers elfNN_vms_post_process_headers
|
||||
|
||||
#undef elf_backend_section_processing
|
||||
#define elf_backend_section_processing elfNN_vms_section_processing
|
||||
|
||||
#undef elf_backend_final_write_processing
|
||||
#define elf_backend_final_write_processing elfNN_vms_final_write_processing
|
||||
|
||||
#undef bfd_elfNN_close_and_cleanup
|
||||
#define bfd_elfNN_close_and_cleanup elfNN_vms_close_and_cleanup
|
||||
|
||||
#undef elf_backend_section_from_bfd_section
|
||||
|
||||
#undef elf_backend_symbol_processing
|
||||
|
||||
#undef elf_backend_want_p_paddr_set_to_zero
|
||||
|
||||
#undef ELF_OSABI
|
||||
#define ELF_OSABI ELFOSABI_OPENVMS
|
||||
|
||||
#undef ELF_MAXPAGESIZE
|
||||
#define ELF_MAXPAGESIZE 0x10000 /* 64KB */
|
||||
|
||||
#undef elfNN_bed
|
||||
#define elfNN_bed elfNN_ia64_vms_bed
|
||||
|
||||
/* Use VMS-style archives (in particular, don't use the standard coff
|
||||
archive format). */
|
||||
#define bfd_elfNN_archive_functions
|
||||
|
||||
#undef bfd_elfNN_archive_p
|
||||
#define bfd_elfNN_archive_p _bfd_vms_lib_ia64_archive_p
|
||||
#undef bfd_elfNN_write_archive_contents
|
||||
#define bfd_elfNN_write_archive_contents _bfd_vms_lib_write_archive_contents
|
||||
#undef bfd_elfNN_mkarchive
|
||||
#define bfd_elfNN_mkarchive _bfd_vms_lib_ia64_mkarchive
|
||||
|
||||
#define bfd_elfNN_archive_slurp_armap \
|
||||
_bfd_vms_lib_slurp_armap
|
||||
#define bfd_elfNN_archive_slurp_extended_name_table \
|
||||
_bfd_vms_lib_slurp_extended_name_table
|
||||
#define bfd_elfNN_archive_construct_extended_name_table \
|
||||
_bfd_vms_lib_construct_extended_name_table
|
||||
#define bfd_elfNN_archive_truncate_arname \
|
||||
_bfd_vms_lib_truncate_arname
|
||||
#define bfd_elfNN_archive_write_armap \
|
||||
_bfd_vms_lib_write_armap
|
||||
#define bfd_elfNN_archive_read_ar_hdr \
|
||||
_bfd_vms_lib_read_ar_hdr
|
||||
#define bfd_elfNN_archive_write_ar_hdr \
|
||||
_bfd_vms_lib_write_ar_hdr
|
||||
#define bfd_elfNN_archive_openr_next_archived_file \
|
||||
_bfd_vms_lib_openr_next_archived_file
|
||||
#define bfd_elfNN_archive_get_elt_at_index \
|
||||
_bfd_vms_lib_get_elt_at_index
|
||||
#define bfd_elfNN_archive_generic_stat_arch_elt \
|
||||
_bfd_vms_lib_generic_stat_arch_elt
|
||||
#define bfd_elfNN_archive_update_armap_timestamp \
|
||||
_bfd_vms_lib_update_armap_timestamp
|
||||
|
||||
#include "elfNN-target.h"
|
||||
|
||||
#endif /* INCLUDE_IA64_VMS */
|
||||
|
|
7
configure
vendored
7
configure
vendored
|
@ -3093,7 +3093,9 @@ case "${target}" in
|
|||
noconfigdirs="$noconfigdirs target-libssp"
|
||||
;;
|
||||
rl78-*-*)
|
||||
# Dereferencing -1 is a compile-time error
|
||||
# libssp uses a misaligned load to trigger a fault, but the RL78
|
||||
# doesn't fault for those - instead, it gives a build-time error
|
||||
# for explicit misaligned loads.
|
||||
noconfigdirs="$noconfigdirs target-libssp"
|
||||
;;
|
||||
esac
|
||||
|
@ -3496,8 +3498,7 @@ case "${target}" in
|
|||
noconfigdirs="$noconfigdirs libgui itcl ld"
|
||||
;;
|
||||
ia64*-*-*vms*)
|
||||
# No ld support yet.
|
||||
noconfigdirs="$noconfigdirs libgui itcl ld"
|
||||
noconfigdirs="$noconfigdirs libgui itcl"
|
||||
;;
|
||||
i[3456789]86-w64-mingw*)
|
||||
;;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
|
||||
# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
|
@ -519,7 +519,9 @@ case "${target}" in
|
|||
noconfigdirs="$noconfigdirs target-libssp"
|
||||
;;
|
||||
rl78-*-*)
|
||||
# Dereferencing -1 is a compile-time error
|
||||
# libssp uses a misaligned load to trigger a fault, but the RL78
|
||||
# doesn't fault for those - instead, it gives a build-time error
|
||||
# for explicit misaligned loads.
|
||||
noconfigdirs="$noconfigdirs target-libssp"
|
||||
;;
|
||||
esac
|
||||
|
@ -922,8 +924,7 @@ case "${target}" in
|
|||
noconfigdirs="$noconfigdirs libgui itcl ld"
|
||||
;;
|
||||
ia64*-*-*vms*)
|
||||
# No ld support yet.
|
||||
noconfigdirs="$noconfigdirs libgui itcl ld"
|
||||
noconfigdirs="$noconfigdirs libgui itcl"
|
||||
;;
|
||||
i[[3456789]]86-w64-mingw*)
|
||||
;;
|
||||
|
|
11
ld/ChangeLog
11
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.
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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
|
||||
|
|
7
ld/emulparams/elf64_ia64_vms.sh
Normal file
7
ld/emulparams/elf64_ia64_vms.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
SCRIPT_NAME=ia64vms
|
||||
|
||||
OUTPUT_FORMAT="elf64-ia64-vms"
|
||||
ARCH=ia64
|
||||
|
||||
COMPILE_IN=yes
|
||||
EXTRA_EM_FILE=vms
|
|
@ -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
|
||||
|
|
129
ld/scripttempl/ia64vms.sc
Normal file
129
ld/scripttempl/ia64vms.sc
Normal file
|
@ -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
|
Loading…
Reference in a new issue