Commit | Line | Data |
---|---|---|
3e90f135 CC |
1 | 2008-05-30 Cary Coutant <ccoutant@google.com> |
2 | ||
3 | * archive.cc (Archive::include_all_members) Correct to step | |
4 | over symbol table and extended name table in thin archives. | |
5 | ||
e09ad04a ILT |
6 | 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com> |
7 | ||
8 | PR 6407 | |
9 | * target-reloc.h (relocate_for_relocatable): Fix new_offset | |
10 | calculation. | |
11 | ||
62b01cb5 ILT |
12 | 2008-05-28 Caleb Howe <cshowe@google.com> |
13 | ||
14 | * reduced_debug_output.cc: New file. | |
15 | * reduced_debug_output.h: New file. | |
16 | * options.h (class General_optoins): Add --strip-debug-non-line. | |
17 | * options.cc (General_options::finalize): Add strip_debug_non_line | |
18 | to the strip heirarchy. | |
19 | * layout.h (class Layout): Add debug_abbrev_ and debug_info_ | |
20 | fields. | |
21 | * layout.cc: Include "reduced_debug_output.h". | |
22 | (Layout::Layout): Initialize new fields. | |
23 | (line_only_debug_sections): New static array. | |
24 | (is_lines_only_debug_sections): New static inline function. | |
25 | (Layout::include_section): Handle --strip-debug-non-line. | |
26 | (Layout::make_output_section): If --strip-debug-non-line, build | |
27 | new output sections for .debug_abbrev and .debug_info. | |
28 | * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace | |
29 | gold. Warn about possible overflow. | |
30 | (read_signed_LEB_128): Likewise. | |
31 | * dwarf_reader.h: (read_unsigned_LEB_128): Declare. | |
32 | (read_signed_LEB_128): Declare. | |
33 | * Makefile.am (CCFILES): Add reduced_debug_output.cc. | |
34 | (HFILES): Add reduced_debug_output.h. | |
35 | * Makefile.in: Rebuild. | |
36 | ||
7d9e3d98 ILT |
37 | 2008-05-21 Ian Lance Taylor <iant@google.com> |
38 | ||
39 | * mapfile.cc: New file. | |
40 | * mapfile.h: New file. | |
41 | * options.h (class General_options): Add -M/--print-map and -Map. | |
42 | * options.cc (General_options::finalize): Make -M equivalent to | |
43 | -Map -. | |
44 | * main.cc: Include <cstdio> and "mapfile.h". | |
45 | (main): Open mapfile if requested. | |
46 | * gold.cc (class Middle_runner): Add mapfile_ field. Update | |
47 | constructor. Change caller. | |
48 | (queue_initial_tasks): Add mapfile parameter. Change caller. | |
49 | (queue_middle_tasks): Likewise. | |
50 | * gold.h (queue_initial_tasks, queue_middle_tasks): Update | |
51 | declarations. | |
52 | * archive.cc: Include "mapfile.h". | |
53 | (Archive::add_symbols): Add mapfile parameter. Change all | |
54 | callers. Pass mapfile, symbol, and reason to include_member. | |
55 | (Archive::include_all_members): Add mapfile parameter. Change all | |
56 | callers. | |
57 | (Archive::include_member): Add mapfile, sym, and why parameters. | |
58 | Change all callers. Report inclusion to map file. | |
59 | * archive.h: Include "fileread.h". | |
60 | (class Archive): Update declarations. | |
61 | (Archive::file): New const method. | |
62 | (class Add_archive_symbols): Add mapfile_ field. Update | |
63 | constructor. Change all callers. | |
64 | * readsyms.h (class Read_symbols): Likewise. | |
65 | (class Finish_group): Likewise. | |
66 | (class Read_script): Likewise. | |
67 | * common.cc: Include "mapfile.h". | |
68 | (Symbol_table::allocate_commons): Add mapfile parameter. Change | |
69 | all callers. | |
70 | (Symbol_table::do_allocate_commons): Likewise. | |
71 | (Symbol_table::do_allocate_commons_list): Likewise. Report common | |
72 | symbol allocation to mapfile. | |
73 | * common.h (class Allocate_commons_task): Add mapfile_ field. | |
74 | Update constructor. Change all callers. | |
75 | * symtab.h (class Symbol_table): Update declarations. | |
76 | * layout.cc: Include "mapfile.h". | |
77 | (Layout_task_runner::run): Print information to mapfile. | |
78 | (Layout::create_gold_note): Change Output_data_fixed_space to | |
79 | Output_data_zero_fill. | |
80 | (Layout::create_build_id): Likewise. | |
81 | (Layout::print_to_mapfile): New function. | |
82 | * layout.h (class Layout_task_runner): Add mapfile_ field. Update | |
83 | constructor. Change caller. | |
84 | (class Layout): Declare print_to_mapfile. | |
85 | * output.cc (Output_section::Input_section::print_to_mapfile): New | |
86 | function. | |
87 | (Output_section::add_input_section): If producing a map, always | |
88 | add to input_sections_ list. | |
89 | (Output_section::do_print_to_mapfile): New function. | |
90 | (Output_segment::print_sections_to_mapfile): New function. | |
91 | (Output_segment::print_section_list_to_mapfile): New function. | |
92 | * output.h: Include "mapfile.h". | |
93 | (Output_data::print_to_mapfile): New function. | |
94 | (Output_data::do_print_to_mapfile): New virtual function. | |
95 | (Output_segment_headers::do_print_to_mapfile): New function. | |
96 | (Output_file_header::do_print_to_mapfile): New function. | |
97 | (Output_data_const::do_print_to_mapfile): New function. | |
98 | (class Output_data_const_buffer): Add map_name_ field. Update | |
99 | constructor. Change all callers. Add do_print_to_mapfile | |
100 | function. | |
101 | (class Output_data_fixed_space): Likewise. | |
102 | (class Output_data_space): Likewise. | |
103 | (class Output_data_zero_fill): New class. | |
104 | (Output_data_strtab::do_print_to_mapfile): New function. | |
105 | (Output_data_reloc_base::do_print_to_mapfile): New function. | |
106 | (Output_relocatable_relocs::do_print_to_mapfile): New function. | |
107 | (Output_data_group::do_print_to_mapfile): New function. | |
108 | (Output_data_got::do_print_to_mapfile): New function. | |
109 | (Output_data_dynamic::do_print_to_mapfile): New function. | |
110 | (Output_symtab_xindex::do_print_to_mapfile): New function. | |
111 | (class Output_section): Declare do_print_to_mapflie. Declare | |
112 | print_to_mapfile in Input_section. | |
113 | (class Output_segment): Declare new functions. | |
114 | * object.h (Sized_relobj::symbol_count): New function. | |
115 | * script-sections.cc | |
116 | (Output_section_element_dot_assignment::set_section_addresses): | |
117 | Change Output_data_fixed_space to Output_data_zero_fill. | |
118 | (Output_data_expression::do_print_to_mapfile): New function. | |
119 | * script.cc (read_input_script): Add mapfile parameter. Change | |
120 | all callers. | |
121 | * script.h (read_input_script): Update declaration. | |
122 | * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function. | |
123 | (Eh_frame::do_print_to_mapfile): New function. | |
124 | * merge.h (Output_merge_data::do_print_to_mapfile): New function. | |
125 | (Output_merge_string::do_print_to_mapfile): New function. | |
126 | * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New | |
127 | function. | |
128 | * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New | |
129 | function. | |
130 | * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New | |
131 | function. | |
132 | * Makefile.am (CCFILES): Add mapfile.cc. | |
133 | (HFILES): Add mapfile.h. | |
134 | * Makefile.in: Rebuild. | |
135 | ||
9f1d377b ILT |
136 | 2008-05-19 Ian Lance Taylor <iant@google.com> |
137 | ||
138 | * options.h (class General_options): Add -z relro. | |
139 | * layout.cc (Layout::Layout): Initialize relro_segment_. | |
140 | (Layout::add_output_section_data): Return the output section. | |
141 | (Layout::make_output_section): Rcognize relro sections and mark | |
142 | them appropriately. | |
143 | (Layout::attach_allocated_section_to_segment): Put relro sections | |
144 | in a PT_GNU_RELRO segment. | |
145 | (Layout::create_initial_dynamic_sections): Mark the .dynamic | |
146 | section as relro. | |
147 | (Layout::segment_precedes): Sort PT_GNU_RELRO segments after | |
148 | PT_TLS segments. | |
149 | (Layout::linkonce_mapping): Map d.rel.ro.local to | |
150 | .data.rel.ro.local. | |
151 | (Layout::output_section_name): Us .data.rel.ro.local for any | |
152 | section which begins with that. | |
153 | * layout.h (class Layout): Update add_output_section_data | |
154 | declaration. Add relro_segment_ field. | |
155 | * output.cc (Output_section::Output_section): Initialize is_relro_ | |
156 | and is_relro_local_ fields. | |
157 | (Output_segment::add_output_section): Group relro sections. | |
158 | (Output_segment::is_first_section_relro): New function. | |
159 | (Output_segment::maximum_alignment): If there is a relro section, | |
160 | align the segment to the common page size. | |
161 | (Output_segment::set_section_addresses): Track whether we are | |
162 | looking at relro sections. If the last section is a relro | |
163 | section, align to the common page size. | |
164 | (Output_segment::set_section_list_addresses): Add in_relro | |
165 | parameter. Change all callers. Align to the page size when | |
166 | moving from relro to non-relro section. | |
167 | (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO | |
168 | segment. | |
169 | * output.h (class Output_section): Add is_relro_ and | |
170 | is_relro_local_ fields. | |
171 | (Output_section::is_relro): New function. | |
172 | (Output_section::set_is_relro): New function. | |
173 | (Output_section::is_relro_local): New function. | |
174 | (Output_section::set_is_relro_local): New function. | |
175 | (class Output_segment): Update declarations. | |
176 | * i386.cc (Target_i386::got_section): Mark .got section as relro. | |
177 | * sparc.cc (Target_sparc::got_section): Likewise. | |
178 | * x86_64.cc (Target_x86_64::got_section): Likewise. | |
179 | * testsuite/relro_test_main.cc: New file. | |
180 | * testsuite/relro_test.cc: New file. | |
181 | * testsuite/Makefile.am (check_PROGRAMS): Add relro_test. | |
182 | (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables. | |
183 | (relro_test_LDFLAGS, relro_test_LDADD): New variables. | |
184 | (relro_test.so, relro_test_pic.o): New targets. | |
185 | * testsuite/Makefile.in: Rebuild. | |
186 | ||
a984ee1d ILT |
187 | 2008-05-16 Ian Lance Taylor <iant@google.com> |
188 | ||
01676dcd ILT |
189 | * output.cc (Output_segment::add_output_section): Remove front |
190 | parameter. | |
191 | * output.h (class Output_segment): Remove | |
192 | add_initial_output_section and overloaded add_output_section. | |
193 | Update declaration of remaining add_output_section. | |
194 | * layout.cc (Layout::create_interp): Call add_output_section | |
195 | rather than add_initial_output_section. | |
196 | (Layout::finish_dynamic_section): Likewise. | |
197 | ||
497897f9 ILT |
198 | * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type |
199 | for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we | |
200 | know the dynamic type. | |
201 | * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_ | |
202 | field. Initialize it in constructor. | |
203 | (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS | |
204 | block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD. | |
205 | Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block | |
206 | reloc. | |
207 | ||
a984ee1d ILT |
208 | * output.cc (Output_reloc::get_address): Change return type to |
209 | Elf_Addr. | |
210 | * output.h (class Output_reloc): Update get_address declaration. | |
211 | * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types | |
212 | for section addresses. | |
213 | ||
55ba0940 ILT |
214 | 2008-05-09 Ian Lance Taylor <iant@google.com> |
215 | ||
216 | PR 6493 | |
217 | * gold.cc (gold_nomem): Use return value of write. | |
218 | ||
75517b77 ILT |
219 | 2008-05-08 Ian Lance Taylor <iant@google.com> |
220 | ||
221 | * symtab.c (Symbol::init_base_output_data): Add version | |
222 | parameter. Change all callers. | |
223 | (Symbol::init_base_output_segment): Likewise. | |
224 | (Symbol::init_base_constant): Likewise. | |
225 | (Symbol::init_base_undefined): Likewise. | |
226 | (Sized_symbol::init_output_data): Likewise. | |
227 | (Sized_symbol::init_output_segment): Likewise. | |
228 | (Sized_symbol::init_constant): Likewise. | |
229 | (Sized_symbol::init_undefined): Likewise. | |
230 | (Symbol_table::do_define_in_output_data): If the new symbol has a | |
231 | version, mark it as the default. | |
232 | (Symbol_table::do_define_in_output_segment): Likewise. | |
233 | (Symbol_table::do_define_as_constant): Likewise. | |
234 | * symtab.h (class Symbol): Update declarations. | |
235 | (class Sized_symbol): Likewise. | |
236 | * resolve.cc (Symbol::override_version): New function. | |
237 | (Symbol::override_base: Call override_version. | |
238 | (Symbol::override_base_with_special): Likewise. | |
239 | * testsuite/ver_script_8.script: New file. | |
240 | * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8. | |
241 | (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define. | |
242 | (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define. | |
243 | (ver_test_8_1.so, ver_test_8_2.so): New targets. | |
244 | ||
f1f70eae ILT |
245 | 2008-05-06 Ian Lance Taylor <iant@google.com> |
246 | ||
f3e9c5c5 ILT |
247 | PR 6049 |
248 | * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end | |
249 | functions. | |
250 | (class General_options): Remove existing --undefined, and add | |
251 | --no-undefined instead. Add new --undefined as synonym for -u. | |
252 | * archive.cc (Archive::add_symbols): Check whether symbol was | |
253 | named with -u. | |
254 | * gold.cc (queue_middle_tasks): Add -u symbols to symbol table. | |
255 | * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change | |
256 | all uses. Add IS_UNDEFINED. Update declarations to split | |
257 | different versions of init_base. Declare init_base_undefined. | |
258 | (Symbol::is_defined): Handle IS_UNDEFINED. | |
259 | (Symbol::is_undefined): Likewise. | |
260 | (Symbol::is_weak_undefined): Call is_undefined. | |
261 | (Symbol::is_absolute): Handle IS_CONSTANT. | |
262 | (class Sized_symbol): Update declarations to split different | |
263 | versions of init. Declare init_undefined. | |
264 | (class Symbol_table): Declare new functions. | |
265 | * symtab.cc (Symbol::init_base_object): Rename from init_base. | |
266 | Change all callers. | |
267 | (Symbol::init_base_output_data): Likewise. | |
268 | (Symbol::init_base_output_segment): Likewise. | |
269 | (Symbol::init_base_constant): Likewise. | |
270 | (Symbol::init_base_undefined): New function. | |
271 | (Sized_symbol::init_object): Rename from init. Change all | |
272 | callers. | |
273 | (Sized_symbol::init_output_data): Likewise. | |
274 | (Sized_symbol::init_output_segment): Likewise. | |
275 | (Sized_symbol::init_constant): Likewise. | |
276 | (Sized_symbol::init_undefined): New function. | |
277 | (Symbol_table::add_undefined_symbols_from_command_line): New | |
278 | function. | |
279 | (Symbol_table::do_add_undefined_symbols_from_command_line): New | |
280 | function. | |
281 | (Symbol::final_value_is_known): Handle IS_UNDEFINED. | |
282 | (Symbol::output_section): Likewise. | |
283 | (Symbol::set_output_section): Likewise. | |
284 | (Symbol_table::sized_finalize_symbol): Likewise. | |
285 | (Symbol_table::sized_write_globals): Likewise. | |
286 | * resolve.cc (Symbol_table::should_override): Likewise. | |
287 | (Symbol::override_base_with_special): Likewise. | |
288 | ||
8bdcdf2c ILT |
289 | * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected |
290 | symbol, change it to have default visibility. | |
291 | * testsuite/protected_1.cc: New file. | |
292 | * testsuite/protected_2.cc: New file. | |
293 | * testsuite/protected_3.cc: New file. | |
294 | * testsuite/protected_main_1.cc: New file. | |
295 | * testsuite/protected_main_2.cc: New file. | |
296 | * testsuite/protected_main_3.cc: New file. | |
297 | * testsuite/Makefile.am (check_PROGRAMS): Add protected_1. | |
298 | (protected_1_SOURCES, protected_1_DEPENDENCIES): Define. | |
299 | (protected_1_LDFLAGS, protected_1_LDADD): Define. | |
300 | (protected_1.so): New target. | |
301 | (protected_1_pic.o, protected_2_pic.o): New targets. | |
302 | (protected_3_pic.o): New target. | |
303 | (check_PROGRAMS): Add protected_2. | |
304 | (protected_2_SOURCES, protected_2_DEPENDENCIES): Define. | |
305 | (protected_2_LDFLAGS, protected_2_LDADD): Define. | |
306 | * testsuite/Makefile.in: Rebuild. | |
307 | ||
2b706932 ILT |
308 | * options.h (DEFINE_var): Add set_user_set_##varname__. |
309 | (DEFINE_bool_alias): New macro. | |
310 | (class General_options): Define -Bstatic using DEFINE_bool_alias | |
311 | rather than DEFINE_special. Add --undefined as an alias for -z | |
312 | defs. | |
313 | * options.cc (General_options::parse_Bstatic): Remove. | |
314 | ||
d82a5bcc ILT |
315 | * options.h (class General_options): Add --fatal-warnings. |
316 | * main.cc (main): Implement --fatal-warnings. | |
317 | * errors.h (Errors::warning_count): New function. | |
318 | ||
f1f70eae ILT |
319 | * options.h (class General_options): Add -Bsymbolic-functions. |
320 | * symtab.h (Symbol::is_preemptible): Check for | |
321 | -Bsymbolic-functions. | |
322 | ||
8825ac63 ILT |
323 | 2008-05-05 Ian Lance Taylor <iant@google.com> |
324 | ||
d98bc257 ILT |
325 | * options.h (DEFINE_bool): For DASH_Z, create the negative option |
326 | as noVARNAME rather than no-VARNAME. | |
327 | (class General_options): Add option -z combreloc. | |
328 | * output.h (class Output_reloc) [SHT_REL]: Declare compare and | |
329 | get_address. | |
330 | (Output_reloc::sort_before) [SHT_REL]: New function. | |
331 | (Output_reloc::sort_before) [SHT_RELA]: New function. | |
332 | (class Output_data_reloc_base): Add sort_relocs_ field. Define | |
333 | Sort_relocs_comparison. | |
334 | (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs | |
335 | parameter. Change all callers. | |
336 | (Output_data_reloc::Output_data_reloc) [both versions]: Add | |
337 | sort_relocs parameter. Change all callers. | |
338 | * output.cc (Output_reloc::get_address): New function, broken out | |
339 | of write_rel. | |
340 | (Output_reloc::write_rel): Call it. | |
341 | (Output_reloc::compare): New function. | |
342 | (Output_data_reloc_base::do_write): Optionally sort relocs. | |
343 | ||
60b2b4e7 ILT |
344 | * configure.ac: If targ_extra_obj is set, link it in. |
345 | * configure.tgt: Initialize all variables. | |
346 | (x86_64*): Set targ_extra_obj and targ_extra_size. | |
347 | * configure: Rebuild. | |
348 | ||
8825ac63 ILT |
349 | * object.cc (Sized_relobj::include_section_group): Adjust section |
350 | indexes read from group data. Build vector to pass to | |
351 | layout_group. | |
352 | * layout.cc (Layout::layout_group): Add flags and shndxes | |
353 | parameters. Remove contents parameter. Change caller. Update | |
354 | explicit instantiations. | |
355 | * layout.h (class Layout): Update layout_group declaration. | |
356 | * output.cc (Output_data_group::Output_data_group): Add flags and | |
357 | input_shndxes parameters. Remove contents parameter. Change | |
358 | caller. | |
359 | (Output_data_group::do_write): Change input_sections_ to | |
360 | input_shndxes_. | |
361 | * output.h (class Output_data_group): Update constructor | |
362 | declaration. Rename input_sections_ to input_shndxes_. | |
363 | * testsuite/many_sections_test.cc: Add template. | |
364 | ||
e94cf127 CC |
365 | 2008-04-30 Cary Coutant <ccoutant@google.com> |
366 | ||
4418b2d5 CC |
367 | * target-reloc.h (relocate_section): Fix dead-pointer bug. |
368 | ||
e94cf127 CC |
369 | * layout.cc (Layout::include_section): Refactored check for debug |
370 | info section. | |
371 | (Layout::add_comdat): Add new parameters. Change type | |
372 | of signature parameter. Add object and shndx to signatures table. | |
373 | (Layout::find_kept_object): New function. | |
374 | * layout.h: Include <cstring>. | |
375 | (Layout::is_debug_info_section): New function. | |
376 | (Layout::add_comdat): Add new parameters. | |
377 | (Layout::find_kept_object): New function. | |
378 | (Layout::Kept_section): New struct. | |
379 | (Layout::Signatures): Change type of map range. | |
380 | * object.cc (Relobj::output_section_address): New function. | |
381 | (Sized_relobj::include_section_group): Add new parameters. Change | |
382 | calls to Layout::add_comdat. Change to build table of kept comdat | |
383 | groups and table mapping discarded sections to kept sections. | |
384 | (Sized_relobj::include_linkonce_section): Likewise. Add new parameter. | |
385 | (Sized_relobj::do_layout): Change calls to include_section_group and | |
386 | include_linkonce_section. | |
387 | (Sized_relobj::do_finalize_local_symbols): Do not set local symbol | |
388 | value to zero when section is discarded. | |
389 | (Sized_relobj::map_to_kept_section): New function. | |
390 | * object.h (Relobj::output_section_address): New function. | |
391 | (Relobj::Comdat_group): New type. | |
392 | (Relobj::find_comdat_group): New function. | |
393 | (Relobj::Comdat_group_table): New type. | |
394 | (Relobj::Kept_comdat_section): New type. | |
395 | (Relobj::Kept_comdat_section_table): New type. | |
396 | (Relobj::add_comdat_group): New function. | |
397 | (Relobj::set_kept_comdat_section): New function. | |
398 | (Relobj::get_kept_comdat_section): New function. | |
399 | (Relobj::comdat_groups_): New field. | |
400 | (Relobj::kept_comdat_sections_): New field. | |
401 | (Symbol_value::input_value): Update comment. | |
402 | (Sized_relobj::map_to_kept_section) New function. | |
403 | (Sized_relobj::include_linkonce_section): Add new parameter. | |
404 | * target-reloc.h (Comdat_behavior): New type. | |
405 | (get_comdat_behavior): New function. | |
406 | (relocate_section): Add code to map a discarded section to the | |
407 | corresponding kept section when applying a relocation. | |
408 | ||
e4e5049b CS |
409 | 2008-04-30 Craig Silverstein <csilvers@google.com> |
410 | ||
411 | * dwarf_reader.cc (next_generation_count): New static var. | |
412 | (Addr2line_cache_entry): New struct. | |
413 | (addr2line_cache): New static var. | |
414 | (Dwarf_line_info::one_addr2line): Added caching. | |
415 | (Dwarf_line_info::clear_addr2line_cache): New function. | |
416 | * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add | |
417 | cache-size parameter. | |
418 | (Dwarf_line_info::one_addr2line_cache): New function. | |
419 | * symtab.cc (Symbol_table::detect_odr_violations): Pass | |
420 | new cache-size argument to one_addr2line(), and clear cache. | |
421 | ||
d09e9154 CC |
422 | 2008-04-28 Cary Coutant <ccoutant@google.com> |
423 | ||
424 | * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and | |
425 | R_386_PC8 relocations. | |
426 | ||
7ef73768 ILT |
427 | 2008-04-23 Ian Lance Taylor <iant@google.com> |
428 | ||
55438702 ILT |
429 | * object.cc (Sized_relobj::include_section_group): Check for |
430 | invalid section group. | |
431 | ||
c165fb93 ILT |
432 | * object.cc (make_elf_object): Correct test for 64-bit ELF file |
433 | header size. | |
434 | ||
7ef73768 ILT |
435 | * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather |
436 | than read for file header. | |
437 | * archive.cc (Archive::include_member): Likewise. | |
438 | ||
6194aaab L |
439 | 2008-04-23 Paolo Bonzini <bonzini@gnu.org> |
440 | ||
441 | * aclocal.m4: Regenerate. | |
442 | * configure: Regenerate. | |
443 | ||
d491d34e ILT |
444 | 2008-04-19 Ian Lance Taylor <iant@google.com> |
445 | ||
5ea2bac6 ILT |
446 | * version.cc (version_string): Bump to 1.6. |
447 | ||
7bc3e21a ILT |
448 | * testsuite/Makefile.am (many_sections_r_test): New target. |
449 | (many_sections_r_test_SOURCES): Remove. | |
450 | (many_sections_r_test_DEPENDENCIES): Remove. | |
451 | (many_sections_r_test_LDFLAGS): Remove. | |
452 | (many_sections_r_test_LDADD): Remove. | |
453 | ||
7fcd3aa9 ILT |
454 | * object.cc (Sized_relobj::do_add_symbols): Always pass |
455 | local_symbol_count_ to add_from_relobj. | |
456 | ||
4c94d6ae ILT |
457 | * testsuite/Makefile.am (many_sections_check.h): Only check one in |
458 | every thousand variables. | |
459 | * testsuite/Makefile.in: Rebuild. | |
460 | ||
d491d34e ILT |
461 | * object.cc (Xindex::initialize_symtab_xindex): New function. |
462 | (Xindex::read_symtab_xindex): New function. | |
463 | (Xindex::sym_xindex_to_shndx): New function. | |
464 | (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if | |
465 | available. | |
466 | (Sized_relobj::do_initialize_xindex): New function. | |
467 | (Sized_relobj::do_read_symbols): Adjust section links. | |
468 | (Sized_relobj::symbol_section_and_value): Add is_ordinary | |
469 | parameter. Change all callers. | |
470 | (Sized_relobj::include_section_group): Adjust section links and | |
471 | symbol section indexes. | |
472 | (Sized_relobj::do_layout): Adjust section links. | |
473 | (Sized_relobj::do_count_local_symbols): Adjust section links and | |
474 | symbol section indexes. | |
475 | (Sized_relobj::do_finalize_local_symbols): Distinguish between | |
476 | ordinary and special symbols. | |
477 | (Sized_relobj::write_local_symbols): Add symtab_xindex and | |
478 | dynsym_xindex parameters. Change all callers. Adjust section | |
479 | links. Use SHN_XINDEX when needed. | |
480 | (Sized_relobj::get_symbol_location_info): Adjust section links. | |
481 | Don't get fooled by special symbols. | |
482 | * object.h (class Xindex): Define. | |
483 | (class Object): Add xindex_ parameter. Declare virtual functoin | |
484 | do_initialize_xindex. | |
485 | (Object::adjust_sym_shndx): New function. | |
486 | (Object::set_xindex): New protected function. | |
487 | (class Symbol_value): Add is_ordinary_shndx_ field. | |
488 | (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_. | |
489 | (Symbol_value::value): Assert ordinary section. | |
490 | (Symbol_value::initialize_input_to_output_map): Likewise. | |
491 | (Symbol_value::set_input_shndx): Add is_ordinary parameter. | |
492 | Change all callers. | |
493 | (Symbol_value::input_shndx): Add is_ordinary parameter. Change | |
494 | all callers. | |
495 | (class Sized_relobj): Update declarations. | |
496 | (Sized_relobj::local_symbol_input_shndx): Add is_ordinary | |
497 | parameter. Change all callers. | |
498 | (Sized_relobj::adjust_shndx): New function. | |
499 | * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_ | |
500 | field. | |
501 | (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx | |
502 | parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section | |
503 | for SHT_DYNSYM section if available. Set dynsym_shndx_ field. | |
504 | (Sized_dynobj::read_dynsym_section): Adjust section links. | |
505 | (Sized_dynobj::read_dynamic): Likewise. | |
506 | (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust | |
507 | section links. | |
508 | (Sized_dynobj::do_initialize_xindex): New function. | |
509 | * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare | |
510 | do_initialize_xindex. | |
511 | (Sized_dynobj::adjust_shndx): New function. | |
512 | * layout.cc (Layout::Layout): Initialize symtab_xindex_ and | |
513 | dynsym_xindex_ fields. | |
514 | (Layout::finalize): Add a call to set_section_indexes before | |
515 | creating the symtab sections. | |
516 | (Layout::set_section_indexes): Don't do anything if the section | |
517 | already has a section index. | |
518 | (Layout::create_symtab_sections): Add shnum parameter. Change | |
519 | caller. Create .symtab_shndx section if needed. | |
520 | (Layout::create_shdrs): Add shstrtab_section parameter. Change | |
521 | caller. | |
522 | (Layout::allocated_output_section_count): New function. | |
523 | (Layout::create_dynamic_symtab): Create .dynsym_shndx section if | |
524 | needed. | |
525 | * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_ | |
526 | fields. Update declarations. | |
527 | (Layout::symtab_xindex): New function. | |
528 | (Layout::dynsym_xindex): New function. | |
529 | (class Write_symbols_task): Add layout_ field. | |
530 | (Write_symbols_task::Write_symbols_task): Add layout parameter. | |
531 | Change caller. | |
532 | * output.cc (Output_section_headers::Output_section_headers): Add | |
533 | shstrtab_section parameter. Change all callers. | |
534 | (Output_section_headers::do_sized_write): Store overflow values | |
535 | for section count and section string table section index in | |
536 | section header zero. | |
537 | (Output_file_header::do_sized_write): Check for overflow of | |
538 | section count and section string table section index. | |
539 | (Output_symtab_xindex::do_write): New function. | |
540 | (Output_symtab_xindex::endian_do_write): New function. | |
541 | * output.h (class Output_section_headers): Add shstrtab_section_. | |
542 | Update declarations. | |
543 | (class Output_symtab_xindex): Define. | |
544 | (Output_section::has_out_shndx): New function. | |
545 | * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_ | |
546 | field. | |
547 | (Symbol::init_base): Add st_shndx and is_ordinary parameters. | |
548 | Change all callers. | |
549 | (Sized_symbol::init): Likewise. | |
550 | (Symbol::output_section): Check for ordinary symbol. | |
551 | (Symbol_table::add_from_object): Remove orig_sym parameter. Add | |
552 | st_shndx, is_ordinary, and orig_st_shndx parameters. Change all | |
553 | callers. | |
554 | (Symbol_table::add_from_relobj): Add symndx_offset parameter. | |
555 | Change all callers. Simplify handling of symbols from sections | |
556 | not included in the link. | |
557 | (Symbol_table::add_from_dynobj): Handle ordinary symbol | |
558 | distinction. | |
559 | (Weak_alias_sorter::operator()): Assert that symbols are | |
560 | ordinary. | |
561 | (Symbol_table::sized_finalize_symbol): Handle ordinary symbol | |
562 | distinction. | |
563 | (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex | |
564 | parameters. Change all callers. | |
565 | (Symbol_table::sized_write_globals): Likewise. Handle ordinary | |
566 | symbol distinction. Use SHN_XINDEX when needed. | |
567 | (Symbol_table::write_section_symbol): Add symtab_xindex | |
568 | parameter. Change all callers. | |
569 | (Symbol_table::sized_write_section_symbol): Likewise. Use | |
570 | SHN_XINDEX when needed. | |
571 | * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update | |
572 | declarations. | |
573 | (Symbol::shndx): Add is_ordinary parameter. Change all callers. | |
574 | (Symbol::is_defined): Check is_ordinary. | |
575 | (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise. | |
576 | (Symbol::is_absolute, Symbol::is_common): Likewise. | |
577 | (class Sized_symbol): Update declarations. | |
578 | (class Symbol_table): Update declarations. | |
579 | * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary | |
580 | parameters. Change all callers. | |
581 | (Sized_symbol::override): Likewise. | |
582 | (Symbol_table::override): Likewise. | |
583 | (symbol_to_bits): Add is_ordinary parameter. Change all callers. | |
584 | (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx, | |
585 | is_ordinary, and orig_st_shndx parameters. Change all callers. | |
586 | * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol | |
587 | to be in an ordinary section. | |
588 | * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add | |
589 | object and is_ordinary parameters. Change all callers. | |
590 | (Sized_dwarf_line_info::read_relocs): Add object parameter. | |
591 | Change all callers. Don't add undefined or non-ordinary symbols | |
592 | to reloc_map_. | |
593 | (Sized_dwarf_line_info::read_line_mappings): Add object parameter. | |
594 | Change all callers. | |
595 | * dwarf_reader.h (class Sized_dwarf_line_info): Update | |
596 | declarations. | |
597 | * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol. | |
598 | * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links. | |
599 | (Sized_relobj::relocate_sections): Likewise. | |
600 | * target-reloc.h (scan_relocs): Adjust section symbol index. | |
601 | (scan_relocatable_relocs): Likewise. | |
602 | * i386.cc (Scan::local): Check for ordinary symbols. | |
603 | * sparc.cc (Scan::local): Likewise. | |
604 | * x86_64.cc (Scan::local): Likewise. | |
605 | * testsuite/binary_unittest.cc (Sized_binary_test): Update calls | |
606 | to symbol_section_and_value. | |
607 | * testsuite/many_sections_test.cc: New file. | |
608 | * testsuite/Makefile.am (BUILT_SOURCES): Define. | |
609 | (check_PROGRAMS): Add many_sections_test. | |
610 | (many_sections_test_SOURCES): Define. | |
611 | (many_sections_test_DEPENDENCIES): Define. | |
612 | (many_sections_test_LDFLAGS): Define. | |
613 | (BUILT_SOURCES): Add many_sections_define.h. | |
614 | (many_sections_define.h): New target. | |
615 | (BUILT_SOURCES): Add many_sections_check.h. | |
616 | (many_sections_check.h): New target. | |
617 | (check_PROGRAMS): Add many_sections_r_test. | |
618 | (many_sections_r_test_SOURCES): Define. | |
619 | (many_sections_r_test_DEPENDENCIES): Define. | |
620 | (many_sections_r_test_LDFLAGS): Define. | |
621 | (many_sections_r_test_LDADD): Define. | |
622 | (many_sections_r_test.o): New target. | |
623 | * testsuite/Makefile.in: Rebuild. | |
624 | ||
c5818ff1 CC |
625 | 2008-04-17 Cary Coutant <ccoutant@google.com> |
626 | ||
627 | * errors.cc (Errors::info): New function. | |
628 | (gold_info): New function. | |
629 | * errors.h (Errors::info): New function. | |
630 | * gold.h (gold_info): New function. | |
631 | * object.cc (Input_objects::add_object): Print trace output. | |
632 | * options.cc (options::parse_set): New function. | |
633 | (General_options::parse_wrap): Deleted. | |
634 | (General_options::General_options): Deleted initializer. | |
635 | * options.h (options::String_set): New typedef. | |
636 | (options::parse_set): New function. | |
637 | (DEFINE_set): New macro. | |
638 | (General_options::wrap): Changed to use DEFINE_set. Changed | |
639 | callers of any_wrap_symbols and is_wrap_symbol. | |
640 | (General_options::trace, General_options::trace_symbol): | |
641 | New options. | |
642 | (General_options::any_wrap_symbols, General_options::is_wrap_symbol) | |
643 | (General_options::wrap_symbols_): Deleted. | |
644 | * symtab.cc (Symbol_table::add_from_object): Print trace output. | |
645 | ||
b5be4a7c DM |
646 | 2008-04-17 David S. Miller <davem@davemloft.net> |
647 | ||
648 | * options.cc (General_options::parse_V): New function. | |
649 | * options.h: Add entries for -V and -Qy. | |
650 | ||
155a0dd7 ILT |
651 | 2008-04-17 Ian Lance Taylor <iant@google.com> |
652 | ||
653 | * common.cc (Symbol_table::allocate_commons): Remove options | |
654 | parameter. Change caller. | |
655 | (Symbol_table::do_allocate_commons): Remove options parameter. | |
656 | Change caller. Just call do_allocate_commons_list twice. | |
657 | (Symbol_table::do_allocate_commons_list): New function, broken out | |
658 | of do_allocate_commons. | |
659 | * common.h (class Allocate_commons_task): Remove options_ field. | |
660 | Update constructor. | |
661 | * symtab.cc (Symbol_table::Symbol_table): Initialize | |
662 | tls_commons_. | |
663 | (Symbol_table::add_from_object): Put TLS common symbols on | |
664 | tls_commons_ list. | |
665 | (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols | |
666 | which are IN_OUTPUT_DATA. | |
667 | * symtab.h (class Symbol_table): Add tls_commons_ field. Update | |
668 | allocate_commons and do_allocate_commons declarations. Declare | |
669 | do_allocate_commons_list. | |
670 | * gold.cc (queue_middle_tasks): Update creation of | |
671 | Allocate_commons_task to not pass options. | |
672 | * testsuite/Makefile.am (INCLUDES): Add -I.. . | |
673 | (TLS_TEST_C_FLAGS): New variable. | |
674 | (tls_test_c_pic.o): New target. | |
675 | (tls_test_shared.so): Link in tls_test_c_pic.o. | |
676 | (tls_test_c_pic_ie.o): New target. | |
677 | (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o. | |
678 | (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o. | |
679 | (tls_test_c.o): New target. | |
680 | (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o. | |
681 | (tls_pic_test_LDADD): Likewise. | |
682 | (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o. | |
683 | (tls_shared_gd_to_ie_test_LDADD): Likewise. | |
684 | (tls_test_c_gnu2.o): New target. | |
685 | (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add | |
686 | tls_test_c_gnu2.o. | |
687 | (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise. | |
688 | (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o. | |
689 | (tls_test_shared_nonpic.so): Link in tls_test_c.o. | |
690 | * testsuite/tls_test.cc: Include "config.h". | |
691 | (t_last): Call t11_last. | |
692 | * testsuite/tls_test.h (t11, t11_last): Declare. | |
693 | * testsuite/tls_test_c.c: New file. | |
694 | * testsuite/tls_test_main.cc (thread_routine): Call t11. | |
695 | * configure.ac: Check for OpenMP support. | |
696 | * configure, config.in, Makefile.in: Rebuild. | |
697 | * testsuite/Makefile.in: Rebuild. | |
698 | ||
edfbb029 CC |
699 | 2008-04-16 Cary Coutant <ccoutant@google.com> |
700 | ||
701 | * i386.cc (Target_i386::define_tls_base_symbol): New function. | |
702 | (Target_i386::tls_base_symbol_defined_): New field. | |
703 | (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol. | |
704 | (Target_i386::Scan::global): Likewise. | |
705 | * symtab.cc (sized_finalize_symbol): Add check for TLS symbol. | |
706 | * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function. | |
707 | (Target_x86_64::tls_base_symbol_defined_): New field. | |
708 | (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol. | |
709 | (Target_x86_64::Scan::global): Likewise. | |
710 | ||
f3c69fca CC |
711 | 2008-04-16 Cary Coutant <ccoutant@google.com> |
712 | ||
713 | * symtab.h (Symbol::is_strong_undefined): Removed unused function. | |
714 | (Symbol::needs_plt_entry): Allow weak undefined symbols. | |
715 | (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when | |
716 | building shared libraries. | |
717 | * testsuite/Makefile.am (weak_undef_nonpic_test): New target. | |
718 | (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o) | |
719 | (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets. | |
720 | * testsuite/Makefile.in: Rebuild. | |
721 | * testsuite/weak_undef.h: New file. | |
722 | * testsuite/weak_undef_file1.cc: Add extra test cases. | |
723 | * testsuite/weak_undef_file2.cc: Likewise. | |
724 | * testsuite/weak_undef_test.cc: Likewise. | |
725 | ||
7c414435 DM |
726 | 2008-04-16 David S. Miller <davem@davemloft.net> |
727 | ||
32b769e1 DM |
728 | * sparc.cc (Target_sparc::Scan): Change from struct to class. |
729 | Add issued_non_pic_error_ field. Declare check_non_pic. | |
730 | (Target_sparc::Scan::check_non_pic): New function. | |
731 | (Target_sparc::Scan::local): Call check_non_pic as appropriate. | |
732 | (Target_sparc::Scan::global): Likewise. | |
733 | ||
11936fb1 DM |
734 | * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64. |
735 | * configure: Rebuild. | |
736 | ||
7c414435 DM |
737 | * options.h (DEFINE_enable): New macro. |
738 | (new_dtags): New enable option. | |
739 | (initfirst, interpose, loadfltr, nodefaultlib, | |
740 | nodelete, nodlopen, nodump): New -z options. | |
741 | * layout.cc (Layout:finish_dynamic_section): If new | |
742 | dtags enabled, emit DT_RUNPATH. Also, emit a | |
743 | DT_FLAGS_1 containing any specified -z flags. | |
744 | ||
85c7bf8b ILT |
745 | 2008-04-16 Ian Lance Taylor <iant@google.com> |
746 | ||
12c0daef ILT |
747 | * copy-relocs.cc: New file. |
748 | * copy-relocs.h: New file. | |
749 | * reloc.cc: Remove Copy_relocs code. | |
750 | * reloc.h: Likewise. | |
751 | * reloc-types.h (struct Reloc_types) [both versions]: Add | |
752 | get_reloc_addend_noerror. | |
753 | * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add | |
754 | variants of add_global which take an addend which must be zero. | |
755 | * i386.cc: Include "copy-relocs.h". | |
756 | (class Target_i386): Change type of copy_relocs_ to variable, | |
757 | update initializer. | |
758 | (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class. | |
759 | Change all callers. | |
760 | (Target_i386::do_finalize_sections): Change handling of | |
761 | copy_relocs_. | |
762 | * sparc.cc: Include "copy-relocs.h". | |
763 | (class Target_sparc): Change type of copy_relocs_ to variable, | |
764 | update initializer. | |
765 | (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class. | |
766 | Change all callers. | |
767 | (Target_sparc::do_finalize_sections): Change handling of | |
768 | copy_relocs_. | |
769 | * x86_64.cc: Include "copy-relocs.h". | |
770 | (class Target_x86_64): Change type of copy_relocs_ to variable, | |
771 | update initializer. | |
772 | (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs | |
773 | class. Change all callers. | |
774 | (Target_x86_64::do_finalize_sections): Change handling of | |
775 | copy_relocs_. | |
776 | * Makefile.am (CCFILES): Add copy-relocs.cc. | |
777 | (HFILES): Add copy-relocs.h. | |
778 | ||
4f4995b6 ILT |
779 | * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild. |
780 | ||
85c7bf8b ILT |
781 | * testsuite/script_test_4.sh: Permit leading zeroes. |
782 | ||
4f2a9edd ILT |
783 | 2008-04-15 Ian Lance Taylor <iant@google.com> |
784 | ||
e6188289 ILT |
785 | * script-sections.cc (Script_sections::create_segments): Use |
786 | header_size_adjustment even when there is enough room for the | |
787 | headers. | |
788 | * testsuite/script_test_4.sh: New file. | |
789 | * testsuite/script_test_4.t: New file. | |
790 | * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh. | |
791 | (check_DATA): Add script_test_4.stdout. | |
792 | (MOSTLYCLEANFILES): Likewise. | |
793 | (script_test_4): New target. | |
794 | (script_test_4.stdout): New target. | |
795 | * testsuite/Makefile.in: Rebuild. | |
796 | ||
4f2a9edd ILT |
797 | * sparc.cc: Add definitions for Output_data_plt_sparc class |
798 | constants. | |
799 | ||
f5314dd5 DM |
800 | 2008-04-14 David S. Miller <davem@davemloft.net> |
801 | ||
802 | * sparc.cc: New file. | |
803 | * Makefile.am (TARGETSOURCES): Add sparc.cc | |
804 | (ALL_TARGETOBJS): Add sparc.$(OBJEXT) | |
805 | * configure.tgt: Document targ_extra_size and | |
806 | targ_extra_big_endian. Add entries for sparc-* and | |
807 | sparc64-*. | |
808 | * configure.ac: Handle targ_extra_size and | |
809 | targ_extra_big_endian. | |
810 | * Makefile.in: Rebuild. | |
811 | * configure: Likewise. | |
812 | * po/POTFILES.in: Likewise. | |
813 | * po/gold.pot: Likewise. | |
814 | ||
154e0e9a ILT |
815 | 2008-04-14 Ian Lance Taylor <iant@google.com> |
816 | ||
817 | * layout.cc (Layout::Layout): Initialize sections_are_attached_. | |
818 | (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR | |
819 | in the name/type/flags to section mapping. Don't call | |
820 | allocate_output_section. | |
821 | (Layout::choose_output_section): Change parameter from adjust_name | |
822 | to is_input_section. Don't permit input sections after sections | |
823 | are attached to segments. Don't call allocate_output_section. | |
824 | (Layout::layout_eh_frame): Call update_flags_for_input_section, | |
825 | not write_enable_output_section. | |
826 | (Layout::make_output_section): Don't push to | |
827 | unattached_section_list_ nor call attach_to_segment. Call | |
828 | attach_section_to_segment if sections are attached. | |
829 | (Layout::attach_sections_to_segments): New function. | |
830 | (Layout::attach_section_to_segment): New function. | |
831 | (Layout::attach_allocated_section_to_segment): Rename from | |
832 | attach_to_segment. Remove flags parameter. | |
833 | (Layout::allocate_output_section): Remove function. | |
834 | (Layout::write_enable_output_section): Remove function. | |
835 | * layout.h (class Layout): Update for above changes. Add new | |
836 | field sections_are_attached_. | |
837 | * output.h (Output_section::update_flags_for_input_section): New | |
838 | function. | |
839 | * output.cc (Output_section::add_input_section): Call | |
840 | update_flags_for_input_section. | |
841 | * gold.cc (queue_middle_tasks): Call attach_sections_to_segments. | |
842 | ||
009a67a2 CC |
843 | 2008-04-11 Cary Coutant <ccoutant@google.com> |
844 | ||
845 | * i386.cc (Target_i386::got_mod_index_entry): Restore code previously | |
846 | thought unnecessary. | |
847 | * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise. | |
848 | ||
759b1a24 ILT |
849 | 2008-04-11 Ian Lance Taylor <iant@google.com> |
850 | ||
851 | * output.h (class Output_section_data): Remove inline definition | |
852 | of set_addralign. | |
853 | * output.cc (Output_section_data::set_addralign): New function. | |
854 | ||
c2b45e22 CC |
855 | 2008-04-11 Cary Coutant <ccoutant@google.com> |
856 | ||
857 | Add support for TLS descriptors for i386 and x86_64. | |
858 | * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function. | |
859 | (Target_i386::Relocate::tls_desc_gd_to_le): New function. | |
860 | (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and | |
861 | GOT_TYPE_TLS_DESC. | |
862 | (Target_i386::got_mod_index_entry): Remove unnecessary code. | |
863 | (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and | |
864 | R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec | |
865 | relocations. | |
866 | (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation. | |
867 | Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations; | |
868 | Fix problem with initial-exec relocations. | |
869 | (Target_i386::Relocate::relocate_tls): Likewise. | |
870 | (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE | |
871 | relaxation. | |
872 | * output.cc (Output_data_dynamic::Dynamic_entry::write): Add | |
873 | support for section-plus-offset dynamic table entries. | |
874 | * output.h (Output_data_dynamic::add_section_plus_offset): New function. | |
875 | (Output_data_dynamic::Dynamic_entry): Add support for | |
876 | section-plus-offset dynamic table entries. | |
877 | (Output_data_dynamic::Classification): Likewise. | |
878 | (Output_data_dynamic::classification_): Renamed offset_. | |
879 | * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function. | |
880 | (Target_x86_64::Relocate::tls_desc_gd_to_le): New function. | |
881 | (Target_x86_64::make_plt_section): New function. | |
882 | (Target_x86_64::reserve_tlsdesc_entries): New function. | |
883 | (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter. | |
884 | (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function. | |
885 | (Output_data_plt_x86_64::has_tlsdesc_entry): New function. | |
886 | (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function. | |
887 | (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function. | |
888 | (Output_data_plt_x86_64::tlsdesc_plt_entry): New field. | |
889 | (Output_data_plt_x86_64::set_final_data_size): Move out of line; | |
890 | add extra PLT entry for TLS descriptors. | |
891 | (Output_data_plt_x86_64::got_): New field. | |
892 | (Output_data_plt_x86_64::tlsdesc_got_offset_): New field. | |
893 | (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new | |
894 | fields. | |
895 | (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS | |
896 | descriptors. | |
897 | (Target_x86_64::make_plt_entry): Factor out make_plt_section. | |
898 | (Target_x86_64::got_mod_index_entry): Remove unnecessary code. | |
899 | (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and | |
900 | R_386_TLS_DESC_CALL relocations. | |
901 | (Target_x86_64::Scan::global): Likewise. | |
902 | (Target_x86_64::do_finalize_sections): Add dynamic table entries | |
903 | for TLS descriptors. | |
904 | (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation. | |
905 | Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations. | |
906 | (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with | |
907 | GD-to-IE relaxation. | |
908 | * configure.ac: Export new conditional variables TLS_GNU2_DIALECT | |
909 | and TLS_DESCRIPTORS. | |
910 | * Makefile.in: Rebuild. | |
911 | * configure: Rebuild. | |
912 | * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target. | |
913 | (tls_test_shared2.so): New target. | |
914 | (tls_shared_gd_to_ie_test_SOURCES): New variable. | |
915 | (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable. | |
916 | (tls_shared_gd_to_ie_test_LDFLAGS): New variable. | |
917 | (tls_shared_gd_to_ie_test_LDADD): New variable. | |
918 | (tls_shared_gnu2_gd_to_ie_test): New target. | |
919 | (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so): | |
920 | New targets. | |
921 | (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable. | |
922 | (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable. | |
923 | (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable. | |
924 | (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable. | |
925 | (tls_shared_gnu2_test): New target. | |
926 | (tls_test_gnu2_shared.so): New target. | |
927 | (tls_shared_gnu2_test_SOURCES): New variable. | |
928 | (tls_shared_gnu2_test_DEPENDENCIES): New variable. | |
929 | (tls_shared_gnu2_test_LDFLAGS): New variable. | |
930 | (tls_shared_gnu2_test_LDADD): New variable. | |
931 | * testsuite/Makefile.in: Rebuild. | |
932 | * testsuite/Makefile. | |
933 | ||
83bfb6b7 ILT |
934 | 2008-04-11 Ian Lance Taylor <iant@google.com> |
935 | ||
936 | * testsuite/Makefile.am (justsyms_2r.o): Add dependency on | |
937 | justsyms.t. | |
938 | * testsuite/Makefile.in: Rebuild. | |
939 | ||
940 | * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes | |
941 | long. | |
942 | * testsuite/script_test_2.cc (main): Adjust test. | |
943 | ||
706e1f5e ILT |
944 | 2008-04-11 David S. Miller <davem@davemloft.net> |
945 | Ian Lance Taylor <iant@google.com> | |
946 | ||
947 | * options.h (General_options): Add entries for '-Y' and | |
948 | '-relax'. | |
949 | * options.cc (General_options:finalize): If -Y was used, add those | |
950 | entries to the library path instead of the default "/lib" and | |
951 | "/usr/lib". | |
952 | ||
7c98e6bb DM |
953 | 2008-04-11 David S. Miller <davem@davemloft.net> |
954 | ||
955 | * testsuite/justsyms.t: Start at 0x100. | |
956 | * testsuite/justsyms_1.cc: Adjust justsyms_string assertion. | |
83bfb6b7 ILT |
957 | * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes |
958 | long. | |
959 | * testsuite/script_test_2.cc: Adjust string and section length | |
960 | checks. | |
7c98e6bb | 961 | |
99a37bfd ILT |
962 | 2008-04-09 Ian Lance Taylor <iant@google.com> |
963 | ||
2cefc357 ILT |
964 | PR gold/5996 |
965 | * script-sections.cc (Sections_element::allocate_to_segment): Add | |
966 | orphan parameter. | |
967 | (Output_section_definition::allocate_to_segment): Likewise. | |
968 | (Orphan_output_section::allocate_to_segment): Likewise. | |
969 | (Script_sections::attach_sections_using_phdrs_clause): Don't | |
970 | propagate non-PT_LOAD segments to orphan sections. | |
971 | * testsuite/Makefile.am (script_test_3.stdout): Generate using | |
972 | readelf rather than objdump. | |
973 | * testsuite/script_test_3.sh: Adjust accordingly. Test that | |
974 | .interp section and PT_INTERP segment are the same size. | |
975 | * testsuite/Makefile.in: Rebuild. | |
976 | ||
99a37bfd ILT |
977 | * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak |
978 | aliases for symbols defined in the same object. | |
979 | * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test. | |
980 | (weak_alias_test_SOURCES): New variable. | |
981 | (weak_alias_test_DEPENDENCIES): New variable. | |
982 | (weak_alias_test_LDFLAGS): New variable. | |
983 | (weak_alias_test_LDADD): New variable. | |
984 | (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets. | |
985 | (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets. | |
986 | (weak_alias_test_3.o): New target. | |
987 | (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets. | |
988 | * testsuite/weak_alias_test_main.cc: New file. | |
989 | * testsuite/weak_alias_test_1.cc: New file. | |
990 | * testsuite/weak_alias_test_2.cc: New file. | |
991 | * testsuite/weak_alias_test_3.cc: New file. | |
992 | ||
780e49c5 ILT |
993 | 2008-04-08 Ian Lance Taylor <iant@google.com> |
994 | ||
cdb0b8f5 ILT |
995 | * options.h (class General_options): Add --noinhibit-exec option. |
996 | * main.cc (main): Check --noinhibit-exec. | |
997 | ||
0864d551 ILT |
998 | * options.h (class General_options): Define --wrap as a special |
999 | option. Add wrap_symbols_ field. | |
1000 | (General_options::any_wrap_symbols): New function. | |
1001 | (General_options::is_wrap_symbol): New function. | |
1002 | * options.cc (General_options::parse_wrap): New function. | |
1003 | (General_options::General_options): Initialize wrap_symbols_. | |
1004 | * symtab.cc (Symbol_table::wrap_symbol): New function. | |
1005 | (Symbol_table::add_from_object): Handle --wrap. | |
1006 | * symtab.h (class Symbol_table): Declare wrap_symbol. | |
1007 | * target.h (Target::wrap_char): New function. | |
1008 | (Target::Target_info): Add wrap_char field. | |
1009 | * i386.cc (Target_i386::i386_info): Initialize wrap_char. | |
1010 | * x86_64.cc (Target_x86_64::x86_64_info): Likewise. | |
1011 | * testsuite/testfile.cc (Target_test::test_target_info): | |
1012 | Likewise. | |
1013 | ||
789aa6de ILT |
1014 | * errors.cc (Errors::undefined_symbol): Mention symbol version if |
1015 | there is one. | |
1016 | ||
2c38906f ILT |
1017 | * layout.h (class Layout): Add added_eh_frame_data_ field. |
1018 | * layout.cc (Layout::Layout): Initialize new field. | |
1019 | (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame | |
1020 | output section until we find a section we merged successfully. | |
1021 | * object.cc (Sized_relobj::check_eh_frame_flags): Don't require | |
1022 | that the size be non-zero. | |
1023 | ||
780e49c5 ILT |
1024 | * merge.cc (Object_merge_map::get_output_offset): Remove inline |
1025 | qualifier. | |
1026 | ||
7fcd0256 ILT |
1027 | 2008-04-08 Craig Silverstein <csilvers@google.com> |
1028 | ||
1029 | * configure.ac: Export new conditional variable HAVE_ZLIB. | |
1030 | * testsuite/Makefile.am (flagstest_o_specialfile): Condition | |
1031 | on HAVE_ZLIB. | |
1032 | (flagstest_o_specialfile_and_compress_debug_sections): Likewise. | |
1033 | * configure, Makefile.in, testsuite/Makefile.in: Rebuild. | |
1034 | ||
6835af53 ILT |
1035 | 2008-04-07 Ian Lance Taylor <iant@google.com> |
1036 | ||
e24f324c ILT |
1037 | * version.cc (version_string): Set to "1.5". |
1038 | ||
a036edd8 ILT |
1039 | * x86_64.cc (Target_x86_64::Scan): Change from struct to class. |
1040 | Add issued_non_pic_error_ field. Declare check_non_pic. | |
1041 | (Target_x86_64::Scan::check_non_pic): New function. | |
1042 | (Target_x86_64::Scan::local): Call check_non_pic as appropriate. | |
1043 | (Target_x86_64::Scan::global): Likewise. | |
1044 | ||
624f8810 ILT |
1045 | * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add |
1046 | addend parameter. Change caller. Handle merge sections. | |
1047 | (Output_reloc<SHT_REL>::symbol_value): Change parameter type from | |
1048 | Address to Addend. Don't add in the result of | |
1049 | local_section_offset, pass down the addend and use the returned | |
1050 | value. | |
1051 | * output.h (class Output_reloc<SHT_REL>): Add Addend typedef. | |
1052 | Update declarations of local_section_offset and symbol_value. | |
1053 | * testsuite/two_file_test_1.cc (t18): New function. | |
1054 | * testsuite/two_file_test_2.cc (f18): New function. | |
1055 | * testsuite/two_file_test_main.cc (main): Call t18. | |
1056 | * testsuite/two_file_test.h (t18, f18): Declare. | |
1057 | ||
6835af53 ILT |
1058 | * configure.ac: Don't test for objdump, c++filt, or readelf. |
1059 | * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT | |
1060 | conditionals. | |
1061 | (TEST_READELF): New variable. | |
1062 | (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables. | |
1063 | (check_PROGRAMS): Add two_file_strip_test. | |
1064 | (two_file_strip_test): New target. | |
1065 | (check_PROGRAMS): Add two_file_same_shared_strip_test. | |
1066 | (two_file_same_shared_strip_test_SOURCES): New variable. | |
1067 | (two_file_same_shared_strip_test_DEPENDENCIES): New variable. | |
1068 | (two_file_same_shared_strip_test_LDFLAGS): New variable. | |
1069 | (two_file_same_shared_strip_test_LDADD): New variable. | |
1070 | (two_file_shared_strip.so): New target. | |
1071 | (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF. | |
1072 | (ver_test_5.syms, ver_test_7.syms): Likewise. | |
1073 | (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT. | |
1074 | (strip_test_3.stdout): Use TEST_OBJDUMP. | |
1075 | * configure, Makefile.in, testsuite/Makefile.in: Rebuild. | |
1076 | ||
86925eef CC |
1077 | 2008-04-04 Cary Coutant <ccoutant@google.com> |
1078 | ||
1079 | * symtab.h (Symbol::is_weak_undefined): New function. | |
1080 | (Symbol::is_strong_undefined): New function. | |
1081 | (Symbol::is_absolute): New function. | |
1082 | (Symbol::needs_plt_entry): Exclude weak undefined symbols. | |
1083 | (Symbol::needs_dynamic_reloc): Exclude weak undefined and | |
1084 | absolute symbols. | |
1085 | * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test. | |
1086 | (weak_undef_test): New target. | |
1087 | * testsuite/Makefile.in: Rebuild. | |
1088 | * testsuite/weak_undef_file1.cc: New file. | |
1089 | * testsuite/weak_undef_file2.cc: New file. | |
1090 | * testsuite/weak_undef_test.cc: New file. | |
1091 | ||
126f3ece ILT |
1092 | 2008-04-03 Craig Silverstein <csilvers@google.com> |
1093 | ||
1094 | * compressed_output.h (class Output_compressed_section): Use | |
1095 | unsigned buffer. | |
1096 | * compressed_output.cc (zlib_compress): Use unsigned buffers, | |
1097 | add zlib header. | |
1098 | (zlib_compressed_suffix): Removed. | |
1099 | (Output_compressed_section::set_final_data_size): Use unsigned | |
1100 | buffers. | |
1101 | * testsuite/Makefile.am (flagstest_compress_debug_sections): | |
1102 | Fix linker invocation. | |
1103 | (flagstest_o_specialfile_and_compress_debug_sections): | |
1104 | Likewise. | |
1105 | * testsuite/Makefile.in: Regenerated. | |
1106 | ||
deae2a14 DM |
1107 | 2008-04-02 David S. Miller <davem@davemloft.net> |
1108 | ||
1109 | * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog, | |
1110 | Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned. | |
1111 | ||
70752818 ILT |
1112 | 2008-04-02 Craig Silverstein <csilvers@google.com> |
1113 | ||
1114 | * TODO: New file. | |
1115 | ||
39d0cb0e ILT |
1116 | 2008-04-02 Ian Lance Taylor <iant@google.com> |
1117 | ||
1118 | * fileread.cc (File_read::find_view): Add byteshift and vshifted | |
1119 | parameters. Update for new key type to views_. Change all | |
1120 | callers. | |
1121 | (File_read::read): Adjust for byteshift in returned view. | |
1122 | (File_read::add_view): New function, broken out of | |
1123 | find_and_make_view. | |
1124 | (File_read::make_view): New function, broken out of | |
1125 | find_and_make_view. | |
1126 | (File_read::find_or_make_view): Add offset and aligned | |
1127 | parameters. Rewrite accordingly. Change all callers. | |
1128 | (File_read::get_view): Add offset and aligned parameters. Adjust | |
1129 | for byteshift in return value. | |
1130 | (File_read::get_lasting_view): Likewise. | |
1131 | * fileread.h (class File_read): Update declarations. | |
1132 | (class File_read::View): Add byteshift_ field. Add byteshift to | |
1133 | constructor. Add byteshift method. | |
1134 | * archive.h (Archive::clear_uncached_views): New function. | |
1135 | (Archive::get_view): Add aligned parameter. Change all callers. | |
1136 | * object.h (Object::get_view): Add aligned parameter. Change all | |
1137 | callers. | |
1138 | (Object::get_lasting_view): Likewise. | |
1139 | ||
1140 | * fileread.cc (File_read::release): Don't call clear_views if | |
1141 | there are multiple objects. | |
1142 | * fileread.h (File_read::clear_uncached_views): New function. | |
1143 | * archive.cc (Add_archive_symbols::run): Call clear_uncached_views | |
1144 | on the archive. | |
1145 | ||
a1207466 CC |
1146 | 2008-03-31 Cary Coutant <ccoutant@google.com> |
1147 | ||
1148 | Add thin archive support. | |
1149 | * archive.cc (Archive::armagt): New const. | |
1150 | (Archive::setup): Remove task parameter and calls to unlock. | |
1151 | (Archive::unlock_nested_archives): New function. | |
1152 | (Archive::read_header): Add nested_off parameter. Change | |
1153 | all callers. | |
1154 | (Archive::interpret_header): Likewise. | |
1155 | (Archive::include_all_members): Change to handle thin | |
1156 | archives. | |
1157 | (Archive::include_member): Likewise. | |
1158 | * archive.h (Archive::Archive): Add new parameters and | |
1159 | initializers. | |
1160 | (Archive::armagt): New const. | |
1161 | (Archive::setup): Remove task parameter. | |
1162 | (Archive::unlock_nested_archives): New function. | |
1163 | (Archive::read_header): Add nested_off parameter. | |
1164 | (Archive::interpret_header): Likewise. | |
1165 | (Archive::Nested_archive_table): New typedef. | |
1166 | (Archive::is_thin_archive_): New field. | |
1167 | (Archive::nested_archives_): New field. | |
1168 | (Archive::options_): New field. | |
1169 | (Archive::dirpath_): New field. | |
1170 | (Archive::task_): New field. | |
1171 | * readsyms.cc (Read_symbols::do_read_symbols): Add check | |
1172 | for thin archives. Pass additional parameters to | |
1173 | Archive::Archive. Unlock the archive file after calling | |
1174 | Archive::setup. | |
1175 | ||
479f6503 ILT |
1176 | 2008-03-29 Ian Lance Taylor <iant@google.com> |
1177 | ||
686c8caf ILT |
1178 | * symtab.cc (Symbol_table::do_define_as_constant): Don't force a |
1179 | version symbol to be local. | |
1180 | * testsuite/ver_test_4.sh: New file. | |
1181 | * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh. | |
1182 | (check_DATA): Add ver_test_4.syms. | |
1183 | (ver_test_4.syms): New target. | |
1184 | * testsuite/Makefile.in: Rebuild. | |
1185 | ||
ab794b6b ILT |
1186 | * output.cc |
1187 | (Output_section::Input_section_sort_entry::has_priority): New | |
1188 | function. | |
1189 | (Output_section::Input_section_sort_entry::match_file_name): New | |
1190 | function. | |
1191 | (Output_section::Input_section_sort_entry::match_section_name): | |
1192 | Remove. | |
1193 | (Output_section::Input_section_sort_entry::match_section_name_prefix): | |
1194 | Remove. | |
1195 | (Output_section::Input_section_sort_entry::match_section_file): | |
1196 | Remove. | |
1197 | (Output_section::Input_section_sort_compare::operator()): Rewrite | |
1198 | using new Input_section_sort_entry functions. Sort crtbegin and | |
1199 | crtend first. Sort sections with no priority before sections with | |
1200 | a priority. | |
1201 | * testsuite/initpri1.c (d3): Check j != 4. | |
1202 | (cd5): New constructor/destructor function. | |
1203 | (main): Check j != 2. | |
1204 | ||
479f6503 ILT |
1205 | * symtab.cc (Symbol_table::add_from_object): If we don't use the |
1206 | new symbol when resolving, don't call set_is_default. | |
1207 | * testsuite/ver_test_7.cc: New file. | |
1208 | * testsuite/ver_test_7.sh: New file. | |
1209 | * testsuite/Makefile.am (ver_test_7.so): New target. | |
1210 | (ver_test_7.o): New target. | |
1211 | (check_SCRIPTS): Add ver_test_7.sh. | |
1212 | (check_DATA): Add ver_test_7.syms. | |
1213 | (ver_test_7.syms): New target. | |
1214 | ||
2fd32231 ILT |
1215 | 2008-03-28 Ian Lance Taylor <iant@google.com> |
1216 | ||
1217 | * layout.cc (Layout::layout): If we see an input section with a | |
1218 | name that needs sorting, set the must_sort flag for the output | |
1219 | section. | |
1220 | (Layout::make_output_section): If the name of the output section | |
1221 | indicates that it might require sorting, set the may_sort flag. | |
1222 | * output.h (Output_section::may_sort_attached_input_sections): New | |
1223 | function. | |
1224 | (Output_section::set_may_sort_attached_input_sections): New | |
1225 | function. | |
1226 | (Output_section::must_sort_attached_input_sections): New | |
1227 | function. | |
1228 | (Output_section::set_must_sort_attached_input_sections): New | |
1229 | function. | |
1230 | (class Output_section): Declare Input_section_sort_entry. Define | |
1231 | Input_section_sort_compare. Declare | |
1232 | sort_attached_input_sections. Add new fields: | |
1233 | may_sort_attached_input_sections_, | |
1234 | must_sort_attached_input_sections_, | |
1235 | attached_input_sections_are_sorted_. | |
1236 | * output.cc (Output_section::Output_section): Initialize new | |
1237 | fields. | |
1238 | (Output_section::add_input_section): Add an entry to | |
1239 | input_sections_ if may_sort or must_sort are true. | |
1240 | (Output_section::set_final_data_size): Call | |
1241 | sort_attached_input_sections if necessary. | |
1242 | (Output_section::Input_section_sort_entry): Define new class. | |
1243 | (Output_section::Input_section_sort_compare::operator()): New | |
1244 | function. | |
1245 | (Output_section::sort_attached_input_sections): New function. | |
1246 | * configure.ac: Check whether the compiler supports constructor | |
1247 | priorities. Define a CONSTRUCTOR_PRIORITY automake conditional. | |
1248 | * testsuite/initpri1.c: New file. | |
1249 | * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if | |
1250 | CONSTRUCTOR_PRIORITY. | |
1251 | (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables. | |
1252 | (initpri1_LDFLAGS): New variable. | |
1253 | * configure, Makefile.in, testsuite/Makefile.in: Rebuild. | |
1254 | ||
18e6b24e ILT |
1255 | 2008-03-27 Ian Lance Taylor <iant@google.com> |
1256 | ||
49bdd526 ILT |
1257 | * common.cc (Sort_commons::operator): Correct sorting algorithm. |
1258 | * testsuite/common_test_1.c: New file. | |
1259 | * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1. | |
1260 | (common_test_1_SOURCES): New variable. | |
1261 | (common_test_1_DEPENDENCIES): New variable. | |
1262 | (common_test_1_LDFLAGS): New variable. | |
1263 | ||
18e6b24e ILT |
1264 | * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_ |
1265 | and commons_ correctly when NAME/VERSION does not override | |
1266 | NAME/NULL. | |
1267 | * testsuite/ver_test_6.c: New file. | |
1268 | * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6 | |
1269 | (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables. | |
1270 | (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables. | |
1271 | ||
04bf7072 ILT |
1272 | 2008-03-26 Ian Lance Taylor <iant@google.com> |
1273 | ||
5871526f ILT |
1274 | * symtab.cc (Symbol_table::add_from_relobj): Don't set the version |
1275 | of an undefined symbol from a version script. | |
1276 | * testsuite/Makefile.am (ver_test_5.so): New target. | |
1277 | (ver_test_5.o): New target. | |
1278 | (check_SCRIPTS): Add ver_test_5.sh. | |
1279 | (check_DATA): Add ver_test_5.syms. | |
1280 | (ver_test_5.syms): New target. | |
1281 | * testsuite/ver_test_5.cc: New file. | |
1282 | * testsuite/ver_test_5.script: New file. | |
1283 | * testsuite/ver_test_5.sh: New file. | |
1284 | * Makefile.in, testsuite/Makefile.in: Rebuild. | |
1285 | ||
04bf7072 ILT |
1286 | PR gold/5986 |
1287 | Fix problems building gold with gcc 4.3.0. | |
1288 | * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define. | |
1289 | (gold_error_at_location, gold_warning_at_location): Use it. | |
1290 | * configure.ac: Check whether we can compile and use a template | |
1291 | function with a printf attribute. | |
1292 | * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value | |
1293 | when jumping over bytes. | |
1294 | * object.cc: Instantiate Object::read_section_data. | |
1295 | * debug.h: Include <cstring> | |
1296 | * dwarf_reader.cc: Include <algorithm> | |
1297 | * main.cc: Include <cstring>. | |
1298 | * options.cc: Include <cstring>. | |
1299 | * output.cc: Include <cstring>. | |
1300 | * script.cc: Include <cstring>. | |
1301 | * script.h: Include <string>. | |
1302 | * symtab.cc: Include <cstring> and <algorithm>. | |
1303 | * target-select.cc: Include <cstring>. | |
1304 | * version.cc: Include <string>. | |
1305 | * testsuite/testmain.cc: Include <cstdlib>. | |
1306 | * configure, config.in: Rebuild. | |
1307 | ||
874c5b28 ILT |
1308 | 2008-03-25 Ian Lance Taylor <iant@google.com> |
1309 | ||
819d6c3a ILT |
1310 | * options.cc: Include "../bfd/bfdver.h". |
1311 | (options::help): Print bug reporting address. | |
1312 | ||
f4b2c6f5 ILT |
1313 | * version.cc (print_version): Adjust output for current value of |
1314 | BFD_VERSION_STRING. | |
1315 | ||
1316 | * NEWS: New file. | |
1317 | ||
e96caa79 ILT |
1318 | * options.cc (options::help): Print list of supported targets. |
1319 | * target-select.h: Include <vector>. | |
1320 | (class Target_selector): Make machine_, size_, and is_big_endian_ | |
1321 | fields const. Add bfd_name_ and instantiated_target_ fields. | |
1322 | (Target_selector::Target_selector): Add bfd_name parameter. | |
1323 | (Target_selector::recognize): Make non-virtual, call | |
1324 | do_recognize. | |
1325 | (Target_selector::recognize_by_name): Make non-virtual, call | |
1326 | do_recognize_by_name. | |
1327 | (Target_selector::supported_names): New function. | |
1328 | (Target_selector::bfd_name): New function. | |
1329 | (Target_selector::do_instantiate_target): New pure virtual | |
1330 | function. | |
1331 | (Target_selector::do_recognize): New virtual function. | |
1332 | (Target_selector::do_recognize_by_name): New virtual function. | |
1333 | (Target_selector::instantiate_target): New private function. | |
1334 | (supported_target_names): Declare. | |
1335 | * target-select.cc (Target_selector::Target_selector): Update for | |
1336 | new parameter and fields. | |
1337 | (select_target_by_name): Check that the name matches before | |
1338 | calling recognize_by_name. | |
1339 | (supported_target_names): New function. | |
1340 | * i386.cc (class Target_selector_i386): Update Target_selector | |
1341 | constructor call. Remove recognize and recognize_by_name. Add | |
1342 | do_instantiate_target. | |
1343 | * x86_64.cc (class Target_selector_x86_64): Likewise. | |
1344 | * testsuite/testfile.cc (class Target_selector_test): Update for | |
1345 | changes to Target_selector. | |
1346 | ||
874c5b28 ILT |
1347 | * README: Rewrite, with some notes on unsupported features. |
1348 | ||
0a65a3a7 CC |
1349 | 2008-03-24 Cary Coutant <ccoutant@google.com> |
1350 | ||
1351 | * i386.cc (Target_i386::Got_type): New enum declaration. | |
1352 | (Target_i386::Scan::local): Updated callers of Output_data_got | |
1353 | member functions. | |
1354 | (Target_i386::Scan::global): Likewise. | |
1355 | (Target_i386::Relocate::relocate): Likewise. | |
1356 | (Target_i386::Relocate::relocate_tls): Likewise. | |
1357 | * object.h (Got_offset_list): New class. | |
1358 | (Sized_relobj::local_has_got_offset): Added got_type parameter. | |
1359 | (Sized_relobj::local_got_offset): Likewise. | |
1360 | (Sized_relobj::set_local_got_offset): Likewise. | |
1361 | (Sized_relobj::local_has_tls_got_offset): Removed. | |
1362 | (Sized_relobj::local_tls_got_offset): Removed. | |
1363 | (Sized_relobj::set_local_tls_got_offset): Removed. | |
1364 | (Sized_relobj::Local_got_offsets): Changed to store a list of offsets. | |
1365 | * output.cc (Output_data_got::add_global): Added got_type parameter. | |
1366 | (Output_data_got::add_global_with_rel): Likewise. | |
1367 | (Output_data_got::add_global_with_rela): Likewise. | |
1368 | (Output_data_got::add_global_pair_with_rel): New function. | |
1369 | (Output_data_got::add_global_pair_with_rela): New function. | |
1370 | (Output_data_got::add_local): Added got_type parameter. | |
1371 | (Output_data_got::add_local_with_rel): Likewise. | |
1372 | (Output_data_got::add_local_with_rela): Likewise. | |
1373 | (Output_data_got::add_local_pair_with_rel): New function. | |
1374 | (Output_data_got::add_local_pair_with_rela): New function. | |
1375 | (Output_data_got::add_global_tls): Removed. | |
1376 | (Output_data_got::add_global_tls_with_rel): Removed. | |
1377 | (Output_data_got::add_global_tls_with_rela): Removed. | |
1378 | (Output_data_got::add_local_tls): Removed. | |
1379 | (Output_data_got::add_local_tls_with_rel): Removed. | |
1380 | (Output_data_got::add_local_tls_with_rela): Removed. | |
1381 | * output.h (Output_data_got::add_global): Added got_type parameter. | |
1382 | (Output_data_got::add_global_with_rel): Likewise. | |
1383 | (Output_data_got::add_global_with_rela): Likewise. | |
1384 | (Output_data_got::add_global_pair_with_rel): New function. | |
1385 | (Output_data_got::add_global_pair_with_rela): New function. | |
1386 | (Output_data_got::add_local): Added got_type parameter. | |
1387 | (Output_data_got::add_local_with_rel): Likewise. | |
1388 | (Output_data_got::add_local_with_rela): Likewise. | |
1389 | (Output_data_got::add_local_pair_with_rel): New function. | |
1390 | (Output_data_got::add_local_pair_with_rela): New function. | |
1391 | (Output_data_got::add_global_tls): Removed. | |
1392 | (Output_data_got::add_global_tls_with_rel): Removed. | |
1393 | (Output_data_got::add_global_tls_with_rela): Removed. | |
1394 | (Output_data_got::add_local_tls): Removed. | |
1395 | (Output_data_got::add_local_tls_with_rel): Removed. | |
1396 | (Output_data_got::add_local_tls_with_rela): Removed. | |
1397 | * resolve.cc (Symbol::override_base_with_special): Removed | |
1398 | reference to has_got_offset_ field. | |
1399 | * symtab.cc (Symbol::init_fields): Replaced initialization | |
1400 | of got_offset_ with got_offsets_. Removed initialization | |
1401 | of has_got_offset_ | |
53fcba31 | 1402 | * symtab.h (Symbol::has_got_offset): Aded got_type parameter. |
0a65a3a7 CC |
1403 | (Symbol::got_offset): Likewise. |
1404 | (Symbol::set_got_offset): Likewise. | |
1405 | (Symbol::has_tls_got_offset): Removed. | |
1406 | (Symbol::tls_got_offset): Removed. | |
1407 | (Symbol::set_tls_got_offset): Removed. | |
1408 | (Symbol::got_offset_): Removed. | |
1409 | (Symbol::tls_mod_got_offset_): Removed. | |
1410 | (Symbol::tls_pair_got_offset_): Removed. | |
1411 | (Symbol::got_offsets_): New field. | |
1412 | (Symbol::has_got_offset): Removed. | |
1413 | (Symbol::has_tls_mod_got_offset): Removed. | |
1414 | (Symbol::has_tls_pair_got_offset): Removed. | |
1415 | * x86_64.cc (Target_x86_64::Got_type): New enum declaration. | |
1416 | (Target_x86_64::Scan::local): Updated callers of Output_data_got | |
1417 | member functions. | |
1418 | (Target_x86_64::Scan::global): Likewise. | |
1419 | (Target_x86_64::Relocate::relocate): Likewise. | |
1420 | (Target_x86_64::Relocate::relocate_tls): Likewise. | |
1421 | ||
bd52eafb BE |
1422 | 2008-03-25 Ben Elliston <bje@au.ibm.com> |
1423 | ||
1424 | * yyscript.y: Fix spelling error in comment. | |
1425 | ||
8b105e34 ILT |
1426 | 2008-03-24 Ian Lance Taylor <iant@google.com> |
1427 | ||
8ed814a9 ILT |
1428 | * options.h (class General_options): Define build_id option. |
1429 | * layout.h (class Layout): Declare write_build_id, create_note, | |
1430 | create_build_id. Add build_id_note_ member. | |
1431 | * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>, | |
1432 | "libiberty.h", "md5.h", "sha1.h". | |
1433 | (Layout::Layout): Initialize eh_frame_data_, | |
1434 | eh_frame_hdr_section_, and build_id_note_. | |
1435 | (Layout::finalize): Call create_build_id. | |
1436 | (Layout::create_note): New function, broken out of | |
1437 | Layout::create_gold_note. | |
1438 | (Layout::create_gold_note): Call create_note. | |
1439 | (Layout::create_build_id): New function. | |
1440 | (Layout::write_build_id): New function. | |
1441 | (Close_task_runner::run): Call write_build_id. | |
1442 | ||
8b105e34 ILT |
1443 | * x86_64.cc: Correct license to GPLv3. |
1444 | ||
086a1841 ILT |
1445 | 2008-03-23 Ian Lance Taylor <iant@google.com> |
1446 | ||
1447 | * options.cc: Include "demangle.h". | |
1448 | (parse_optional_string): New function. | |
1449 | (parse_long_option): Handle takes_optional_argument. | |
1450 | (parse_short_option): Update dash_z initializer. Handle | |
1451 | takes_optional_argument. | |
1452 | (General_options::General_options): Initialize do_demangle_. | |
1453 | (General_options::finalize): Set do_demangle_. Handle demangling | |
1454 | style. | |
1455 | * options.h (parse_optional_string): Declare. | |
1456 | (struct One_option): Add optional_arg field. Update constructor. | |
1457 | Update call constructor calls. Add takes_optional_argument | |
1458 | function. | |
1459 | (DEFINE_var): Add optional_arg__ parameter. Change all callers. | |
1460 | (DEFINE_optional_string): Define. | |
1461 | (General_options::demangle): Change from DEFINE_bool to | |
1462 | DEFINE_optional_string. | |
1463 | (General_options::no_demangle): New function. | |
1464 | (General_options::do_demangle): New function. | |
1465 | (General_options::set_do_demangle): New function. | |
1466 | (General_options::execstack_status_): Move definition to end of | |
1467 | class definition. | |
1468 | (General_options::static_): Likewise. | |
1469 | (General_options::do_demangle_): New field. | |
1470 | * object.cc (big_endian>::get_symbol_location_info): Call | |
1471 | Options::do_demangle, not Options::demangle. | |
1472 | * symtab.cc (demangle): Likewise. | |
1473 | ||
cbb93e63 ILT |
1474 | 2008-03-22 Ian Lance Taylor <iant@google.com> |
1475 | ||
1476 | * gold.h: Include <cstddef> and <sys/types.h> | |
1477 | * options.h: Include <cstring>. | |
1478 | ||
ec531623 ILT |
1479 | 2008-03-21 Ian Lance Taylor <iant@google.com> |
1480 | ||
1481 | * Added source code to GNU binutils. | |
1482 |