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]

Re: [3/21] Keep .text, .data and .bss on AIX


Hi Richard,

ld/
	* emultempl/aix.em (gld${EMULATION_NAME}_before_allocation): Mark
	.text, .data and .bss output sections as SEC_KEEP.

ld/testsuite/
	* ld-powerpc/aix-core-sec-1.s, ld-powerpc/aix-core-sec-1.ex,
	ld-powerpc/aix-core-sec-1.hd, ld-powerpc/aix-core-sec-2.s,
	ld-powerpc/aix-core-sec-2.ex, ld-powerpc/aix-core-sec-2.hd,
	ld-powerpc/aix-core-sec-3.s, ld-powerpc/aix-core-sec-3.ex,
	ld-powerpc/aix-core-sec-3.hd: New tests.
	* ld-powerpc/aix52.exp: New harness.

Approved - please apply, but ...


+  /* We must always have .text, .data and .bss output sections, so that
+     the header can refer to them.  The kernel refuses to load shared
+     objects that have missing sections.  */
+  for (i = 0; i < ARRAY_SIZE (must_keep_sections); i++)
+    {
+      asection *sec;
+
+      sec = bfd_get_section_by_name (link_info.output_bfd,
+				     must_keep_sections[i]);
+      if (sec)
+	sec->flags |= SEC_KEEP;
+    }

Should a warning be issued if one of these must-keep sections cannot be found ? Presumably this would only matter if they are missing in the output bfd (and the bfd is an executabe or shared library) so maybe this is not the right place for such a test.


Cheers
  Nick


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