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