- internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, NULL, (Elf_Internal_Rela *) NULL,
- link_info->keep_memory));
+ /* Note - we ignore the setting of link_info->keep_memory when reading
+ in these relocs. We have to maintain a permanent copy of the relocs
+ because we are going to walk over them multiple times, adjusting them
+ as bytes are deleted from the section, and with this relaxation
+ function itself being called multiple times on the same section... */
+ internal_relocs = _bfd_elf_link_read_relocs
+ (abfd, sec, NULL, (Elf_Internal_Rela *) NULL, TRUE);