This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] IA-64: Fix linker error with --no-keep-memory.


Fixes for the --no-keep-memory bug reported in PR 15904.  Setting the changed_*
vars prevents us from freeing modified memory.

Tested with binutils, gas, and ld make check.  There were no regressions.

Committed.

Jim

	bfd/
	PR 15904
	* elfnn-ia64.c (elfNN_ia64_relax_section): After ia64_elf_relax_brl
	call, set changed_contents and changed_relocs.  Likewise after
	successful ia64_elf_relax_br call.
---
 bfd/elfnn-ia64.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
index 595316dc11..84b1af1456 100644
--- a/bfd/elfnn-ia64.c
+++ b/bfd/elfnn-ia64.c
@@ -593,6 +593,9 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec,
 		     1, change it to slot 2.  */
 		  if ((irel->r_offset & 3) == 1)
 		    irel->r_offset += 1;
+
+		  changed_contents = TRUE;
+		  changed_relocs = TRUE;
 		}
 
 	      continue;
@@ -607,6 +610,9 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec,
 
 	      /* Make the relocation offset point to slot 1.  */
 	      irel->r_offset = (irel->r_offset & ~((bfd_vma) 0x3)) + 1;
+
+	      changed_contents = TRUE;
+	      changed_relocs = TRUE;
 	      continue;
 	    }
 
-- 
2.14.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]