mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 10:34:21 +08:00
Fix bug when generating REL type relocs for assembler generated build notes.
PR 24748 * write.c (create_note_reloc): Add desc2_offset parameter. Change name of offset parameter to note_offset. Only use desc2_offset when placing addend into REL reloc's address space. (maybe_generate_build_notes): Update parameters passed to create_note_reloc.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2019-07-01 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
PR 24748
|
||||||
|
* write.c (create_note_reloc): Add desc2_offset parameter. Change
|
||||||
|
name of offset parameter to note_offset. Only use desc2_offset
|
||||||
|
when placing addend into REL reloc's address space.
|
||||||
|
(maybe_generate_build_notes): Update parameters passed to
|
||||||
|
create_note_reloc.
|
||||||
|
|
||||||
2019-07-01 Matthew Malcomson <matthew.malcomson@arm.com>
|
2019-07-01 Matthew Malcomson <matthew.malcomson@arm.com>
|
||||||
|
|
||||||
* testsuite/gas/aarch64/illegal-sve2-aes.d: Update tests.
|
* testsuite/gas/aarch64/illegal-sve2-aes.d: Update tests.
|
||||||
|
16
gas/write.c
16
gas/write.c
@ -1240,6 +1240,7 @@ write_relocs (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
|
|||||||
|
|
||||||
/* Extract relocs for this section from reloc_list. */
|
/* Extract relocs for this section from reloc_list. */
|
||||||
rp = &reloc_list;
|
rp = &reloc_list;
|
||||||
|
|
||||||
my_reloc_list = NULL;
|
my_reloc_list = NULL;
|
||||||
while ((r = *rp) != NULL)
|
while ((r = *rp) != NULL)
|
||||||
{
|
{
|
||||||
@ -1889,7 +1890,8 @@ create_obj_attrs_section (void)
|
|||||||
static void
|
static void
|
||||||
create_note_reloc (segT sec,
|
create_note_reloc (segT sec,
|
||||||
symbolS * sym,
|
symbolS * sym,
|
||||||
bfd_size_type offset,
|
bfd_size_type note_offset,
|
||||||
|
bfd_size_type desc2_offset,
|
||||||
int reloc_type,
|
int reloc_type,
|
||||||
bfd_vma addend,
|
bfd_vma addend,
|
||||||
char * note)
|
char * note)
|
||||||
@ -1902,7 +1904,7 @@ create_note_reloc (segT sec,
|
|||||||
reloc->u.b.sec = sec;
|
reloc->u.b.sec = sec;
|
||||||
reloc->u.b.s = symbol_get_bfdsym (sym);
|
reloc->u.b.s = symbol_get_bfdsym (sym);
|
||||||
reloc->u.b.r.sym_ptr_ptr = & reloc->u.b.s;
|
reloc->u.b.r.sym_ptr_ptr = & reloc->u.b.s;
|
||||||
reloc->u.b.r.address = offset;
|
reloc->u.b.r.address = note_offset + desc2_offset;
|
||||||
reloc->u.b.r.addend = addend;
|
reloc->u.b.r.addend = addend;
|
||||||
reloc->u.b.r.howto = bfd_reloc_type_lookup (stdoutput, reloc_type);
|
reloc->u.b.r.howto = bfd_reloc_type_lookup (stdoutput, reloc_type);
|
||||||
|
|
||||||
@ -1927,12 +1929,12 @@ create_note_reloc (segT sec,
|
|||||||
if (target_big_endian)
|
if (target_big_endian)
|
||||||
{
|
{
|
||||||
if (bfd_arch_bits_per_address (stdoutput) <= 32)
|
if (bfd_arch_bits_per_address (stdoutput) <= 32)
|
||||||
note[offset + 3] = addend;
|
note[desc2_offset + 3] = addend;
|
||||||
else
|
else
|
||||||
note[offset + 7] = addend;
|
note[desc2_offset + 7] = addend;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
note[offset] = addend;
|
note[desc2_offset] = addend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2035,10 +2037,10 @@ maybe_generate_build_notes (void)
|
|||||||
memcpy (note + 12, "GA$3a1", 8);
|
memcpy (note + 12, "GA$3a1", 8);
|
||||||
|
|
||||||
/* Create a relocation to install the start address of the note... */
|
/* Create a relocation to install the start address of the note... */
|
||||||
create_note_reloc (sec, sym, total_size + 20, desc_reloc, 0, note);
|
create_note_reloc (sec, sym, total_size, 20, desc_reloc, 0, note);
|
||||||
|
|
||||||
/* ...and another one to install the end address. */
|
/* ...and another one to install the end address. */
|
||||||
create_note_reloc (sec, sym, total_size + desc2_offset, desc_reloc,
|
create_note_reloc (sec, sym, total_size, desc2_offset, desc_reloc,
|
||||||
bfd_get_section_size (bsym->section),
|
bfd_get_section_size (bsym->section),
|
||||||
note);
|
note);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user