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)
/* PR 17512: file: 2844a11d. */
if (hdr->sh_size == 0)
return;
+ if (hdr->sh_size > bfd_get_file_size (abfd))
+ {
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%pB: error: attribute section '%pA' too big: %#llx"),
+ abfd, hdr->bfd_section, (long long) hdr->sh_size);
+ bfd_set_error (bfd_error_invalid_operation);
+ return;
+ }
+
contents = (bfd_byte *) bfd_malloc (hdr->sh_size + 1);
if (!contents)
return;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("error: %pB: Object has vendor-specific contents that "
+ (_("error: %pB: object has vendor-specific contents that "
"must be processed by the '%s' toolchain"),
ibfd, in_attr->s);
return FALSE;
|| (in_attr->i != 0 && strcmp (in_attr->s, out_attr->s) != 0))
{
/* xgettext:c-format */
- _bfd_error_handler (_("error: %pB: Object tag '%d, %s' is "
+ _bfd_error_handler (_("error: %pB: object tag '%d, %s' is "
"incompatible with tag '%d, %s'"),
ibfd,
in_attr->i, in_attr->s ? in_attr->s : "",