]> git.pld-linux.org Git - packages/binutils.git/blob - binutils-ia64-tls2.patch
- obsolete
[packages/binutils.git] / binutils-ia64-tls2.patch
1 2003-01-17  Jakub Jelinek  <jakub@redhat.com>
2
3         * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle
4         R_IA64_TPREL64[LM]SB against non-global symbol properly.
5
6         * ld-ia64/tlspic1.s: Add tests for IE in shared libraries.
7         * ld-ia64/tlspic.rd: Adjust.
8         * ld-ia64/tlspic.dd: Adjust.
9         * ld-ia64/tlspic.sd: Adjust.
10
11 --- binutils-2.13.90.0.16/bfd/elfxx-ia64.c.jj   2003-01-16 22:28:30.000000000 +0100
12 +++ binutils-2.13.90.0.16/bfd/elfxx-ia64.c      2003-01-17 14:57:18.000000000 +0100
13 @@ -4264,13 +4264,23 @@ elfNN_ia64_relocate_section (output_bfd,
14         case R_IA64_LTOFF_DTPREL22:
15           {
16             int got_r_type;
17 +           long dynindx = h ? h->dynindx : -1;
18 +           bfd_vma r_addend = rel->r_addend;
19  
20             switch (r_type)
21               {
22               default:
23               case R_IA64_LTOFF_TPREL22:
24 -               if (!dynamic_symbol_p && !info->shared)
25 -                 value -= elfNN_ia64_tprel_base (info);
26 +               if (!dynamic_symbol_p)
27 +                 {
28 +                   if (!info->shared)
29 +                     value -= elfNN_ia64_tprel_base (info);
30 +                   else
31 +                     {
32 +                       r_addend += value - elfNN_ia64_dtprel_base (info);
33 +                       dynindx = 0;
34 +                     }
35 +                 }
36                 got_r_type = R_IA64_TPREL64LSB;
37                 break;
38               case R_IA64_LTOFF_DTPMOD22:
39 @@ -4285,8 +4295,7 @@ elfNN_ia64_relocate_section (output_bfd,
40                 break;
41               }
42             dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false);
43 -           value = set_got_entry (input_bfd, info, dyn_i,
44 -                                  (h ? h->dynindx : -1), rel->r_addend,
45 +           value = set_got_entry (input_bfd, info, dyn_i, dynindx, r_addend,
46                                    value, got_r_type);
47             value -= gp_val;
48             r = elfNN_ia64_install_value (output_bfd, hit_addr, value,
49 --- binutils-2.13.90.0.16/ld/testsuite/ld-ia64/tlspic1.s.jj     2003-01-16 22:28:30.000000000 +0100
50 +++ binutils-2.13.90.0.16/ld/testsuite/ld-ia64/tlspic1.s        2003-01-17 14:11:42.000000000 +0100
51 @@ -88,6 +88,25 @@ fn1:
52         add     r15 = r15, r8
53         ;;
54  
55 +       /* IE against global */
56 +       addl    r14 = @ltoff(@tprel(sg2#)), gp
57 +       ;;
58 +       ld8     r15 = [r14]
59 +       ;;
60 +       add     r14 = r15, r13
61 +       ;;
62 +
63 +       /* IE against local and hidden */
64 +       addl    r14 = @ltoff(@tprel(sl2#)), gp
65 +       addl    r15 = @ltoff(@tprel(sh2#)), gp
66 +       ;;
67 +       ld8     r14 = [r14]
68 +       ld8     r15 = [r15]
69 +       ;;
70 +       add     r14 = r14, r13
71 +       add     r15 = r15, r13
72 +       ;;
73 +
74         mov     ar.pfs = r34
75         mov     b0 = r33
76         br.ret.sptk.many b0
77 --- binutils-2.13.90.0.16/ld/testsuite/ld-ia64/tlspic.rd.jj     2003-01-16 22:28:30.000000000 +0100
78 +++ binutils-2.13.90.0.16/ld/testsuite/ld-ia64/tlspic.rd        2003-01-17 15:12:59.000000000 +0100
79 @@ -22,8 +22,8 @@ Section Headers:
80    \[10\] .data +.*
81    \[11\] .tdata +PROGBITS +0+13000 0+3000 0+60 00 WAT +0 +0 +4
82    \[12\] .tbss +NOBITS +0+13060 0+3060 0+20 00 WAT +0 +0 +1
83 -  \[13\] .dynamic +DYNAMIC +0+13060 0+3060 0+130 10 +WA +3 +0 +8
84 -  \[14\] .got +PROGBITS +0+13190 0+3190 0+38 00 WAp +0 +0 +8
85 +  \[13\] .dynamic +DYNAMIC +0+13060 0+3060 0+140 10 +WA +3 +0 +8
86 +  \[14\] .got +PROGBITS +0+131a0 0+31a0 0+50 00 WAp +0 +0 +8
87    \[15\] .IA_64.pltoff +.*
88    \[16\] .sbss +.*
89    \[17\] .bss +.*
90 @@ -40,17 +40,20 @@ There are 5 program headers, starting at
91  Program Headers:
92    Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
93    LOAD +0x0+ 0x0+ 0x0+ 0x0+2030 0x0+2030 R E 0x10000
94 -  LOAD +0x0+3000 0x0+13000 0x0+13000 0x0+1e0 0x0+1e0 RW +0x10000
95 -  DYNAMIC +0x0+3060 0x0+13060 0x0+13060 0x0+130 0x0+130 RW +0x8
96 +  LOAD +0x0+3000 0x0+13000 0x0+13000 0x0+200 0x0+200 RW +0x10000
97 +  DYNAMIC +0x0+3060 0x0+13060 0x0+13060 0x0+140 0x0+140 RW +0x8
98    TLS +0x0+3000 0x0+13000 0x0+13000 0x0+60 0x0+80 R +0x4
99    IA_64_UNWIND +0x0+2018 0x0+2018 0x0+2018 0x0+18 0x0+18 R +0x8
100  #...
101  
102 -Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 3 entries:
103 +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 6 entries:
104   +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
105 -0+131a8 +0+18000000a7 R_IA64_DTPMOD64LSB +0+ sg1 \+ 0
106 -0+131b0 +0+18000000b7 R_IA64_DTPREL64LSB +0+ sg1 \+ 0
107 -0+131b8 +0+a7 R_IA64_DTPMOD64LSB +0+
108 +0+131b8 +0+18000000a7 R_IA64_DTPMOD64LSB +0+ sg1 \+ 0
109 +0+131c0 +0+18000000b7 R_IA64_DTPREL64LSB +0+ sg1 \+ 0
110 +0+131c8 +0+1b00000097 R_IA64_TPREL64LSB +0+4 sg2 \+ 0
111 +0+131d0 +0+a7 R_IA64_DTPMOD64LSB +0+
112 +0+131d8 +0+97 R_IA64_TPREL64LSB +0+44
113 +0+131e8 +0+97 R_IA64_TPREL64LSB +0+24
114  
115  Relocation section '.rela.IA_64.pltoff' at offset 0x[0-9a-f]+ contains 1 entries:
116   +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
117 @@ -83,13 +86,13 @@ Symbol table '.dynsym' contains 33 entri
118   +22: 0+10 +0 TLS +GLOBAL DEFAULT +11 sg5
119   +23: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr
120   +24: 0+ +0 TLS +GLOBAL DEFAULT +11 sg1
121 - +25: 0+1000 +208 FUNC +GLOBAL DEFAULT +7 fn1
122 + +25: 0+1000 +272 FUNC +GLOBAL DEFAULT +7 fn1
123   +26: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
124   +27: 0+4 +0 TLS +GLOBAL DEFAULT +11 sg2
125   +28: 0+14 +0 TLS +GLOBAL DEFAULT +11 sg6
126   +29: 0+18 +0 TLS +GLOBAL DEFAULT +11 sg7
127   +30: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
128 - +31: 0+13190 +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
129 + +31: 0+131a0 +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
130   +32: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
131  
132  Symbol table '.symtab' contains 60 entries:
133 @@ -146,11 +149,11 @@ Symbol table '.symtab' contains 60 entri
134   +49: 0+10 +0 TLS +GLOBAL DEFAULT +11 sg5
135   +50: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr
136   +51: 0+ +0 TLS +GLOBAL DEFAULT +11 sg1
137 - +52: 0+1000 +208 FUNC +GLOBAL DEFAULT +7 fn1
138 + +52: 0+1000 +272 FUNC +GLOBAL DEFAULT +7 fn1
139   +53: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
140   +54: 0+4 +0 TLS +GLOBAL DEFAULT +11 sg2
141   +55: 0+14 +0 TLS +GLOBAL DEFAULT +11 sg6
142   +56: 0+18 +0 TLS +GLOBAL DEFAULT +11 sg7
143   +57: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
144 - +58: 0+13190 +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
145 + +58: 0+131a0 +0 OBJECT +GLOBAL DEFAULT +ABS _GLOBAL_OFFSET_TABLE_
146   +59: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
147 --- binutils-2.13.90.0.16/ld/testsuite/ld-ia64/tlspic.dd.jj     2003-01-16 22:28:30.000000000 +0100
148 +++ binutils-2.13.90.0.16/ld/testsuite/ld-ia64/tlspic.dd        2003-01-17 15:20:45.000000000 +0100
149 @@ -18,35 +18,47 @@ Disassembly of section .text:
150   +101c:        01 0a 00 90[    ]+addl r15=32,r1;;
151   +1020:        19 18 01 1c 18 10[      ]+\[MMB\] +ld8 r35=\[r14\]
152   +1026:        40 02 3c 30 20 00[      ]+ld8 r36=\[r15\]
153 - +102c:        48 f6 ff 58[    ]+br.call.sptk.many b0=[0-9a-f]+ <.*>;;
154 - +1030:        0d 70 a0 02 00 24[      ]+\[MFI\] +addl r14=40,r1
155 + +102c:        88 f6 ff 58[    ]+br.call.sptk.many b0=[0-9a-f]+ <.*>;;
156 + +1030:        0d 70 c0 02 00 24[      ]+\[MFI\] +addl r14=48,r1
157   +1036:        00 00 00 02 00 e0[      ]+nop.f 0x0
158 - +103c:        01 0b 00 90[    ]+addl r15=48,r1;;
159 + +103c:        01 0c 00 90[    ]+addl r15=64,r1;;
160   +1040:        19 18 01 1c 18 10[      ]+\[MMB\] +ld8 r35=\[r14\]
161   +1046:        40 02 3c 30 20 00[      ]+ld8 r36=\[r15\]
162 - +104c:        28 f6 ff 58[    ]+br.call.sptk.many b0=[0-9a-f]+ <.*>;;
163 - +1050:        0d 70 a0 02 00 24[      ]+\[MFI\] +addl r14=40,r1
164 + +104c:        68 f6 ff 58[    ]+br.call.sptk.many b0=[0-9a-f]+ <.*>;;
165 + +1050:        0d 70 c0 02 00 24[      ]+\[MFI\] +addl r14=48,r1
166   +1056:        00 00 00 02 00 80[      ]+nop.f 0x0
167   +105c:        14 02 00 90[    ]+mov r36=33;;
168   +1060:        1d 18 01 1c 18 10[      ]+\[MFB\] +ld8 r35=\[r14\]
169   +1066:        00 00 00 02 00 00[      ]+nop.f 0x0
170 - +106c:        08 f6 ff 58[    ]+br.call.sptk.many b0=[0-9a-f]+ <.*>;;
171 - +1070:        0d 70 a0 02 00 24[      ]+\[MFI\] +addl r14=40,r1
172 + +106c:        48 f6 ff 58[    ]+br.call.sptk.many b0=[0-9a-f]+ <.*>;;
173 + +1070:        0d 70 c0 02 00 24[      ]+\[MFI\] +addl r14=48,r1
174   +1076:        00 00 00 02 00 80[      ]+nop.f 0x0
175   +107c:        04 00 00 84[    ]+mov r36=r0;;
176   +1080:        1d 18 01 1c 18 10[      ]+\[MFB\] +ld8 r35=\[r14\]
177   +1086:        00 00 00 02 00 00[      ]+nop.f 0x0
178 - +108c:        e8 f5 ff 58[    ]+br.call.sptk.many b0=[0-9a-f]+ <.*>;;
179 + +108c:        28 f6 ff 58[    ]+br.call.sptk.many b0=[0-9a-f]+ <.*>;;
180   +1090:        0b 10 00 10 00 21[      ]+\[MMI\] +mov r2=r8;;
181   +1096:        e0 00 0a 00 48 e0[      ]+addl r14=64,r2
182   +109c:        21 16 00 90[    ]+addl r15=98,r2;;
183   +10a0:        05 70 4c 11 00 21[      ]+\[MLX\] +adds r14=83,r8
184   +10a6:        00 00 00 00 00 e0[      ]+movl r15=0x71;;
185   +10ac:        11 07 00 60 
186 - +10b0:        0a 78 3c 10 00 20[      ]+\[MMI\] +add r15=r15,r8;;
187 - +10b6:        00 00 00 02 00 00[      ]+nop.m 0x0
188 - +10bc:        20 02 aa 00[    ]+mov.i ar.pfs=r34
189 - +10c0:        11 00 00 00 01 00[      ]+\[MIB\] +nop.m 0x0
190 - +10c6:        00 08 05 80 03 80[      ]+mov b0=r33
191 - +10cc:        08 00 84 00[    ]+br.ret.sptk.many b0;;
192 + +10b0:        0b 78 3c 10 00 20[      ]+\[MMI\] +add r15=r15,r8;;
193 + +10b6:        e0 40 05 00 48 00[      ]+addl r14=40,r1
194 + +10bc:        00 00 04 00[    ]+nop.i 0x0;;
195 + +10c0:        0b 78 00 1c 18 10[      ]+\[MMI\] +ld8 r15=\[r14\];;
196 + +10c6:        e0 78 34 00 40 00[      ]+add r14=r15,r13
197 + +10cc:        00 00 04 00[    ]+nop.i 0x0;;
198 + +10d0:        0d 70 20 03 00 24[      ]+\[MFI\] +addl r14=72,r1
199 + +10d6:        00 00 00 02 00 e0[      ]+nop.f 0x0
200 + +10dc:        81 0b 00 90[    ]+addl r15=56,r1;;
201 + +10e0:        09 70 00 1c 18 10[      ]+\[MMI\] +ld8 r14=\[r14\]
202 + +10e6:        f0 00 3c 30 20 00[      ]+ld8 r15=\[r15\]
203 + +10ec:        00 00 04 00[    ]+nop.i 0x0;;
204 + +10f0:        02 70 38 1a 00 20[      ]+\[MII\] +add r14=r14,r13
205 + +10f6:        f0 78 34 00 40 00[      ]+add r15=r15,r13;;
206 + +10fc:        20 02 aa 00[    ]+mov.i ar.pfs=r34
207 + +1100:        11 00 00 00 01 00[      ]+\[MIB\] +nop.m 0x0
208 + +1106:        00 08 05 80 03 80[      ]+mov b0=r33
209 + +110c:        08 00 84 00[    ]+br.ret.sptk.many b0;;
210  #pass
211 --- binutils-2.13.90.0.16/ld/testsuite/ld-ia64/tlspic.sd.jj     2003-01-17 15:40:29.000000000 +0100
212 +++ binutils-2.13.90.0.16/ld/testsuite/ld-ia64/tlspic.sd        2003-01-17 15:39:45.000000000 +0100
213 @@ -8,7 +8,8 @@
214  .*: +file format elf64-ia64-little
215  
216  Contents of section .got:
217 - 13190 0+ 0+ 0+ 0+  .*
218 - 131a0 0+ 0+ [0-9a-f]+ [0-9a-f]+  .*
219 - 131b0 [0-9a-f]+ [0-9a-f]+ [0-9a-f]+ [0-9a-f]+  .*
220 - 131c0 440+ 0+  .*
221 + 131a0 0+ 0+ 0+ 0+  .*
222 + 131b0 0+ 0+ [0-9a-f]+ [0-9a-f]+  .*
223 + 131c0 [0-9a-f]+ [0-9a-f]+ [0-9a-f]+ [0-9a-f]+  .*
224 + 131d0 [0-9a-f]+ [0-9a-f]+ [0-9a-f]+ [0-9a-f]+  .*
225 + 131e0 440+ 0+ [0-9a-f]+ [0-9a-f]+  .*
This page took 0.123353 seconds and 3 git commands to generate.