|
|
a6dfc0 |
--- binutils.orig/gas/write.c 2019-07-01 16:23:28.133707500 +0100
|
|
|
a6dfc0 |
+++ binutils-2.32/gas/write.c 2019-07-01 16:24:50.699130611 +0100
|
|
|
a6dfc0 |
@@ -1891,7 +1891,8 @@ create_obj_attrs_section (void)
|
|
|
a6dfc0 |
static void
|
|
|
a6dfc0 |
create_note_reloc (segT sec,
|
|
|
a6dfc0 |
symbolS * sym,
|
|
|
a6dfc0 |
- bfd_size_type offset,
|
|
|
a6dfc0 |
+ bfd_size_type note_offset,
|
|
|
a6dfc0 |
+ bfd_size_type desc2_offset,
|
|
|
a6dfc0 |
int reloc_type,
|
|
|
a6dfc0 |
bfd_vma addend,
|
|
|
a6dfc0 |
char * note)
|
|
|
a6dfc0 |
@@ -1901,10 +1902,10 @@ create_note_reloc (segT sec,
|
|
|
a6dfc0 |
reloc = XNEW (struct reloc_list);
|
|
|
a6dfc0 |
|
|
|
a6dfc0 |
/* We create a .b type reloc as resolve_reloc_expr_symbols() has already been called. */
|
|
|
a6dfc0 |
- reloc->u.b.sec = sec;
|
|
|
a6dfc0 |
- reloc->u.b.s = symbol_get_bfdsym (sym);
|
|
|
a6dfc0 |
+ reloc->u.b.sec = sec;
|
|
|
a6dfc0 |
+ reloc->u.b.s = symbol_get_bfdsym (sym);
|
|
|
a6dfc0 |
reloc->u.b.r.sym_ptr_ptr = & reloc->u.b.s;
|
|
|
a6dfc0 |
- reloc->u.b.r.address = offset;
|
|
|
a6dfc0 |
+ reloc->u.b.r.address = note_offset + desc2_offset;
|
|
|
a6dfc0 |
reloc->u.b.r.addend = addend;
|
|
|
a6dfc0 |
reloc->u.b.r.howto = bfd_reloc_type_lookup (stdoutput, reloc_type);
|
|
|
a6dfc0 |
|
|
|
a6dfc0 |
@@ -1929,12 +1930,12 @@ create_note_reloc (segT sec,
|
|
|
a6dfc0 |
if (target_big_endian)
|
|
|
a6dfc0 |
{
|
|
|
a6dfc0 |
if (bfd_arch_bits_per_address (stdoutput) <= 32)
|
|
|
a6dfc0 |
- note[offset + 3] = addend;
|
|
|
a6dfc0 |
+ note[desc2_offset + 3] = addend;
|
|
|
a6dfc0 |
else
|
|
|
a6dfc0 |
- note[offset + 7] = addend;
|
|
|
a6dfc0 |
+ note[desc2_offset + 7] = addend;
|
|
|
a6dfc0 |
}
|
|
|
a6dfc0 |
else
|
|
|
a6dfc0 |
- note[offset] = addend;
|
|
|
a6dfc0 |
+ note[desc2_offset] = addend;
|
|
|
a6dfc0 |
}
|
|
|
a6dfc0 |
}
|
|
|
a6dfc0 |
|
|
|
a6dfc0 |
@@ -2037,10 +2038,10 @@ maybe_generate_build_notes (void)
|
|
|
a6dfc0 |
memcpy (note + 12, "GA$?3a1", 8);
|
|
|
a6dfc0 |
|
|
|
a6dfc0 |
/* Create a relocation to install the start address of the note... */
|
|
|
a6dfc0 |
- create_note_reloc (sec, sym, total_size + 20, desc_reloc, 0, note);
|
|
|
a6dfc0 |
+ create_note_reloc (sec, sym, total_size, 20, desc_reloc, 0, note);
|
|
|
a6dfc0 |
|
|
|
a6dfc0 |
/* ...and another one to install the end address. */
|
|
|
a6dfc0 |
- create_note_reloc (sec, sym, total_size + desc2_offset, desc_reloc,
|
|
|
a6dfc0 |
+ create_note_reloc (sec, sym, total_size, desc2_offset, desc_reloc,
|
|
|
a6dfc0 |
bfd_get_section_size (bsym->section),
|
|
|
a6dfc0 |
note);
|
|
|
a6dfc0 |
|