PERFORCE change 55138 for review
Juli Mallett
jmallett at FreeBSD.org
Thu Jun 17 06:57:40 GMT 2004
http://perforce.freebsd.org/chv.cgi?CH=55138
Change 55138 by jmallett at jmallett_oingo on 2004/06/17 06:57:10
Screw the world and switch over to 64-bit ELF. Now I have to do
loader, using 32-bit code for elf32, because of braindamage to BU.
I'd really rather be doing N32 Elf trad binaries and let GAS let me
use 64-bit code without whining... I'd really like to do that. But
instead, in order to keep using 64-bit longs and pointers with the
C compiler, pacify the lower toolchain and switch to Elf64 - still
trad mips though, now that I've figured out *that* mess.
So now, without a loader, this won't produce something useful for
real hardware, and I won't compromise on being a 64-bit-execution-only
port.
Tempting to go ahead and switch to XKPHYS, with loader running 32-bit
anyway. But then that'd break systems with 32-bit ARCS. Maybe I
should just decide I don't care, except that all the systems I have
but 1 are 32-bit ARCS.
Affected files ...
.. //depot/projects/mips/contrib/gcc/config/mips/freebsd.h#13 edit
.. //depot/projects/mips/gnu/usr.bin/binutils/as/mips-freebsd/config.h#6 edit
.. //depot/projects/mips/gnu/usr.bin/binutils/ld/Makefile.mips#9 edit
.. //depot/projects/mips/gnu/usr.bin/binutils/libbfd/Makefile.mips#12 edit
.. //depot/projects/mips/sys/conf/Makefile.mips#15 edit
.. //depot/projects/mips/sys/conf/ldscript.mips#5 edit
.. //depot/projects/mips/sys/mips/conf/INDY#14 edit
Differences ...
==== //depot/projects/mips/contrib/gcc/config/mips/freebsd.h#13 (text+ko) ====
==== //depot/projects/mips/gnu/usr.bin/binutils/as/mips-freebsd/config.h#6 (text+ko) ====
@@ -165,13 +165,13 @@
#define MIPS_CPU_STRING_DEFAULT "from-abi"
/* Allow use of E_MIPS_ABI_O32 on MIPS targets. */
-#define USE_E_MIPS_ABI_O32 1
+#define USE_E_MIPS_ABI_O32 0
/* Generate 64-bit code by default on MIPS targets. */
#define MIPS_DEFAULT_64BIT 1
/* Choose a default ABI for MIPS targets. */
-#define MIPS_DEFAULT_ABI N32_ABI
+#define MIPS_DEFAULT_ABI N64_ABI
/* Default architecture. */
#define DEFAULT_ARCH "mips3"
==== //depot/projects/mips/gnu/usr.bin/binutils/ld/Makefile.mips#9 (text+ko) ====
@@ -3,7 +3,7 @@
TARGET_TUPLE= mips-jmallett-freebsd
.if ${TARGET_ARCH} == "mips"
-DEFAULT_EMULATION= elf32btsmip
+DEFAULT_EMULATION?= elf64btsmip
EMULATIONS= elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip
HOST= ${TARGET_TUPLE}
==== //depot/projects/mips/gnu/usr.bin/binutils/libbfd/Makefile.mips#12 (text+ko) ====
@@ -1,6 +1,6 @@
# $FreeBSD$
-DEFAULT_VECTOR?= bfd_elf32_ntradbigmips_vec
+DEFAULT_VECTOR?= bfd_elf64_tradbigmips_vec
SRCS+= cpu-mips.c \
ecofflink.c \
==== //depot/projects/mips/sys/conf/Makefile.mips#15 (text+ko) ====
==== //depot/projects/mips/sys/conf/ldscript.mips#5 (text+ko) ====
@@ -1,64 +1,126 @@
/* $FreeBSD$ */
-/* Default linker script, for normal executables */
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", "elf64-tradlittlemips")
OUTPUT_ARCH(mips)
ENTRY(start)
-SEARCH_DIR("/usr/lib");
/* Do we need any of these for elf?
__DYNAMIC = 0; */
SECTIONS
{
- /* Read-only sections, merged into text segment. Assumes the
- kernel Makefile sets the start address via -Ttext. */
- .text :
+ /* Read-only sections, merged into text segment: */
+ .MIPS.options : { *(.MIPS.options) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .text :
{
_ftext = . ;
- *(.text)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} =0
- _etext = .;
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
PROVIDE (etext = .);
- .rodata : { *(.rodata) }
- .reginfo : { *(.reginfo) }
-/* . = . + 0x1000; */
- .data :
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN(0x100000) + (. & (0x100000 - 1));
+ .data :
{
_fdata = . ;
- *(.data)
- CONSTRUCTORS
+ *(.data .data.* .gnu.linkonce.d.*)
}
+ .data1 : { *(.data1) }
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .eh_frame : { KEEP (*(.eh_frame)) }
+ .jcr : { KEEP (*(.jcr)) }
_gp = ALIGN(16) + 0x7ff0;
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
- .sdata : { *(.sdata) }
- _edata = .;
+ .got : { *(.got.plt) *(.got) }
+ .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .;
PROVIDE (edata = .);
__bss_start = .;
_fbss = .;
- .sbss : { *(.sbss) *(.scommon) }
- .bss :
+ .sbss :
+ {
+ PROVIDE (__sbss_start = .);
+ PROVIDE (___sbss_start = .);
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ PROVIDE (__sbss_end = .);
+ PROVIDE (___sbss_end = .);
+ }
+ .bss :
{
- *(.bss)
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections. */
+ . = ALIGN(64 / 8);
}
- _end = . ;
+ . = ALIGN(64 / 8);
+ _end = .;
PROVIDE (end = .);
- /* These are needed for ELF backends which have not yet been
- converted to the new style linker. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
/* DWARF debug sections.
- Symbols in the .debug DWARF section are relative to the beginning of the
- section so we begin .debug at 0. It's not clear yet what needs to happen
- for the others. */
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
.debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- .line 0 : { *(.line) }
- /* These must appear regardless of . */
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) }
}
==== //depot/projects/mips/sys/mips/conf/INDY#14 (text+ko) ====
@@ -12,7 +12,7 @@
makeoptions MIPSOPTS=-mips3 #Build for a MIPS III
-makeoptions TEXTADDR=0x88069000 #Indy
+makeoptions TEXTADDR=0xFFFFFFFF88069000 #Indy
# Platform support
platform sgimips #SGI MIPS systems.
More information about the p4-projects
mailing list