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