ld/
[deliverable/binutils-gdb.git] / ld / emulparams / elf32bmipn32-defs.sh
index 6933dbfec892fa3990d7a3d4e5ef584f8ce7c98e..4c9834057be0c9896aae67f7384a483bbb2b1209 100644 (file)
@@ -11,13 +11,39 @@ BIG_OUTPUT_FORMAT="elf32-bigmips"
 LITTLE_OUTPUT_FORMAT="elf32-littlemips"
 
 TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=mipself
+
+case "$EMULATION_NAME" in
+elf32*n32*) ELFSIZE=32 ;;
+elf64*) ELFSIZE=64 ;;
+*) echo $0: unhandled emulation $EMULATION_NAME >&2; exit 1 ;;
+esac
+
+if test `echo "$host" | sed -e s/64//` = `echo "$target" | sed -e s/64//`; then
+  case " $EMULATION_LIBPATH " in
+    *" ${EMULATION_NAME} "*)
+      NATIVE=yes
+      ;;
+  esac
+fi
+
+# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
+LIBPATH_SUFFIX=$ELFSIZE
+
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
 
 TEXT_START_ADDR=0x10000000
-MAXPAGESIZE=0x100000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
 ENTRY=__start
 
 # GOT-related settings.  
+# If the output has a GOT section, there must be exactly 0x7ff0 bytes
+# between .got and _gp.  The ". = ." below stops the orphan code from
+# inserting other sections between the assignment to _gp and the start
+# of .got.
 OTHER_GOT_SYMBOLS='
+  . = .;
   _gp = ALIGN(16) + 0x7ff0;
 '
 OTHER_SDATA_SECTIONS="
@@ -30,42 +56,10 @@ OTHER_SDATA_SECTIONS="
 TEXT_START_SYMBOLS='_ftext = . ;'
 DATA_START_SYMBOLS='_fdata = . ;'
 OTHER_BSS_SYMBOLS='_fbss = .;'
-# IRIX6 defines these symbols.  0x34 is the size of the ELF header.
-EXECUTABLE_SYMBOLS="
-  __dso_displacement = 0;
-  __elf_header = ${TEXT_START_ADDR};
-  __program_header_table = ${TEXT_START_ADDR} + 0x34;
-"
 
-# There are often dynamic relocations against the .rodata section.
-# Setting DT_TEXTREL in the .dynamic section does not convince the
-# IRIX6 linker to permit relocations against the text segment.
-# Following the IRIX linker, we simply put .rodata in the data
-# segment.
-WRITABLE_RODATA=
+INITIAL_READONLY_SECTIONS=".MIPS.options : { *(.MIPS.options) }"
+# Discard any .MIPS.content* or .MIPS.events* sections.  The linker
+# doesn't know how to adjust them.
+OTHER_SECTIONS="/DISCARD/ : { *(.MIPS.content*) *(.MIPS.events*) }"
 
-OTHER_SECTIONS="
-  .MIPS.events.text ${RELOCATING-0} :
-    {
-       *(.MIPS.events.text${RELOCATING+ .MIPS.events.gnu.linkonce.t*})
-    }
-  .MIPS.content.text ${RELOCATING-0} : 
-    {
-       *(.MIPS.content.text${RELOCATING+ .MIPS.content.gnu.linkonce.t*})
-    }
-  .MIPS.events.data ${RELOCATING-0} :
-    {
-       *(.MIPS.events.data${RELOCATING+ .MIPS.events.gnu.linkonce.d*})
-    }
-  .MIPS.content.data ${RELOCATING-0} :
-    {
-       *(.MIPS.content.data${RELOCATING+ .MIPS.content.gnu.linkonce.d*})
-    }
-  .MIPS.events.rodata ${RELOCATING-0} :
-    {
-       *(.MIPS.events.rodata${RELOCATING+ .MIPS.events.gnu.linkonce.r*})
-    }
-  .MIPS.content.rodata ${RELOCATING-0} :
-    {
-       *(.MIPS.content.rodata${RELOCATING+ .MIPS.content.gnu.linkonce.r*})
-    }"
+TEXT_DYNAMIC=
This page took 0.02508 seconds and 4 git commands to generate.