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