+2017-08-22 Richard Biener <rguenther@suse.de>
+
+ PR lto/81925
+ * simple-object-elf.c (simple_object_elf_write_shdr): Adjust
+ type of sh_addralign and sh_entsize and properly write
+ sh_entsize as Elf_Addr.
+ (simple_object_elf_write_to_file): Read sh_entsize as Elf_Addr.
+
2017-08-21 Richard Biener <rguenther@suse.de>
* simple-object-common.h (struct simple_object_functions): Add
off_t sh_addr,
unsigned int sh_offset, unsigned int sh_size,
unsigned int sh_link, unsigned int sh_info,
- unsigned int sh_addralign,
- unsigned int sh_entsize,
+ size_t sh_addralign,
+ size_t sh_entsize,
const char **errmsg, int *err)
{
struct simple_object_elf_attributes *attrs =
ELF_SET_FIELD (fns, cl, Shdr, buf, sh_link, Elf_Word, sh_link);
ELF_SET_FIELD (fns, cl, Shdr, buf, sh_info, Elf_Word, sh_info);
ELF_SET_FIELD (fns, cl, Shdr, buf, sh_addralign, Elf_Addr, sh_addralign);
- ELF_SET_FIELD (fns, cl, Shdr, buf, sh_entsize, Elf_Word, sh_entsize);
+ ELF_SET_FIELD (fns, cl, Shdr, buf, sh_entsize, Elf_Addr, sh_entsize);
return simple_object_internal_write (descriptor, offset, buf, shdr_size,
errmsg, err);
off_t sh_addr = 0;
unsigned int sh_link = 0;
unsigned int sh_info = 0;
- unsigned int sh_addralign = 1U << section->align;
- unsigned int sh_entsize = 0;
+ size_t sh_addralign = 1U << section->align;
+ size_t sh_entsize = 0;
if (eow->shdrs)
{
sh_type = ELF_FETCH_FIELD (attrs->type_functions, attrs->ei_class, Shdr,
sh_addralign, Elf_Addr);
sh_entsize = ELF_FETCH_FIELD (attrs->type_functions, attrs->ei_class, Shdr,
eow->shdrs + secnum * shdr_size,
- sh_entsize, Elf_Word);
+ sh_entsize, Elf_Addr);
secnum++;
}