Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib The "objcopy" based crunchide method has a problem o...



details:   https://anonhg.NetBSD.org/src/rev/c931ebe8963a
branches:  trunk
changeset: 526034:c931ebe8963a
user:      tv <tv%NetBSD.org@localhost>
date:      Tue Apr 23 19:53:10 2002 +0000

description:
The "objcopy" based crunchide method has a problem on MIPS; it turns global
symbols into locals, but relocs are left in place (rather than attempting
to resolve-in-place with "ld -r", even with "-Bsymbolic").

Standard MIPS code will generate CALL16 relocs for function calls, but
the linker forbids such relocs from being used to call local symbols (such
as those turned "local" by objcopy).  So, rather than battle the toolchain
uphill, work around it for the moment by forcing 32-bit GOT references with
the assembler option "-xgot".

This will be fixed in a more clean manner in the future.

diffstat:

 distrib/arc/ramdisk/Makefile               |  6 +++---
 distrib/hpcmips/miniroot/Makefile.inc      |  4 +++-
 distrib/mipsco/ramdisk/Makefile            |  5 +++--
 distrib/newsmips/floppies/ramdisk/Makefile |  4 ++--
 distrib/playstation2/miniroot/Makefile.inc |  4 +++-
 distrib/pmax/miniroot/Makefile.inc         |  4 +++-
 distrib/pmax/ramdisk/Makefile              |  5 +++--
 7 files changed, 20 insertions(+), 12 deletions(-)

diffs (114 lines):

diff -r feb3de59891a -r c931ebe8963a distrib/arc/ramdisk/Makefile
--- a/distrib/arc/ramdisk/Makefile      Tue Apr 23 19:48:41 2002 +0000
+++ b/distrib/arc/ramdisk/Makefile      Tue Apr 23 19:53:10 2002 +0000
@@ -1,14 +1,14 @@
-#      $NetBSD: Makefile,v 1.3 2002/04/14 12:52:15 tsutsui Exp $
+#      $NetBSD: Makefile,v 1.4 2002/04/23 19:53:11 tv Exp $
 
 .include <bsd.own.mk>
 .include "${_SRC_TOP_}/distrib/Makefile.inc"
 
 IMAGE=         ramdisk.fs
-IMAGESIZE=     2048k
+IMAGESIZE=     3m
 MAKEFS_FLAGS=  -f 15
 
 WARNS=         1
-DBG=           -Os -mmemcpy
+DBG=           -Os -mmemcpy -Wa,-xgot # XXX -xgot workaround for objcopy-crunchide
 
 CRUNCHBIN=     ramdiskbin
 CRUNCHGEN_FLAGS= -d "${DBG}"
diff -r feb3de59891a -r c931ebe8963a distrib/hpcmips/miniroot/Makefile.inc
--- a/distrib/hpcmips/miniroot/Makefile.inc     Tue Apr 23 19:48:41 2002 +0000
+++ b/distrib/hpcmips/miniroot/Makefile.inc     Tue Apr 23 19:53:10 2002 +0000
@@ -1,4 +1,6 @@
-#      $NetBSD: Makefile.inc,v 1.9 2002/04/01 12:16:11 lukem Exp $
+#      $NetBSD: Makefile.inc,v 1.10 2002/04/23 19:53:12 tv Exp $
+
+DBG=           -Os -Wa,-xgot # XXX -xgot workaround for objcopy-crunchide
 
 IMAGESIZE=     4m
 MAKEFS_FLAGS=  -o density=2k
diff -r feb3de59891a -r c931ebe8963a distrib/mipsco/ramdisk/Makefile
--- a/distrib/mipsco/ramdisk/Makefile   Tue Apr 23 19:48:41 2002 +0000
+++ b/distrib/mipsco/ramdisk/Makefile   Tue Apr 23 19:53:10 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.9 2002/04/12 06:02:36 lukem Exp $
+#      $NetBSD: Makefile,v 1.10 2002/04/23 19:53:10 tv Exp $
 
 .include <bsd.own.mk>
 .include "${_SRC_TOP_}/distrib/Makefile.inc"
@@ -9,9 +9,10 @@
 MAKEFS_FLAGS=  -f 15
 
 WARNS=         1
-DBG=           -Os
+DBG=           -Os -Wa,-xgot # XXX -xgot workaround for objcopy-crunchide
 
 CRUNCHBIN=     ramdiskbin
+CRUNCHGEN_FLAGS= -d "${DBG}"
 LISTS=         ${.CURDIR}/list ${DISTRIBDIR}/common/list.sysinst
 MTREECONF=     ${DISTRIBDIR}/common/mtree.common
 IMAGEENDIAN=   be
diff -r feb3de59891a -r c931ebe8963a distrib/newsmips/floppies/ramdisk/Makefile
--- a/distrib/newsmips/floppies/ramdisk/Makefile        Tue Apr 23 19:48:41 2002 +0000
+++ b/distrib/newsmips/floppies/ramdisk/Makefile        Tue Apr 23 19:53:10 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.21 2002/04/14 07:14:44 tsutsui Exp $
+#      $NetBSD: Makefile,v 1.22 2002/04/23 19:53:11 tv Exp $
 
 .include <bsd.own.mk>
 .include "${_SRC_TOP_}/distrib/Makefile.inc"
@@ -8,7 +8,7 @@
 MAKEFS_FLAGS=  -f 15
 
 WARNS=         1
-DBG=           -Os -mmemcpy
+DBG=           -Os -mmemcpy -Wa,-xgot # XXX -xgot workaround for objcopy-crunchide
 
 CRUNCHBIN=     ramdiskbin
 CRUNCHGEN_FLAGS= -d "${DBG}"
diff -r feb3de59891a -r c931ebe8963a distrib/playstation2/miniroot/Makefile.inc
--- a/distrib/playstation2/miniroot/Makefile.inc        Tue Apr 23 19:48:41 2002 +0000
+++ b/distrib/playstation2/miniroot/Makefile.inc        Tue Apr 23 19:53:10 2002 +0000
@@ -1,4 +1,6 @@
-#      $NetBSD: Makefile.inc,v 1.6 2002/04/01 12:16:13 lukem Exp $
+#      $NetBSD: Makefile.inc,v 1.7 2002/04/23 19:53:12 tv Exp $
+
+DBG=           -Os -Wa,-xgot # XXX -xgot workaround for objcopy-crunchide
 
 IMAGESIZE=     5m
 MAKEFS_FLAGS=  -o density=2k
diff -r feb3de59891a -r c931ebe8963a distrib/pmax/miniroot/Makefile.inc
--- a/distrib/pmax/miniroot/Makefile.inc        Tue Apr 23 19:48:41 2002 +0000
+++ b/distrib/pmax/miniroot/Makefile.inc        Tue Apr 23 19:53:10 2002 +0000
@@ -1,4 +1,6 @@
-#      $NetBSD: Makefile.inc,v 1.9 2002/04/12 03:21:11 lukem Exp $
+#      $NetBSD: Makefile.inc,v 1.10 2002/04/23 19:53:12 tv Exp $
+
+DBG=           -Os -Wa,-xgot # XXX -xgot workaround for objcopy-crunchide
 
 IMAGESIZE=     32m
 MAKEFS_FLAGS=  -f 15
diff -r feb3de59891a -r c931ebe8963a distrib/pmax/ramdisk/Makefile
--- a/distrib/pmax/ramdisk/Makefile     Tue Apr 23 19:48:41 2002 +0000
+++ b/distrib/pmax/ramdisk/Makefile     Tue Apr 23 19:53:10 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.26 2002/04/12 05:15:18 lukem Exp $
+#      $NetBSD: Makefile,v 1.27 2002/04/23 19:53:12 tv Exp $
 
 .include <bsd.own.mk>
 .include "${_SRC_TOP_}/distrib/Makefile.inc"
@@ -9,9 +9,10 @@
 MAKEFS_FLAGS=  -f 15
 
 WARNS=         1
-DBG=           -Os
+DBG=           -Os -Wa,-xgot # XXX -xgot workaround for objcopy-crunchide
 
 CRUNCHBIN=     ramdiskbin
+CRUNCHGEN_FLAGS= -d "${DBG}"
 LISTS=         ${.CURDIR}/list ${DISTRIBDIR}/common/list.sysinst
 MTREECONF=     ${DISTRIBDIR}/common/mtree.common
 IMAGEENDIAN=   le



Home | Main Index | Thread Index | Old Index