* [rfa] alpha sjlj vs pointer mangling
@ 2006-01-10 0:35 Richard Henderson
2006-01-10 1:52 ` Roland McGrath
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Richard Henderson @ 2006-01-10 0:35 UTC (permalink / raw)
To: libc-hacker
For Alpha, it's faster to access through got than through thread pointer.
So I'd rather rely on __pointer_chk_guard{,_local} than have to manage
setting up a local thread base pointer.
This does cause one complication -- the iconvdata libraries use one of
the objects that does a pointer check, and thus must be linked against
ld.so to get that resolved. This isn't strictly needed for other targets,
so I wonder what the best way to avoid this is? Unless of course we
already default to --as-needed?
r~
2006-01-09 Richard Henderson <rth@redhat.com>
* iconvdata/extra-module.mk ($(objpfx)$(mod).so): Depend on ld.so.
* sysdeps/alpha/__longjmp.S: Use PTR_DEMANGLE.
* sysdeps/alpha/setjmp.S: Likewise. Avoid __sigjmp_save for rtld;
tailcall in libc.so.
* sysdeps/unix/sysv/linux/alpha/sysdep.h (PTR_MANGLE): New.
(PTR_MANGLE2): New.
Index: iconvdata/extra-module.mk
===================================================================
RCS file: /cvs/glibc/libc/iconvdata/extra-module.mk,v
retrieving revision 1.4
diff -u -p -d -r1.4 extra-module.mk
--- iconvdata/extra-module.mk 26 Apr 2003 23:38:36 -0000 1.4
+++ iconvdata/extra-module.mk 9 Jan 2006 23:05:58 -0000
@@ -10,7 +10,9 @@ $(objpfx)$(mod).so: $(addprefix $(objpfx
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
# This ensures they will load libc.so for needed symbols if loaded by
# a statically-linked program that hasn't already loaded it.
-$(objpfx)$(mod).so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
+$(objpfx)$(mod).so: $(common-objpfx)libc.so \
+ $(common-objpfx)/elf/ld.so \
+ $(common-objpfx)libc_nonshared.a
ifneq (,$(extra-modules-left))
include extra-module.mk
Index: sysdeps/alpha/__longjmp.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/__longjmp.S,v
retrieving revision 1.3
diff -u -p -d -r1.3 __longjmp.S
--- sysdeps/alpha/__longjmp.S 6 Jul 2001 04:55:44 -0000 1.3
+++ sysdeps/alpha/__longjmp.S 9 Jan 2006 23:06:01 -0000
@@ -54,6 +54,11 @@ ENTRY(__longjmp)
ldt $f7, JB_F7*8(a0)
ldt $f8, JB_F8*8(a0)
ldt $f9, JB_F9*8(a0)
+#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE(ra, t1)
+ PTR_DEMANGLE2(t0, t1)
+ PTR_DEMANGLE2(fp, t1)
+#endif
cmoveq v0, 1, v0
mov t0, sp
ret
Index: sysdeps/alpha/setjmp.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/setjmp.S,v
retrieving revision 1.19
diff -u -p -d -r1.19 setjmp.S
--- sysdeps/alpha/setjmp.S 24 Jun 2003 16:29:21 -0000 1.19
+++ sysdeps/alpha/setjmp.S 9 Jan 2006 23:06:01 -0000
@@ -23,16 +23,22 @@
#define _SETJMP_H
#include <bits/setjmp.h>
- .ent __sigsetjmp
- .global __sigsetjmp
+ .ent __sigsetjmp
+ .global __sigsetjmp
__sigsetjmp:
- ldgp gp, 0(pv)
+ ldgp gp, 0(pv)
$sigsetjmp_local:
- subq sp, 16, sp
- .frame sp, 16, ra, 0
- stq ra, 0(sp)
- .mask 0x04000000, -16
+#ifndef PIC
+#define FRAME 16
+ subq sp, FRAME, sp
+ .frame sp, FRAME, ra, 0
+ stq ra, 0(sp)
+ .mask 0x04000000, -FRAME
+#else
+#define FRAME 0
+ .frame sp, FRAME, ra, 0
+#endif
#ifdef PROF
.set noat
lda AT, _mcount
@@ -47,10 +53,27 @@ $sigsetjmp_local:
stq s3, JB_S3*8(a0)
stq s4, JB_S4*8(a0)
stq s5, JB_S5*8(a0)
+#ifdef PTR_MANGLE
+ PTR_MANGLE(t1, ra, t0)
+ stq t1, JB_PC*8(a0)
+#else
stq ra, JB_PC*8(a0)
- addq sp, 16, t0
+#endif
+#if defined(PTR_MANGLE) && FRAME == 0
+ PTR_MANGLE2(t1, sp, t0)
+#else
+ addq sp, FRAME, t1
+# ifdef PTR_MANGLE
+ PTR_MANGLE2(t1, t1, t0)
+# endif
+#endif
+ stq t1, JB_SP*8(a0)
+#ifdef PTR_MANGLE
+ PTR_MANGLE2(t1, fp, t0)
+ stq t1, JB_FP*8(a0)
+#else
stq fp, JB_FP*8(a0)
- stq t0, JB_SP*8(a0)
+#endif
stt $f2, JB_F2*8(a0)
stt $f3, JB_F3*8(a0)
stt $f4, JB_F4*8(a0)
@@ -60,12 +83,20 @@ $sigsetjmp_local:
stt $f8, JB_F8*8(a0)
stt $f9, JB_F9*8(a0)
+#ifndef PIC
/* Call to C to (potentially) save our signal mask. */
jsr ra, __sigjmp_save
-
ldq ra, 0(sp)
addq sp, 16, sp
ret
+#elif defined NOT_IN_libc && defined IS_IN_rtld
+ /* In ld.so we never save the signal mask. */
+ mov 0, v0
+ ret
+#else
+ /* Tailcall to save the signal mask. */
+ br $31, __sigjmp_save !samegp
+#endif
END(__sigsetjmp)
Index: sysdeps/unix/sysv/linux/alpha/sysdep.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/alpha/sysdep.h,v
retrieving revision 1.17
diff -u -p -d -r1.17 sysdep.h
--- sysdeps/unix/sysv/linux/alpha/sysdep.h 23 Mar 2004 23:31:47 -0000 1.17
+++ sysdeps/unix/sysv/linux/alpha/sysdep.h 9 Jan 2006 23:06:03 -0000
@@ -22,10 +22,10 @@
#define _LINUX_ALPHA_SYSDEP_H 1
#ifdef __ASSEMBLER__
-
#include <asm/pal.h>
#include <alpha/regdef.h>
-
+#else
+#include <stdint.h>
#endif
/* There is some commonality. */
@@ -98,4 +98,39 @@
INTERNAL_SYSCALL1(name, err_out, nr, args); \
})
+/* Pointer mangling support. Note that tls access is slow enough that
+ we don't deoptimize things by placing the pointer check value there. */
+#if defined NOT_IN_libc && defined IS_IN_rtld
+# ifdef __ASSEMBLER__
+# define PTR_MANGLE(dst, src, tmp) \
+ ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
+ ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
+ xor src, tmp, dst
+# define PTR_MANGLE2(dst, src, tmp) \
+ xor src, tmp, dst
+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
+# else
+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
+# define PTR_MANGLE(var) \
+ (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
+# endif
+#elif defined PIC
+# ifdef __ASSEMBLER__
+# define PTR_MANGLE(dst, src, tmp) \
+ ldq tmp, __pointer_chk_guard; \
+ xor src, tmp, dst
+# define PTR_MANGLE2(dst, src, tmp) \
+ xor src, tmp, dst
+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
+# else
+extern uintptr_t __pointer_chk_guard attribute_relro;
+# define PTR_MANGLE(var) \
+ (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
+# endif
+#endif
+
#endif /* _LINUX_ALPHA_SYSDEP_H */
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] alpha sjlj vs pointer mangling
2006-01-10 0:35 [rfa] alpha sjlj vs pointer mangling Richard Henderson
@ 2006-01-10 1:52 ` Roland McGrath
2006-01-10 2:03 ` Ulrich Drepper
2006-01-10 2:10 ` Richard Henderson
2006-01-10 18:18 ` Ulrich Drepper
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Roland McGrath @ 2006-01-10 1:52 UTC (permalink / raw)
To: Richard Henderson; +Cc: libc-hacker
If it doesn't use the thread pointer, then the PTR_MANGLE defn belongs in a
generic alpha file (create sysdeps/alpha/sysdep.h I guess).
> This does cause one complication -- the iconvdata libraries use one of
> the objects that does a pointer check, and thus must be linked against
> ld.so to get that resolved. This isn't strictly needed for other targets,
> so I wonder what the best way to avoid this is? Unless of course we
> already default to --as-needed?
We don't. There is no particular harm in those modules getting the
DT_NEEDED for ld.so's soname, so I wouldn't bother avoiding it.
Thanks,
Roland
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] alpha sjlj vs pointer mangling
2006-01-10 1:52 ` Roland McGrath
@ 2006-01-10 2:03 ` Ulrich Drepper
2006-01-10 2:10 ` Richard Henderson
1 sibling, 0 replies; 11+ messages in thread
From: Ulrich Drepper @ 2006-01-10 2:03 UTC (permalink / raw)
To: Roland McGrath; +Cc: Richard Henderson, libc-hacker
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
Roland McGrath wrote:
> We don't. There is no particular harm in those modules getting the
> DT_NEEDED for ld.so's soname, so I wouldn't bother avoiding it.
It's unnecessary work for dlopen. Let's add it, better do work at link
time than at runtime.
--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] alpha sjlj vs pointer mangling
2006-01-10 1:52 ` Roland McGrath
2006-01-10 2:03 ` Ulrich Drepper
@ 2006-01-10 2:10 ` Richard Henderson
1 sibling, 0 replies; 11+ messages in thread
From: Richard Henderson @ 2006-01-10 2:10 UTC (permalink / raw)
To: Roland McGrath; +Cc: libc-hacker
On Mon, Jan 09, 2006 at 05:51:57PM -0800, Roland McGrath wrote:
> If it doesn't use the thread pointer, then the PTR_MANGLE defn belongs in a
> generic alpha file (create sysdeps/alpha/sysdep.h I guess).
sysdeps/unix/alpha/sysdep.h is the base include file here;
I'll move the bits.
r~
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] alpha sjlj vs pointer mangling
2006-01-10 0:35 [rfa] alpha sjlj vs pointer mangling Richard Henderson
2006-01-10 1:52 ` Roland McGrath
@ 2006-01-10 18:18 ` Ulrich Drepper
2006-01-10 18:27 ` Ulrich Drepper
2006-01-12 0:09 ` Richard Henderson
2006-01-12 0:12 ` Ulrich Drepper
3 siblings, 1 reply; 11+ messages in thread
From: Ulrich Drepper @ 2006-01-10 18:18 UTC (permalink / raw)
To: libc-hacker
[-- Attachment #1: Type: text/plain, Size: 101 bytes --]
Applied.
--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] alpha sjlj vs pointer mangling
2006-01-10 18:18 ` Ulrich Drepper
@ 2006-01-10 18:27 ` Ulrich Drepper
0 siblings, 0 replies; 11+ messages in thread
From: Ulrich Drepper @ 2006-01-10 18:27 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: libc-hacker
[-- Attachment #1: Type: text/plain, Size: 171 bytes --]
Ulrich Drepper wrote:
> Applied.
Ehm, wrong mai. I didn't apply this one.
--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] alpha sjlj vs pointer mangling
2006-01-10 0:35 [rfa] alpha sjlj vs pointer mangling Richard Henderson
2006-01-10 1:52 ` Roland McGrath
2006-01-10 18:18 ` Ulrich Drepper
@ 2006-01-12 0:09 ` Richard Henderson
2006-01-12 0:24 ` Ulrich Drepper
2006-01-12 0:12 ` Ulrich Drepper
3 siblings, 1 reply; 11+ messages in thread
From: Richard Henderson @ 2006-01-12 0:09 UTC (permalink / raw)
To: libc-hacker
Here's a revised patch, also tested on i686 to be sure that the
iconvdata dso's don't get a DT_NEEDED for ld.so.
r~
2006-01-11 Richard Henderson <rth@redhat.com>
* iconvdata/extra-module.mk ($(objpfx)$(mod).so): Depend on ld.so;
append --as-needed, if available, to LDFLAGS.so.
* sysdeps/alpha/__longjmp.S: Use PTR_DEMANGLE.
* sysdeps/alpha/setjmp.S: Likewise. Avoid __sigjmp_save for rtld;
tailcall in libc.so.
* sysdeps/unix/alpha/sysdep.h (PTR_MANGLE): New.
(PTR_MANGLE2): New.
Index: iconvdata/extra-module.mk
===================================================================
RCS file: /cvs/glibc/libc/iconvdata/extra-module.mk,v
retrieving revision 1.4
diff -u -p -d -r1.4 extra-module.mk
--- iconvdata/extra-module.mk 26 Apr 2003 23:38:36 -0000 1.4
+++ iconvdata/extra-module.mk 11 Jan 2006 19:48:42 -0000
@@ -10,7 +10,15 @@ $(objpfx)$(mod).so: $(addprefix $(objpfx
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
# This ensures they will load libc.so for needed symbols if loaded by
# a statically-linked program that hasn't already loaded it.
-$(objpfx)$(mod).so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
+$(objpfx)$(mod).so: $(common-objpfx)libc.so \
+ $(common-objpfx)/elf/ld.so \
+ $(common-objpfx)libc_nonshared.a
+
+# Don't depend on ld.so if it isn't needed. This is a sort-of big hammer
+# to use for this, but it's easiest to avoid mucking with the Makerules.
+ifeq ($(have-as-needed),yes)
+$(objpfx)$(mod).so: LDFLAGS.so += -Wl,--as-needed
+endif
ifneq (,$(extra-modules-left))
include extra-module.mk
Index: sysdeps/alpha/__longjmp.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/__longjmp.S,v
retrieving revision 1.3
diff -u -p -d -r1.3 __longjmp.S
--- sysdeps/alpha/__longjmp.S 6 Jul 2001 04:55:44 -0000 1.3
+++ sysdeps/alpha/__longjmp.S 11 Jan 2006 19:48:45 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1994, 1997, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -54,6 +54,11 @@ ENTRY(__longjmp)
ldt $f7, JB_F7*8(a0)
ldt $f8, JB_F8*8(a0)
ldt $f9, JB_F9*8(a0)
+#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE(ra, t1)
+ PTR_DEMANGLE2(t0, t1)
+ PTR_DEMANGLE2(fp, t1)
+#endif
cmoveq v0, 1, v0
mov t0, sp
ret
Index: sysdeps/alpha/setjmp.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/setjmp.S,v
retrieving revision 1.19
diff -u -p -d -r1.19 setjmp.S
--- sysdeps/alpha/setjmp.S 24 Jun 2003 16:29:21 -0000 1.19
+++ sysdeps/alpha/setjmp.S 11 Jan 2006 19:48:45 -0000
@@ -1,4 +1,5 @@
-/* Copyright (C) 1992, 1994, 1996, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1994, 1996, 1997, 2002, 2006
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,16 +24,22 @@
#define _SETJMP_H
#include <bits/setjmp.h>
- .ent __sigsetjmp
- .global __sigsetjmp
+ .ent __sigsetjmp
+ .global __sigsetjmp
__sigsetjmp:
- ldgp gp, 0(pv)
+ ldgp gp, 0(pv)
$sigsetjmp_local:
- subq sp, 16, sp
- .frame sp, 16, ra, 0
- stq ra, 0(sp)
- .mask 0x04000000, -16
+#ifndef PIC
+#define FRAME 16
+ subq sp, FRAME, sp
+ .frame sp, FRAME, ra, 0
+ stq ra, 0(sp)
+ .mask 0x04000000, -FRAME
+#else
+#define FRAME 0
+ .frame sp, FRAME, ra, 0
+#endif
#ifdef PROF
.set noat
lda AT, _mcount
@@ -47,10 +54,27 @@ $sigsetjmp_local:
stq s3, JB_S3*8(a0)
stq s4, JB_S4*8(a0)
stq s5, JB_S5*8(a0)
+#ifdef PTR_MANGLE
+ PTR_MANGLE(t1, ra, t0)
+ stq t1, JB_PC*8(a0)
+#else
stq ra, JB_PC*8(a0)
- addq sp, 16, t0
+#endif
+#if defined(PTR_MANGLE) && FRAME == 0
+ PTR_MANGLE2(t1, sp, t0)
+#else
+ addq sp, FRAME, t1
+# ifdef PTR_MANGLE
+ PTR_MANGLE2(t1, t1, t0)
+# endif
+#endif
+ stq t1, JB_SP*8(a0)
+#ifdef PTR_MANGLE
+ PTR_MANGLE2(t1, fp, t0)
+ stq t1, JB_FP*8(a0)
+#else
stq fp, JB_FP*8(a0)
- stq t0, JB_SP*8(a0)
+#endif
stt $f2, JB_F2*8(a0)
stt $f3, JB_F3*8(a0)
stt $f4, JB_F4*8(a0)
@@ -60,12 +84,20 @@ $sigsetjmp_local:
stt $f8, JB_F8*8(a0)
stt $f9, JB_F9*8(a0)
+#ifndef PIC
/* Call to C to (potentially) save our signal mask. */
jsr ra, __sigjmp_save
-
ldq ra, 0(sp)
addq sp, 16, sp
ret
+#elif defined NOT_IN_libc && defined IS_IN_rtld
+ /* In ld.so we never save the signal mask. */
+ mov 0, v0
+ ret
+#else
+ /* Tailcall to save the signal mask. */
+ br $31, __sigjmp_save !samegp
+#endif
END(__sigsetjmp)
Index: sysdeps/unix/alpha/sysdep.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/alpha/sysdep.h,v
retrieving revision 1.27
diff -u -p -d -r1.27 sysdep.h
--- sysdeps/unix/alpha/sysdep.h 20 Sep 2005 05:35:42 -0000 1.27
+++ sysdeps/unix/alpha/sysdep.h 11 Jan 2006 19:48:47 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1996, 2000, 2003, 2004
+/* Copyright (C) 1992, 1995, 1996, 2000, 2003, 2004, 2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
@@ -397,4 +397,42 @@ __LABEL(name) \
_sc_ret = _sc_0, _sc_err = _sc_19; \
}
+/* Pointer mangling support. Note that tls access is slow enough that
+ we don't deoptimize things by placing the pointer check value there. */
+
+#include <stdint.h>
+
+#if defined NOT_IN_libc && defined IS_IN_rtld
+# ifdef __ASSEMBLER__
+# define PTR_MANGLE(dst, src, tmp) \
+ ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
+ ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
+ xor src, tmp, dst
+# define PTR_MANGLE2(dst, src, tmp) \
+ xor src, tmp, dst
+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
+# else
+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
+# define PTR_MANGLE(var) \
+ (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
+# endif
+#elif defined PIC
+# ifdef __ASSEMBLER__
+# define PTR_MANGLE(dst, src, tmp) \
+ ldq tmp, __pointer_chk_guard; \
+ xor src, tmp, dst
+# define PTR_MANGLE2(dst, src, tmp) \
+ xor src, tmp, dst
+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
+# else
+extern uintptr_t __pointer_chk_guard attribute_relro;
+# define PTR_MANGLE(var) \
+ (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
+# endif
+#endif
+
#endif /* ASSEMBLER */
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] alpha sjlj vs pointer mangling
2006-01-10 0:35 [rfa] alpha sjlj vs pointer mangling Richard Henderson
` (2 preceding siblings ...)
2006-01-12 0:09 ` Richard Henderson
@ 2006-01-12 0:12 ` Ulrich Drepper
3 siblings, 0 replies; 11+ messages in thread
From: Ulrich Drepper @ 2006-01-12 0:12 UTC (permalink / raw)
To: libc-hacker
[-- Attachment #1: Type: text/plain, Size: 158 bytes --]
I added this patch now along with the changes to use --as-needed.
--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] alpha sjlj vs pointer mangling
2006-01-12 0:09 ` Richard Henderson
@ 2006-01-12 0:24 ` Ulrich Drepper
2006-01-13 21:09 ` Richard Henderson
0 siblings, 1 reply; 11+ messages in thread
From: Ulrich Drepper @ 2006-01-12 0:24 UTC (permalink / raw)
To: libc-hacker
[-- Attachment #1: Type: text/plain, Size: 378 bytes --]
Richard Henderson wrote:
> Here's a revised patch, also tested on i686 to be sure that the
> iconvdata dso's don't get a DT_NEEDED for ld.so.
I already added the previous patch plus the --as-needed fixup. Please
resent whatever patch is needed on top of the current CVS version.
--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] alpha sjlj vs pointer mangling
2006-01-12 0:24 ` Ulrich Drepper
@ 2006-01-13 21:09 ` Richard Henderson
2006-01-13 21:49 ` Ulrich Drepper
0 siblings, 1 reply; 11+ messages in thread
From: Richard Henderson @ 2006-01-13 21:09 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: libc-hacker
On Wed, Jan 11, 2006 at 04:25:07PM -0800, Ulrich Drepper wrote:
> I already added the previous patch plus the --as-needed fixup. Please
> resent whatever patch is needed on top of the current CVS version.
Here's what's needed vs yesterday's cvs. A couple of new things
crept in on the side.
r~
2006-01-13 Richard Henderson <rth@redhat.com>
nptl/
* sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
* sysdeps/alpha/__longjmp.S: Update copyright.
* sysdeps/alpha/setjmp.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/sysdep.h (PTR_MANGLE, PTR_MANGLE2,
PTR_DEMANGLE, PTR_DEMANGLE2): Move ...
* sysdeps/unix/alpha/sysdep.h: ... here.
* sysdeps/unix/sysv/linux/alpha/fxstatat.c: Define __GI___fxstatat64.
Index: nptl/sysdeps/alpha/tls.h
===================================================================
RCS file: /cvs/glibc/libc/nptl/sysdeps/alpha/tls.h,v
retrieving revision 1.5
diff -u -p -d -r1.5 tls.h
--- nptl/sysdeps/alpha/tls.h 6 Jan 2005 22:40:24 -0000 1.5
+++ nptl/sysdeps/alpha/tls.h 13 Jan 2006 21:05:29 -0000
@@ -65,7 +65,7 @@ typedef union dtv
typedef struct
{
dtv_t *dtv;
- void *private;
+ void *__private;
} tcbhead_t;
/* This is the size of the initial TCB. */
Index: sysdeps/alpha/__longjmp.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/__longjmp.S,v
retrieving revision 1.4
diff -u -p -d -r1.4 __longjmp.S
--- sysdeps/alpha/__longjmp.S 11 Jan 2006 22:14:19 -0000 1.4
+++ sysdeps/alpha/__longjmp.S 13 Jan 2006 21:05:30 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1994, 1997, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Index: sysdeps/alpha/setjmp.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/setjmp.S,v
retrieving revision 1.20
diff -u -p -d -r1.20 setjmp.S
--- sysdeps/alpha/setjmp.S 11 Jan 2006 22:15:28 -0000 1.20
+++ sysdeps/alpha/setjmp.S 13 Jan 2006 21:05:30 -0000
@@ -1,4 +1,5 @@
-/* Copyright (C) 1992, 1994, 1996, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1994, 1996, 1997, 2002, 2006
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Index: sysdeps/unix/alpha/sysdep.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/alpha/sysdep.h,v
retrieving revision 1.27
diff -u -p -d -r1.27 sysdep.h
--- sysdeps/unix/alpha/sysdep.h 20 Sep 2005 05:35:42 -0000 1.27
+++ sysdeps/unix/alpha/sysdep.h 13 Jan 2006 21:05:32 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1996, 2000, 2003, 2004
+/* Copyright (C) 1992, 1995, 1996, 2000, 2003, 2004, 2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
@@ -397,4 +397,42 @@ __LABEL(name) \
_sc_ret = _sc_0, _sc_err = _sc_19; \
}
+/* Pointer mangling support. Note that tls access is slow enough that
+ we don't deoptimize things by placing the pointer check value there. */
+
+#include <stdint.h>
+
+#if defined NOT_IN_libc && defined IS_IN_rtld
+# ifdef __ASSEMBLER__
+# define PTR_MANGLE(dst, src, tmp) \
+ ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
+ ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
+ xor src, tmp, dst
+# define PTR_MANGLE2(dst, src, tmp) \
+ xor src, tmp, dst
+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
+# else
+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
+# define PTR_MANGLE(var) \
+ (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
+# endif
+#elif defined PIC
+# ifdef __ASSEMBLER__
+# define PTR_MANGLE(dst, src, tmp) \
+ ldq tmp, __pointer_chk_guard; \
+ xor src, tmp, dst
+# define PTR_MANGLE2(dst, src, tmp) \
+ xor src, tmp, dst
+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
+# else
+extern uintptr_t __pointer_chk_guard attribute_relro;
+# define PTR_MANGLE(var) \
+ (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
+# endif
+#endif
+
#endif /* ASSEMBLER */
Index: sysdeps/unix/sysv/linux/alpha/fxstatat.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/alpha/fxstatat.c,v
retrieving revision 1.2
diff -u -p -d -r1.2 fxstatat.c
--- sysdeps/unix/sysv/linux/alpha/fxstatat.c 26 Nov 2005 00:52:45 -0000 1.2
+++ sysdeps/unix/sysv/linux/alpha/fxstatat.c 13 Jan 2006 21:05:32 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -94,4 +94,5 @@ __fxstatat (int vers, int fd, const char
return -1;
}
-strong_alias (__fxstatat, __fxstatat64);
+strong_alias (__fxstatat, __fxstatat64)
+strong_alias (__fxstatat64, __GI___fxstatat64)
Index: sysdeps/unix/sysv/linux/alpha/sysdep.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/alpha/sysdep.h,v
retrieving revision 1.18
diff -u -p -d -r1.18 sysdep.h
--- sysdeps/unix/sysv/linux/alpha/sysdep.h 11 Jan 2006 22:16:27 -0000 1.18
+++ sysdeps/unix/sysv/linux/alpha/sysdep.h 13 Jan 2006 21:05:32 -0000
@@ -24,8 +24,6 @@
#ifdef __ASSEMBLER__
#include <asm/pal.h>
#include <alpha/regdef.h>
-#else
-#include <stdint.h>
#endif
/* There is some commonality. */
@@ -98,39 +96,4 @@
INTERNAL_SYSCALL1(name, err_out, nr, args); \
})
-/* Pointer mangling support. Note that tls access is slow enough that
- we don't deoptimize things by placing the pointer check value there. */
-#if defined NOT_IN_libc && defined IS_IN_rtld
-# ifdef __ASSEMBLER__
-# define PTR_MANGLE(dst, src, tmp) \
- ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
- ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
- xor src, tmp, dst
-# define PTR_MANGLE2(dst, src, tmp) \
- xor src, tmp, dst
-# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-# else
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_MANGLE(var) \
- (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-# endif
-#elif defined PIC
-# ifdef __ASSEMBLER__
-# define PTR_MANGLE(dst, src, tmp) \
- ldq tmp, __pointer_chk_guard; \
- xor src, tmp, dst
-# define PTR_MANGLE2(dst, src, tmp) \
- xor src, tmp, dst
-# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_MANGLE(var) \
- (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
-# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-# endif
-#endif
-
#endif /* _LINUX_ALPHA_SYSDEP_H */
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] alpha sjlj vs pointer mangling
2006-01-13 21:09 ` Richard Henderson
@ 2006-01-13 21:49 ` Ulrich Drepper
0 siblings, 0 replies; 11+ messages in thread
From: Ulrich Drepper @ 2006-01-13 21:49 UTC (permalink / raw)
To: Ulrich Drepper, libc-hacker
[-- Attachment #1: Type: text/plain, Size: 145 bytes --]
I added the parts of the patch which were necessary.
--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-01-13 21:49 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-10 0:35 [rfa] alpha sjlj vs pointer mangling Richard Henderson
2006-01-10 1:52 ` Roland McGrath
2006-01-10 2:03 ` Ulrich Drepper
2006-01-10 2:10 ` Richard Henderson
2006-01-10 18:18 ` Ulrich Drepper
2006-01-10 18:27 ` Ulrich Drepper
2006-01-12 0:09 ` Richard Henderson
2006-01-12 0:24 ` Ulrich Drepper
2006-01-13 21:09 ` Richard Henderson
2006-01-13 21:49 ` Ulrich Drepper
2006-01-12 0:12 ` Ulrich Drepper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).