Re: PR16005, avr linker crash on a particular instruction sequence with --relax
authorAlan Modra <amodra@gmail.com>
Fri, 29 Jul 2022 13:05:13 +0000 (22:35 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 29 Jul 2022 13:58:04 +0000 (23:28 +0930)
commit10948fb9fd66c029d59c97e04556ab827076336c
tree279c693318eea5eab01c98ebe5035e4fd6627b78
parent76a4c1e063fabb45d15597a6dd17813e92875a43
Re: PR16005, avr linker crash on a particular instruction sequence with --relax

The last patch wasn't so clever.  The contents in fact have already
been read, just not cached where relax_delete_bytes expects them.
relax_delete_bytes also modifies relocs and syms, so they should be
cached too.

PR 16005
* elf32-avr.c (elf32_avr_relax_delete_bytes): Revert last change.
(elf32_avr_relax_section): Cache contents, relocs and syms
before calling relax_delete_bytes.
bfd/elf32-avr.c