/* vms.c -- BFD back-end for EVAX (openVMS/Alpha) files.
- Copyright (C) 1996-2018 Free Software Foundation, Inc.
+ Copyright (C) 1996-2019 Free Software Foundation, Inc.
Initial version written by Klaus Kaempf (kkaempf@rmi.de)
Major rewrite by Adacore.
section->size = size;
section->vma = vaddr;
- if (!bfd_set_section_flags (abfd, section, bfd_flags))
+ if (!bfd_set_section_flags (section, bfd_flags))
return FALSE;
}
section->size = dstsize;
section->filepos = VMS_BLOCK_SIZE * (dstvbn - 1);
- if (!bfd_set_section_flags (abfd, section, bfd_flags))
+ if (!bfd_set_section_flags (section, bfd_flags))
return FALSE;
PRIV (dst_section) = section;
section->size = dmtbytes;
section->filepos = VMS_BLOCK_SIZE * (dmtvbn - 1);
- if (!bfd_set_section_flags (abfd, section, bfd_flags))
+ if (!bfd_set_section_flags (section, bfd_flags))
return FALSE;
}
new_flags |= SEC_CODE;
new_flags &= ~SEC_DATA;
}
- if (!bfd_set_section_flags (abfd, section, new_flags))
+ if (!bfd_set_section_flags (section, new_flags))
return FALSE;
/* Give a non-overlapping vma to non absolute sections. */
section = bfd_make_section (abfd, "$DST$");
if (!section)
return FALSE;
- if (!bfd_set_section_flags (abfd, section, flags))
+ if (!bfd_set_section_flags (section, flags))
return FALSE;
PRIV (dst_section) = section;
}
break;
case ALPHA_R_LINKAGE:
+ size = 16;
etir_output_check (abfd, section, curr_addr, 64);
_bfd_vms_output_begin_subrec (recwr, ETIR__C_STC_LP_PSB);
_bfd_vms_output_long
{
/* Output rest of section. */
if (curr_addr > section->size)
- _bfd_error_handler (_("size error in section %pA"), section);
+ {
+ _bfd_error_handler (_("size error in section %pA"), section);
+ return FALSE;
+ }
size = section->size - curr_addr;
sto_imm (abfd, section, size, curr_data, curr_addr);
curr_data += size;
section and build the list of modules. This is sufficient
since we can compute the start address and the end address
of every module from the section contents. */
- bfd_size_type size = bfd_get_section_size (dmt);
+ bfd_size_type size = bfd_section_size (dmt);
unsigned char *ptr, *end;
ptr = (unsigned char *) bfd_alloc (abfd, size);
asection *sec;
struct vms_section_data_struct *vms_sec;
arelent *reloc;
+ bfd_size_type size;
/* Get section to which the relocation applies. */
if (cur_psect < 0 || cur_psect > (int)PRIV (section_count))
reloc->address = cur_address;
reloc->addend = cur_addend;
- vaddr += bfd_get_reloc_size (reloc->howto);
+ if (reloc_code == ALPHA_R_LINKAGE)
+ size = 16;
+ else
+ size = bfd_get_reloc_size (reloc->howto);
+ vaddr += size;
}
cur_addend = 0;
/* Hack. Linkage is done by linker. */
HOWTO (ALPHA_R_LINKAGE, /* Type. */
0, /* Rightshift. */
- 8, /* Size (0 = byte, 1 = short, 2 = long). */
- 256, /* Bitsize. */
+ 0, /* Size (0 = byte, 1 = short, 2 = long). */
+ 0, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_dont,/* Complain_on_overflow. */
/* Return a pointer to a howto structure which, when invoked, will perform
the relocation code on data from the architecture noted. */
-static const struct reloc_howto_struct *
+static reloc_howto_type *
alpha_vms_bfd_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
bfd_reloc_code_real_type code)
{
return FALSE;
}
- bfd_get_outsymbols (abfd) = NULL;
- bfd_get_symcount (abfd) = 0;
+ abfd->outsymbols = NULL;
+ abfd->symcount = 0;
/* Mark all sections which will be included in the output file. */
for (o = abfd->sections; o != NULL; o = o->next)
vms_debug2 ((1, "vms_new_section_hook (%p, [%u]%s)\n",
abfd, section->index, section->name));
- if (! bfd_set_section_alignment (abfd, section, 0))
+ if (!bfd_set_section_alignment (section, 0))
return FALSE;
vms_debug2 ((7, "%u: %s\n", section->index, section->name));
else if (bfd_is_ind_section (sec))
ret->type = 'I';
else if ((symbol->flags & BSF_FUNCTION)
- || (bfd_get_section_flags (abfd, sec) & SEC_CODE))
+ || (bfd_section_flags (sec) & SEC_CODE))
ret->type = 'T';
- else if (bfd_get_section_flags (abfd, sec) & SEC_DATA)
+ else if (bfd_section_flags (sec) & SEC_DATA)
ret->type = 'D';
- else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ else if (bfd_section_flags (sec) & SEC_ALLOC)
ret->type = 'B';
else
ret->type = '?';
#define vms_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
#define vms_bfd_is_group_section bfd_generic_is_group_section
+#define vms_bfd_group_name bfd_generic_group_name
#define vms_bfd_discard_group bfd_generic_discard_group
#define vms_section_already_linked _bfd_generic_section_already_linked
#define vms_bfd_define_common_symbol bfd_generic_define_common_symbol
#define alpha_vms_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define alpha_vms_bfd_merge_sections bfd_generic_merge_sections
#define alpha_vms_bfd_is_group_section bfd_generic_is_group_section
+#define alpha_vms_bfd_group_name bfd_generic_group_name
#define alpha_vms_bfd_discard_group bfd_generic_discard_group
#define alpha_vms_section_already_linked \
_bfd_generic_section_already_linked