Some fixes to the mips64 merge so far.
Jayachandran C.
c.jayachandran at gmail.com
Thu Jun 24 11:00:48 UTC 2010
I'm resending this patch as it has been updated, this has the following fixes.
lib/libc/mips/sys/brk.S
lib/libc/mips/sys/sbrk.S
- use PTR_WORD for __curbrk and minbrk instead of .word, these have
to be 64-bit on n64
gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh
gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh
- add an alignment of 8 for sections. The default alignment of of 4
for n32 causes _end to be word aligned, which will be returned by
sbrk(). This will make the current implementation of malloc to crash.
I've reported this, but meantime this is probably a safe change.
Let me know if there are any comments.
Thanks,
JC.
-------------- next part --------------
Index: gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh
===================================================================
--- gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh (revision 209500)
+++ gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh (working copy)
@@ -2,3 +2,4 @@
. ${srcdir}/emulparams/elf32btsmipn32.sh
. ${srcdir}/emulparams/elf_fbsd.sh
GENERATE_PIE_SCRIPT=yes
+ALIGNMENT=8
Index: gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh
===================================================================
--- gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh (revision 209500)
+++ gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh (working copy)
@@ -2,3 +2,4 @@
. ${srcdir}/emulparams/elf32ltsmipn32.sh
. ${srcdir}/emulparams/elf_fbsd.sh
GENERATE_PIE_SCRIPT=yes
+ALIGNMENT=8
Index: lib/libc/mips/sys/brk.S
===================================================================
--- lib/libc/mips/sys/brk.S (revision 209500)
+++ lib/libc/mips/sys/brk.S (working copy)
@@ -47,7 +47,7 @@
.data
_C_LABEL(minbrk):
- .word _C_LABEL(_end)
+ PTR_WORD _C_LABEL(_end)
.text
LEAF(__sys_brk)
Index: lib/libc/mips/sys/sbrk.S
===================================================================
--- lib/libc/mips/sys/sbrk.S (revision 209500)
+++ lib/libc/mips/sys/sbrk.S (working copy)
@@ -46,7 +46,7 @@
.data
_C_LABEL(__curbrk):
- .word _C_LABEL(_end)
+ PTR_WORD _C_LABEL(_end)
.text
LEAF(__sys_sbrk)
More information about the freebsd-mips
mailing list