mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 09:38:57 +00:00
Don't merge notes when the relocs associated with them cannot be reliably deleted.
* objcopy.c (merge_gnu_build_notes): Disable merge if there are more internal relocs than external relocs.
This commit is contained in:
@@ -2137,6 +2137,13 @@ merge_gnu_build_notes (bfd * abfd, asection * sec, bfd_size_type size, bfd_byte
|
||||
relcount = 0;
|
||||
}
|
||||
|
||||
/* A few targets (eg MIPS, SPARC) create multiple internal relocs to
|
||||
represent a single external reloc. Unfortunately the current BFD
|
||||
API does not handle deleting relocs in such situations very well
|
||||
and so it is unsafe to proceed. */
|
||||
if (relcount > sec->reloc_count)
|
||||
goto done;
|
||||
|
||||
/* Eliminate the duplicates. */
|
||||
new = new_contents = xmalloc (size);
|
||||
for (pnote = pnotes, old = contents;
|
||||
|
||||
Reference in New Issue
Block a user