/* BFD back-end for ALPHA Extended-Coff files.
- Copyright (C) 1993-2014 Free Software Foundation, Inc.
+ Copyright (C) 1993-2016 Free Software Foundation, Inc.
Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and
Ian Lance Taylor <ian@cygnus.com>.
unsigned long r_symndx;
bfd_vma relocation;
- BFD_ASSERT (info->relocatable);
+ BFD_ASSERT (bfd_link_relocatable (info));
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
lita_sec = symndx_to_section[RELOC_SECTION_LITA];
gp = _bfd_get_gp_value (output_bfd);
- if (! info->relocatable && lita_sec != NULL)
+ if (! bfd_link_relocatable (info) && lita_sec != NULL)
{
struct ecoff_section_tdata *lita_sec_data;
not otherwise used for anything. For some reason, the
address of the relocation does not appear to include the
section VMA, unlike the other relocation types. */
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
H_PUT_64 (input_bfd, input_section->output_offset + r_vaddr,
ext_rel->r_vaddr);
adjust_addrp = FALSE;
if (h == (struct ecoff_link_hash_entry *) NULL)
abort ();
- if (! info->relocatable)
+ if (! bfd_link_relocatable (info))
{
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
addend += r_vaddr;
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
{
/* Adjust r_vaddr by the addend. */
H_PUT_64 (input_bfd, addend, ext_rel->r_vaddr);
/* Store a value from the reloc stack into a bitfield. If
we are generating relocatable output, all we do is
adjust the address of the reloc. */
- if (! info->relocatable)
+ if (! bfd_link_relocatable (info))
{
bfd_vma mask;
bfd_vma val;
abort ();
}
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
{
/* We are generating relocatable output, and must
convert the existing reloc. */
}
}
- if (info->relocatable && adjust_addrp)
+ if (bfd_link_relocatable (info) && adjust_addrp)
{
/* Change the address of the relocation. */
H_PUT_64 (input_bfd,
static bfd *
alpha_ecoff_openr_next_archived_file (bfd *archive, bfd *last_file)
{
- file_ptr filestart;
+ ufile_ptr filestart;
if (last_file == NULL)
filestart = bfd_ardata (archive)->first_file_filepos;
BSD-4.4-style element with a long odd size. */
filestart = last_file->proxy_origin + size;
filestart += filestart % 2;
+ if (filestart <= last_file->proxy_origin)
+ {
+ /* Prevent looping. See PR19256. */
+ bfd_set_error (bfd_error_malformed_archive);
+ return NULL;
+ }
}
return alpha_ecoff_get_elt_at_filepos (archive, filestart);