Skip to content

Commit 4312a18

Browse files
erifan01ianlancetaylor
erifan01
authored andcommitted
runtime/cgo: declare variable setg_gcc as static
variable setg_gcc in runtime/cgo/*.c should be static, otherwise it will be mixed with the function of the same name in runtime/asm_*.s or tls_*.s, which causes an error when building PIE with internal linking mode. Fixes #31485 Change-Id: I79b311ffcaf450984328db65397840ae7d85e65d Reviewed-on: https://go-review.googlesource.com/c/go/+/172498 Reviewed-by: Ian Lance Taylor <iant@golang.org>
1 parent 3b37ff4 commit 4312a18

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/runtime/cgo/gcc_darwin_arm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ inittls(void **tlsg, void **tlsbase)
4747
}
4848

4949
static void *threadentry(void*);
50-
void (*setg_gcc)(void*);
50+
static void (*setg_gcc)(void*);
5151

5252
void
5353
_cgo_sys_thread_start(ThreadStart *ts)

src/runtime/cgo/gcc_darwin_arm64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ inittls(void **tlsg, void **tlsbase)
4848
}
4949

5050
static void *threadentry(void*);
51-
void (*setg_gcc)(void*);
51+
static void (*setg_gcc)(void*);
5252

5353
void
5454
_cgo_sys_thread_start(ThreadStart *ts)

src/runtime/cgo/gcc_linux_arm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
static void *threadentry(void*);
1212

1313
void (*x_cgo_inittls)(void **tlsg, void **tlsbase);
14-
void (*setg_gcc)(void*);
14+
static void (*setg_gcc)(void*);
1515

1616
void
1717
_cgo_sys_thread_start(ThreadStart *ts)

src/runtime/cgo/gcc_linux_arm64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
static void *threadentry(void*);
1414

1515
void (*x_cgo_inittls)(void **tlsg, void **tlsbase);
16-
void (*setg_gcc)(void*);
16+
static void (*setg_gcc)(void*);
1717

1818
void
1919
_cgo_sys_thread_start(ThreadStart *ts)

src/runtime/cgo/gcc_linux_mips64x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
static void *threadentry(void*);
1616

1717
void (*x_cgo_inittls)(void **tlsg, void **tlsbase);
18-
void (*setg_gcc)(void*);
18+
static void (*setg_gcc)(void*);
1919

2020
void
2121
_cgo_sys_thread_start(ThreadStart *ts)

src/runtime/cgo/gcc_linux_mipsx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
static void *threadentry(void*);
1616

1717
void (*x_cgo_inittls)(void **tlsg, void **tlsbase);
18-
void (*setg_gcc)(void*);
18+
static void (*setg_gcc)(void*);
1919

2020
void
2121
_cgo_sys_thread_start(ThreadStart *ts)

0 commit comments

Comments
 (0)