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: ld/3015: -z relro may create PT_NULL segment


This patch will remove the PT_NULL segment created by -z relro. I will
add a testcase later.


H.J.
----
bfd/

2006-08-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3015
	* elf.c (assign_file_positions_for_non_load_sections): Change
	the unused PT_GNU_RELRO segment to PT_LOAD segment instead of
	PT_NULL.

--- binutils/bfd/elf.c.relro	2006-08-09 12:41:05.000000000 -0700
+++ binutils/bfd/elf.c	2006-08-14 17:35:51.000000000 -0700
@@ -4774,7 +4774,9 @@ assign_file_positions_for_non_load_secti
 	      else
 		{
 		  memset (p, 0, sizeof *p);
-		  p->p_type = PT_NULL;
+		  /* elf_modify_segment_map will delete empty PT_LOAD
+		     segments.  */
+		  p->p_type = PT_LOAD;
 		}
 	    }
 	}


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