diff options
author | Keith Randall <khr@golang.org> | 2013-08-07 10:23:24 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2013-08-07 10:23:24 -0700 |
commit | bb4fcd5d1d87828ed5a4ad2598299461c59f986d (patch) | |
tree | 0edf8f0e4b4042a7489ebb0f320b757e9abde13b /src/cmd | |
parent | cfe40c7c1400c9b429f587a2b6f7adafc069fd8e (diff) | |
download | go-bb4fcd5d1d87828ed5a4ad2598299461c59f986d.tar.gz |
cmd/ld: Put the textflag constants in a separate file.
We can then include this file in assembly to replace
cryptic constants like "7" with meaningful constants
like "(NOPROF|DUPOK|NOSPLIT)".
Converting just pkg/runtime/asm*.s for now. Dropping NOPROF
and DUPOK from lots of places where they aren't needed.
More .s files to come in a subsequent changelist.
A nonzero number in the textflag field now means
"has not been converted yet".
R=golang-dev, daniel.morsing, rsc, khr
CC=golang-dev
https://codereview.appspot.com/12568043
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/5l/5.out.h | 7 | ||||
-rw-r--r-- | src/cmd/6l/6.out.h | 6 | ||||
-rw-r--r-- | src/cmd/8l/8.out.h | 6 | ||||
-rw-r--r-- | src/cmd/ld/textflag.h | 19 |
4 files changed, 22 insertions, 16 deletions
diff --git a/src/cmd/5l/5.out.h b/src/cmd/5l/5.out.h index eda379c6f..85dd17a8e 100644 --- a/src/cmd/5l/5.out.h +++ b/src/cmd/5l/5.out.h @@ -31,12 +31,7 @@ #define NSNAME 8 #define NSYM 50 #define NREG 16 - -#define NOPROF (1<<0) -#define DUPOK (1<<1) -#define NOSPLIT (1<<2) -#define RODATA (1<<3) -#define NOPTR (1<<4) +#include "../ld/textflag.h" #define REGRET 0 /* -1 disables use of REGARG */ diff --git a/src/cmd/6l/6.out.h b/src/cmd/6l/6.out.h index b95b3fd13..b96be6024 100644 --- a/src/cmd/6l/6.out.h +++ b/src/cmd/6l/6.out.h @@ -30,11 +30,7 @@ #define NSYM 50 #define NSNAME 8 -#define NOPROF (1<<0) -#define DUPOK (1<<1) -#define NOSPLIT (1<<2) -#define RODATA (1<<3) -#define NOPTR (1<<4) +#include "../ld/textflag.h" /* * amd64 diff --git a/src/cmd/8l/8.out.h b/src/cmd/8l/8.out.h index 7683d50ad..a804ae94b 100644 --- a/src/cmd/8l/8.out.h +++ b/src/cmd/8l/8.out.h @@ -30,11 +30,7 @@ #define NSYM 50 #define NSNAME 8 -#define NOPROF (1<<0) -#define DUPOK (1<<1) -#define NOSPLIT (1<<2) -#define RODATA (1<<3) -#define NOPTR (1<<4) +#include "../ld/textflag.h" enum as { diff --git a/src/cmd/ld/textflag.h b/src/cmd/ld/textflag.h new file mode 100644 index 000000000..7b16865be --- /dev/null +++ b/src/cmd/ld/textflag.h @@ -0,0 +1,19 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file defines flags attached to various functions +// and data objects. The compilers, assemblers, and linker must +// all agree on these values. + +// Don't profile the marked routine. This flag is deprecated. +#define NOPROF (1<<0) +// It is ok for the linker to get multiple of these symbols. It will +// pick one of the duplicates to use. +#define DUPOK (1<<1) +// Don't insert stack check preamble. +#define NOSPLIT (1<<2) +// Put this data in a read-only section. +#define RODATA (1<<3) +// This data contains no pointers. +#define NOPTR (1<<4) |