aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucio De Re <lucio.dere@gmail.com>2011-06-14 14:14:11 -0400
committerRuss Cox <rsc@golang.org>2011-06-14 14:14:11 -0400
commit340251e43d980be7166c9d08bde22bda1cfa05d5 (patch)
tree567ae50252179bedb70611faba4dc7f15cac5332
parenta84e9d01f0bb15b192fd2ce202aa3ee095443cca (diff)
downloadgo-340251e43d980be7166c9d08bde22bda1cfa05d5.tar.gz
go-340251e43d980be7166c9d08bde22bda1cfa05d5.zip
build: fix header files for Plan 9
The "elf.h" header changes involve only comments, the released Plan 9 C preprocessing function does not cope with multiline comments following the #define keyword. All multiline comments have been moved to the line above the associated definition. Sigh! Fixing the Plan 9 compiler is not an option. <time.h> does not exist in the Plan 9 Native library. I have moved it from src/cmd/ld/pe.h to include/u.h. RSC correctly points out that this copy of <u.h> is not the one used to compile the Go release on Plan 9 platforms. R=golang-dev CC=golang-dev, rsc https://golang.org/cl/4574042
-rw-r--r--include/u.h1
-rw-r--r--src/cmd/ld/elf.h73
2 files changed, 37 insertions, 37 deletions
diff --git a/include/u.h b/include/u.h
index 690b2f616f..9ee7493b46 100644
--- a/include/u.h
+++ b/include/u.h
@@ -69,6 +69,7 @@ extern "C" {
#include <math.h>
#include <ctype.h> /* for tolower */
#include <signal.h>
+#include <time.h>
/*
* OS-specific crap
diff --git a/src/cmd/ld/elf.h b/src/cmd/ld/elf.h
index d1370d28be..4db7a63d64 100644
--- a/src/cmd/ld/elf.h
+++ b/src/cmd/ld/elf.h
@@ -262,8 +262,8 @@ typedef struct {
/* Values for d_tag. */
#define DT_NULL 0 /* Terminating entry. */
-#define DT_NEEDED 1 /* String table offset of a needed shared
- library. */
+/* String table offset of a needed shared library. */
+#define DT_NEEDED 1
#define DT_PLTRELSZ 2 /* Total size in bytes of PLT relocations. */
#define DT_PLTGOT 3 /* Processor-dependent address. */
#define DT_HASH 4 /* Address of symbol hash table. */
@@ -276,8 +276,8 @@ typedef struct {
#define DT_SYMENT 11 /* Size of each symbol table entry. */
#define DT_INIT 12 /* Address of initialization function. */
#define DT_FINI 13 /* Address of finalization function. */
-#define DT_SONAME 14 /* String table offset of shared object
- name. */
+/* String table offset of shared object name. */
+#define DT_SONAME 14
#define DT_RPATH 15 /* String table offset of library path. [sup] */
#define DT_SYMBOLIC 16 /* Indicates "symbolic" linking. [sup] */
#define DT_REL 17 /* Address of ElfNN_Rel relocations. */
@@ -285,30 +285,29 @@ typedef struct {
#define DT_RELENT 19 /* Size of each ElfNN_Rel relocation. */
#define DT_PLTREL 20 /* Type of relocation used for PLT. */
#define DT_DEBUG 21 /* Reserved (not used). */
-#define DT_TEXTREL 22 /* Indicates there may be relocations in
- non-writable segments. [sup] */
+/* Indicates there may be relocations in non-writable segments. [sup] */
+#define DT_TEXTREL 22
#define DT_JMPREL 23 /* Address of PLT relocations. */
#define DT_BIND_NOW 24 /* [sup] */
-#define DT_INIT_ARRAY 25 /* Address of the array of pointers to
- initialization functions */
-#define DT_FINI_ARRAY 26 /* Address of the array of pointers to
- termination functions */
-#define DT_INIT_ARRAYSZ 27 /* Size in bytes of the array of
- initialization functions. */
-#define DT_FINI_ARRAYSZ 28 /* Size in bytes of the array of
- terminationfunctions. */
-#define DT_RUNPATH 29 /* String table offset of a null-terminated
- library search path string. */
+/* Address of the array of pointers to initialization functions */
+#define DT_INIT_ARRAY 25
+/* Address of the array of pointers to termination functions */
+#define DT_FINI_ARRAY 26
+/* Size in bytes of the array of initialization functions. */
+#define DT_INIT_ARRAYSZ 27
+/* Size in bytes of the array of terminationfunctions. */
+#define DT_FINI_ARRAYSZ 28
+/* String table offset of a null-terminated library search path string. */
+#define DT_RUNPATH 29
#define DT_FLAGS 30 /* Object specific flag values. */
-#define DT_ENCODING 32 /* Values greater than or equal to DT_ENCODING
- and less than DT_LOOS follow the rules for
- the interpretation of the d_un union
- as follows: even == 'd_ptr', even == 'd_val'
- or none */
-#define DT_PREINIT_ARRAY 32 /* Address of the array of pointers to
- pre-initialization functions. */
-#define DT_PREINIT_ARRAYSZ 33 /* Size in bytes of the array of
- pre-initialization functions. */
+/* Values greater than or equal to DT_ENCODING and less than
+ DT_LOOS follow the rules for the interpretation of the d_un
+ union as follows: even == 'd_ptr', even == 'd_val' or none */
+#define DT_ENCODING 32
+/* Address of the array of pointers to pre-initialization functions. */
+#define DT_PREINIT_ARRAY 32
+/* Size in bytes of the array of pre-initialization functions. */
+#define DT_PREINIT_ARRAYSZ 33
#define DT_LOOS 0x6000000d /* First OS-specific */
#define DT_HIOS 0x6ffff000 /* Last OS-specific */
#define DT_LOPROC 0x70000000 /* First processor-specific type. */
@@ -319,19 +318,19 @@ typedef struct {
#define DT_VERSYM 0x6ffffff0
/* Values for DT_FLAGS */
-#define DF_ORIGIN 0x0001 /* Indicates that the object being loaded may
- make reference to the $ORIGIN substitution
- string */
+/* Indicates that the object being loaded may make reference to
+ the $ORIGIN substitution string */
+#define DF_ORIGIN 0x0001
#define DF_SYMBOLIC 0x0002 /* Indicates "symbolic" linking. */
-#define DF_TEXTREL 0x0004 /* Indicates there may be relocations in
- non-writable segments. */
-#define DF_BIND_NOW 0x0008 /* Indicates that the dynamic linker should
- process all relocations for the object
- containing this entry before transferring
- control to the program. */
-#define DF_STATIC_TLS 0x0010 /* Indicates that the shared object or
- executable contains code using a static
- thread-local storage scheme. */
+/* Indicates there may be relocations in non-writable segments. */
+#define DF_TEXTREL 0x0004
+/* Indicates that the dynamic linker should process all
+ relocations for the object containing this entry before
+ transferring control to the program. */
+#define DF_BIND_NOW 0x0008
+/* Indicates that the shared object or executable contains code
+ using a static thread-local storage scheme. */
+#define DF_STATIC_TLS 0x0010
/* Values for n_type. Used in core files. */
#define NT_PRSTATUS 1 /* Process status. */