]> Cypherpunks repositories - gostls13.git/commitdiff
rename libmach_amd64 libmach
authorRob Pike <r@golang.org>
Fri, 14 Aug 2009 17:46:04 +0000 (10:46 -0700)
committerRob Pike <r@golang.org>
Fri, 14 Aug 2009 17:46:04 +0000 (10:46 -0700)
R=rsc
OCL=33273
CL=33276

32 files changed:
include/mach.h [moved from include/mach_amd64.h with 97% similarity]
src/clean.bash
src/cmd/ar/Makefile
src/cmd/ar/ar.c
src/cmd/cov/Makefile
src/cmd/cov/main.c
src/cmd/nm/Makefile
src/cmd/nm/nm.c
src/cmd/prof/Makefile
src/cmd/prof/main.c
src/libmach/5obj.c [moved from src/libmach_amd64/5obj.c with 99% similarity]
src/libmach/6.c [moved from src/libmach_amd64/6.c with 99% similarity]
src/libmach/6obj.c [moved from src/libmach_amd64/6obj.c with 99% similarity]
src/libmach/8.c [moved from src/libmach_amd64/8.c with 99% similarity]
src/libmach/8db.c [moved from src/libmach_amd64/8db.c with 99% similarity]
src/libmach/8obj.c [moved from src/libmach_amd64/8obj.c with 99% similarity]
src/libmach/Makefile [moved from src/libmach_amd64/Makefile with 86% similarity]
src/libmach/access.c [moved from src/libmach_amd64/access.c with 99% similarity]
src/libmach/darwin.c [moved from src/libmach_amd64/darwin.c with 99% similarity]
src/libmach/elf.h [moved from src/libmach_amd64/elf.h with 100% similarity]
src/libmach/executable.c [moved from src/libmach_amd64/executable.c with 98% similarity]
src/libmach/fakeobj.c [moved from src/libmach_amd64/fakeobj.c with 97% similarity]
src/libmach/linux.c [moved from src/libmach_amd64/linux.c with 99% similarity]
src/libmach/machdata.c [moved from src/libmach_amd64/machdata.c with 99% similarity]
src/libmach/macho.h [moved from src/libmach_amd64/macho.h with 100% similarity]
src/libmach/map.c [moved from src/libmach_amd64/map.c with 99% similarity]
src/libmach/obj.c [moved from src/libmach_amd64/obj.c with 99% similarity]
src/libmach/obj.h [moved from src/libmach_amd64/obj.h with 100% similarity]
src/libmach/setmach.c [moved from src/libmach_amd64/setmach.c with 99% similarity]
src/libmach/swap.c [moved from src/libmach_amd64/swap.c with 100% similarity]
src/libmach/sym.c [moved from src/libmach_amd64/sym.c with 99% similarity]
src/make.bash

similarity index 97%
rename from include/mach_amd64.h
rename to include/mach.h
index f99924bbc5b7434610db8f5e79d2f1abf0b7f6dd..5b1ce7b3a9b3441aac2db4bc98ab2f7ce6dcf779 100644 (file)
 
 /*
  *     Architecture-dependent application data
- *     This is just Plan 9's mach.h, tweaked to support only amd64 for now.
  */
-/*
- * Start of Plan 9 a.out.h
- * Don't use system a.out; instead just lay in the Plan 9 one for now.
- */
-/*
-#include "a.out.h"
-*/
 
 typedef        struct  Exec    Exec;
 struct Exec
@@ -87,10 +79,6 @@ struct       Sym
        vlong   gotype;
        int     sequence;       // order in file
 };
-/*
- * End of Plan 9 a.out.h
- * Don't use system a.out; instead just lay in the Plan 9 one for now.
- */
 
 
 /*
index e67fe1403517edf154279425a4963699b9adde84..cf29029517006b06e6e73610c7e583a7dd7ce0f4 100755 (executable)
@@ -5,7 +5,7 @@
 
 rm -rf $GOROOT/pkg/[0-9a-zA-Z_]*
 rm -f $GOROOT/lib/*.[6a]
-for i in lib9 libbio libmach_amd64 libregexp cmd pkg
+for i in lib9 libbio libmach libregexp cmd pkg
 do
        cd $i
        case $i in
index b6999aa37a458d494b55503005cedf46ab468f12..f0e51afdd493b356b16076aa6df8e016b115c711 100644 (file)
@@ -13,7 +13,7 @@ OFILES=\
        ar.$O\
 
 $(TARG): $(OFILES)
-       $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach_amd64 -lbio -l9
+       $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach -lbio -l9
 
 clean:
        rm -f $(OFILES) $(TARG)
index 880f32986cb8525986a92f91d1fdc73524f22166..a9e16bcc0041ee55237e8021f797ec5da56155af 100644 (file)
@@ -39,7 +39,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 #include <ar.h>
 
 #undef select
index fc98974731b3c77be6ab64099164bb485edb3914..4e02547dcafcd39dedc2d78e16a926b6a7c19ede 100644 (file)
@@ -17,7 +17,7 @@ HFILES=\
        tree.h\
 
 $(TARG): $(OFILES)
-       $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach_amd64 -lregexp9 -lbio -l9
+       $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach -lregexp9 -lbio -l9
 
 clean:
        rm -f $(OFILES) $(TARG)
index 073821e9378655946cb1c19d4d6554898b06410c..294bb149f2ed04a5546c3d42e14af7667e9fc4ca 100644 (file)
@@ -15,7 +15,7 @@
 #include "tree.h"
 
 #include <ureg_amd64.h>
-#include <mach_amd64.h>
+#include <mach.h>
 typedef struct Ureg Ureg;
 
 void
index 8ed55ff3fe0013f33dda01f0bb550aa6745eb545..00d9beebfe4c311694cb97fe4530f57a04c08f63 100644 (file)
@@ -13,7 +13,7 @@ OFILES=\
        nm.$O\
 
 $(TARG): $(OFILES)
-       $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach_amd64 -lbio -l9
+       $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach -lbio -l9
 
 clean:
        rm -f $(OFILES) $(TARG)
index 57e6636a32a96c71a7851bbe73678b7b728cbefa..52a73d64a2002341f16265320e865db5057e1bde 100644 (file)
@@ -1,25 +1,25 @@
 // Inferno utils/nm/nm.c
 // http://code.google.com/p/inferno-os/source/browse/utils/nm/nm.c
-//
-//     Copyright © 1994-1999 Lucent Technologies Inc.  All rights reserved.
-//     Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
-//     Portions Copyright © 1997-1999 Vita Nuova Limited
-//     Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
-//     Portions Copyright © 2004,2006 Bruce Ellis
-//     Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
-//     Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
-//     Portions Copyright © 2009 The Go Authors. All rights reserved.
-//
+// 
+//     Copyright © 1994-1999 Lucent Technologies Inc.  All rights reserved.
+//     Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
+//     Portions Copyright © 1997-1999 Vita Nuova Limited
+//     Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
+//     Portions Copyright © 2004,2006 Bruce Ellis
+//     Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
+//     Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
+//     Portions Copyright © 2009 The Go Authors. All rights reserved.
+// 
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
 // in the Software without restriction, including without limitation the rights
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 // copies of the Software, and to permit persons to whom the Software is
 // furnished to do so, subject to the following conditions:
-//
+// 
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
-//
+// 
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
@@ -35,7 +35,7 @@
 #include <libc.h>
 #include <ar.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 
 enum{
        CHUNK   =       256     /* must be power of 2 */
index 8d785b4aaf35e0d0518739e8ed17a4e7056616ed..193f5896cd5b35bb37bb9b047e6a7c42dd7c7e33 100644 (file)
@@ -17,7 +17,7 @@ OFILES=\
 #      fns.h\
 
 $(TARG): $(OFILES)
-       $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach_amd64 -lbio -l9
+       $(LD) -o $(TARG) -L$(GOROOT)/lib $(OFILES) -lmach -lbio -l9
 
 clean:
        rm -f $(OFILES) $(TARG)
index 7b9213da8ff84f3dfbccb53b65cb92dea8268927..462aab9f6ccec9978afa74157513882e306934f2 100644 (file)
@@ -9,7 +9,7 @@
 #include <ctype.h>
 
 #include <ureg_amd64.h>
-#include <mach_amd64.h>
+#include <mach.h>
 
 char* file = "6.out";
 static Fhdr fhdr;
similarity index 99%
rename from src/libmach_amd64/5obj.c
rename to src/libmach/5obj.c
index 08a7738d2aab7d9a26fb0e87641fd91e48f3598b..034deea2c5fcf1628d30443a677849451c722f45 100644 (file)
@@ -32,7 +32,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 #include "../cmd/5l/5.out.h"
 #include "obj.h"
 
similarity index 99%
rename from src/libmach_amd64/6.c
rename to src/libmach/6.c
index 1d470c37df928360f67de6a4c40115156abcc192..0f0636303efaeaffee42f55cf01867f8c2649645 100644 (file)
@@ -33,7 +33,7 @@
 #include <libc.h>
 #include <bio.h>
 #include "ureg_amd64.h"
-#include <mach_amd64.h>
+#include <mach.h>
 
 #define        REGOFF(x)       offsetof(struct Ureg, x)
 
similarity index 99%
rename from src/libmach_amd64/6obj.c
rename to src/libmach/6obj.c
index 18a12a1709a691b04971e4e2c87f97dbd821ba64..578ae2b5ec8e818307edc31de6dd0cb0dc260489 100644 (file)
@@ -32,7 +32,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 #include "../cmd/6l/6.out.h"
 #include "obj.h"
 
similarity index 99%
rename from src/libmach_amd64/8.c
rename to src/libmach/8.c
index 63c3f98f4cf59d4720d85026fa1a56aff92ca44d..07ec305057bae2170bc9a253364f4118c1fb7520 100644 (file)
@@ -32,7 +32,7 @@
 #include <u.h>
 #include <bio.h>
 #include <ureg_x86.h>
-#include <mach_amd64.h>
+#include <mach.h>
 
 #define        REGOFF(x)       (uintptr)(&((struct Ureg *) 0)->x)
 
similarity index 99%
rename from src/libmach_amd64/8db.c
rename to src/libmach/8db.c
index b73275899e7902640cdd07fb807586f87f1c27cf..0abf77b1061e2623806714f429fe10f4475248e1 100644 (file)
@@ -29,7 +29,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 #define Ureg UregAmd64
 #include <ureg_amd64.h>
 #undef Ureg
@@ -226,7 +226,7 @@ i386trace(Map *map, uvlong pc, uvlong sp, uvlong link, Tracer trace)
                        findsym(pc, CTEXT, &s);
                        (*trace)(map, pc, sp, &s1);             // morestack's caller; caller's caller's PC/SP
                        continue;
-               } 
+               }
 
                if(pc == lessstack) {
                        // ../pkg/runtime/runtime.h
similarity index 99%
rename from src/libmach_amd64/8obj.c
rename to src/libmach/8obj.c
index e513cf9ebf2c9b83707adf2a0d1ee3f3940bf533..f8ca1c4c394f3cf777afade073ec3215f2a0bd31 100644 (file)
@@ -32,7 +32,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 #include "../cmd/8l/8.out.h"
 #include "obj.h"
 
similarity index 86%
rename from src/libmach_amd64/Makefile
rename to src/libmach/Makefile
index 66c6e29f29e207649fd86f4280f92d1ce8d26c04..4a5e3405fc3596e6b30add96358b3f4a44e3c23a 100644 (file)
@@ -28,7 +28,7 @@
 
 include ../Make.conf
 
-LIB=libmach_amd64.a
+LIB=libmach.a
 OFILES=\
        executable.$O\
        fakeobj.$O\
@@ -46,32 +46,8 @@ OFILES=\
        6obj.$O\
        8obj.$O\
        $(GOOS).$O\
-#      v.$O\
-#      k.$O\
-#      u.$O\
-#      q.$O\
-#      0.$O\
-#      2.$O\
-#      5.$O\
-#      7.$O\
-#      9.$O\
-#      vdb.$O\
-#      kdb.$O\
-#      udb.$O\
-#      qdb.$O\
-#      2db.$O\
-#      5db.$O\
-#      7db.$O\
-#      vobj.$O\
-#      kobj.$O\
-#      uobj.$O\
-#      2obj.$O\
-#      7obj.$O\
-#      9obj.$O\
-#      qobj.$O\
-#      vcodas.$O\
 
-HFILES=$(GOROOT)/include/mach_amd64.h elf.h macho.h obj.h
+HFILES=$(GOROOT)/include/mach.h elf.h macho.h obj.h
 
 install: $(LIB)
        cp $(LIB) $(GOROOT)/lib
similarity index 99%
rename from src/libmach_amd64/access.c
rename to src/libmach/access.c
index 0ab01d40c6227b88ed31ed9dc0f32d96adaeab75..0ee75d148a1d058264cb30d951a3c51c52f14959 100644 (file)
@@ -33,7 +33,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 
 static int     mget(Map*, uvlong, void*, int);
 static int     mput(Map*, uvlong, void*, int);
similarity index 99%
rename from src/libmach_amd64/darwin.c
rename to src/libmach/darwin.c
index 11cc3151ed0f2150feacfef76ffcfdca23d2eee0..87fe423defd2141955f4c2d89c2e1724dc65a4aa 100644 (file)
@@ -28,7 +28,7 @@
 #include <errno.h>
 #include <libc.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 #define Ureg Ureg32
 #include <ureg_x86.h>
 #undef Ureg
similarity index 100%
rename from src/libmach_amd64/elf.h
rename to src/libmach/elf.h
similarity index 98%
rename from src/libmach_amd64/executable.c
rename to src/libmach/executable.c
index d1ad1fe6c590c54527e520846aaef17c2f55a12b..0cc7d0f997e6f566902b3c59f9ed84860b28a068 100644 (file)
@@ -1,11 +1,11 @@
 // Inferno libmach/executable.c
 // http://code.google.com/p/inferno-os/source/browse/utils/libmach/executable.c
 //
-//     Copyright © 1994-1999 Lucent Technologies Inc.
-//     Power PC support Copyright © 1995-2004 C H Forsyth (forsyth@terzarima.net).
-//     Portions Copyright © 1997-1999 Vita Nuova Limited.
-//     Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com).
-//     Revisions Copyright © 2000-2004 Lucent Technologies Inc. and others.
+//     Copyright © 1994-1999 Lucent Technologies Inc.
+//     Power PC support Copyright © 1995-2004 C H Forsyth (forsyth@terzarima.net).
+//     Portions Copyright © 1997-1999 Vita Nuova Limited.
+//     Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com).
+//     Revisions Copyright © 2000-2004 Lucent Technologies Inc. and others.
 //     Portions Copyright © 2009 The Go Authors.  All rights reserved.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -30,7 +30,7 @@
 #include       <libc.h>
 #include       <bio.h>
 #include       <bootexec.h>
-#include       <mach_amd64.h>
+#include       <mach.h>
 #include       "elf.h"
 #include       "macho.h"
 
@@ -268,7 +268,7 @@ ExecTable exectab[] =
                sizeof(Machhdr),
                nil,
                machdotout },
-       { MACH32_MAG,                   /* 64-bit MACH (apple mac) */
+       { MACH32_MAG,                   /* 32-bit MACH (apple mac) */
                "mach executable",
                nil,
                FI386,
similarity index 97%
rename from src/libmach_amd64/fakeobj.c
rename to src/libmach/fakeobj.c
index c1a6565a2de4ef82a6f19f7db69082f7c57f4d6b..ea7ef012cf652f54fb537c8d018ba958dc67d77b 100644 (file)
@@ -10,7 +10,7 @@
 #include <libc.h>
 #include <bio.h>
 #include <ar.h>
-#include <mach_amd64.h>
+#include <mach.h>
 #include "obj.h"
 
 int _is2(char* x) { return 0; }
similarity index 99%
rename from src/libmach_amd64/linux.c
rename to src/libmach/linux.c
index b1e8d0f97e3f3d8916bd8e0bc79f252a8c3541fc..20e62ee7a11cf77650d592a0cfe932a9adb951d5 100644 (file)
@@ -37,7 +37,7 @@
 #include <errno.h>
 #include <libc.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 #define Ureg Ureg32
 #include <ureg_x86.h>
 #undef Ureg
similarity index 99%
rename from src/libmach_amd64/machdata.c
rename to src/libmach/machdata.c
index 2b7368ddebec95564ce125c731e9ace969b8040b..425a9217946ca1db5ebd9d74c665a466933315e2 100644 (file)
@@ -33,7 +33,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 
 #define STARTSYM       "_main"
 #define PROFSYM                "_mainp"
similarity index 99%
rename from src/libmach_amd64/map.c
rename to src/libmach/map.c
index 747969335f76b4ee3c5090f4c1179d488ed1ebb7..ebfe03702704e76d5c217ad07b4bc96bd9a2f771 100644 (file)
@@ -37,7 +37,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 
 Map *
 newmap(Map *map, int n)
similarity index 99%
rename from src/libmach_amd64/obj.c
rename to src/libmach/obj.c
index 8bd138421bc6d0b552e4dc1879598549d5a0d282..aa914e2c761725a9582f931b022c58e31186b3e7 100644 (file)
@@ -34,7 +34,7 @@
 #include <libc.h>
 #include <bio.h>
 #include <ar.h>
-#include <mach_amd64.h>
+#include <mach.h>
 #include "obj.h"
 
 #define islocal(t)     ((t)=='a' || (t)=='p')
@@ -333,7 +333,7 @@ _offset(int id, vlong off)
 /*
  * update the type of a global text or data symbol
  */
-static void 
+static void
 objupdate(int id, int type)
 {
        Sym *s;
similarity index 100%
rename from src/libmach_amd64/obj.h
rename to src/libmach/obj.h
similarity index 99%
rename from src/libmach_amd64/setmach.c
rename to src/libmach/setmach.c
index 613ad3c61e39ea56d43a6a2a722a04d35f528069..b8877818679b6897d552823b8b25027dc9804c0d 100644 (file)
@@ -29,7 +29,7 @@
 #include       <u.h>
 #include       <libc.h>
 #include       <bio.h>
-#include       <mach_amd64.h>
+#include       <mach.h>
                /* table for selecting machine-dependent parameters */
 
 typedef        struct machtab Machtab;
similarity index 100%
rename from src/libmach_amd64/swap.c
rename to src/libmach/swap.c
similarity index 99%
rename from src/libmach_amd64/sym.c
rename to src/libmach/sym.c
index 13bc608fc4c72e097e1e7fe7ae2b175ee28aa15a..997cc063374ceec6d02e73dff4d708a76467a519 100644 (file)
@@ -29,7 +29,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
-#include <mach_amd64.h>
+#include <mach.h>
 
 #define        HUGEINT 0x7fffffff
 #define        NNAME   20              /* a relic of the past */
index acd4f5af798681c79482f47f4f41519d8c85eed5..5f3643c01546860409ed804176aabe6daa1a7269 100755 (executable)
@@ -19,7 +19,7 @@ rm -f $GOBIN/quietgcc
 cp quietgcc.bash $GOBIN/quietgcc
 chmod +x $GOBIN/quietgcc
 
-for i in lib9 libbio libmach_amd64 libregexp cmd pkg cmd/ebnflint cmd/godoc cmd/gofmt
+for i in lib9 libbio libmach libregexp cmd pkg cmd/ebnflint cmd/godoc cmd/gofmt
 do
        # The ( ) here are to preserve the current directory
        # for the next round despite the cd $i below.