* config/pa/linux.mh (XDEPFILES): Remove.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
483620e8
CC
12008-12-23 Cary Coutant <ccoutant@google.com>
2
3 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
4 * plugin.cc (Plugin_manager::finish): Rename as
5 layout_deferred_objects. Move cleanup to separate function.
6 (Plugin_manager::cleanup): New function.
7 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8 separately.
9 * plugin.h (Plugin_manager::finish): Rename as
10 layout_deferred_objects.
11 (Plugin_manager::cleanup): New function.
12 (Plugin_manager::cleanup_done): New field.
13
d66a9eb3
CC
142008-12-23 Cary Coutant <ccoutant@google.com>
15
16 * plugin.cc (is_visible_from_outside): New function.
17 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
18 so we don't return "IR only" status for exported symbols or -r links.
19
20 * testsuite/Makefile.am (plugin_test_3): New test case.
21 * testsuite/Makefile.in: Regenerate.
22 * testsuite/plugin_test_3.sh: New file.
23
5995b570
CC
242008-12-22 Cary Coutant <ccoutant@google.com>
25
26 * object.cc (Sized_relobj::layout_section): New function.
27 (Sized_relobj::do_layout): Defer layout of input sections until after
28 plugin has provided replacement files.
29 (Sized_relobj::do_layout_deferred_sections): New function.
30 * object.h (Relobj::set_section_offset): Remove virtual keyword.
31 (Relobj::layout_deferred_sections): New function.
32 (Relobj::do_layout_deferred_sections): New function.
33 (Sized_relobj::do_layout_deferred_sections): New function.
34 (Sized_relobj::layout_section): New function.
35 (Sized_relobj::Deferred_layout): New structure.
36 (Sized_relobj::deferred_layout_): New field.
37 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
38 Change all callers. Layout deferred sections.
39 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
40 references.
41 (Plugin_hook::run): Move code from do_plugin_hook inline.
42 (Plugin_hook::do_plugin_hook): Remove.
43 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
44 (Plugin_manager::finish): Renamed, was cleanup.
45 (Plugin_manager::should_defer_layout): New function.
46 (Plugin_manager::add_deferred_layout_object): New function.
47 (Plugin_manager::Deferred_layout_list): New type.
48 (Plugin_manager::deferred_layout_objects_): New field.
49 (Plugin_hook::do_plugin_hook): Remove.
50
ee769c88
ILT
512008-12-17 Ian Lance Taylor <iant@google.com>
52
53 * options.h (class General_options): Add --no case for
54 --export-dynamic.
55
abc8dcba
CC
562008-12-16 Cary Coutant <ccoutant@google.com>
57
58 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
59 vector.
60 (Plugin_manager::claim_file): Create plugin object even if
61 plugin did not call the add_symbols callback.
62 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
63 asking for more symbols than were added.
64 * testsuite/Makefile.am (plugin_test_1): Add test case with
65 no global symbols.
66 (empty.syms): New target.
67 * testsuite/Makefile.in: Regenerate.
68 * testsuite/plugin_test.c (claim_file_hook): Add new debug
69 message. Don't call add_symbols if no globals.
70 (all_symbols_read_hook): Don't provide replacement for empty
71 claimed file.
72
b0074644
ILT
732008-12-12 Ian Lance Taylor <iant@google.com>
74
68943102
ILT
75 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
76 r_type == 0 for a local symbol with r_sym == 0.
77 (scan_relocatable_relocs): Pass r_sym to
78 local_non_section_strategy.
79 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
80 r_sym parameter.
81
b0074644
ILT
82 * configure.ac: Update test for TLS descriptors: they are
83 supported as of glibc 2.9.
84 * configure: Rebuild.
85
c2508178
ILT
862008-12-11 Ian Lance Taylor <iant@google.com>
87
88 PR 7091
89 * target-reloc.h (Default_scan_relocatable_relocs): For each
90 function, map r_type == 0 to RELOC_DISCARD.
91
2756a258
CC
922008-12-10 Cary Coutant <ccoutant@google.com>
93
94 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
95 object to override a kept COMDAT group from a plugin object.
96
bb6f53d3
ILT
972008-12-09 Ian Lance Taylor <iant@google.com>
98
fbc558e1
ILT
99 PR 7088
100 * yyscript.y (file_cmd): Handle INPUT.
101
bb6f53d3
ILT
102 * testsuite/initpri1.c: Change all declarations to be full
103 prototypes by adding void, to avoid compiler warnings.
104
4674ecfc
CC
1052008-12-05 Rafael Avila de Espindola <espindola@google.com>
106
107 * options.cc (General_options::parse_plugin_opt): New.
108 (General_options::add_plugin): The argument now is just the filename.
109 (General_options::add_plugin_option): New.
110 * options.h (plugin_opt): New.
111 (add_plugin): Change argument name.
112 (add_plugin_option): New.
113 * plugin.cc (Plugin::load): Don't parse the plugin option.
114 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
115 (Plugin::add_option): New.
116 (Plugin::args_): Change type.
117 (Plugin::filename_): New.
118 (Plugin_manager::add_plugin_option): New.
119 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
120 * testsuite/Makefile.in: Regenerate.
121
fd06b4aa
CC
1222008-12-05 Cary Coutant <ccoutant@google.com>
123
124 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
125 Handle --strip-lto-sections option.
126 * options.h (strip_lto_sections): New option.
127
6c52134c
CC
1282008-12-01 Cary Coutant <ccoutant@google.com>
129
130 * plugin.cc (ld_plugin_message): Change format parameter to const.
131 Fix mismatch between new[] and delete.
132
a45248e0
CC
1332008-11-14 Cary Coutant <ccoutant@google.com>
134
135 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
136 instead of -1U.
137
c82fbeee
CS
1382008-11-05 Craig Silverstein <csilvers@google.com>
139
140 * options.cc (General_options::parse_dynamic_list): New function.
141 * options.h (General_options): New flags dynamic_list,
142 dynamic_list_data, dynamic_list_cpp_new, and
143 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
144 (General_options::in_dynamic_list): New function.
145 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
146 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
147 (Lex::can_continue_name): Likewise.
148 (yylex): Likewise.
149 (read_script_file): New parameter script_options.
150 (read_dynamic_list): New function.
151 (Script_options::define_dynamic_list): New function.
152 (dynamic_list_keyword_parsecodes): New variable.
153 (dynamic_list_keywords): New variable.
154 * script.h (Script_options::define_dynamic_list): New function
155 prototype.
156 (read_dynamic_list): New function prototype.
157 * symtab.cc (strprefix): New macro.
158 (Symbol::should_add_dynsym_entry): Support dynamic_list,
159 dynamic_list_data, dynamic_list_cpp_new, and
160 dynamic_list_cpp_typeinfo.
161 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
162 (dynamic_list_expr): New rule.
163 (dynamic_list_nodes): Likewise.
164 (dynamic_list_node): Likewise.
165 * testsuite/Makefile.am (dynamic_list): New test.
166 * testsuite/Makefile.in: Regenerated.
167 * testsuite/dynamic_list.t: New file.
168 * testsuite/dynamic_list.sh: New file.
169
e0bb29a5
CS
1702008-11-05 Craig Silverstein <csilvers@google.com>
171
172 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
173 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
174 (t11_last): Likewise.
175 * testsuite/ver_test_6.c (main): Likewise.
176
4e1e25e0
CC
1772008-10-07 Cary Coutant <ccoutant@google.com>
178
179 * options.c (General_options::finalize): Add check for -static and
180 -shared.
181 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
182 is not empty.
183
92f03fcb
CC
1842008-10-02 Cary Coutant <ccoutant@google.com>
185
186 * plugin.cc (make_sized_plugin_object): Fix conditional
187 compilation to work when not all targets are enabled.
188
fbd8a257
CC
1892008-09-29 Cary Coutant <ccoutant@google.com>
190
191 * archive.cc (Archive::get_file_and_offset): Use filename instead
192 of name to get library path.
193 (Archive::include_member): Unlock external member of a thin archive.
194
195 * testsuite/Makefile.am (TEST_AR): New variable.
196 (thin_archive_test_1): New test.
197 (thin_archive_test_2): New test.
81636b3f
CC
198 * testsuite/Makefile.in: Regenerate.
199 * testsuite/thin_archive_main.cc: New file.
200 * testsuite/thin_archive_test_1.cc: New file.
201 * testsuite/thin_archive_test_2.cc: New file.
202 * testsuite/thin_archive_test_3.cc: New file.
203 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 204
eff45813
CC
2052008-09-29 Cary Coutant <ccoutant@google.com>
206
207 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
208 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
209 instead of -1U.
210 (Sized_relobj::do_finalize_local_symbols): Likewise.
211 (Sized_relobj::map_to_kept_section): Likewise.
212 * object.h (Sized_relobj::invalid_address): New constant.
213 (Sized_relobj::do_output_section_offset): Check for invalid_address
214 and return -1ULL.
215 * output.cc (Output_reloc::local_section_offset): Use constant
216 invalid_address instead of -1U.
217 (Output_reloc::get_address): Likewise.
218 (Output_section::output_address): Change -1U to -1ULL.
219 * output.h (Output_reloc::invalid_address): New constant.
220 * reloc.cc (Sized_relobj::write_sections): Use constant
221 invalid_address instead of -1U.
222 (Sized_relobj::relocate_sections): Likewise.
223 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
224 values for merge sections.
225 * target-reloc.h (relocate_for_relocatable): Use constant
226 invalid_address instead of -1U.
227
89fc3421
CC
2282008-09-19 Cary Coutant <ccoutant@google.com>
229
230 Add plugin functionality for link-time optimization (LTO).
231 * configure.ac (plugins): Add --enable-plugins option.
232 * configure: Regenerate.
233 * config.in: Regenerate.
234 * Makefile.am (LIBDL): New variable.
235 (CCFILES): Add plugin.cc.
236 (HFILES): Add plugin.h.
237 (ldadd_var): Add LIBDL.
238 * Makefile.in: Regenerate.
239
240 * archive.cc: Include "plugin.h".
241 (Archive::setup): Don't preread archive symbols when using a plugin.
242 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
243 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
244 files.
245 (Archive::include_member): Add symbols from plugin objects.
246 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
247 * descriptors.cc (Descriptors::open): Check for file descriptors
248 abandoned by plugins.
249 (Descriptors::claim_for_plugin): New function.
250 * descriptors.h (Descriptors::claim_for_plugin): New function.
251 (Open_descriptor::is_claimed): New field.
252 (claim_descriptor_for_plugin): New function.
253 * fileread.cc (File_read::claim_for_plugin): New function.
254 * fileread.h (File_read::claim_for_plugin): New function.
255 (File_read::descriptor): New function.
256 * gold.cc: Include "plugin.h".
257 (queue_initial_tasks): Add task to call plugin hooks for generating
258 new object files.
259 * main.cc: Include "plugin.h".
260 (main): Load plugin libraries.
261 * object.h (Pluginobj): Declare.
262 (Object::pluginobj): New function.
263 (Object::do_pluginobj): New function.
264 (Object::set_target): New function.
265 * options.cc: Include "plugin.h".
266 (General_options::parse_plugin): New function.
267 (General_options::General_options): Initialize plugins_ field.
268 (General_options::add_plugin): New function.
269 * options.h (Plugin_manager): Declare.
270 (General_options): Add --plugin option.
271 (General_options::has_plugins): New function.
272 (General_options::plugins): New function.
273 (General_options::add_plugin): New function.
274 (General_options::plugins_): New field.
275 * plugin.cc: New file.
276 * plugin.h: New file.
277 * readsyms.cc: Include "plugin.h".
278 (Read_symbols::do_read_symbols): Check for archive before checking
279 for ELF file. Call plugin hooks to claim files.
280 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
281 from a real object file; force override when processing replacement
282 files.
283 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
284 (Symbol::init_base_object): Likewise.
285 (Symbol::init_base_output_data): Likewise.
286 (Symbol::init_base_output_segment): Likewise.
287 (Symbol::init_base_constant): Likewise.
288 (Symbol::init_base_undefined): Likewise.
289 (Symbol::output_section): Assert that object is not a plugin.
290 (Symbol_table::add_from_pluginobj): New function.
291 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
292 undefined.
293 (Symbol_table::sized_write_globals): Likewise.
294 (Symbol_table::add_from_pluginobj): Instantiate template.
295 * symtab.h (Sized_pluginobj): Declare.
296 (Symbol::in_real_elf): New function.
297 (Symbol::set_in_real_elf): New function.
298 (Symbol::in_real_elf_): New field.
299 (Symbol_table::add_from_pluginobj): New function.
300
301 * testsuite/Makefile.am (AM_CFLAGS): New variable.
302 (LIBDL): New variable.
303 (LDADD): Add LIBDL.
304 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
305 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
306 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
307 (MOSTLYCLEANFILES): Likewise.
308 * testsuite/Makefile.in: Regenerate.
309 * testsuite/plugin_test.c: New file.
310 * testsuite/plugin_test_1.sh: New file.
311 * testsuite/plugin_test_2.sh: New file.
312
de31bda5
ILT
3132008-09-16 Ian Lance Taylor <iant@google.com>
314
9c2d0ef9
ILT
315 * target-reloc.h (relocate_section): Check whether a symbol is
316 defined by the ABI before reporting an undefined symbol error.
317 * target.h (Target::is_defined_by_abi): Make parameter const.
318 (Target::do_is_defined_by_abi): Likewise.
319 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
320 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
321 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
322 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
323 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
324 * testsuite/Makefile.in: Rebuild.
325
de31bda5
ILT
326 * fileread.cc (make_view): Add casts to avoid warning.
327
9fa33bee
AO
3282008-09-16 Alexandre Oliva <aoliva@redhat.com>
329
330 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
331 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
332
183fd0e3
AO
3332008-09-16 Alexandre Oliva <aoliva@redhat.com>
334
335 * options.h (General_options::output_is_executable): New.
336 (General_options::output_is_pie): New.
337 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
338 for shared libraries.
339 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
340
7be8330a
CD
3412008-09-11 Chris Demetriou <cgd@google.com>
342
343 * options.h (origin): New -z option.
344 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
345 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
346 in DT_FLAGS_1.
347
a9caad02
CC
3482008-09-05 Cary Coutant <ccoutant@google.com>
349
350 * fileread.cc (File_read::make_view): Add check for attempt to map
351 beyond end of file.
352
ae6dce4d
CC
3532008-09-05 Cary Coutant <ccoutant@google.com>
354
355 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
356 explicit instantiations.
357
d7ab2a47
KVH
3582008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
359
360 PR gold/6858
361 * options.cc (General_options::finalize): Allow undefined symbols
362 in shlibs if linking -shared.
363
364 PR gold/6859
365 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
366 symbols as not needing a dynsym entry.
367
1e52a9c1
CS
3682008-08-20 Craig Silverstein <csilvers@google.com>
369
370 * fileread.cc (File_read::open): Do not lock the file unless it
371 was successfully opened.
372
d85c80a3
CC
3732008-08-14 Cary Coutant <ccoutant@google.com>
374
375 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
376 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
377 * testsuite/tls_test.cc (struct int128): 128-bit struct
378 for testing TLS relocs with non-zero addend.
379 (v12): New TLS variable.
380 (t12): New test.
381 (t_last): Add check for v12.
382 * testsuite/tls_test.h (t12): New function.
383 * testsuite/tls_test_main.cc (thread_routine): Call new test.
384
2d924fd9
ILT
3852008-08-13 Ian Lance Taylor <iant@google.com>
386
387 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
388 set tls_segment_ or relro_segment_.
389 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
390 when appropriate.
391 * output.h (Output_section::clear_is_relro): New function.
392 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
393 sections specially even when output_data_ is empty.
394 (Output_segment::maximum_alignment): When first section is relro,
395 only force alignment for PT_LOAD segments.
396 * script.cc (script_data_segment_align): New function.
397 (script_data_segment_relro_end): New function.
398 * script-c.h (script_data_segment_align): Declare.
399 (script_data_segment_relro_end): Declare.
400 * script-sections.h (class Script_sections): Declare
401 data_segment_align and data_segment_relro_end. Add fields
402 segment_align_index_ and saw_relro_end_.
403 * script-sections.cc (class Sections_element): Add set_is_relro
404 virtual function. Add new bool* parameter to place_orphan_here.
405 Add get_output_section virtual function.
406 (class Output_section_definition): Add set_is_relro. Add new
407 bool* parameter to place_orphan_here. Add get_output_section.
408 Add is_relro_ field.
409 (Output_section_definition::Output_section_definition): Initialize
410 evaluated_address_, evaluated_load_address, evaluated_addralign_,
411 and is_relro_ fields.
412 (Output_section_definition::place_orphan_here): Add is_relro
413 parameter.
414 (Output_section_definition::set_section_addresses): Set relro for
415 output section.
416 (Output_section_definition::alternate_constraint): Likewise.
417 (class Orphan_output_section): Add new bool* parameter to
418 place_orphan_here. Add get_output_section.
419 (Orphan_output_section::place_orphan_here): Add is_relro
420 parameter.
421 (Script_sections::Script_sections): Initialize
422 data_segment_align_index_ and saw_relro_end_.
423 (Script_sections::data_segment_align): New function.
424 (Script_sections::data_segment_relro_end): New function.
425 (Script_sections::place_orphan): Set or clear is_relro.
426 (Script_sections::set_section_addresses): Force alignment of first
427 TLS section.
428 * yyscript.y (exp): Call script_data_segment_align and
429 script_data_segment_relro_end.
430 * testsuite/relro_script_test.t: New file.
431 * testsuite/relro_test.cc (using_script): Declare.
432 (t1, t2): Test using_script.
433 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
434 (relro_script_test_SOURCES): Define.
435 (relro_script_test_DEPENDENCIES): Define.
436 (relro_script_test_LDFLAGS): Define.
437 (relro_script_test_LDADD): Define.
438 (relro_script_test.so): New target.
439 * testsuite/Makefile.in: Rebuild.
440
f827c9a9
CC
4412008-08-06 Cary Coutant <ccoutant@google.com>
442
443 * archive.cc (Archive::total_archives, Archive::total_members)
444 (Archive::total_members_loaded): New variables.
445 (Archive::setup): Add parameter. Add option to preread
446 archive symbols.
447 (Archive::read_armap): Add counter.
448 (Archive::get_file_and_offset): New function.
449 (Archive::get_elf_object_for_member): New function.
450 (Archive::read_all_symbols): New function.
451 (Archive::read_symbols): New function.
452 (Archive::add_symbols): Add counters.
453 (Archive::include_all_members): Use armap to find members if it's
454 already built.
455 (Archive::include_member): Skip reading symbols if already read.
456 Factored code into Archive::get_file_and_offset and
457 Archive::get_elf_object_for_member. Changed call to
458 Mapfile::report_include_archive_member.
459 (Archive::print_stats): New function.
460 * archive.h: Declare Object and Read_symbols_data classes.
461 (Archive::Archive): Add initializers for new members.
462 (Archive::setup): Add parameter.
463 (Archive::print_stats): New function.
464 (Archive::total_archives, Archive::total_members)
465 (Archive::total_members_loaded): New variables.
466 (Archive::get_file_and_offset): New function.
467 (Archive::get_elf_object_for_member): New function.
468 (Archive::read_all_symbols): New function.
469 (Archive::read_symbols): New function.
470 (Archive::Archive_member): New class.
471 (Archive::members_): New member.
472 (Archive::num_members_): New member.
473 * main.cc: Include archive.h.
474 (main): Call Archive::print_stats.
475 * mapfile.cc (Mapfile::report_include_archive_member): Delete
476 archive parameter; member_name is now the fully-decorated name.
477 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
478 * options.h: (General_options): Add --preread-archive-symbols option.
479 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
480 Archive::setup.
481
de4c45bd
ILT
4822008-08-04 Ian Lance Taylor <iant@google.com>
483
484 * symtab.h (Symbol::use_plt_offset): New function.
485 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
486 * powerpc.cc (Relocate::relocate): Likewise.
487 * sparc.cc (Relocate::relocate): Likewise.
488 * x86_64.cc (Relocate::relocate): Likewise.
489 * testsuite/weak_plt.sh: New test.
490 * testsuite/weak_plt_main.cc: New test.
491 * testsuite/weak_plt_shared.cc: New test.
492 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
493 (check_PROGRAMS): Add weak_plt.
494 (check_DATA): Add weak_plt_shared.so.
495 (weak_plt_main_pic.o, weak_plt): New targets.
496 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
497 * testsuite/Makefile.in: Rebuild.
498
499 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
500 gcctestdir/ld.
501 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
502 * testsuite/Makefile.in: Rebuild.
503
323ee3f4
AM
5042008-08-04 Alan Modra <amodra@bigpond.net.au>
505
506 * Makefile.am (POTFILES.in): Set LC_ALL=C.
507 * Makefile.in: Regenerate.
508 * po/POTFILES.in: Regenerate.
509
7c07ecec
ILT
5102008-07-29 Ian Lance Taylor <iant@google.com>
511
512 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
513 symbols before other symbols.
514 * testsuite/script_test_2.cc (test_addr): Declare.
515 (test_addr_alias): Declare.
516 (main): Check that test_addr and test_addr_alias have the right
517 values.
518 * testsuite/script_test_2.t: Define test_addr_alias and
519 test_addr.
520
5778530e
ILT
5212008-07-24 Ian Lance Taylor <iant@google.com>
522
2a00e4fb
ILT
523 PR 5990
524 * descriptors.cc: New file.
525 * descriptors.h: New file.
526 * gold-threads.h (class Hold_optional_lock): New class.
527 * fileread.cc: Include "descriptors.h".
528 (File_read::~File_read): Release descriptor rather than closing
529 it.
530 (File_read::open) [file]: Call open_descriptor rather than open.
531 Set is_descriptor_opened_.
532 (File_read::open) [memory]: Assert that descriptor is not open.
533 (File_read::reopen_descriptor): New function.
534 (File_read::release): Release descriptor.
535 (File_read::do_read): Make non-const. Reopen descriptor.
536 (File_read::read): Make non-const.
537 (File_read::make_view): Reopen descriptor.
538 (File_read::do_readv): Likewise.
539 * fileread.h (class File_read): Add is_descriptor_opened_ field.
540 Update declarations.
541 * layout.cc: Include "descriptors.h".
542 (Layout::create_build_id): Use open_descriptor rather than open.
543 * output.cc: Include "descriptors.h".
544 (Output_file::open): Use open_descriptor rather than open.
545 * archive.cc (Archive::const_iterator): Change Archive to be
546 non-const.
547 (Archive::begin, Archive::end): Make non-const.
548 (Archive::count_members): Likewise.
549 * archive.h (class Archive): Update declarations.
550 * object.h (Object::read): Make non-const.
551 * Makefile.am (CCFILES): Add descriptors.cc.
552 (HFILES): Add descriptors.h.
553 * Makefile.in: Rebuild.
554
801647d1
ILT
555 PR 6716
556 * gold.h: Always include <clocale>. Add Solaris workarounds
557 following code in binutils/sysdep.h.
558
5edd166e
ILT
559 PR 6048
560 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
561 this->eh_frame_hdr_ is NULL before using it.
562
c89ad728
ILT
563 * dynobj.cc (Versions::Versions): Update comment.
564
aa86f06b
ILT
565 * dynobj.cc (Versions::Versions): If there is an soname, use it as
566 the base version name.
567
5778530e
ILT
568 * stringpool.cc (Stringpool_template::add_with_length): Set key to
569 array size plus one.
570 (Stringpool_template::set_string_offsets): Subtract one from key
571 before using it as an array index.
572 (Stringpool_template::get_offset_with_length): Likewise.
573 (Stringpool_template::write_to_buffer): Likewise.
574 * stringpool.h (Stringpool_template::get_offset_from_key):
575 Likewise.
576
057ead22
ILT
5772008-07-23 Ian Lance Taylor <iant@google.com>
578
7f649c59
ILT
579 PR 6658
580 * object.h (Merged_symbol_value::value): Do our best to handle a
581 negative addend.
582
057ead22
ILT
583 PR 6647
584 * script.cc (Version_script_info::get_versions): Don't add empty
585 version tag to return value.
586 (Version_script_info::get_symbol_version_helper): Change return
587 type to bool. Add pversion parameter. Change all callers.
588 (script_register_vers_node): Don't require a non-NULL tag.
589 * script.h (class Version_script_info): Update declarations.
590 (Version_script_info::get_symbol_version): Change return type to
591 bool. Add version parameter. Change all callers.
592 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
593 handling. Handle an empty version from a version script.
594 (Symbol_table::define_special_symbol): Likewise.
595 * testsuite/ver_test_10.script: New file.
596 * testsuite/ver_test_10.sh: New file.
597 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
598 (check_DATA): Add ver_test_10.syms.
599 (ver_test_10.syms, ver_test_10.so): New target.
600 * testsuite/Makefile.in: Rebuild.
601
58e54ac2
CD
6022008-07-23 Simon Baldwin <simonb@google.com>
603
604 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
605 to zero for undefined symbols from dynamic libraries.
606
95d14cd3
ILT
6072008-07-23 Ian Lance Taylor <iant@google.com>
608
609 * symtab.cc (Symbol_table::resolve): Remove version parameter.
610 Change all callers.
611 * symtab.h (class Symbol_table): Update declaration.
612 * testsuite/ver_test_9.cc: New file.
613 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
614 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
615 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
616 (ver_test_9.so, ver_test_9.o): New targets.
617 * testsuite/Makefile.in: Rebuild.
618
92de84a6
ILT
6192008-07-22 Ian Lance Taylor <iant@google.com>
620
34810851
ILT
621 * options.h (class General_options): Define --check-sections.
622 * layout.cc (Layout::set_segment_offsets): Handle
623 --check-sections.
624
af6156ef
ILT
625 * options.h (class General_options): Define -n/--nmagic and
626 -N/--omagic.
627 * options.cc (General_options::finalize): For -n/--nmagic or
628 -N/--omagic, set -static.
629 * layout.cc (Layout::attach_allocated_section_to_segment): If
630 -N/--omagic, don't put read-only and read-write sections in
631 different segments.
632 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
633 finding a read-only segment.
634 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
635 don't set the minimum segment alignment to the common page size,
636 and don't set the file offset to the address modulo the page size.
637 * script-sections.cc (Script_sections::create_segments): If
638 -n/--omagic, don't put read-only and read-write sections in
639 different segments.
640
92de84a6
ILT
641 * cref.cc: New file.
642 * cref.h: New file.
643 * options.h (class General_options): Add --print-symbol-counts.
644 * main.cc (main): Issue defined symbol report if requested.
645 * archive.cc (Archive::interpret_header): Make into a const member
646 function.
647 (Archive::add_symbols): Call Input_objects::archive_start and
648 archive_stop.
649 (Archive::const_iterator): Define new class.
650 (Archive::begin, Archive::end): New functions.
651 (Archive::include_all_members): Rewrite to use iterator.
652 (Archive::count_members): New function.
653 * archive.h (class Archive): Update declarations.
654 (Archive::filename): New function.
655 * object.cc: Include "cref.h".
656 (Sized_relobj::Sized_relobj): Initialize defined_count_.
657 (Sized_relobj::do_get_global_symbol_counts): New function.
658 (Input_objects::add_object): Add object to cross-referencer.
659 (Input_objects::archive_start): New function.
660 (Input_objects::archive_stop): New function.
661 (Input_objects::print_symbol_counts): New function.
662 * object.h: Declare Cref and Archive.
663 (Object::get_global_symbol_counts): New function.
664 (Object::do_get_global_symbol_counts): New pure virtual function.
665 (class Sized_relobj): Add defined_count_ field. Update
666 declarations.
667 (class Input_objects): Add cref_ field. Update constructor.
668 Update declarations.
669 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
670 defined_count_.
671 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
672 symbol counts.
673 (Sized_dynobj::do_get_global_symbol_counts): New function.
674 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
675 defined_count_. Update declarations. Define Symbols typedef.
676 * symtab.cc (Symbol_table::add_from_relobj): Add defined
677 parameter. Change all callers.
678 (Symbol_table::add_from_dynobj): Add sympointers and defined
679 parameters. Change all callers.
680 * symtab.h (class Symbol_table): Update declarations.
681 * Makefile.am (CCFILES): Add cref.cc.
682 (HFILES): Add cref.h.
683 * Makefile.in: Rebuild.
684
3f7c5e1d
CD
6852008-07-22 Simon Baldwin <simonb@google.com>
686
687 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
688 to zero when writing undefined symbols.
689
e0b64032
ILT
6902008-07-22 Ian Lance Taylor <iant@google.com>
691
692 * output.cc (Output_section::add_input_section): Don't try to
693 merge empty merge sections.
694
096b02cf
CS
6952008-07-21 Craig Silverstein <csilvers@google.com>
696
697 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
698 Include symbol version in error message.
699
1d1f116d
CD
7002008-07-20 Chris Demetriou <cgd@google.com>
701
702 * configure.ac (gold_cv_c_random_seed): New configured variable.
703 (RANDOM_SEED_CFLAGS): New substituted variable.
704 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
705 * configure: Rebuild.
706 * Makefile.in: Likewise.
707 * testsuite/Makefile.in: Likewise.
708
a18f591e
ILT
7092008-07-18 Ian Lance Taylor <iant@google.com>
710
711 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
712 where we see NAME/NULL and NAME/VERSION as separate symbols.
713 * testsuite/ver_test_main.cc (main): Call t4.
714 (t4, t4_2a): Define.
715 * testsuite/ver_test_2.cc (t4_2): Define.
716 * testsuite/ver_test_2.script: Put t4_2a in VER2.
717 * testsuite/ver_test_4.cc (t4_2a): Define.
718 * testsuite/ver_test_4.script: Put t4_2a in VER2.
719 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
720
c6e3f6ed
ILT
7212008-07-17 Ian Lance Taylor <iant@google.com>
722
723 * dynobj.cc (Versions::add_def): If we give an error about a
724 missing version, go ahead and create the version anyhow.
725
ef9beddf
ILT
7262008-07-10 Ian Lance Taylor <iant@google.com>
727
728 Handle output sections with more than 0x7fffffff bytes.
729 * object.h (class Relobj): Change map_to_output_ to
730 output_sections_, and just keep a section pointer. Change all
731 uses. Move comdat group support to Sized_relobj.
732 (Relobj::is_section_specially_mapped): Remove.
733 (Relobj::output_section): Remove poff parameter. Change all
734 callers.
735 (Relobj::output_section_offset): New function.
736 (Relobj::set_section_offset): Rewrite.
737 (Relobj::map_to_output): Remove.
738 (Relobj::output_sections): New function.
739 (Relobj::do_output_section_offset): New pure virtual function.
740 (Relobj::do_set_section_offset): Likewise.
741 (class Sized_relobj): Add section_offsets_ field. Add comdat
742 group support from Relobj. Update declarations.
743 (Sized_relobj::get_output_section_offset): New function.
744 (Sized_relobj::do_output_section_offset): New function.
745 (Sized_relobj::do_set_section_offset): New function.
746 * object.cc (Relobj::output_section_address): Remove.
747 (Sized_relobj::Sized_relobj): Initialize new fields.
748 (Sized_relobj::include_section_group): Cast find_kept_object to
749 Sized_relobj.
750 (Sized_relobj::include_linkonce_section): Likewise.
751 (Sized_relobj::do_layout): Use separate arrays for output section
752 and output offset.
753 (Sized_relobj::do_count_local_symbols): Change map_to_output to
754 output_sections.
755 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
756 output_sections and section_offsets.
757 (Sized_relobj::write_local_symbols): Likewise.
758 (map_to_kept_section): Compute output address directly.
759 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
760 output_sections and section_offsets.
761 (Sized_relobj::write_sections): Likewise.
762 (Sized_relobj::relocate_sections): Likewise.
763 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
764 * output.h (class Output_reloc): Update declarations. Change
765 u2_.relobj to Sized_relobj*.
766 (class Output_data_reloc): Change add functions to use
767 Sized_relobj*.
768 * output.cc (Output_reloc::Output_reloc): Change relobj to
769 Sized_relobj*.
770 (Output_reloc::local_section_offset): Change return type to
771 Elf_Addr. Use get_output_section_offset.
772 (Output_reloc::get_address): Likewise.
773 (Output_section::is_input_address_mapped): Don't call
774 is_section_specially_mapped.
775 (Output_section::output_offset): Likewise.
776 (Output_section::output_address): Likewise.
777 (Output_section::starting_output_address): Likewise.
778 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
779 parameter to Sized_relobj*.
780 (Copy_relocs::need_copy_reloc): Likewise.
781 (Copy_relocs::save): Likewise.
782 * copy-relocs.h (class Copy_relocs): Update declarations.
783 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
784 Sized_relobj*. Change relobj_ field to Sized_relobj*.
785 * target-reloc.h (relocate_for_relocatable): Change
786 offset_in_output_section type to Elf_Addr. Change code that uses
787 it as well.
788 * layout.cc (Layout::layout): Always set *off.
789 * mapfile.cc (Mapfile::print_input_section): Use
790 output_section_offset.
791 * i386.cc (Target_i386::copy_reloc): Change object parameter to
792 Sized_relobj*.
793 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
794 * sparc.cc (Target_sparc::copy_reloc): Likewise.
795 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
796
5cb66f97
ILT
7972008-07-03 Ian Lance Taylor <iant@google.com>
798
799 * layout.cc (Layout::include_section): Do not discard unrecognized
800 SHT_STRTAB sections.
801
afe47622
CS
8022008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
803
804 * script.cc (Lex::can_continue_name): Make '?' allowable in
805 version-script names.
806 * testsuite/version_script.map: Change glob pattern to use '?'
807
5adf9721
ILT
8082008-06-30 Manish Singh <yosh@gimp.org>
809
810 PR 6585
811 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
812 Correct typo.
813
e6fde208
ILT
8142008-06-30 Ian Lance Taylor <iant@google.com>
815
816 PR 6660
817 PR 6682
818 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
819 versions]: Don't try to read the value in the contents, since we
820 don't use it. Use the template endianness when writing.
821
3f2e6a2d
CC
8222008-06-25 Cary Coutant <ccoutant@google.com>
823
824 * fileread.cc (File_read::make_view): Assert on zero-length view.
825 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
826 symbol table when there are no symbols to read.
827
c43d3a48
CS
8282008-06-23 Craig Silverstein <csilvers@google.com>
829
830 * version.cc (version_string): Bump to 1.7
831
5f494ea0
CS
8322008-06-18 Craig Silverstein <csilvers@google.com>
833
834 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
835 constant 0xFFFF to type Valtype.
836 (Powerpc_relocate_functions::rel16_ha): Likewise.
837
c42e122e
ILT
8382008-06-17 Ian Lance Taylor <iant@google.com>
839
f34787f8
ILT
840 * output.h (Output_section::Input_section): Initialize p2align_ to
841 zero for Output_section_data constructors.
842 (Output_section::Input_section::addralign): If not an input
843 section, return the alignment of the Output_section_data.
844 * testsuite/copy_test.cc: New file.
845 * testsuite/copy_test_1.cc: New file.
846 * testsuite/copy_test_2.cc: New file.
847 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
848 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
849 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
850 (copy_test_1_pic.o, copy_test_1.so): New targets.
851 (copy_test_2_pic.o, copy_test_2.so): New targets.
852 * testsuite/Makefile.in: Rebuild.
853
c42e122e
ILT
854 * script-sections.cc (Script_sections::place_orphan): Initialize
855 local variable exact.
856
ce3ac18a
DE
8572008-06-13 David Edelsohn <edelsohn@gnu.org>
858
859 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
860
42cacb20
DE
8612008-06-12 David Edelsohn <edelsohn@gnu.org>
862 David S. Miller <davem@davemloft.net>
863
864 * powerpc.cc: New file.
865 * Makefile.am (TARGETSOURCES): Add powerpc.cc
866 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
867 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
868 * Makefile.in: Rebuild.
869
7b308235
ILT
8702008-06-09 Ian Lance Taylor <iant@google.com>
871
872 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
873 <exception>.
874 (throwing, orig_terminate): New static variables.
875 (terminate_handler): New static function.
876 (t2): Set terminate handler.
877
f0b886e3
ILT
8782008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
879
880 PR 6584
881 * binary.cc (Binary_to_elf::sized_convert): Fix .data
882 alignment.
883
3e90f135
CC
8842008-05-30 Cary Coutant <ccoutant@google.com>
885
886 * archive.cc (Archive::include_all_members) Correct to step
887 over symbol table and extended name table in thin archives.
888
e09ad04a
ILT
8892008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
890
891 PR 6407
892 * target-reloc.h (relocate_for_relocatable): Fix new_offset
893 calculation.
894
62b01cb5
ILT
8952008-05-28 Caleb Howe <cshowe@google.com>
896
897 * reduced_debug_output.cc: New file.
898 * reduced_debug_output.h: New file.
92de84a6 899 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
900 * options.cc (General_options::finalize): Add strip_debug_non_line
901 to the strip heirarchy.
902 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
903 fields.
904 * layout.cc: Include "reduced_debug_output.h".
905 (Layout::Layout): Initialize new fields.
906 (line_only_debug_sections): New static array.
907 (is_lines_only_debug_sections): New static inline function.
908 (Layout::include_section): Handle --strip-debug-non-line.
909 (Layout::make_output_section): If --strip-debug-non-line, build
910 new output sections for .debug_abbrev and .debug_info.
911 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
912 gold. Warn about possible overflow.
913 (read_signed_LEB_128): Likewise.
914 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
915 (read_signed_LEB_128): Declare.
916 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
917 (HFILES): Add reduced_debug_output.h.
918 * Makefile.in: Rebuild.
919
7d9e3d98
ILT
9202008-05-21 Ian Lance Taylor <iant@google.com>
921
922 * mapfile.cc: New file.
923 * mapfile.h: New file.
924 * options.h (class General_options): Add -M/--print-map and -Map.
925 * options.cc (General_options::finalize): Make -M equivalent to
926 -Map -.
927 * main.cc: Include <cstdio> and "mapfile.h".
928 (main): Open mapfile if requested.
929 * gold.cc (class Middle_runner): Add mapfile_ field. Update
930 constructor. Change caller.
931 (queue_initial_tasks): Add mapfile parameter. Change caller.
932 (queue_middle_tasks): Likewise.
933 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
934 declarations.
935 * archive.cc: Include "mapfile.h".
936 (Archive::add_symbols): Add mapfile parameter. Change all
937 callers. Pass mapfile, symbol, and reason to include_member.
938 (Archive::include_all_members): Add mapfile parameter. Change all
939 callers.
940 (Archive::include_member): Add mapfile, sym, and why parameters.
941 Change all callers. Report inclusion to map file.
942 * archive.h: Include "fileread.h".
943 (class Archive): Update declarations.
944 (Archive::file): New const method.
945 (class Add_archive_symbols): Add mapfile_ field. Update
946 constructor. Change all callers.
947 * readsyms.h (class Read_symbols): Likewise.
948 (class Finish_group): Likewise.
949 (class Read_script): Likewise.
950 * common.cc: Include "mapfile.h".
951 (Symbol_table::allocate_commons): Add mapfile parameter. Change
952 all callers.
953 (Symbol_table::do_allocate_commons): Likewise.
954 (Symbol_table::do_allocate_commons_list): Likewise. Report common
955 symbol allocation to mapfile.
956 * common.h (class Allocate_commons_task): Add mapfile_ field.
957 Update constructor. Change all callers.
958 * symtab.h (class Symbol_table): Update declarations.
959 * layout.cc: Include "mapfile.h".
960 (Layout_task_runner::run): Print information to mapfile.
961 (Layout::create_gold_note): Change Output_data_fixed_space to
962 Output_data_zero_fill.
963 (Layout::create_build_id): Likewise.
964 (Layout::print_to_mapfile): New function.
965 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
966 constructor. Change caller.
967 (class Layout): Declare print_to_mapfile.
968 * output.cc (Output_section::Input_section::print_to_mapfile): New
969 function.
970 (Output_section::add_input_section): If producing a map, always
971 add to input_sections_ list.
972 (Output_section::do_print_to_mapfile): New function.
973 (Output_segment::print_sections_to_mapfile): New function.
974 (Output_segment::print_section_list_to_mapfile): New function.
975 * output.h: Include "mapfile.h".
976 (Output_data::print_to_mapfile): New function.
977 (Output_data::do_print_to_mapfile): New virtual function.
978 (Output_segment_headers::do_print_to_mapfile): New function.
979 (Output_file_header::do_print_to_mapfile): New function.
980 (Output_data_const::do_print_to_mapfile): New function.
981 (class Output_data_const_buffer): Add map_name_ field. Update
982 constructor. Change all callers. Add do_print_to_mapfile
983 function.
984 (class Output_data_fixed_space): Likewise.
985 (class Output_data_space): Likewise.
986 (class Output_data_zero_fill): New class.
987 (Output_data_strtab::do_print_to_mapfile): New function.
988 (Output_data_reloc_base::do_print_to_mapfile): New function.
989 (Output_relocatable_relocs::do_print_to_mapfile): New function.
990 (Output_data_group::do_print_to_mapfile): New function.
991 (Output_data_got::do_print_to_mapfile): New function.
992 (Output_data_dynamic::do_print_to_mapfile): New function.
993 (Output_symtab_xindex::do_print_to_mapfile): New function.
994 (class Output_section): Declare do_print_to_mapflie. Declare
995 print_to_mapfile in Input_section.
996 (class Output_segment): Declare new functions.
997 * object.h (Sized_relobj::symbol_count): New function.
998 * script-sections.cc
999 (Output_section_element_dot_assignment::set_section_addresses):
1000 Change Output_data_fixed_space to Output_data_zero_fill.
1001 (Output_data_expression::do_print_to_mapfile): New function.
1002 * script.cc (read_input_script): Add mapfile parameter. Change
1003 all callers.
1004 * script.h (read_input_script): Update declaration.
1005 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
1006 (Eh_frame::do_print_to_mapfile): New function.
1007 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
1008 (Output_merge_string::do_print_to_mapfile): New function.
1009 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
1010 function.
1011 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
1012 function.
1013 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
1014 function.
1015 * Makefile.am (CCFILES): Add mapfile.cc.
1016 (HFILES): Add mapfile.h.
1017 * Makefile.in: Rebuild.
1018
9f1d377b
ILT
10192008-05-19 Ian Lance Taylor <iant@google.com>
1020
1021 * options.h (class General_options): Add -z relro.
1022 * layout.cc (Layout::Layout): Initialize relro_segment_.
1023 (Layout::add_output_section_data): Return the output section.
1024 (Layout::make_output_section): Rcognize relro sections and mark
1025 them appropriately.
1026 (Layout::attach_allocated_section_to_segment): Put relro sections
1027 in a PT_GNU_RELRO segment.
1028 (Layout::create_initial_dynamic_sections): Mark the .dynamic
1029 section as relro.
1030 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
1031 PT_TLS segments.
1032 (Layout::linkonce_mapping): Map d.rel.ro.local to
1033 .data.rel.ro.local.
1034 (Layout::output_section_name): Us .data.rel.ro.local for any
1035 section which begins with that.
1036 * layout.h (class Layout): Update add_output_section_data
1037 declaration. Add relro_segment_ field.
1038 * output.cc (Output_section::Output_section): Initialize is_relro_
1039 and is_relro_local_ fields.
1040 (Output_segment::add_output_section): Group relro sections.
1041 (Output_segment::is_first_section_relro): New function.
1042 (Output_segment::maximum_alignment): If there is a relro section,
1043 align the segment to the common page size.
1044 (Output_segment::set_section_addresses): Track whether we are
1045 looking at relro sections. If the last section is a relro
1046 section, align to the common page size.
1047 (Output_segment::set_section_list_addresses): Add in_relro
1048 parameter. Change all callers. Align to the page size when
1049 moving from relro to non-relro section.
1050 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
1051 segment.
1052 * output.h (class Output_section): Add is_relro_ and
1053 is_relro_local_ fields.
1054 (Output_section::is_relro): New function.
1055 (Output_section::set_is_relro): New function.
1056 (Output_section::is_relro_local): New function.
1057 (Output_section::set_is_relro_local): New function.
1058 (class Output_segment): Update declarations.
1059 * i386.cc (Target_i386::got_section): Mark .got section as relro.
1060 * sparc.cc (Target_sparc::got_section): Likewise.
1061 * x86_64.cc (Target_x86_64::got_section): Likewise.
1062 * testsuite/relro_test_main.cc: New file.
1063 * testsuite/relro_test.cc: New file.
1064 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
1065 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
1066 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
1067 (relro_test.so, relro_test_pic.o): New targets.
1068 * testsuite/Makefile.in: Rebuild.
1069
a984ee1d
ILT
10702008-05-16 Ian Lance Taylor <iant@google.com>
1071
01676dcd
ILT
1072 * output.cc (Output_segment::add_output_section): Remove front
1073 parameter.
1074 * output.h (class Output_segment): Remove
1075 add_initial_output_section and overloaded add_output_section.
1076 Update declaration of remaining add_output_section.
1077 * layout.cc (Layout::create_interp): Call add_output_section
1078 rather than add_initial_output_section.
1079 (Layout::finish_dynamic_section): Likewise.
1080
497897f9
ILT
1081 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
1082 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
1083 know the dynamic type.
1084 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
1085 field. Initialize it in constructor.
1086 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
1087 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
1088 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
1089 reloc.
1090
a984ee1d
ILT
1091 * output.cc (Output_reloc::get_address): Change return type to
1092 Elf_Addr.
1093 * output.h (class Output_reloc): Update get_address declaration.
1094 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
1095 for section addresses.
1096
55ba0940
ILT
10972008-05-09 Ian Lance Taylor <iant@google.com>
1098
1099 PR 6493
1100 * gold.cc (gold_nomem): Use return value of write.
1101
75517b77
ILT
11022008-05-08 Ian Lance Taylor <iant@google.com>
1103
1104 * symtab.c (Symbol::init_base_output_data): Add version
1105 parameter. Change all callers.
1106 (Symbol::init_base_output_segment): Likewise.
1107 (Symbol::init_base_constant): Likewise.
1108 (Symbol::init_base_undefined): Likewise.
1109 (Sized_symbol::init_output_data): Likewise.
1110 (Sized_symbol::init_output_segment): Likewise.
1111 (Sized_symbol::init_constant): Likewise.
1112 (Sized_symbol::init_undefined): Likewise.
1113 (Symbol_table::do_define_in_output_data): If the new symbol has a
1114 version, mark it as the default.
1115 (Symbol_table::do_define_in_output_segment): Likewise.
1116 (Symbol_table::do_define_as_constant): Likewise.
1117 * symtab.h (class Symbol): Update declarations.
1118 (class Sized_symbol): Likewise.
1119 * resolve.cc (Symbol::override_version): New function.
c42e122e 1120 (Symbol::override_base): Call override_version.
75517b77
ILT
1121 (Symbol::override_base_with_special): Likewise.
1122 * testsuite/ver_script_8.script: New file.
1123 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
1124 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
1125 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
1126 (ver_test_8_1.so, ver_test_8_2.so): New targets.
1127
f1f70eae
ILT
11282008-05-06 Ian Lance Taylor <iant@google.com>
1129
f3e9c5c5
ILT
1130 PR 6049
1131 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
1132 functions.
1133 (class General_options): Remove existing --undefined, and add
1134 --no-undefined instead. Add new --undefined as synonym for -u.
1135 * archive.cc (Archive::add_symbols): Check whether symbol was
1136 named with -u.
1137 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
1138 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
1139 all uses. Add IS_UNDEFINED. Update declarations to split
1140 different versions of init_base. Declare init_base_undefined.
1141 (Symbol::is_defined): Handle IS_UNDEFINED.
1142 (Symbol::is_undefined): Likewise.
1143 (Symbol::is_weak_undefined): Call is_undefined.
1144 (Symbol::is_absolute): Handle IS_CONSTANT.
1145 (class Sized_symbol): Update declarations to split different
1146 versions of init. Declare init_undefined.
1147 (class Symbol_table): Declare new functions.
1148 * symtab.cc (Symbol::init_base_object): Rename from init_base.
1149 Change all callers.
1150 (Symbol::init_base_output_data): Likewise.
1151 (Symbol::init_base_output_segment): Likewise.
1152 (Symbol::init_base_constant): Likewise.
1153 (Symbol::init_base_undefined): New function.
1154 (Sized_symbol::init_object): Rename from init. Change all
1155 callers.
1156 (Sized_symbol::init_output_data): Likewise.
1157 (Sized_symbol::init_output_segment): Likewise.
1158 (Sized_symbol::init_constant): Likewise.
1159 (Sized_symbol::init_undefined): New function.
1160 (Symbol_table::add_undefined_symbols_from_command_line): New
1161 function.
1162 (Symbol_table::do_add_undefined_symbols_from_command_line): New
1163 function.
1164 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
1165 (Symbol::output_section): Likewise.
1166 (Symbol::set_output_section): Likewise.
1167 (Symbol_table::sized_finalize_symbol): Likewise.
1168 (Symbol_table::sized_write_globals): Likewise.
1169 * resolve.cc (Symbol_table::should_override): Likewise.
1170 (Symbol::override_base_with_special): Likewise.
1171
8bdcdf2c
ILT
1172 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
1173 symbol, change it to have default visibility.
1174 * testsuite/protected_1.cc: New file.
1175 * testsuite/protected_2.cc: New file.
1176 * testsuite/protected_3.cc: New file.
1177 * testsuite/protected_main_1.cc: New file.
1178 * testsuite/protected_main_2.cc: New file.
1179 * testsuite/protected_main_3.cc: New file.
1180 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
1181 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
1182 (protected_1_LDFLAGS, protected_1_LDADD): Define.
1183 (protected_1.so): New target.
1184 (protected_1_pic.o, protected_2_pic.o): New targets.
1185 (protected_3_pic.o): New target.
1186 (check_PROGRAMS): Add protected_2.
1187 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
1188 (protected_2_LDFLAGS, protected_2_LDADD): Define.
1189 * testsuite/Makefile.in: Rebuild.
1190
2b706932
ILT
1191 * options.h (DEFINE_var): Add set_user_set_##varname__.
1192 (DEFINE_bool_alias): New macro.
1193 (class General_options): Define -Bstatic using DEFINE_bool_alias
1194 rather than DEFINE_special. Add --undefined as an alias for -z
1195 defs.
1196 * options.cc (General_options::parse_Bstatic): Remove.
1197
d82a5bcc
ILT
1198 * options.h (class General_options): Add --fatal-warnings.
1199 * main.cc (main): Implement --fatal-warnings.
1200 * errors.h (Errors::warning_count): New function.
1201
f1f70eae
ILT
1202 * options.h (class General_options): Add -Bsymbolic-functions.
1203 * symtab.h (Symbol::is_preemptible): Check for
1204 -Bsymbolic-functions.
1205
8825ac63
ILT
12062008-05-05 Ian Lance Taylor <iant@google.com>
1207
d98bc257
ILT
1208 * options.h (DEFINE_bool): For DASH_Z, create the negative option
1209 as noVARNAME rather than no-VARNAME.
1210 (class General_options): Add option -z combreloc.
1211 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
1212 get_address.
1213 (Output_reloc::sort_before) [SHT_REL]: New function.
1214 (Output_reloc::sort_before) [SHT_RELA]: New function.
1215 (class Output_data_reloc_base): Add sort_relocs_ field. Define
1216 Sort_relocs_comparison.
1217 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
1218 parameter. Change all callers.
1219 (Output_data_reloc::Output_data_reloc) [both versions]: Add
1220 sort_relocs parameter. Change all callers.
1221 * output.cc (Output_reloc::get_address): New function, broken out
1222 of write_rel.
1223 (Output_reloc::write_rel): Call it.
1224 (Output_reloc::compare): New function.
1225 (Output_data_reloc_base::do_write): Optionally sort relocs.
1226
60b2b4e7
ILT
1227 * configure.ac: If targ_extra_obj is set, link it in.
1228 * configure.tgt: Initialize all variables.
1229 (x86_64*): Set targ_extra_obj and targ_extra_size.
1230 * configure: Rebuild.
1231
8825ac63
ILT
1232 * object.cc (Sized_relobj::include_section_group): Adjust section
1233 indexes read from group data. Build vector to pass to
1234 layout_group.
1235 * layout.cc (Layout::layout_group): Add flags and shndxes
1236 parameters. Remove contents parameter. Change caller. Update
1237 explicit instantiations.
1238 * layout.h (class Layout): Update layout_group declaration.
1239 * output.cc (Output_data_group::Output_data_group): Add flags and
1240 input_shndxes parameters. Remove contents parameter. Change
1241 caller.
1242 (Output_data_group::do_write): Change input_sections_ to
1243 input_shndxes_.
1244 * output.h (class Output_data_group): Update constructor
1245 declaration. Rename input_sections_ to input_shndxes_.
1246 * testsuite/many_sections_test.cc: Add template.
1247
e94cf127
CC
12482008-04-30 Cary Coutant <ccoutant@google.com>
1249
4418b2d5
CC
1250 * target-reloc.h (relocate_section): Fix dead-pointer bug.
1251
e94cf127
CC
1252 * layout.cc (Layout::include_section): Refactored check for debug
1253 info section.
1254 (Layout::add_comdat): Add new parameters. Change type
1255 of signature parameter. Add object and shndx to signatures table.
1256 (Layout::find_kept_object): New function.
1257 * layout.h: Include <cstring>.
1258 (Layout::is_debug_info_section): New function.
1259 (Layout::add_comdat): Add new parameters.
1260 (Layout::find_kept_object): New function.
1261 (Layout::Kept_section): New struct.
1262 (Layout::Signatures): Change type of map range.
1263 * object.cc (Relobj::output_section_address): New function.
1264 (Sized_relobj::include_section_group): Add new parameters. Change
1265 calls to Layout::add_comdat. Change to build table of kept comdat
1266 groups and table mapping discarded sections to kept sections.
1267 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
1268 (Sized_relobj::do_layout): Change calls to include_section_group and
1269 include_linkonce_section.
1270 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
1271 value to zero when section is discarded.
1272 (Sized_relobj::map_to_kept_section): New function.
1273 * object.h (Relobj::output_section_address): New function.
1274 (Relobj::Comdat_group): New type.
1275 (Relobj::find_comdat_group): New function.
1276 (Relobj::Comdat_group_table): New type.
1277 (Relobj::Kept_comdat_section): New type.
1278 (Relobj::Kept_comdat_section_table): New type.
1279 (Relobj::add_comdat_group): New function.
1280 (Relobj::set_kept_comdat_section): New function.
1281 (Relobj::get_kept_comdat_section): New function.
1282 (Relobj::comdat_groups_): New field.
1283 (Relobj::kept_comdat_sections_): New field.
1284 (Symbol_value::input_value): Update comment.
1285 (Sized_relobj::map_to_kept_section) New function.
1286 (Sized_relobj::include_linkonce_section): Add new parameter.
1287 * target-reloc.h (Comdat_behavior): New type.
1288 (get_comdat_behavior): New function.
1289 (relocate_section): Add code to map a discarded section to the
1290 corresponding kept section when applying a relocation.
1291
e4e5049b
CS
12922008-04-30 Craig Silverstein <csilvers@google.com>
1293
1294 * dwarf_reader.cc (next_generation_count): New static var.
1295 (Addr2line_cache_entry): New struct.
1296 (addr2line_cache): New static var.
1297 (Dwarf_line_info::one_addr2line): Added caching.
1298 (Dwarf_line_info::clear_addr2line_cache): New function.
1299 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
1300 cache-size parameter.
1301 (Dwarf_line_info::one_addr2line_cache): New function.
1302 * symtab.cc (Symbol_table::detect_odr_violations): Pass
1303 new cache-size argument to one_addr2line(), and clear cache.
1304
d09e9154
CC
13052008-04-28 Cary Coutant <ccoutant@google.com>
1306
1307 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
1308 R_386_PC8 relocations.
1309
7ef73768
ILT
13102008-04-23 Ian Lance Taylor <iant@google.com>
1311
55438702
ILT
1312 * object.cc (Sized_relobj::include_section_group): Check for
1313 invalid section group.
1314
c165fb93
ILT
1315 * object.cc (make_elf_object): Correct test for 64-bit ELF file
1316 header size.
1317
7ef73768
ILT
1318 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
1319 than read for file header.
1320 * archive.cc (Archive::include_member): Likewise.
1321
6194aaab
L
13222008-04-23 Paolo Bonzini <bonzini@gnu.org>
1323
1324 * aclocal.m4: Regenerate.
1325 * configure: Regenerate.
1326
d491d34e
ILT
13272008-04-19 Ian Lance Taylor <iant@google.com>
1328
5ea2bac6
ILT
1329 * version.cc (version_string): Bump to 1.6.
1330
7bc3e21a
ILT
1331 * testsuite/Makefile.am (many_sections_r_test): New target.
1332 (many_sections_r_test_SOURCES): Remove.
1333 (many_sections_r_test_DEPENDENCIES): Remove.
1334 (many_sections_r_test_LDFLAGS): Remove.
1335 (many_sections_r_test_LDADD): Remove.
1336
7fcd3aa9
ILT
1337 * object.cc (Sized_relobj::do_add_symbols): Always pass
1338 local_symbol_count_ to add_from_relobj.
1339
4c94d6ae
ILT
1340 * testsuite/Makefile.am (many_sections_check.h): Only check one in
1341 every thousand variables.
1342 * testsuite/Makefile.in: Rebuild.
1343
d491d34e
ILT
1344 * object.cc (Xindex::initialize_symtab_xindex): New function.
1345 (Xindex::read_symtab_xindex): New function.
1346 (Xindex::sym_xindex_to_shndx): New function.
1347 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
1348 available.
1349 (Sized_relobj::do_initialize_xindex): New function.
1350 (Sized_relobj::do_read_symbols): Adjust section links.
1351 (Sized_relobj::symbol_section_and_value): Add is_ordinary
1352 parameter. Change all callers.
1353 (Sized_relobj::include_section_group): Adjust section links and
1354 symbol section indexes.
1355 (Sized_relobj::do_layout): Adjust section links.
1356 (Sized_relobj::do_count_local_symbols): Adjust section links and
1357 symbol section indexes.
1358 (Sized_relobj::do_finalize_local_symbols): Distinguish between
1359 ordinary and special symbols.
1360 (Sized_relobj::write_local_symbols): Add symtab_xindex and
1361 dynsym_xindex parameters. Change all callers. Adjust section
1362 links. Use SHN_XINDEX when needed.
1363 (Sized_relobj::get_symbol_location_info): Adjust section links.
1364 Don't get fooled by special symbols.
1365 * object.h (class Xindex): Define.
1366 (class Object): Add xindex_ parameter. Declare virtual functoin
1367 do_initialize_xindex.
1368 (Object::adjust_sym_shndx): New function.
1369 (Object::set_xindex): New protected function.
1370 (class Symbol_value): Add is_ordinary_shndx_ field.
1371 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
1372 (Symbol_value::value): Assert ordinary section.
1373 (Symbol_value::initialize_input_to_output_map): Likewise.
1374 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
1375 Change all callers.
1376 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
1377 all callers.
1378 (class Sized_relobj): Update declarations.
1379 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
1380 parameter. Change all callers.
1381 (Sized_relobj::adjust_shndx): New function.
1382 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
1383 field.
1384 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
1385 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
1386 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
1387 (Sized_dynobj::read_dynsym_section): Adjust section links.
1388 (Sized_dynobj::read_dynamic): Likewise.
1389 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
1390 section links.
1391 (Sized_dynobj::do_initialize_xindex): New function.
1392 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
1393 do_initialize_xindex.
1394 (Sized_dynobj::adjust_shndx): New function.
1395 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
1396 dynsym_xindex_ fields.
1397 (Layout::finalize): Add a call to set_section_indexes before
1398 creating the symtab sections.
1399 (Layout::set_section_indexes): Don't do anything if the section
1400 already has a section index.
1401 (Layout::create_symtab_sections): Add shnum parameter. Change
1402 caller. Create .symtab_shndx section if needed.
1403 (Layout::create_shdrs): Add shstrtab_section parameter. Change
1404 caller.
1405 (Layout::allocated_output_section_count): New function.
1406 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
1407 needed.
1408 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
1409 fields. Update declarations.
1410 (Layout::symtab_xindex): New function.
1411 (Layout::dynsym_xindex): New function.
1412 (class Write_symbols_task): Add layout_ field.
1413 (Write_symbols_task::Write_symbols_task): Add layout parameter.
1414 Change caller.
1415 * output.cc (Output_section_headers::Output_section_headers): Add
1416 shstrtab_section parameter. Change all callers.
1417 (Output_section_headers::do_sized_write): Store overflow values
1418 for section count and section string table section index in
1419 section header zero.
1420 (Output_file_header::do_sized_write): Check for overflow of
1421 section count and section string table section index.
1422 (Output_symtab_xindex::do_write): New function.
1423 (Output_symtab_xindex::endian_do_write): New function.
1424 * output.h (class Output_section_headers): Add shstrtab_section_.
1425 Update declarations.
1426 (class Output_symtab_xindex): Define.
1427 (Output_section::has_out_shndx): New function.
1428 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
1429 field.
1430 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
1431 Change all callers.
1432 (Sized_symbol::init): Likewise.
1433 (Symbol::output_section): Check for ordinary symbol.
1434 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
1435 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
1436 callers.
1437 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
1438 Change all callers. Simplify handling of symbols from sections
1439 not included in the link.
1440 (Symbol_table::add_from_dynobj): Handle ordinary symbol
1441 distinction.
1442 (Weak_alias_sorter::operator()): Assert that symbols are
1443 ordinary.
1444 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
1445 distinction.
1446 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
1447 parameters. Change all callers.
1448 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
1449 symbol distinction. Use SHN_XINDEX when needed.
1450 (Symbol_table::write_section_symbol): Add symtab_xindex
1451 parameter. Change all callers.
1452 (Symbol_table::sized_write_section_symbol): Likewise. Use
1453 SHN_XINDEX when needed.
1454 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
1455 declarations.
1456 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
1457 (Symbol::is_defined): Check is_ordinary.
1458 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
1459 (Symbol::is_absolute, Symbol::is_common): Likewise.
1460 (class Sized_symbol): Update declarations.
1461 (class Symbol_table): Update declarations.
1462 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
1463 parameters. Change all callers.
1464 (Sized_symbol::override): Likewise.
1465 (Symbol_table::override): Likewise.
1466 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
1467 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
1468 is_ordinary, and orig_st_shndx parameters. Change all callers.
1469 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
1470 to be in an ordinary section.
1471 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
1472 object and is_ordinary parameters. Change all callers.
1473 (Sized_dwarf_line_info::read_relocs): Add object parameter.
1474 Change all callers. Don't add undefined or non-ordinary symbols
1475 to reloc_map_.
1476 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
1477 Change all callers.
1478 * dwarf_reader.h (class Sized_dwarf_line_info): Update
1479 declarations.
1480 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
1481 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
1482 (Sized_relobj::relocate_sections): Likewise.
1483 * target-reloc.h (scan_relocs): Adjust section symbol index.
1484 (scan_relocatable_relocs): Likewise.
1485 * i386.cc (Scan::local): Check for ordinary symbols.
1486 * sparc.cc (Scan::local): Likewise.
1487 * x86_64.cc (Scan::local): Likewise.
1488 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
1489 to symbol_section_and_value.
1490 * testsuite/many_sections_test.cc: New file.
1491 * testsuite/Makefile.am (BUILT_SOURCES): Define.
1492 (check_PROGRAMS): Add many_sections_test.
1493 (many_sections_test_SOURCES): Define.
1494 (many_sections_test_DEPENDENCIES): Define.
1495 (many_sections_test_LDFLAGS): Define.
1496 (BUILT_SOURCES): Add many_sections_define.h.
1497 (many_sections_define.h): New target.
1498 (BUILT_SOURCES): Add many_sections_check.h.
1499 (many_sections_check.h): New target.
1500 (check_PROGRAMS): Add many_sections_r_test.
1501 (many_sections_r_test_SOURCES): Define.
1502 (many_sections_r_test_DEPENDENCIES): Define.
1503 (many_sections_r_test_LDFLAGS): Define.
1504 (many_sections_r_test_LDADD): Define.
1505 (many_sections_r_test.o): New target.
1506 * testsuite/Makefile.in: Rebuild.
1507
c5818ff1
CC
15082008-04-17 Cary Coutant <ccoutant@google.com>
1509
1510 * errors.cc (Errors::info): New function.
1511 (gold_info): New function.
1512 * errors.h (Errors::info): New function.
1513 * gold.h (gold_info): New function.
1514 * object.cc (Input_objects::add_object): Print trace output.
1515 * options.cc (options::parse_set): New function.
1516 (General_options::parse_wrap): Deleted.
1517 (General_options::General_options): Deleted initializer.
1518 * options.h (options::String_set): New typedef.
1519 (options::parse_set): New function.
1520 (DEFINE_set): New macro.
1521 (General_options::wrap): Changed to use DEFINE_set. Changed
1522 callers of any_wrap_symbols and is_wrap_symbol.
1523 (General_options::trace, General_options::trace_symbol):
1524 New options.
1525 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
1526 (General_options::wrap_symbols_): Deleted.
1527 * symtab.cc (Symbol_table::add_from_object): Print trace output.
1528
b5be4a7c
DM
15292008-04-17 David S. Miller <davem@davemloft.net>
1530
1531 * options.cc (General_options::parse_V): New function.
1532 * options.h: Add entries for -V and -Qy.
1533
155a0dd7
ILT
15342008-04-17 Ian Lance Taylor <iant@google.com>
1535
1536 * common.cc (Symbol_table::allocate_commons): Remove options
1537 parameter. Change caller.
1538 (Symbol_table::do_allocate_commons): Remove options parameter.
1539 Change caller. Just call do_allocate_commons_list twice.
1540 (Symbol_table::do_allocate_commons_list): New function, broken out
1541 of do_allocate_commons.
1542 * common.h (class Allocate_commons_task): Remove options_ field.
1543 Update constructor.
1544 * symtab.cc (Symbol_table::Symbol_table): Initialize
1545 tls_commons_.
1546 (Symbol_table::add_from_object): Put TLS common symbols on
1547 tls_commons_ list.
1548 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
1549 which are IN_OUTPUT_DATA.
1550 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
1551 allocate_commons and do_allocate_commons declarations. Declare
1552 do_allocate_commons_list.
1553 * gold.cc (queue_middle_tasks): Update creation of
1554 Allocate_commons_task to not pass options.
1555 * testsuite/Makefile.am (INCLUDES): Add -I.. .
1556 (TLS_TEST_C_FLAGS): New variable.
1557 (tls_test_c_pic.o): New target.
1558 (tls_test_shared.so): Link in tls_test_c_pic.o.
1559 (tls_test_c_pic_ie.o): New target.
1560 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
1561 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
1562 (tls_test_c.o): New target.
1563 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
1564 (tls_pic_test_LDADD): Likewise.
1565 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
1566 (tls_shared_gd_to_ie_test_LDADD): Likewise.
1567 (tls_test_c_gnu2.o): New target.
1568 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
1569 tls_test_c_gnu2.o.
1570 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
1571 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
1572 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
1573 * testsuite/tls_test.cc: Include "config.h".
1574 (t_last): Call t11_last.
1575 * testsuite/tls_test.h (t11, t11_last): Declare.
1576 * testsuite/tls_test_c.c: New file.
1577 * testsuite/tls_test_main.cc (thread_routine): Call t11.
1578 * configure.ac: Check for OpenMP support.
1579 * configure, config.in, Makefile.in: Rebuild.
1580 * testsuite/Makefile.in: Rebuild.
1581
edfbb029
CC
15822008-04-16 Cary Coutant <ccoutant@google.com>
1583
1584 * i386.cc (Target_i386::define_tls_base_symbol): New function.
1585 (Target_i386::tls_base_symbol_defined_): New field.
1586 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
1587 (Target_i386::Scan::global): Likewise.
1588 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
1589 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
1590 (Target_x86_64::tls_base_symbol_defined_): New field.
1591 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
1592 (Target_x86_64::Scan::global): Likewise.
1593
f3c69fca
CC
15942008-04-16 Cary Coutant <ccoutant@google.com>
1595
1596 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
1597 (Symbol::needs_plt_entry): Allow weak undefined symbols.
1598 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
1599 building shared libraries.
1600 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
1601 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
1602 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
1603 * testsuite/Makefile.in: Rebuild.
1604 * testsuite/weak_undef.h: New file.
1605 * testsuite/weak_undef_file1.cc: Add extra test cases.
1606 * testsuite/weak_undef_file2.cc: Likewise.
1607 * testsuite/weak_undef_test.cc: Likewise.
1608
7c414435
DM
16092008-04-16 David S. Miller <davem@davemloft.net>
1610
32b769e1
DM
1611 * sparc.cc (Target_sparc::Scan): Change from struct to class.
1612 Add issued_non_pic_error_ field. Declare check_non_pic.
1613 (Target_sparc::Scan::check_non_pic): New function.
1614 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
1615 (Target_sparc::Scan::global): Likewise.
1616
11936fb1
DM
1617 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
1618 * configure: Rebuild.
1619
7c414435
DM
1620 * options.h (DEFINE_enable): New macro.
1621 (new_dtags): New enable option.
1622 (initfirst, interpose, loadfltr, nodefaultlib,
1623 nodelete, nodlopen, nodump): New -z options.
1624 * layout.cc (Layout:finish_dynamic_section): If new
1625 dtags enabled, emit DT_RUNPATH. Also, emit a
1626 DT_FLAGS_1 containing any specified -z flags.
1627
85c7bf8b
ILT
16282008-04-16 Ian Lance Taylor <iant@google.com>
1629
12c0daef
ILT
1630 * copy-relocs.cc: New file.
1631 * copy-relocs.h: New file.
1632 * reloc.cc: Remove Copy_relocs code.
1633 * reloc.h: Likewise.
1634 * reloc-types.h (struct Reloc_types) [both versions]: Add
1635 get_reloc_addend_noerror.
1636 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
1637 variants of add_global which take an addend which must be zero.
1638 * i386.cc: Include "copy-relocs.h".
1639 (class Target_i386): Change type of copy_relocs_ to variable,
1640 update initializer.
1641 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
1642 Change all callers.
1643 (Target_i386::do_finalize_sections): Change handling of
1644 copy_relocs_.
1645 * sparc.cc: Include "copy-relocs.h".
1646 (class Target_sparc): Change type of copy_relocs_ to variable,
1647 update initializer.
1648 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
1649 Change all callers.
1650 (Target_sparc::do_finalize_sections): Change handling of
1651 copy_relocs_.
1652 * x86_64.cc: Include "copy-relocs.h".
1653 (class Target_x86_64): Change type of copy_relocs_ to variable,
1654 update initializer.
1655 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
1656 class. Change all callers.
1657 (Target_x86_64::do_finalize_sections): Change handling of
1658 copy_relocs_.
1659 * Makefile.am (CCFILES): Add copy-relocs.cc.
1660 (HFILES): Add copy-relocs.h.
1661
4f4995b6
ILT
1662 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
1663
85c7bf8b
ILT
1664 * testsuite/script_test_4.sh: Permit leading zeroes.
1665
4f2a9edd
ILT
16662008-04-15 Ian Lance Taylor <iant@google.com>
1667
e6188289
ILT
1668 * script-sections.cc (Script_sections::create_segments): Use
1669 header_size_adjustment even when there is enough room for the
1670 headers.
1671 * testsuite/script_test_4.sh: New file.
1672 * testsuite/script_test_4.t: New file.
1673 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
1674 (check_DATA): Add script_test_4.stdout.
1675 (MOSTLYCLEANFILES): Likewise.
1676 (script_test_4): New target.
1677 (script_test_4.stdout): New target.
1678 * testsuite/Makefile.in: Rebuild.
1679
4f2a9edd
ILT
1680 * sparc.cc: Add definitions for Output_data_plt_sparc class
1681 constants.
1682
f5314dd5
DM
16832008-04-14 David S. Miller <davem@davemloft.net>
1684
1685 * sparc.cc: New file.
1686 * Makefile.am (TARGETSOURCES): Add sparc.cc
1687 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
1688 * configure.tgt: Document targ_extra_size and
1689 targ_extra_big_endian. Add entries for sparc-* and
1690 sparc64-*.
1691 * configure.ac: Handle targ_extra_size and
1692 targ_extra_big_endian.
1693 * Makefile.in: Rebuild.
1694 * configure: Likewise.
1695 * po/POTFILES.in: Likewise.
1696 * po/gold.pot: Likewise.
1697
154e0e9a
ILT
16982008-04-14 Ian Lance Taylor <iant@google.com>
1699
1700 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
1701 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
1702 in the name/type/flags to section mapping. Don't call
1703 allocate_output_section.
1704 (Layout::choose_output_section): Change parameter from adjust_name
1705 to is_input_section. Don't permit input sections after sections
1706 are attached to segments. Don't call allocate_output_section.
1707 (Layout::layout_eh_frame): Call update_flags_for_input_section,
1708 not write_enable_output_section.
1709 (Layout::make_output_section): Don't push to
1710 unattached_section_list_ nor call attach_to_segment. Call
1711 attach_section_to_segment if sections are attached.
1712 (Layout::attach_sections_to_segments): New function.
1713 (Layout::attach_section_to_segment): New function.
1714 (Layout::attach_allocated_section_to_segment): Rename from
1715 attach_to_segment. Remove flags parameter.
1716 (Layout::allocate_output_section): Remove function.
1717 (Layout::write_enable_output_section): Remove function.
1718 * layout.h (class Layout): Update for above changes. Add new
1719 field sections_are_attached_.
1720 * output.h (Output_section::update_flags_for_input_section): New
1721 function.
1722 * output.cc (Output_section::add_input_section): Call
1723 update_flags_for_input_section.
1724 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
1725
009a67a2
CC
17262008-04-11 Cary Coutant <ccoutant@google.com>
1727
1728 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
1729 thought unnecessary.
1730 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
1731
759b1a24
ILT
17322008-04-11 Ian Lance Taylor <iant@google.com>
1733
1734 * output.h (class Output_section_data): Remove inline definition
1735 of set_addralign.
1736 * output.cc (Output_section_data::set_addralign): New function.
1737
c2b45e22
CC
17382008-04-11 Cary Coutant <ccoutant@google.com>
1739
1740 Add support for TLS descriptors for i386 and x86_64.
1741 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
1742 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
1743 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
1744 GOT_TYPE_TLS_DESC.
1745 (Target_i386::got_mod_index_entry): Remove unnecessary code.
1746 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
1747 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
1748 relocations.
1749 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
1750 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
1751 Fix problem with initial-exec relocations.
1752 (Target_i386::Relocate::relocate_tls): Likewise.
1753 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
1754 relaxation.
1755 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
1756 support for section-plus-offset dynamic table entries.
1757 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
1758 (Output_data_dynamic::Dynamic_entry): Add support for
1759 section-plus-offset dynamic table entries.
1760 (Output_data_dynamic::Classification): Likewise.
1761 (Output_data_dynamic::classification_): Renamed offset_.
1762 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
1763 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
1764 (Target_x86_64::make_plt_section): New function.
1765 (Target_x86_64::reserve_tlsdesc_entries): New function.
1766 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
1767 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
1768 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
1769 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
1770 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
1771 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
1772 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
1773 add extra PLT entry for TLS descriptors.
1774 (Output_data_plt_x86_64::got_): New field.
1775 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
1776 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
1777 fields.
1778 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
1779 descriptors.
1780 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
1781 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
1782 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
1783 R_386_TLS_DESC_CALL relocations.
1784 (Target_x86_64::Scan::global): Likewise.
1785 (Target_x86_64::do_finalize_sections): Add dynamic table entries
1786 for TLS descriptors.
1787 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
1788 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
1789 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
1790 GD-to-IE relaxation.
1791 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
1792 and TLS_DESCRIPTORS.
1793 * Makefile.in: Rebuild.
1794 * configure: Rebuild.
1795 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
1796 (tls_test_shared2.so): New target.
1797 (tls_shared_gd_to_ie_test_SOURCES): New variable.
1798 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
1799 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
1800 (tls_shared_gd_to_ie_test_LDADD): New variable.
1801 (tls_shared_gnu2_gd_to_ie_test): New target.
1802 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
1803 New targets.
1804 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
1805 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
1806 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
1807 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
1808 (tls_shared_gnu2_test): New target.
1809 (tls_test_gnu2_shared.so): New target.
1810 (tls_shared_gnu2_test_SOURCES): New variable.
1811 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
1812 (tls_shared_gnu2_test_LDFLAGS): New variable.
1813 (tls_shared_gnu2_test_LDADD): New variable.
1814 * testsuite/Makefile.in: Rebuild.
1815 * testsuite/Makefile.
1816
83bfb6b7
ILT
18172008-04-11 Ian Lance Taylor <iant@google.com>
1818
1819 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
1820 justsyms.t.
1821 * testsuite/Makefile.in: Rebuild.
1822
1823 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
1824 long.
1825 * testsuite/script_test_2.cc (main): Adjust test.
1826
706e1f5e
ILT
18272008-04-11 David S. Miller <davem@davemloft.net>
1828 Ian Lance Taylor <iant@google.com>
1829
1830 * options.h (General_options): Add entries for '-Y' and
1831 '-relax'.
1832 * options.cc (General_options:finalize): If -Y was used, add those
1833 entries to the library path instead of the default "/lib" and
1834 "/usr/lib".
1835
7c98e6bb
DM
18362008-04-11 David S. Miller <davem@davemloft.net>
1837
1838 * testsuite/justsyms.t: Start at 0x100.
1839 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
1840 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
1841 long.
1842 * testsuite/script_test_2.cc: Adjust string and section length
1843 checks.
7c98e6bb 1844
99a37bfd
ILT
18452008-04-09 Ian Lance Taylor <iant@google.com>
1846
2cefc357
ILT
1847 PR gold/5996
1848 * script-sections.cc (Sections_element::allocate_to_segment): Add
1849 orphan parameter.
1850 (Output_section_definition::allocate_to_segment): Likewise.
1851 (Orphan_output_section::allocate_to_segment): Likewise.
1852 (Script_sections::attach_sections_using_phdrs_clause): Don't
1853 propagate non-PT_LOAD segments to orphan sections.
1854 * testsuite/Makefile.am (script_test_3.stdout): Generate using
1855 readelf rather than objdump.
1856 * testsuite/script_test_3.sh: Adjust accordingly. Test that
1857 .interp section and PT_INTERP segment are the same size.
1858 * testsuite/Makefile.in: Rebuild.
1859
99a37bfd
ILT
1860 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
1861 aliases for symbols defined in the same object.
1862 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
1863 (weak_alias_test_SOURCES): New variable.
1864 (weak_alias_test_DEPENDENCIES): New variable.
1865 (weak_alias_test_LDFLAGS): New variable.
1866 (weak_alias_test_LDADD): New variable.
1867 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
1868 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
1869 (weak_alias_test_3.o): New target.
1870 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
1871 * testsuite/weak_alias_test_main.cc: New file.
1872 * testsuite/weak_alias_test_1.cc: New file.
1873 * testsuite/weak_alias_test_2.cc: New file.
1874 * testsuite/weak_alias_test_3.cc: New file.
1875
780e49c5
ILT
18762008-04-08 Ian Lance Taylor <iant@google.com>
1877
cdb0b8f5
ILT
1878 * options.h (class General_options): Add --noinhibit-exec option.
1879 * main.cc (main): Check --noinhibit-exec.
1880
0864d551
ILT
1881 * options.h (class General_options): Define --wrap as a special
1882 option. Add wrap_symbols_ field.
1883 (General_options::any_wrap_symbols): New function.
1884 (General_options::is_wrap_symbol): New function.
1885 * options.cc (General_options::parse_wrap): New function.
1886 (General_options::General_options): Initialize wrap_symbols_.
1887 * symtab.cc (Symbol_table::wrap_symbol): New function.
1888 (Symbol_table::add_from_object): Handle --wrap.
1889 * symtab.h (class Symbol_table): Declare wrap_symbol.
1890 * target.h (Target::wrap_char): New function.
1891 (Target::Target_info): Add wrap_char field.
1892 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
1893 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1894 * testsuite/testfile.cc (Target_test::test_target_info):
1895 Likewise.
1896
789aa6de
ILT
1897 * errors.cc (Errors::undefined_symbol): Mention symbol version if
1898 there is one.
1899
2c38906f
ILT
1900 * layout.h (class Layout): Add added_eh_frame_data_ field.
1901 * layout.cc (Layout::Layout): Initialize new field.
1902 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
1903 output section until we find a section we merged successfully.
1904 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
1905 that the size be non-zero.
1906
780e49c5
ILT
1907 * merge.cc (Object_merge_map::get_output_offset): Remove inline
1908 qualifier.
1909
7fcd0256
ILT
19102008-04-08 Craig Silverstein <csilvers@google.com>
1911
1912 * configure.ac: Export new conditional variable HAVE_ZLIB.
1913 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
1914 on HAVE_ZLIB.
1915 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
1916 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1917
6835af53
ILT
19182008-04-07 Ian Lance Taylor <iant@google.com>
1919
e24f324c
ILT
1920 * version.cc (version_string): Set to "1.5".
1921
a036edd8
ILT
1922 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
1923 Add issued_non_pic_error_ field. Declare check_non_pic.
1924 (Target_x86_64::Scan::check_non_pic): New function.
1925 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
1926 (Target_x86_64::Scan::global): Likewise.
1927
624f8810
ILT
1928 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
1929 addend parameter. Change caller. Handle merge sections.
1930 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
1931 Address to Addend. Don't add in the result of
1932 local_section_offset, pass down the addend and use the returned
1933 value.
1934 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
1935 Update declarations of local_section_offset and symbol_value.
1936 * testsuite/two_file_test_1.cc (t18): New function.
1937 * testsuite/two_file_test_2.cc (f18): New function.
1938 * testsuite/two_file_test_main.cc (main): Call t18.
1939 * testsuite/two_file_test.h (t18, f18): Declare.
1940
6835af53
ILT
1941 * configure.ac: Don't test for objdump, c++filt, or readelf.
1942 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
1943 conditionals.
1944 (TEST_READELF): New variable.
1945 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
1946 (check_PROGRAMS): Add two_file_strip_test.
1947 (two_file_strip_test): New target.
1948 (check_PROGRAMS): Add two_file_same_shared_strip_test.
1949 (two_file_same_shared_strip_test_SOURCES): New variable.
1950 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
1951 (two_file_same_shared_strip_test_LDFLAGS): New variable.
1952 (two_file_same_shared_strip_test_LDADD): New variable.
1953 (two_file_shared_strip.so): New target.
1954 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
1955 (ver_test_5.syms, ver_test_7.syms): Likewise.
1956 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
1957 (strip_test_3.stdout): Use TEST_OBJDUMP.
1958 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1959
86925eef
CC
19602008-04-04 Cary Coutant <ccoutant@google.com>
1961
1962 * symtab.h (Symbol::is_weak_undefined): New function.
1963 (Symbol::is_strong_undefined): New function.
1964 (Symbol::is_absolute): New function.
1965 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
1966 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
1967 absolute symbols.
1968 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
1969 (weak_undef_test): New target.
1970 * testsuite/Makefile.in: Rebuild.
1971 * testsuite/weak_undef_file1.cc: New file.
1972 * testsuite/weak_undef_file2.cc: New file.
1973 * testsuite/weak_undef_test.cc: New file.
1974
126f3ece
ILT
19752008-04-03 Craig Silverstein <csilvers@google.com>
1976
1977 * compressed_output.h (class Output_compressed_section): Use
1978 unsigned buffer.
1979 * compressed_output.cc (zlib_compress): Use unsigned buffers,
1980 add zlib header.
1981 (zlib_compressed_suffix): Removed.
1982 (Output_compressed_section::set_final_data_size): Use unsigned
1983 buffers.
1984 * testsuite/Makefile.am (flagstest_compress_debug_sections):
1985 Fix linker invocation.
1986 (flagstest_o_specialfile_and_compress_debug_sections):
1987 Likewise.
1988 * testsuite/Makefile.in: Regenerated.
1989
deae2a14
DM
19902008-04-02 David S. Miller <davem@davemloft.net>
1991
1992 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
1993 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
1994
70752818
ILT
19952008-04-02 Craig Silverstein <csilvers@google.com>
1996
1997 * TODO: New file.
1998
39d0cb0e
ILT
19992008-04-02 Ian Lance Taylor <iant@google.com>
2000
2001 * fileread.cc (File_read::find_view): Add byteshift and vshifted
2002 parameters. Update for new key type to views_. Change all
2003 callers.
2004 (File_read::read): Adjust for byteshift in returned view.
2005 (File_read::add_view): New function, broken out of
2006 find_and_make_view.
2007 (File_read::make_view): New function, broken out of
2008 find_and_make_view.
2009 (File_read::find_or_make_view): Add offset and aligned
2010 parameters. Rewrite accordingly. Change all callers.
2011 (File_read::get_view): Add offset and aligned parameters. Adjust
2012 for byteshift in return value.
2013 (File_read::get_lasting_view): Likewise.
2014 * fileread.h (class File_read): Update declarations.
2015 (class File_read::View): Add byteshift_ field. Add byteshift to
2016 constructor. Add byteshift method.
2017 * archive.h (Archive::clear_uncached_views): New function.
2018 (Archive::get_view): Add aligned parameter. Change all callers.
2019 * object.h (Object::get_view): Add aligned parameter. Change all
2020 callers.
2021 (Object::get_lasting_view): Likewise.
2022
2023 * fileread.cc (File_read::release): Don't call clear_views if
2024 there are multiple objects.
2025 * fileread.h (File_read::clear_uncached_views): New function.
2026 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
2027 on the archive.
2028
a1207466
CC
20292008-03-31 Cary Coutant <ccoutant@google.com>
2030
2031 Add thin archive support.
2032 * archive.cc (Archive::armagt): New const.
2033 (Archive::setup): Remove task parameter and calls to unlock.
2034 (Archive::unlock_nested_archives): New function.
2035 (Archive::read_header): Add nested_off parameter. Change
2036 all callers.
2037 (Archive::interpret_header): Likewise.
2038 (Archive::include_all_members): Change to handle thin
2039 archives.
2040 (Archive::include_member): Likewise.
2041 * archive.h (Archive::Archive): Add new parameters and
2042 initializers.
2043 (Archive::armagt): New const.
2044 (Archive::setup): Remove task parameter.
2045 (Archive::unlock_nested_archives): New function.
2046 (Archive::read_header): Add nested_off parameter.
2047 (Archive::interpret_header): Likewise.
2048 (Archive::Nested_archive_table): New typedef.
2049 (Archive::is_thin_archive_): New field.
2050 (Archive::nested_archives_): New field.
2051 (Archive::options_): New field.
2052 (Archive::dirpath_): New field.
2053 (Archive::task_): New field.
2054 * readsyms.cc (Read_symbols::do_read_symbols): Add check
2055 for thin archives. Pass additional parameters to
2056 Archive::Archive. Unlock the archive file after calling
2057 Archive::setup.
2058
479f6503
ILT
20592008-03-29 Ian Lance Taylor <iant@google.com>
2060
686c8caf
ILT
2061 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
2062 version symbol to be local.
2063 * testsuite/ver_test_4.sh: New file.
2064 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
2065 (check_DATA): Add ver_test_4.syms.
2066 (ver_test_4.syms): New target.
2067 * testsuite/Makefile.in: Rebuild.
2068
ab794b6b
ILT
2069 * output.cc
2070 (Output_section::Input_section_sort_entry::has_priority): New
2071 function.
2072 (Output_section::Input_section_sort_entry::match_file_name): New
2073 function.
2074 (Output_section::Input_section_sort_entry::match_section_name):
2075 Remove.
2076 (Output_section::Input_section_sort_entry::match_section_name_prefix):
2077 Remove.
2078 (Output_section::Input_section_sort_entry::match_section_file):
2079 Remove.
2080 (Output_section::Input_section_sort_compare::operator()): Rewrite
2081 using new Input_section_sort_entry functions. Sort crtbegin and
2082 crtend first. Sort sections with no priority before sections with
2083 a priority.
2084 * testsuite/initpri1.c (d3): Check j != 4.
2085 (cd5): New constructor/destructor function.
2086 (main): Check j != 2.
2087
479f6503
ILT
2088 * symtab.cc (Symbol_table::add_from_object): If we don't use the
2089 new symbol when resolving, don't call set_is_default.
2090 * testsuite/ver_test_7.cc: New file.
2091 * testsuite/ver_test_7.sh: New file.
2092 * testsuite/Makefile.am (ver_test_7.so): New target.
2093 (ver_test_7.o): New target.
2094 (check_SCRIPTS): Add ver_test_7.sh.
2095 (check_DATA): Add ver_test_7.syms.
2096 (ver_test_7.syms): New target.
2097
2fd32231
ILT
20982008-03-28 Ian Lance Taylor <iant@google.com>
2099
2100 * layout.cc (Layout::layout): If we see an input section with a
2101 name that needs sorting, set the must_sort flag for the output
2102 section.
2103 (Layout::make_output_section): If the name of the output section
2104 indicates that it might require sorting, set the may_sort flag.
2105 * output.h (Output_section::may_sort_attached_input_sections): New
2106 function.
2107 (Output_section::set_may_sort_attached_input_sections): New
2108 function.
2109 (Output_section::must_sort_attached_input_sections): New
2110 function.
2111 (Output_section::set_must_sort_attached_input_sections): New
2112 function.
2113 (class Output_section): Declare Input_section_sort_entry. Define
2114 Input_section_sort_compare. Declare
2115 sort_attached_input_sections. Add new fields:
2116 may_sort_attached_input_sections_,
2117 must_sort_attached_input_sections_,
2118 attached_input_sections_are_sorted_.
2119 * output.cc (Output_section::Output_section): Initialize new
2120 fields.
2121 (Output_section::add_input_section): Add an entry to
2122 input_sections_ if may_sort or must_sort are true.
2123 (Output_section::set_final_data_size): Call
2124 sort_attached_input_sections if necessary.
2125 (Output_section::Input_section_sort_entry): Define new class.
2126 (Output_section::Input_section_sort_compare::operator()): New
2127 function.
2128 (Output_section::sort_attached_input_sections): New function.
2129 * configure.ac: Check whether the compiler supports constructor
2130 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
2131 * testsuite/initpri1.c: New file.
2132 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
2133 CONSTRUCTOR_PRIORITY.
2134 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
2135 (initpri1_LDFLAGS): New variable.
2136 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
2137
18e6b24e
ILT
21382008-03-27 Ian Lance Taylor <iant@google.com>
2139
49bdd526
ILT
2140 * common.cc (Sort_commons::operator): Correct sorting algorithm.
2141 * testsuite/common_test_1.c: New file.
2142 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
2143 (common_test_1_SOURCES): New variable.
2144 (common_test_1_DEPENDENCIES): New variable.
2145 (common_test_1_LDFLAGS): New variable.
2146
18e6b24e
ILT
2147 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
2148 and commons_ correctly when NAME/VERSION does not override
2149 NAME/NULL.
2150 * testsuite/ver_test_6.c: New file.
2151 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
2152 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
2153 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
2154
04bf7072
ILT
21552008-03-26 Ian Lance Taylor <iant@google.com>
2156
5871526f
ILT
2157 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
2158 of an undefined symbol from a version script.
2159 * testsuite/Makefile.am (ver_test_5.so): New target.
2160 (ver_test_5.o): New target.
2161 (check_SCRIPTS): Add ver_test_5.sh.
2162 (check_DATA): Add ver_test_5.syms.
2163 (ver_test_5.syms): New target.
2164 * testsuite/ver_test_5.cc: New file.
2165 * testsuite/ver_test_5.script: New file.
2166 * testsuite/ver_test_5.sh: New file.
2167 * Makefile.in, testsuite/Makefile.in: Rebuild.
2168
04bf7072
ILT
2169 PR gold/5986
2170 Fix problems building gold with gcc 4.3.0.
2171 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
2172 (gold_error_at_location, gold_warning_at_location): Use it.
2173 * configure.ac: Check whether we can compile and use a template
2174 function with a printf attribute.
2175 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
2176 when jumping over bytes.
2177 * object.cc: Instantiate Object::read_section_data.
2178 * debug.h: Include <cstring>
2179 * dwarf_reader.cc: Include <algorithm>
2180 * main.cc: Include <cstring>.
2181 * options.cc: Include <cstring>.
2182 * output.cc: Include <cstring>.
2183 * script.cc: Include <cstring>.
2184 * script.h: Include <string>.
2185 * symtab.cc: Include <cstring> and <algorithm>.
2186 * target-select.cc: Include <cstring>.
2187 * version.cc: Include <string>.
2188 * testsuite/testmain.cc: Include <cstdlib>.
2189 * configure, config.in: Rebuild.
2190
874c5b28
ILT
21912008-03-25 Ian Lance Taylor <iant@google.com>
2192
819d6c3a
ILT
2193 * options.cc: Include "../bfd/bfdver.h".
2194 (options::help): Print bug reporting address.
2195
f4b2c6f5
ILT
2196 * version.cc (print_version): Adjust output for current value of
2197 BFD_VERSION_STRING.
2198
2199 * NEWS: New file.
2200
e96caa79
ILT
2201 * options.cc (options::help): Print list of supported targets.
2202 * target-select.h: Include <vector>.
2203 (class Target_selector): Make machine_, size_, and is_big_endian_
2204 fields const. Add bfd_name_ and instantiated_target_ fields.
2205 (Target_selector::Target_selector): Add bfd_name parameter.
2206 (Target_selector::recognize): Make non-virtual, call
2207 do_recognize.
2208 (Target_selector::recognize_by_name): Make non-virtual, call
2209 do_recognize_by_name.
2210 (Target_selector::supported_names): New function.
2211 (Target_selector::bfd_name): New function.
2212 (Target_selector::do_instantiate_target): New pure virtual
2213 function.
2214 (Target_selector::do_recognize): New virtual function.
2215 (Target_selector::do_recognize_by_name): New virtual function.
2216 (Target_selector::instantiate_target): New private function.
2217 (supported_target_names): Declare.
2218 * target-select.cc (Target_selector::Target_selector): Update for
2219 new parameter and fields.
2220 (select_target_by_name): Check that the name matches before
2221 calling recognize_by_name.
2222 (supported_target_names): New function.
2223 * i386.cc (class Target_selector_i386): Update Target_selector
2224 constructor call. Remove recognize and recognize_by_name. Add
2225 do_instantiate_target.
2226 * x86_64.cc (class Target_selector_x86_64): Likewise.
2227 * testsuite/testfile.cc (class Target_selector_test): Update for
2228 changes to Target_selector.
2229
874c5b28
ILT
2230 * README: Rewrite, with some notes on unsupported features.
2231
0a65a3a7
CC
22322008-03-24 Cary Coutant <ccoutant@google.com>
2233
2234 * i386.cc (Target_i386::Got_type): New enum declaration.
2235 (Target_i386::Scan::local): Updated callers of Output_data_got
2236 member functions.
2237 (Target_i386::Scan::global): Likewise.
2238 (Target_i386::Relocate::relocate): Likewise.
2239 (Target_i386::Relocate::relocate_tls): Likewise.
2240 * object.h (Got_offset_list): New class.
2241 (Sized_relobj::local_has_got_offset): Added got_type parameter.
2242 (Sized_relobj::local_got_offset): Likewise.
2243 (Sized_relobj::set_local_got_offset): Likewise.
2244 (Sized_relobj::local_has_tls_got_offset): Removed.
2245 (Sized_relobj::local_tls_got_offset): Removed.
2246 (Sized_relobj::set_local_tls_got_offset): Removed.
2247 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
2248 * output.cc (Output_data_got::add_global): Added got_type parameter.
2249 (Output_data_got::add_global_with_rel): Likewise.
2250 (Output_data_got::add_global_with_rela): Likewise.
2251 (Output_data_got::add_global_pair_with_rel): New function.
2252 (Output_data_got::add_global_pair_with_rela): New function.
2253 (Output_data_got::add_local): Added got_type parameter.
2254 (Output_data_got::add_local_with_rel): Likewise.
2255 (Output_data_got::add_local_with_rela): Likewise.
2256 (Output_data_got::add_local_pair_with_rel): New function.
2257 (Output_data_got::add_local_pair_with_rela): New function.
2258 (Output_data_got::add_global_tls): Removed.
2259 (Output_data_got::add_global_tls_with_rel): Removed.
2260 (Output_data_got::add_global_tls_with_rela): Removed.
2261 (Output_data_got::add_local_tls): Removed.
2262 (Output_data_got::add_local_tls_with_rel): Removed.
2263 (Output_data_got::add_local_tls_with_rela): Removed.
2264 * output.h (Output_data_got::add_global): Added got_type parameter.
2265 (Output_data_got::add_global_with_rel): Likewise.
2266 (Output_data_got::add_global_with_rela): Likewise.
2267 (Output_data_got::add_global_pair_with_rel): New function.
2268 (Output_data_got::add_global_pair_with_rela): New function.
2269 (Output_data_got::add_local): Added got_type parameter.
2270 (Output_data_got::add_local_with_rel): Likewise.
2271 (Output_data_got::add_local_with_rela): Likewise.
2272 (Output_data_got::add_local_pair_with_rel): New function.
2273 (Output_data_got::add_local_pair_with_rela): New function.
2274 (Output_data_got::add_global_tls): Removed.
2275 (Output_data_got::add_global_tls_with_rel): Removed.
2276 (Output_data_got::add_global_tls_with_rela): Removed.
2277 (Output_data_got::add_local_tls): Removed.
2278 (Output_data_got::add_local_tls_with_rel): Removed.
2279 (Output_data_got::add_local_tls_with_rela): Removed.
2280 * resolve.cc (Symbol::override_base_with_special): Removed
2281 reference to has_got_offset_ field.
2282 * symtab.cc (Symbol::init_fields): Replaced initialization
2283 of got_offset_ with got_offsets_. Removed initialization
2284 of has_got_offset_
53fcba31 2285 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
2286 (Symbol::got_offset): Likewise.
2287 (Symbol::set_got_offset): Likewise.
2288 (Symbol::has_tls_got_offset): Removed.
2289 (Symbol::tls_got_offset): Removed.
2290 (Symbol::set_tls_got_offset): Removed.
2291 (Symbol::got_offset_): Removed.
2292 (Symbol::tls_mod_got_offset_): Removed.
2293 (Symbol::tls_pair_got_offset_): Removed.
2294 (Symbol::got_offsets_): New field.
2295 (Symbol::has_got_offset): Removed.
2296 (Symbol::has_tls_mod_got_offset): Removed.
2297 (Symbol::has_tls_pair_got_offset): Removed.
2298 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
2299 (Target_x86_64::Scan::local): Updated callers of Output_data_got
2300 member functions.
2301 (Target_x86_64::Scan::global): Likewise.
2302 (Target_x86_64::Relocate::relocate): Likewise.
2303 (Target_x86_64::Relocate::relocate_tls): Likewise.
2304
bd52eafb
BE
23052008-03-25 Ben Elliston <bje@au.ibm.com>
2306
2307 * yyscript.y: Fix spelling error in comment.
2308
8b105e34
ILT
23092008-03-24 Ian Lance Taylor <iant@google.com>
2310
8ed814a9
ILT
2311 * options.h (class General_options): Define build_id option.
2312 * layout.h (class Layout): Declare write_build_id, create_note,
2313 create_build_id. Add build_id_note_ member.
2314 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
2315 "libiberty.h", "md5.h", "sha1.h".
2316 (Layout::Layout): Initialize eh_frame_data_,
2317 eh_frame_hdr_section_, and build_id_note_.
2318 (Layout::finalize): Call create_build_id.
2319 (Layout::create_note): New function, broken out of
2320 Layout::create_gold_note.
2321 (Layout::create_gold_note): Call create_note.
2322 (Layout::create_build_id): New function.
2323 (Layout::write_build_id): New function.
2324 (Close_task_runner::run): Call write_build_id.
2325
8b105e34
ILT
2326 * x86_64.cc: Correct license to GPLv3.
2327
086a1841
ILT
23282008-03-23 Ian Lance Taylor <iant@google.com>
2329
2330 * options.cc: Include "demangle.h".
2331 (parse_optional_string): New function.
2332 (parse_long_option): Handle takes_optional_argument.
2333 (parse_short_option): Update dash_z initializer. Handle
2334 takes_optional_argument.
2335 (General_options::General_options): Initialize do_demangle_.
2336 (General_options::finalize): Set do_demangle_. Handle demangling
2337 style.
2338 * options.h (parse_optional_string): Declare.
2339 (struct One_option): Add optional_arg field. Update constructor.
2340 Update call constructor calls. Add takes_optional_argument
2341 function.
2342 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
2343 (DEFINE_optional_string): Define.
2344 (General_options::demangle): Change from DEFINE_bool to
2345 DEFINE_optional_string.
2346 (General_options::no_demangle): New function.
2347 (General_options::do_demangle): New function.
2348 (General_options::set_do_demangle): New function.
2349 (General_options::execstack_status_): Move definition to end of
2350 class definition.
2351 (General_options::static_): Likewise.
2352 (General_options::do_demangle_): New field.
2353 * object.cc (big_endian>::get_symbol_location_info): Call
2354 Options::do_demangle, not Options::demangle.
2355 * symtab.cc (demangle): Likewise.
2356
cbb93e63
ILT
23572008-03-22 Ian Lance Taylor <iant@google.com>
2358
2359 * gold.h: Include <cstddef> and <sys/types.h>
2360 * options.h: Include <cstring>.
2361
ec531623
ILT
23622008-03-21 Ian Lance Taylor <iant@google.com>
2363
2364 * Added source code to GNU binutils.
2365
This page took 0.199147 seconds and 4 git commands to generate.