diff options
author | Nick Clifton <nickc@redhat.com> | 2015-06-30 17:12:47 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2015-06-30 17:12:47 +0100 |
commit | 5ee4a1ca16364c79f8717752ee9a9bd562580907 (patch) | |
tree | 31bfba06decc04d489288c9efd29d6ec5715abd8 /bfd/elf-bfd.h | |
parent | 9916071f8df180400e39d1783d4a878cf57c61fe (diff) | |
download | gdb-5ee4a1ca16364c79f8717752ee9a9bd562580907.zip gdb-5ee4a1ca16364c79f8717752ee9a9bd562580907.tar.gz gdb-5ee4a1ca16364c79f8717752ee9a9bd562580907.tar.bz2 |
This fixes parsing a file containing ELF attributes with very large tag values.
PR binutils/18570
* elf-attrs.c (obj_attr_size): Use an unsigned int type for the tag.
(write_obj_attribute): Likewise.
(elf_new_obj_attr): Likewise.
(bfd_elf_get_obj_attr_int): Likewise.
(bfd_elf_add_obj_attr_int): Likewise.
(bfd_elf_add_obj_attr_string): Likewise.
(bfd_elf_add_obj_attr_int_string): Likewise.
(gnu_obj_attrs_arg_type): Likewise.
(_bfd_elf_obj_attrs_arg_type): Likewise.
(_bfd_elf_parse_attributes): Likewise.
(_bfd_elf_merge_unknown_attribute_list): Likewise.
* elf-bfd.h (struct obj_attribute_list): Likewise.
Update prototypes.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 06a3883..e08b2d6 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1549,7 +1549,7 @@ typedef struct obj_attribute typedef struct obj_attribute_list { struct obj_attribute_list *next; - int tag; + unsigned int tag; obj_attribute attr; } obj_attribute_list; @@ -2412,22 +2412,22 @@ extern bfd *_bfd_elf64_bfd_from_remote_memory extern bfd_vma bfd_elf_obj_attr_size (bfd *); extern void bfd_elf_set_obj_attr_contents (bfd *, bfd_byte *, bfd_vma); -extern int bfd_elf_get_obj_attr_int (bfd *, int, int); -extern void bfd_elf_add_obj_attr_int (bfd *, int, int, unsigned int); +extern int bfd_elf_get_obj_attr_int (bfd *, int, unsigned int); +extern void bfd_elf_add_obj_attr_int (bfd *, int, unsigned int, unsigned int); #define bfd_elf_add_proc_attr_int(BFD, TAG, VALUE) \ bfd_elf_add_obj_attr_int ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE)) -extern void bfd_elf_add_obj_attr_string (bfd *, int, int, const char *); +extern void bfd_elf_add_obj_attr_string (bfd *, int, unsigned int, const char *); #define bfd_elf_add_proc_attr_string(BFD, TAG, VALUE) \ bfd_elf_add_obj_attr_string ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE)) -extern void bfd_elf_add_obj_attr_int_string (bfd *, int, int, unsigned int, - const char *); +extern void bfd_elf_add_obj_attr_int_string (bfd *, int, unsigned int, + unsigned int, const char *); #define bfd_elf_add_proc_attr_int_string(BFD, TAG, INTVAL, STRVAL) \ bfd_elf_add_obj_attr_int_string ((BFD), OBJ_ATTR_PROC, (TAG), \ (INTVAL), (STRVAL)) extern char *_bfd_elf_attr_strdup (bfd *, const char *); extern void _bfd_elf_copy_obj_attributes (bfd *, bfd *); -extern int _bfd_elf_obj_attrs_arg_type (bfd *, int, int); +extern int _bfd_elf_obj_attrs_arg_type (bfd *, int, unsigned int); extern void _bfd_elf_parse_attributes (bfd *, Elf_Internal_Shdr *); extern bfd_boolean _bfd_elf_merge_object_attributes (bfd *, bfd *); extern bfd_boolean _bfd_elf_merge_unknown_attribute_low (bfd *, bfd *, int); |