]> git.pld-linux.org Git - packages/glibc.git/blame - glibc-fix_tls_linkage.patch
- damn, wrong branch
[packages/glibc.git] / glibc-fix_tls_linkage.patch
CommitLineData
55751c79
SP
12004-10-01 H.J. Lu <hongjiu.lu@intel.com>
2
3 * elf/Makefile (rtld-routines): Add dl-errno.
4 ($(objpfx)librtld.map): Copy libc_pic.a to libc_pic.a, remove
5 errno.os from libc_pic.a and use libc_rtld.a instead of
6 libc_pic.a.
7 ($(objpfx)librtld.mk): Match libc_rtld.a instead of libc_pic.a.
8
9 * elf/dl-errno.c: New file.
10
11--- elf/Makefile.tls 2004-09-23 15:55:51.000000000 -0700
12+++ elf/Makefile 2004-10-01 16:10:16.000000000 -0700
13@@ -38,7 +38,8 @@ shared-only-routines += dl-caller
14
15 # ld.so uses those routines, plus some special stuff for being the program
16 # interpreter and operating independent of libc.
17-rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ dl-minimal
18+rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ \
19+ dl-minimal dl-errno
20 all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines)
21
22 distribute := rtld-Rules \
23@@ -229,11 +230,17 @@ $(objpfx)dl-allobjs.os: $(all-rtld-routi
24 # those modules come from and builds special rtld-foo.os versions that
25 # are compiled with special flags, and puts these modules into rtld-libc.a
26 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
27+# `errno' is a special case. We don't want the one in libc_pic.a since
28+# `errno' in libc_pic.a may be a TLS, but the dynamic linker doesn't
29+# use TLS. The linker doesn't allow mixing TLS and non-TLS symbols.
30
31 $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
32 @-rm -f $@T
33- $(reloc-link) -o $@.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T
34- rm -f $@.o
35+ @rm -f libc_rtld.a
36+ cp $(common-objpfx)libc_pic.a $(common-objpfx)libc_rtld.a
37+ $(AR) d$(verbose) $(common-objpfx)libc_rtld.a errno.os
38+ $(reloc-link) -o $@.o '-Wl,-(' $(objpfx)dl-allobjs.os $(common-objpfx)libc_rtld.a -lgcc '-Wl,-)' -Wl,-Map,$@T
39+ rm -f $@.o $(common-objpfx)libc_rtld.a
40 mv -f $@T $@
41
42 $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile
43@@ -242,7 +249,7 @@ $(objpfx)librtld.mk: $(objpfx)librtld.ma
44 $< | \
45 while read lib file; do \
46 case $$lib in \
47- libc_pic.a) \
48+ libc_rtld.a) \
49 LC_ALL=C fgrep -l /$$file \
50 $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \
51 LC_ALL=C \
52--- elf/dl-errno.c.tls 2004-10-01 14:57:23.000000000 -0700
53+++ elf/dl-errno.c 2004-10-01 15:34:30.000000000 -0700
54@@ -0,0 +1,19 @@
55+/* Copyright (C) 2004 Free Software Foundation, Inc.
56+ This file is part of the GNU C Library.
57+
58+ The GNU C Library is free software; you can redistribute it and/or
59+ modify it under the terms of the GNU Lesser General Public
60+ License as published by the Free Software Foundation; either
61+ version 2.1 of the License, or (at your option) any later version.
62+
63+ The GNU C Library is distributed in the hope that it will be useful,
64+ but WITHOUT ANY WARRANTY; without even the implied warranty of
65+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
66+ Lesser General Public License for more details.
67+
68+ You should have received a copy of the GNU Lesser General Public
69+ License along with the GNU C Library; if not, write to the Free
70+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
71+ 02111-1307 USA. */
72+
73+#include <errno.c>
74
This page took 0.038952 seconds and 4 git commands to generate.