This is the mail archive of the binutils@sourceware.cygnus.com 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]

Re: PATCH for elf.sc


>>>>> "Ian" == Ian Lance Taylor <ian@zembu.com> writes:

    Ian> Yes, we probably care.  If the SGI linker consistently puts
    Ian> the .rodata section in the data segment, and the SGI dynamic
    Ian> linker does not support DT_TEXTREL, then the GNU linker
    Ian> should probably do the same as the SGI linker.

I agree.  If for no other reason to support linking of GCC and SGI CC
compiled code.

    Ian> It would be best to only do it for SGI, though, and not for,
    Ian> say, MIPS GNU/Linux.

Naturally.  Here's a variant on my original patch, to deal with the
nested braces.  I put this in.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

1999-06-20  Mark Mitchell  <mark@codesourcery.com>

	* scripttempl/elf.sc (WRITABLE_RODATA): New variable for
	controlling whether or not .rodata is in the data segment or the
	text segment.

Index: elf.sc
===================================================================
RCS file: /cvs/binutils/binutils/ld/scripttempl/elf.sc,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 elf.sc
--- elf.sc	1999/05/03 07:29:08	1.1.1.1
+++ elf.sc	1999/06/21 20:08:12
@@ -25,6 +25,7 @@
 #	SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
 #		start address of shared library.
 #	INPUT_FILES - INPUT command of files to always include
+#	WRITABLE_RODATA - if set, the .rodata section should be writable
 #
 # When adding sections, do note that the names of some sections are used
 # when specifying the start address of the next.
@@ -40,7 +41,7 @@ test "$LD_FLAG" = "N" && DATA_ADDR=.
 INTERP=".interp   ${RELOCATING-0} : { *(.interp) 	}"
 PLT=".plt    ${RELOCATING-0} : { *(.plt)	}"
 DYNAMIC=".dynamic     ${RELOCATING-0} : { *(.dynamic) }"
-
+RODATA=".rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r*)} }"
 CTOR=".ctors ${CONSTRUCTING-0} : 
   {
     ${CONSTRUCTING+${CTOR_START}}
@@ -180,12 +181,7 @@ SECTIONS
   ${RELOCATING+_etext = .;}
   ${RELOCATING+PROVIDE (etext = .);}
   .fini    ${RELOCATING-0} : { KEEP (*(.fini))		} =${NOP-0}
-  .rodata  ${RELOCATING-0} :
-  {
-    *(.rodata)
-    ${RELOCATING+*(.rodata.*)}
-    ${RELOCATING+*(.gnu.linkonce.r*)}
-  }
+  ${WRITABLE_RODATA-${RODATA}}
   .rodata1 ${RELOCATING-0} : { *(.rodata1) }
   ${RELOCATING+${OTHER_READONLY_SECTIONS}}
 
@@ -205,6 +201,7 @@ SECTIONS
   .data1 ${RELOCATING-0} : { *(.data1) }
   .eh_frame : { *(.eh_frame) }
   .gcc_except_table : { *(.gcc_except_table) }
+  ${WRITABLE_RODATA+${RODATA}}
   ${RELOCATING+${OTHER_READWRITE_SECTIONS}}
   ${RELOCATING+${CTOR}}
   ${RELOCATING+${DTOR}}

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