/* vms.c -- BFD back-end for EVAX (openVMS/Alpha) files.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Initial version written by Klaus Kaempf (kkaempf@rmi.de)
Major rewrite by Adacore.
struct module *modules; /* list of all compilation units */
+ /* The DST section. */
asection *dst_section;
unsigned int dst_ptr_offsets_count; /* # of offsets in following array */
struct vms_internal_eisd_map *gbl_eisd_tail;
/* linkage index counter used by conditional store commands */
- int vms_linkage_index;
+ unsigned int vms_linkage_index;
/* see tc-alpha.c of gas for a description. */
int flag_hash_long_names; /* -+, hash instead of truncate */
static void alpha_vms_add_fixup_ca (struct bfd_link_info *, bfd *, bfd *);
static void alpha_vms_add_fixup_qr (struct bfd_link_info *, bfd *, bfd *,
bfd_vma);
+static void alpha_vms_add_fixup_lr (struct bfd_link_info *, unsigned int,
+ bfd_vma);
static void alpha_vms_add_lw_reloc (struct bfd_link_info *info);
static void alpha_vms_add_qw_reloc (struct bfd_link_info *info);
-static void alpha_vms_add_lw_fixup (struct bfd_link_info *, unsigned int,
- bfd_vma);
struct vector_type
{
{
struct bfd_link_hash_table root;
- /* Vector of shared libaries. */
+ /* Vector of shared libraries. */
struct vector_type shrlibs;
/* Fixup section. */
/* Extract record size. */
PRIV (recrd.rec_size) = bfd_getl16 (PRIV (recrd.rec) + 2);
- if (PRIV (recrd.rec_size) <= 0)
+ if (PRIV (recrd.rec_size) == 0)
{
bfd_set_error (bfd_error_file_truncated);
return 0;
0 },
{ EVAX_CODE_NAME,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_EXE,
- SEC_CODE,
+ SEC_CODE | SEC_READONLY,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_EXE,
- SEC_CODE | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
+ SEC_CODE | SEC_READONLY | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
{ EVAX_LITERAL_NAME,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_RD | EGPS__V_NOMOD,
SEC_DATA | SEC_READONLY,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_RD,
- SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_READONLY | SEC_LOAD },
+ SEC_DATA | SEC_READONLY | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
{ EVAX_LINK_NAME,
EGPS__V_REL | EGPS__V_RD,
SEC_DATA | SEC_READONLY,
EGPS__V_REL | EGPS__V_RD,
- SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_READONLY | SEC_LOAD },
+ SEC_DATA | SEC_READONLY | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
{ EVAX_DATA_NAME,
EGPS__V_REL | EGPS__V_RD | EGPS__V_WRT | EGPS__V_NOMOD,
SEC_DATA,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_RD,
SEC_DATA | SEC_READONLY,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_RD,
- SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_READONLY | SEC_LOAD },
+ SEC_DATA | SEC_READONLY | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
{ EVAX_READONLY_NAME,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_RD | EGPS__V_NOMOD,
SEC_DATA | SEC_READONLY,
EGPS__V_PIC | EGPS__V_REL | EGPS__V_SHR | EGPS__V_RD,
- SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_READONLY | SEC_LOAD },
+ SEC_DATA | SEC_READONLY | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
{ EVAX_LOCAL_NAME,
EGPS__V_REL | EGPS__V_RD | EGPS__V_WRT,
SEC_DATA,
EGPS__V_PIC | EGPS__V_OVR,
SEC_DATA | SEC_READONLY,
EGPS__V_PIC | EGPS__V_OVR,
- SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_READONLY | SEC_LOAD },
+ SEC_DATA | SEC_READONLY | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD },
{ NULL,
EGPS__V_REL | EGPS__V_RD | EGPS__V_WRT,
SEC_DATA,
EGPS__V_REL | EGPS__V_RD | EGPS__V_WRT,
- SEC_IN_MEMORY | SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD }
+ SEC_DATA | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD }
};
/* Retrieve BFD section flags by name and size. */
_bfd_vms_slurp_egsd (bfd *abfd)
{
int gsd_type, gsd_size;
- asection *section;
unsigned char *vms_rec;
- flagword new_flags, old_flags;
- char *name;
unsigned long base_addr;
- unsigned long align_addr;
vms_debug2 ((2, "EGSD\n"));
switch (gsd_type)
{
case EGSD__C_PSC:
+ /* Program section definition. */
{
- /* Program section definition. */
struct vms_egps *egps = (struct vms_egps *)vms_rec;
+ flagword new_flags, vms_flags;
+ asection *section;
- name = _bfd_vms_save_counted_string (&egps->namlng);
- section = bfd_make_section (abfd, name);
- if (!section)
- return FALSE;
-
- old_flags = bfd_getl16 (egps->flags);
- vms_section_data (section)->flags = old_flags;
- vms_section_data (section)->no_flags = 0;
- section->size = bfd_getl32 (egps->alloc);
- new_flags = vms_secflag_by_name (evax_section_flags, name,
- section->size > 0);
- if (!(old_flags & EGPS__V_NOMOD) && section->size > 0)
+ vms_flags = bfd_getl16 (egps->flags);
+
+ if ((vms_flags & EGPS__V_REL) == 0)
{
- new_flags |= SEC_HAS_CONTENTS;
- if (old_flags & EGPS__V_REL)
- new_flags |= SEC_RELOC;
+ /* Use the global absolute section for all
+ absolute sections. */
+ section = bfd_abs_section_ptr;
}
- if (!bfd_set_section_flags (abfd, section, new_flags))
- return FALSE;
- section->alignment_power = egps->align;
- if ((old_flags & EGPS__V_REL) != 0)
+ else
{
+ char *name;
+ unsigned long align_addr;
+
+ name = _bfd_vms_save_counted_string (&egps->namlng);
+
+ section = bfd_make_section (abfd, name);
+ if (!section)
+ return FALSE;
+
+ section->filepos = 0;
+ section->size = bfd_getl32 (egps->alloc);
+ section->alignment_power = egps->align;
+
+ vms_section_data (section)->flags = vms_flags;
+ vms_section_data (section)->no_flags = 0;
+
+ new_flags = vms_secflag_by_name (evax_section_flags, name,
+ section->size > 0);
+ if (section->size > 0)
+ new_flags |= SEC_LOAD;
+ if (!(vms_flags & EGPS__V_NOMOD) && section->size > 0)
+ {
+ /* Set RELOC and HAS_CONTENTS if the section is not
+ demand-zero and not empty. */
+ new_flags |= SEC_HAS_CONTENTS;
+ if (vms_flags & EGPS__V_REL)
+ new_flags |= SEC_RELOC;
+ }
+ if (vms_flags & EGPS__V_EXE)
+ {
+ /* Set CODE if section is executable. */
+ new_flags |= SEC_CODE;
+ new_flags &= ~SEC_DATA;
+ }
+ if (!bfd_set_section_flags (abfd, section, new_flags))
+ return FALSE;
+
/* Give a non-overlapping vma to non absolute sections. */
align_addr = (1 << section->alignment_power);
if ((base_addr % align_addr) != 0)
section->vma = (bfd_vma)base_addr;
base_addr += section->size;
}
- else
- section->vma = 0;
- section->filepos = 0;
/* Append it to the section array. */
if (PRIV (section_count) >= PRIV (section_max))
PRIV (sections)[PRIV (section_count)] = section;
PRIV (section_count)++;
-
-#if VMS_DEBUG
- vms_debug (4, "EGSD P-section %d (%s, flags %04x) ",
- section->index, name, old_flags);
- vms_debug (4, "%lu bytes at 0x%08lx (mem %p)\n",
- (unsigned long)section->size,
- (unsigned long)section->vma, section->contents);
-#endif
}
break;
int nameoff;
struct vms_symbol_entry *entry;
struct vms_egsy *egsy = (struct vms_egsy *) vms_rec;
+ flagword old_flags;
old_flags = bfd_getl16 (egsy->flags);
if (old_flags & EGSY__V_DEF)
{
struct vms_symbol_entry *entry;
struct vms_egst *egst = (struct vms_egst *)vms_rec;
+ flagword old_flags;
old_flags = bfd_getl16 (egst->header.flags);
#if VMS_DEBUG
_bfd_vms_debug (4, "etir: %s(%d)\n",
_bfd_vms_etir_name (cmd), cmd);
- _bfd_hexdump (8, ptr, cmd_length - 4, (long) ptr);
+ _bfd_hexdump (8, ptr, cmd_length - 4, 0);
#endif
switch (cmd)
}
else if (rel1 & RELC_SHR_BASE)
{
- alpha_vms_add_lw_fixup (info, rel1 & RELC_MASK, op1);
+ alpha_vms_add_fixup_lr (info, rel1 & RELC_MASK, op1);
rel1 = RELC_NONE;
}
if (rel1 != RELC_NONE)
static const struct bfd_target *
alpha_vms_object_p (bfd *abfd)
{
- PTR tdata_save = abfd->tdata.any;
+ void *tdata_save = abfd->tdata.any;
unsigned int test_len;
unsigned char *buf;
_bfd_vms_output_alignment (recwr, 2);
_bfd_vms_output_begin (recwr, EOBJ__C_EEOM);
- _bfd_vms_output_long (recwr, (unsigned long) (PRIV (vms_linkage_index) >> 1));
+ _bfd_vms_output_long (recwr, PRIV (vms_linkage_index + 1) >> 1);
_bfd_vms_output_byte (recwr, 0); /* Completion code. */
_bfd_vms_output_byte (recwr, 0); /* Fill byte. */
if (!(sec->flags & SEC_READONLY))
eisd->u.eisd.flags |= EISD__M_WRT | EISD__M_CRF;
- if (!(sec->flags & SEC_LOAD))
+ /* If relocations or fixup will be applied, make this isect writeable. */
+ if (sec->flags & SEC_RELOC)
+ eisd->u.eisd.flags |= EISD__M_WRT | EISD__M_CRF;
+
+ if (!(sec->flags & SEC_HAS_CONTENTS))
{
eisd->u.eisd.flags |= EISD__M_DZRO;
eisd->u.eisd.flags &= ~EISD__M_CRF;
_bfd_vms_output_alignment (recwr, 4);
- PRIV (vms_linkage_index) = 1;
+ PRIV (vms_linkage_index) = 0;
for (section = abfd->sections; section; section = section->next)
{
int pass2_in_progress = 0;
unsigned int irel;
- if (section->reloc_count <= 0)
+ if (section->reloc_count == 0)
(*_bfd_error_handler)
(_("SEC_RELOC with no relocs in section %s"), section->name);
etir_output_check (abfd, section, curr_addr, 64);
_bfd_vms_output_begin_subrec (recwr, ETIR__C_STC_LP_PSB);
_bfd_vms_output_long
- (recwr, (unsigned long) PRIV (vms_linkage_index));
- PRIV (vms_linkage_index) += 2;
+ (recwr, (unsigned long) rptr->addend);
+ if (rptr->addend > PRIV (vms_linkage_index))
+ PRIV (vms_linkage_index) = rptr->addend;
hash = _bfd_vms_length_hash_symbol
(abfd, sym->name, EOBJ__C_SYMSIZ);
_bfd_vms_output_counted (recwr, hash);
_bfd_vms_output_begin_subrec (recwr, ETIR__C_STC_NOP_GBL);
_bfd_vms_output_long (recwr, (unsigned long) udata->lkindex);
_bfd_vms_output_long
- (recwr,
- (unsigned long) udata->enbsym->section->target_index);
+ (recwr, (unsigned long) section->target_index);
_bfd_vms_output_quad (recwr, rptr->address);
_bfd_vms_output_long (recwr, (unsigned long) 0x47ff041f);
_bfd_vms_output_long
- (recwr,
- (unsigned long) udata->enbsym->section->target_index);
+ (recwr, (unsigned long) section->target_index);
_bfd_vms_output_quad (recwr, rptr->addend);
_bfd_vms_output_counted
(recwr, _bfd_vms_length_hash_symbol
_bfd_vms_output_long
(recwr, (unsigned long) udata->lkindex + 1);
_bfd_vms_output_long
- (recwr,
- (unsigned long) udata->enbsym->section->target_index);
+ (recwr, (unsigned long) section->target_index);
_bfd_vms_output_quad (recwr, rptr->address);
_bfd_vms_output_long (recwr, (unsigned long) 0x237B0000);
_bfd_vms_output_long
_bfd_vms_output_begin_subrec (recwr, ETIR__C_STC_BOH_GBL);
_bfd_vms_output_long (recwr, (unsigned long) udata->lkindex);
_bfd_vms_output_long
- (recwr,
- (unsigned long) udata->enbsym->section->target_index);
+ (recwr, (unsigned long) section->target_index);
_bfd_vms_output_quad (recwr, rptr->address);
_bfd_vms_output_long (recwr, (unsigned long) 0xD3400000);
_bfd_vms_output_long
- (recwr,
- (unsigned long) udata->enbsym->section->target_index);
+ (recwr, (unsigned long) section->target_index);
_bfd_vms_output_quad (recwr, rptr->addend);
_bfd_vms_output_counted
(recwr, _bfd_vms_length_hash_symbol
/* We don't have a DMT section so this must be an object. Parse
the module right now in order to compute its start address and
end address. */
+ void *dst = PRIV (dst_section)->contents;
+
+ if (dst == NULL)
+ return NULL;
+
module = new_module (abfd);
parse_module (abfd, module, PRIV (dst_section)->contents, -1);
list = module;
*func = NULL;
*line = 0;
- if (PRIV (dst_section) == NULL || !(abfd->flags & (EXEC_P | DYNAMIC)))
+ /* We can't do anything if there is no DST (debug symbol table). */
+ if (PRIV (dst_section) == NULL)
return FALSE;
+ /* Create the module list - if not already done. */
if (PRIV (modules) == NULL)
{
PRIV (modules) = build_module_list (abfd);
(*_bfd_error_handler) (_("Invalid section index in ETIR"));
return FALSE;
}
+
sec = PRIV (sections)[cur_psect];
+ if (sec == bfd_abs_section_ptr)
+ {
+ (*_bfd_error_handler) (_("Relocation for non-REL psect"));
+ return FALSE;
+ }
+
vms_sec = vms_section_data (sec);
/* Allocate a reloc entry. */
vms_sec->reloc_max = 64;
sec->relocation = bfd_zmalloc
(vms_sec->reloc_max * sizeof (arelent));
- }
+ }
else
{
vms_sec->reloc_max *= 2;
}
if (lpfixoff != 0)
{
- fprintf (file, _(" Linkage Pairs Referece Fixups:\n"));
+ fprintf (file, _(" Linkage Pairs Reference Fixups:\n"));
evax_bfd_print_reference_fixups (file, buf + lpfixoff);
}
if (chgprtoff)
sl->has_fixups = TRUE;
VEC_APPEND_EL (sl->lp, bfd_vma,
sect->output_section->vma + sect->output_offset + offset);
+ sect->output_section->flags |= SEC_RELOC;
}
+/* Add a code address fixup at address SECT + OFFSET to SHLIB. */
+
static void
alpha_vms_add_fixup_ca (struct bfd_link_info *info, bfd *src, bfd *shlib)
{
sl->has_fixups = TRUE;
VEC_APPEND_EL (sl->ca, bfd_vma,
sect->output_section->vma + sect->output_offset + offset);
+ sect->output_section->flags |= SEC_RELOC;
}
+/* Add a quad word relocation fixup at address SECT + OFFSET to SHLIB. */
+
static void
alpha_vms_add_fixup_qr (struct bfd_link_info *info, bfd *src,
bfd *shlib, bfd_vma vec)
r = VEC_APPEND (sl->qr, struct alpha_vms_vma_ref);
r->vma = sect->output_section->vma + sect->output_offset + offset;
r->ref = vec;
+ sect->output_section->flags |= SEC_RELOC;
}
static void
-alpha_vms_add_lw_fixup (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+alpha_vms_add_fixup_lr (struct bfd_link_info *info ATTRIBUTE_UNUSED,
unsigned int shr ATTRIBUTE_UNUSED,
bfd_vma vec ATTRIBUTE_UNUSED)
{
+ /* Not yet supported. */
abort ();
}
-#if 0
-static void
-alpha_vms_add_qw_fixup (struct bfd_link_info *info ATTRIBUTE_UNUSED,
- unsigned int shr ATTRIBUTE_UNUSED,
- bfd_vma vec ATTRIBUTE_UNUSED)
-{
- abort ();
-}
-#endif
+/* Add relocation. FIXME: Not yet emitted. */
static void
alpha_vms_add_lw_reloc (struct bfd_link_info *info ATTRIBUTE_UNUSED)
return FALSE;
if (element->archive_pass == -1 || element->archive_pass == pass)
- continue;
+ {
+ /* Next symbol if this archive is wrong or already handled. */
+ continue;
+ }
if (! bfd_check_format (element, bfd_object))
{
/* Unlike the generic linker, we know that this element provides
a definition for an undefined symbol and we know that we want
to include it. We don't need to check anything. */
- if (! (*info->callbacks->add_archive_element) (info, element,
- h->root.string))
+ if (!(*info->callbacks
+ ->add_archive_element) (info, element, h->root.string, &element))
return FALSE;
- if (! alpha_vms_link_add_object_symbols (element, info))
+ if (!alpha_vms_link_add_object_symbols (element, info))
return FALSE;
orig_element->archive_pass = pass;
unsigned int ca_sz = 0;
unsigned int qr_sz = 0;
unsigned int shrimg_cnt = 0;
+ unsigned int chgprt_num = 0;
+ unsigned int chgprt_sz = 0;
struct vms_eiaf *eiaf;
unsigned int off;
asection *sec;
if (ca_sz + lp_sz + qr_sz == 0)
return TRUE;
+ /* Add an eicp entry for the fixup itself. */
+ chgprt_num = 1;
+ for (sec = info->output_bfd->sections; sec != NULL; sec = sec->next)
+ {
+ /* This isect could be made RO or EXE after relocations are applied. */
+ if ((sec->flags & SEC_RELOC) != 0
+ && (sec->flags & (SEC_CODE | SEC_READONLY)) != 0)
+ chgprt_num++;
+ }
+ chgprt_sz = 4 + chgprt_num * sizeof (struct vms_eicp);
+
/* Allocate section content (round-up size) */
sz = sizeof (struct vms_eiaf) + shrimg_cnt * sizeof (struct vms_shl)
- + ca_sz + lp_sz + qr_sz;
+ + ca_sz + lp_sz + qr_sz + chgprt_sz;
sz = (sz + VMS_BLOCK_SIZE - 1) & ~(VMS_BLOCK_SIZE - 1);
content = bfd_zalloc (info->output_bfd, sz);
if (content == NULL)
bfd_putl32 (0, content + off + 4);
off += 8;
}
+ }
- /* CA fixups. */
+ /* Write the change protection table. */
+ bfd_putl32 (off, eiaf->chgprtoff);
+ bfd_putl32 (chgprt_num, content + off);
+ off += 4;
+
+ for (sec = info->output_bfd->sections; sec != NULL; sec = sec->next)
+ {
+ struct vms_eicp *eicp;
+ unsigned int prot;
+
+ if ((sec->flags & SEC_LINKER_CREATED) != 0 &&
+ strcmp (sec->name, "$FIXUP$") == 0)
+ prot = PRT__C_UREW;
+ else if ((sec->flags & SEC_RELOC) != 0
+ && (sec->flags & (SEC_CODE | SEC_READONLY)) != 0)
+ prot = PRT__C_UR;
+ else
+ continue;
+
+ eicp = (struct vms_eicp *)(content + off);
+ bfd_putl64 (sec->vma - t->base_addr, eicp->baseva);
+ bfd_putl32 ((sec->size + VMS_BLOCK_SIZE - 1) & ~(VMS_BLOCK_SIZE - 1),
+ eicp->size);
+ bfd_putl32 (prot, eicp->newprt);
+ off += sizeof (struct vms_eicp);
}
return TRUE;
}
-/* Called by bfd_link_hash_traverse to fill the symbol table.
+/* Called by bfd_hash_traverse to fill the symbol table.
Return FALSE in case of failure. */
static bfd_boolean
-alpha_vms_link_output_symbol (struct bfd_link_hash_entry *hc, void *infov)
+alpha_vms_link_output_symbol (struct bfd_hash_entry *bh, void *infov)
{
+ struct bfd_link_hash_entry *hc = (struct bfd_link_hash_entry *) bh;
struct bfd_link_info *info = (struct bfd_link_info *)infov;
- struct alpha_vms_link_hash_entry *h = (struct alpha_vms_link_hash_entry *)hc;
+ struct alpha_vms_link_hash_entry *h;
struct vms_symbol_entry *sym;
+ if (hc->type == bfd_link_hash_warning)
+ {
+ hc = hc->u.i.link;
+ if (hc->type == bfd_link_hash_new)
+ return TRUE;
+ }
+ h = (struct alpha_vms_link_hash_entry *) hc;
+
switch (h->root.type)
{
- case bfd_link_hash_new:
case bfd_link_hash_undefined:
+ return TRUE;
+ case bfd_link_hash_new:
+ case bfd_link_hash_warning:
abort ();
case bfd_link_hash_undefweak:
return TRUE;
case bfd_link_hash_common:
break;
case bfd_link_hash_indirect:
- case bfd_link_hash_warning:
return TRUE;
}
asection *dst;
asection *dmt;
+ if (info->relocatable)
+ {
+ /* FIXME: we do not yet support relocatable link. It is not obvious
+ how to do it for debug infos. */
+ (*info->callbacks->einfo)(_("%P: relocatable link is not supported\n"));
+ return FALSE;
+ }
+
bfd_get_outsymbols (abfd) = NULL;
bfd_get_symcount (abfd) = 0;
/* Generate the symbol table. */
BFD_ASSERT (PRIV (syms) == NULL);
if (info->strip != strip_all)
- bfd_link_hash_traverse (info->hash, alpha_vms_link_output_symbol, info);
+ bfd_hash_traverse (&info->hash->table, alpha_vms_link_output_symbol, info);
/* Find the entry point. */
if (bfd_get_start_address (abfd) == 0)
PRIV (transfer_address[i++]) = 0;
}
- /* Allocate contents. */
+ /* Allocate contents.
+ Also compute the virtual base address. */
base_addr = (bfd_vma)-1;
last_addr = 0;
for (o = abfd->sections; o != NULL; o = o->next)
if (o->vma + o->size > last_addr)
last_addr = o->vma + o->size;
}
+ /* Clear the RELOC flags. Currently we don't support incremental
+ linking. We use the RELOC flag for computing the eicp entries. */
+ o->flags &= ~SEC_RELOC;
}
/* Create the fixup section. */
return FALSE;
}
- /* Alloc in memory and read ETIRs. */
- BFD_ASSERT (section->contents == NULL);
+ /* If the section is already in memory, just copy it. */
+ if (section->flags & SEC_IN_MEMORY)
+ {
+ BFD_ASSERT (section->contents != NULL);
+ memcpy (buf, section->contents + offset, count);
+ return TRUE;
+ }
+ if (section->size == 0)
+ return TRUE;
+ /* Alloc in memory and read ETIRs. */
for (sec = abfd->sections; sec; sec = sec->next)
{
BFD_ASSERT (sec->contents == NULL);
if (!alpha_vms_read_sections_content (abfd, NULL))
return FALSE;
for (sec = abfd->sections; sec; sec = sec->next)
- if (section->contents)
- section->flags |= SEC_IN_MEMORY;
+ if (sec->contents)
+ sec->flags |= SEC_IN_MEMORY;
memcpy (buf, section->contents + offset, count);
return TRUE;
}
vms_debug2 ((7, "%d: %s\n", section->index, section->name));
amt = sizeof (struct vms_section_data_struct);
- section->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
+ section->used_by_bfd = bfd_zalloc (abfd, amt);
if (section->used_by_bfd == NULL)
return FALSE;
else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
ret->type = 'B';
else
- ret->type = '-';
+ ret->type = '?';
if (ret->type != 'U')
ret->value = symbol->value + symbol->section->vma;
#define alpha_vms_bfd_relax_section bfd_generic_relax_section
#define alpha_vms_bfd_gc_sections bfd_generic_gc_sections
+#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_discard_group bfd_generic_discard_group
0, /* symbol_leading_char. */
' ', /* ar_pad_char. */
15, /* ar_max_namelen. */
+ 0, /* match priority. */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16,
NULL,
- (PTR) 0
+ NULL
};