Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jun 2010 16:30:47 +0530
From:      "Jayachandran C." <c.jayachandran@gmail.com>
To:        Juli Mallett <jmallett@freebsd.org>, freebsd-mips@freebsd.org,  Randall Stewart <rrs@lakerest.net>
Subject:   Some fixes to the mips64 merge so far.
Message-ID:  <AANLkTiliCPJ4kek7PkGiy-d1zWKGiurNxydNYgOXpHEQ@mail.gmail.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]
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.

[-- Attachment #2 --]
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)
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTiliCPJ4kek7PkGiy-d1zWKGiurNxydNYgOXpHEQ>