/* ELF attributes support (based on ARM EABI attributes).
- Copyright (C) 2005-2018 Free Software Foundation, Inc.
+ Copyright (C) 2005-2020 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
static bfd_boolean
is_default_attr (obj_attribute *attr)
{
+ if (ATTR_TYPE_HAS_ERROR (attr->type))
+ return TRUE;
if (ATTR_TYPE_HAS_INT_VAL (attr->type) && attr->i != 0)
return FALSE;
if (ATTR_TYPE_HAS_STR_VAL (attr->type) && attr->s && *attr->s)
size += obj_attr_size (list->tag, &list->attr);
/* <size> <vendor_name> NUL 0x1 <size> */
- return ((size || vendor == OBJ_ATTR_PROC)
+ return (size
? size + 10 + strlen (vendor_name)
: 0);
}
bfd_byte *p_end;
bfd_vma len;
const char *std_sec;
+ ufile_ptr filesize;
/* PR 17512: file: 2844a11d. */
if (hdr->sh_size == 0)
return;
- if (hdr->sh_size > bfd_get_file_size (abfd))
+
+ filesize = bfd_get_file_size (abfd);
+ if (filesize != 0 && hdr->sh_size > filesize)
{
/* xgettext:c-format */
_bfd_error_handler (_("%pB: error: attribute section '%pA' too big: %#llx"),