Change to "Copyright 2010".
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
e291e7b9
ILT
12010-01-08 Ian Lance Taylor <iant@google.com>
2
3 PR 10287
4 PR 11063
5 * i386.cc (class Target_i386): Change return type of plt_section
6 to be non-const.
7 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9 tls_desc_rel_ field.
10 (Output_data_plt_i386::rel_tls_desc): New function.
11 (Target_i386::rel_tls_desc_section): New function.
12 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
13 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
14 R_386_TLS_DESC reloc in rel_tls_desc_section.
15 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
16 Define struct Tlsdesc_info.
17 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
18 (Target_x86_64::do_reloc_symbol_index): New function.
19 (Target_x86_64::add_tlsdesc_info): New function.
20 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
21 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
22 tlsdesc_rel_ field.
23 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
24 all callers.
25 (Output_data_plt_x86_64::rela_tlsdesc): New function.
26 (Target_x86_64::rela_tlsdesc_section): New function.
27 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
28 handling.
29 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
30 (Target_x86_64::do_reloc_addend): New function.
31 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
32 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
33 declarations. Define TARGET_CODE. Add arg field to u1_ union.
34 (Output_reloc::type): New function.
35 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
36 (Output_reloc::is_target_specific): New function.
37 (Output_reloc::target_arg): New function.
38 (class Output_reloc) [SHT_RELA]: Add four new constructors for
39 absolute relocs and target specific relocs.
40 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
41 add_target_specific.
42 (class Output_data_reloc) [SHT_RELA]: Likewise.
43 * output.cc (Output_reloc::Output_reloc): Add four new versions
44 for absolute relocs and target specific relocs.
45 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
46 (Output_reloc::get_symbol_index): Likewise.
47 (Output_reloc::local_section_offset): Check that local_sym_index_
48 is not TARGET_CODE or 0.
49 (Output_reloc::symbol_value): Likewise.
50 (Output_reloc::write) [SHT_RELA]: Call target for target specific
51 reloc.
52 * target.h (class Target): Add reloc_symbol_index and reloc_addend
53 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
54 functions.
55 * layout.cc (add_target_dynamic_tags): Use output section for
56 DT_PLTRELSZ and DT_JMPREL.
57
3a44184e
ILT
582010-01-07 Ian Lance Taylor <iant@google.com>
59
60 PR 11061
61 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
62 function.
63 (class Output_data_reloc_generic): Define.
64 (class Output_data_reloc_base): Change base class to
65 Output_data_reloc_generic. Change add() method to call
66 bump_relative_reloc_count for a relative reloc. Remove
67 sort_relocs_ field.
68 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
69 to sort_relocs().
70 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
71 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
72 appropriate.
73 * layout.h (class Layout): Update declaration.
74
ea715a34
ILT
752010-01-07 Ian Lance Taylor <iant@google.com>
76
77 * output.h (class Output_data): Add const version of
78 output_section and do_output_section.
79 (class Output_section_data): Add const version of
80 do_output_section.
81 (class Output_section): Likewise.
82 * layout.cc (Layout::add_target_dynamic_tags): New function.
83 * layout.h (class Layout): Update declarations.
84 * arm.cc (Target_arm::do_finalize_sections): Use
85 add_target_dynamic_tags.
86 * i386.cc (Target_i386::do_finalize_sections): Likewise.
87 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
88 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
89 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
90
659948a4
ILT
912010-01-07 Ian Lance Taylor <iant@google.com>
92
93 PR 11042
94 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
95 object as needed.
96
9d3b86f6
ILT
972010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
98 Ian Lance Taylor <iant@google.com>
99
100 PR 11019
101 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
102 Xindex::read_symtab_xindex.
103
bb0d3eb0
DK
1042010-01-07 Doug Kwan <dougkwan@google.com>
105
106 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
107 (Insn_template::thumb16_bcond_insn): New method declaration.
108 (Insn_template): Fix spelling.
109 (Stub::thumb16_special): New method declaration.
110 (Stub::do_write): Define virtual method which was previously pure
111 virtual.
112 (Stub::do_thumb16_special): New method declaration.
113 (Stub::do_fixed_endian_write): New template member.
114 (Reloc_stub::do_write): Remove.
115 (Reloc_stub::do_fixed_endian_write): Remove.
116 (Cortex_a8_stub): New class definition.
117 (Stub_factory::make_cortex_a8_stub): New method definition.
118 (Stub_factory::Stub_factory): Add missing static storage class
119 qualifier for elf32_arm_stub_a8_veneer_blx.
120
ffeef7df
ILT
1212010-01-07 Ian Lance Taylor <iant@google.com>
122
dc3f80fe
ILT
123 PR 10980
124 * options.h (class General_options): Add --warn-unresolved-symbols
125 and --error-unresolved-symbols.
126 * errors.cc (Errors::undefined_symbol): Implement
127 --warn-unresolved-symbols.
128
ffeef7df
ILT
129 * options.h (class General_options): Add -z text and -z textoff.
130 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
131
f1ec9ded
ST
1322010-01-06 Sriraman Tallam <tmsriram@google.com>
133
134 * gc.h (Garbage_collection::Cident_section_map): New typedef.
135 (Garbage_collection::cident_sections): New function.
136 (Garbage_collection::add_cident_section): New function.
137 (Garbage_collection::cident_sections_): New member.
138 (gc_process_relocs): Add references to sections whose names are C
139 identifiers.
140 * gold.h (cident_section_start_prefix): New constant.
141 (cident_section_stop_prefix): New constant.
142 (is_cident): New function.
143 * layout.cc (Layout::define_section_symbols): Replace string constants
144 with the newly defined constants.
145 * object.cc (Sized_relobj::do_layout): Track sections whose names are
146 C identifiers.
147 * testsuite/Makefile.am: Add gc_orphan_section_test.
148 * testsuite/Makefile.in: Regenerate.
149 * testsuite/gc_orphan_section_test.cc: New file.
150 * testsuite/gc_orphan_section_test.sh: New file.
151
6eda8c29
ILT
1522010-01-06 Ian Lance Taylor <iant@google.com>
153
b9674e17
ILT
154 PR 10980
155 * options.h (class General_options): Add --warn-shared-textrel.
156 * layout.cc (Layout::finish_dynamic_section): Implement
157 --warn-shared-textrel.
158
6eda8c29
ILT
159 PR 10980
160 * options.h (class General_options): Add --warn-multiple-gp.
161
32dcd44e
ILT
1622010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
163
164 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
165 $(THREADSLIB) and $(LIBDL).
166 * Makefile.in: Rebuild.
167
a192ba05
ILT
1682010-01-06 Ian Lance Taylor <iant@google.com>
169
170 PR 10980
171 * options.cc (General_options::parse_section_start): New function.
172 (General_options::section_start): New function.
173 (General_options::General_options): Initialize all members.
174 * options.h: Include <map>
175 (class General_options): Add --section-start. Add section_starts_
176 member.
177 * layout.cc (Layout::attach_allocated_section_to_segment): If
178 --section-start was used, set the address of the segment. Remove
179 local sort_sections.
180 (Layout::relaxation_loop_body): If the address of the load segment
181 has been set by --section-start, don't use it.
182 * output.h (Output_segment::update_flags_for_output_section): New
183 function.
184 * output.cc (Output_segment::add_output_section): Call
185 update_flags_for_output_section.
186
dde3f402
ILT
1872010-01-05 Ian Lance Taylor <iant@google.com>
188
62dfdd4d
ILT
189 PR 10980
190 * options.h (class General_options): Add --undefined-version.
191 * script.cc (struct Version_expression): Add was_matched_by_symbol
192 field.
193 (Version_script_info::matched_symbol): New function.
194 (Version_script_info::get_symbol_version_helper): Call
195 matched_symbol.
196 (Version_script_info::check_unmatched_names): New function.
197 * script.h (class Version_script_info): Update declarations.
198 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
199
9c4ae156
ILT
200 * options.h (class General_options): Use DEFINE_bool_alias for
201 allow_multiple_definition.
202 * resolve.cc (Symbol_table::should_override): Don't test
203 allow_multiple_definition.
204
dde3f402
ILT
205 PR 10980
206 * options.h (class General_options): Add --cref.
207 * main.cc (main): Print cref table if --cref. Don't close mapfile
208 until after printing cref table.
209 * cref.cc: Include "symtab.h".
210 (class Cref_inputs): Define Cref_table_compare and Cref_table.
211 (Cref_table_compare::operator()): New function.
212 (Cref_inputs::gather_cref): New function.
213 (filecol): New static const.
214 (Cref_inputs::print_cref): New function.
215 (Cref::print_cref): New function.
216 * cref.h: Include <cstdio>.
217 (class Cref): Update declarations.
218 * mapfile.h (Mapfile::file): New function.
219 * object.h (class Object): Define Symbols. Declare virtual
220 do_get_global_symbols.
221 (Object::get_global_symbols): New function.
222 * object.cc (Input_objects::add_object): Pass object to cref_ if
223 --cref.
224 (Input_objects::archive_start): Likewise.
225 (Input_objects::archive_stop): Likewise.
226 (Input_objects::print_cref): New function.
227 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
228 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
229 --cref.
230 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
231 function.
232 * plugin.h (class Sized_pluginobj): Update declarations.
233
8781f709
ILT
2342010-01-05 Ian Lance Taylor <iant@google.com>
235
236 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
237 to is_default_version. Rename insdef to insdefault.
238 (Symbol_table::add_from_relobj): Rename def to is_default_version
239 and local to is_forced_local.
240 (Symbol_table::add_from_pluginobj): Likewise.
241 (Symbol_table::add_from_dynobj): Likewise.
242 (Symbol_table::define_special_symbol): Rename insdef to
243 insdefault.
244
fe35d28d
ILT
2452010-01-04 Ian Lance Taylor <iant@google.com>
246
30bc8c46
ILT
247 PR 10980
248 * options.h (class General_options): Add
249 --allow-multiple-definition and -z muldefs.
250 * resolve.cc (Symbol_table::should_override): Don't warn about a
251 multiple symbol definition if --allow-multiple-definition or -z
252 muldefs.
253
7eaea549
ILT
254 PR 10980
255 * options.h (class General_options): Add --add-needed and
256 --copy-dt-needed-entries. Tweak --as-needed help entry.
257 * object.cc (Input_objects::check_dynamic_dependencies): Give an
258 error if --copy-dt-needed-entries aka --add-needed is used and
259 would cause a change in behaviour.
260
fe35d28d
ILT
261 PR 10980
262 * options.h (class General_options): Add -G as a short version of
263 --shared. Add no-op options -assert, -g, and -i.
264
55a2bb35
ST
2652010-01-04 Sriraman Tallam <tmsriram@google.com>
266
267 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
268 check for .text or .gnu.linkonce.t sections.
269 * icf.cc (Icf::find_identical_sections): Ditto.
270 Change the detection for mangled function name within the section
271 name.
272 * icf.h (is_section_foldable_candidate): New function.
273
719328e1
ILT
2742009-12-30 Ian Lance Taylor <iant@google.com>
275
276 PR 10980
277 * options.h (class General_options): Permit two dashes with
278 --retain-symbols-file.
279
d7bb5745
ILT
2802009-12-30 Ian Lance Taylor <iant@google.com>
281
403a15dd
ILT
282 PR 10979
283 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
284 don't put the file header and segment headers in the text
285 segment.
286
eda294df
ILT
287 PR 10979
288 * common.cc (Sort_commons::operator()): Stabilize sort when both
289 entries are NULL.
290 (Symbol_table::do_allocate_commons_list): When allocating common
291 symbols, skip a symbol which is no longer common.
292 * symtab.h (Symbol::is_common): Test whether the symbol comes from
293 an object before checking its type.
294 * testsuite/common_test_2.c: New file.
295 * testsuite/common_test_3.c: New file.
296 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
297 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
298 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
299 (common_test_2_pic.o, common_test_2.so): New targets.
300 (common_test_3_pic.o, common_test_3.so): New targets.
301 * testsuite/Makefile.in: Rebuild.
302
d7bb5745
ILT
303 PR 10979
304 * script.cc (read_input_script): If we see a new SECTIONS clause,
305 and we have added an input section, give an error.
306 * layout.h (class Layout): Add have_added_input_section function.
307 Add have_added_input_section_ field.
308 * layout.cc (Layout::Layout): Initialize
309 have_added_input_section_.
310 (Layout::layout): Set have_added_input_section_.
311 (Layout::layout_eh_frame): Likewise.
312
fc59c572
ILT
3132009-12-30 Ian Lance Taylor <iant@google.com>
314
315 PR 10931
316 * options.h (class General_options): Add --sort-common option.
317 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
318 * common.cc (Sort_common): Add sort_order parameter to
319 constructor. Add sort_order_ field.
320 (Sort_commons::operator): Check sort_order_.
321 (Symbol_table::allocate_commons): Determine the sort order.
322 (Symbol_table::do_allocate_commons): Add sort_order parameter.
323 Change all callers.
324 (Symbol_table::do_allocate_commons_list): Likewise.
325
1c74fab0
ILT
3262009-12-30 Ian Lance Taylor <iant@google.com>
327
328 PR 10916
329 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
330 symbols from this object, don't change the visibility of an
331 undefined symbol.
332 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
333
6affe781
ILT
3342009-12-30 Ian Lance Taylor <iant@google.com>
335
336 PR 10861
337 * script.h (class Version_script_info): Define Language enum.
338 Update declarations. Define Glob, Exact, and Lookup types. Add
339 new fields globals_, locals_, and is_finalized_.
340 * script.cc: Various formatting fixes.
341 (class Parser_closure): Change language_stack_ from a vector of
342 std::string to one of Version_script_info::Language. Adjust all
343 uses accordingly.
344 (class Lazy_demangler): Remove.
345 (struct Version_expression): Change language from std::string to
346 Version_script_info::Language.
347 (Version_script_info::Version_script_info): New function.
348 (Version_script_info::~Version_script_info): Don't call clear.
349 (Version_script_info::finalize): New function.
350 (Version_script_info::build_lookup_tables): New function.
351 (Version_script_info::build_expression_list_lookup): New
352 function.
353 (Version_script_info::get_symbol_version_helper): Rewrite to use
354 lookup tables.
355 (Version_script_info::print_expression_list): Adjust to use
356 Version_script_info::Language.
357 (script_push_lex_into_version_mode): Check that the version script
358 has not been finalized.
359 (version_script_push_lang): Change language string to
360 Version_script_info::Language.
361 * options.cc (Command_line::version_script): New function.
362 * options.h (class General_options): Add finalize_dynamic_list
363 function. Change version_script from declaration to definition.
364 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
365 * testsuite/version_script.map: Remove duplicate def of foo.
366 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
367 version_script.map.
368 * testsuite/Makefile.in: Rebuild.
369
818bf354
ILT
3702009-12-30 Ian Lance Taylor <iant@google.com>
371
372 PR 10843
373 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
374 if the input symbol index is 0, make the output symbol index 0.
375
ebcc8304
ILT
3762009-12-30 Ian Lance Taylor <iant@google.com>
377
378 PR 10670
379 * options.h (class General_options): Add -x/--discard-all.
380 * object.cc (Sized_relobj::do_count_local_symbols): Handle
381 --discard-all. If the local symbol needs a dynamic entry, check
382 that before handling --discard-locals.
383
176fe33f
ILT
3842009-12-30 Ian Lance Taylor <iant@google.com>
385
bb321bb1
ILT
386 PR 10450
387 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
388 flags to PF_R.
389 (Output_segment::add_output_section): Don't change the flags if
390 the type is PT_TLS.
391
176fe33f
ILT
392 PR 10450
393 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
394 GNU hash table if they need a dynamic value. Otherwise, don't add
395 them if they are defined in a dynamic object or are forced local.
396
e8cd95c7
ILT
3972009-12-29 Ian Lance Taylor <iant@google.com>
398
1b81fb71
ILT
399 PR 10450
400 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
401 .gnu.hash table for a 32-bit target.
402
8d6d383d
ILT
403 PR 10450
404 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
405 regular and a dynamic object only needs a dynamic symbol table
406 entry if it is externally visible.
407
e785ec03
ILT
408 PR 10450
409 * i386.cc (class Target_i386): Initialize global_offset_table_ in
410 constructor. Add global_offset_table_ field.
411 (Target_i386::got_section): Set global_offset_table_.
412 (Target_i386::do_finalize_sections): Set global_offset_table_
413 size.
414 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
415 in constructor. Add global_offset_table_ field.
416 (Target_x86_64::got_section): Set global_offset_table_.
417 (Target_x86_64::do_finalize_sections): Set global_offset_table_
418 size.
419
1a2dff53
ILT
420 * layout.cc (Layout::Layout): Initialize increase_relro_.
421 (Layout::get_output_section): Add is_relro, is_last_relro, and
422 is_first_non_relro parameters. Change all callers.
423 (Layout::choose_output_section): Likewise.
424 (Layout::add_output_section_data): Likewise.
425 (Layout::make_output_section): Likewise.
426 (Layout::set_segment_offsets): Clear increase_relro when using a
427 linker script.
428 * layout.h (class Layout): Add increase_relro method. Add
429 increase_relro_ field. Update declarations.
430 * output.cc (Output_section::Output_section): Initialize
431 is_last_relro_ and is_first_non_relro_.
432 (Output_segment::add_output_section): Group relro sections is
433 do_sort is true. Handle is_last_relro and is_first_non_relro.
434 (Output_segment::maximum_alignment): Remove relro handling.
435 (Output_segment::set_section_addresses): Add increase_relro
436 parameter. Change all callers. Add initial alignment to align
437 relro sections on separate page. Remove old relro handling.
438 (Output_segment::set_section_list_addresses): Remove in_relro
439 parameter. Change all callers.
440 (Output_segment::set_offset): Add increase parameter. Change all
441 callers. Remove old relro handling.
442 * output.h (class Output_section): Add new methods: is_last_relro,
443 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
444 Add is_last_relro_ and is_first_non_relro_ fields.
445 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
446 Create separate .got.plt section. Call increase_relro.
447 * x86_64.cc (Target_x86_64::got_section): Likewise.
448 * testsuite/relro_script_test.t: Add .got.plt.
449
f0ba79e2
ILT
450 PR 10450
451 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
452 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
453 (Layout::finalize): Call set_dynamic_symbol_size.
454 (Layout::set_dynamic_symbol_size): New function.
455 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
456 set_dynamic_symbol_size.
457
e8cd95c7
ILT
458 PR 10450
459 * output.h (class Output_section): Add is_entsize_zero_ field.
460 * output.cc (Output_section::Output_section): Initialize
461 is_entsize_zero_.
462 (Output_section::set_entsize): If two different entsizes are
463 requested, force it to zero.
464 (Output_section::add_input_section): Set flags for .debug_str
465 before updating section flags. Set entsize.
466 (Output_section::update_flags_for_input_section): Set SHF_MERGE
467 and SHF_STRING if all input sections have those flags.
468
3e1b9a8a
RÁE
4692009-12-29 Rafael Espindola <espindola@google.com>
470
471 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
472 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
473 reporting.
3e1b9a8a 474
3dcad376
ST
4752009-12-29 Sriraman Tallam <tmsriram@google.com>
476
477 * options.cc (General_options::parse_version): Allow -v to exit
478 without an error if there is nothing to link.
479
084e2665
ILT
4802009-12-29 Ian Lance Taylor <iant@google.com>
481
482 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
483 using a version of gcc before 4.1.
484 * configure: Rebuild.
485
250acde3
CD
4862009-12-28 Chris Demetriou <cgd@google.com>
487
488 * attributes.cc (Output_attributes_section_data::do_write): Use
489 std::vector::front rather than std::vector::data.
490
99fff23b
ILT
4912009-12-28 Ian Lance Taylor <iant@google.com>
492
493 * symtab.h (class Symbol_table): Add enum Defined.
494 * resolve.cc (Symbol_table::should_override): Add defined
495 parameter. Change all callers. Test whether object is NULL
496 before calling a method on it.
497 (Symbol_table::report_resolve_problem): Add defined parameter.
498 Change all callers.
499 (Symbol_table::should_override_with_special): Likewise.
500 * symtab.cc (Symbol_table::define_in_output_data): Add defined
501 parameter. Change all callers.
502 (Symbol_table::do_define_in_output_data): Likewise.
503 (Symbol_table::define_in_output_segment): Likewise.
504 (Symbol_table::do_define_in_output_segment): Likewise.
505 (Symbol_table::define_as_constant): Likewise.
506 (Symbol_table::do_define_as_constant): Likewise.
507 * script.h (class Symbol_assignment): Add is_defsym parameter to
508 constructor; change all callers.
509 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
510 parameter. Change all callers. Add is_defsym_ field.
511 (class Parser_closure): Add parsing_defsym parameter to
512 constructor; change all callers. Add parsing_defsym accessor
513 function. Add parsing_defsym_ field.
514
556bd683
ILT
5152009-12-28 Ian Lance Taylor <iant@google.com>
516
517 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 518 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 519
1782c879
ILT
5202009-12-23 Ian Lance Taylor <iant@google.com>
521
522 * i386.cc (Target_i386::do_calls_non_split): Recognize
523 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
524 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
525 -fsplit-stack prologue when using %r11.
1782c879 526
329ca2b1
ST
5272009-12-21 Sriraman Tallam <tmsriram@google.com>
528
529 * options.cc (General_options::parse_version): Make -v continue and do
530 the link like GNU ld does.
531
d675ff46
RÁE
5322009-12-17 Rafael Avila de Espindola <espindola@google.com>
533
534 * Makefile.am (CCFILES): Add timer.cc.
535 (HFILES): Add timer.h.
536 * configure.ac: Check for sysconf and times.
537 * main.cc: include timer.h.
538 (main): Use Timer instead of get_run_time.
539 * timer.cc: New.
540 * timer.h: New.
541 * workqueue.cc: include timer.h.
542 (Workqueue::find_and_run_task):
543 Report user, sys and wall time.
544 * Makefile.in: Regenerate.
545 * config.in: Regenerate.
546 * configure: Regenerate.
547
d6344fb5
DK
5482009-12-16 Doug Kwan <dougkwan@google.com>
549
550 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
551 sections.
552 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
553 relaxed input sections.
554 * output.cc (Output_section::find_relaxed_input_section): Change
555 return type to Output_relaxed_input_section pointer. Adjust code
556 for new type of relaxed_input_section_map_.
557 * output.h (Output_section::find_relaxed_input_section): Change
558 return type to Output_relaxed_input_section pointer.
559 (Output_section::Output_relaxed_input_section_by_input_section_map):
560 New type.
561 (Output_section::relaxed_input_section_map_): Change type to
562 Output_section::Output_relaxed_input_section_by_input_section_map.
563 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
564 input section.
565
0e0d5469
ILT
5662009-12-15 Ian Lance Taylor <iant@google.com>
567
568 * layout.cc (Layout::create_shstrtab): Only write out after input
569 sections if we are compressing debug sections.
570
0649a889
ILT
5712009-12-15 Ian Lance Taylor <iant@google.com>
572
573 * archive.cc (Archive::add_symbols): Only look up a symbol without
574 a version if there is, in fact, a version.
575
2ea97941
ILT
5762009-12-14 Ian Lance Taylor <iant@google.com>
577
578 Revert -Wshadow changes, all changes from:
579 2009-12-11 Doug Kwan <dougkwan@google.com>
580 2009-12-11 Nick Clifton <nickc@redhat.com>
581 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
582
b0eec2cc
DK
5832009-12-11 Doug Kwan <dougkwan@google.com>
584
585 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
586 due to -Wshadow.
587 * attributes.cc (Object_attribute::size): Ditto.
588 (Attributes_section_data::size): Ditto.
589 (Attributes_section_data::Attributes_section_data): Ditto.
590 (Output_attributes_section_data::do_write): Ditto.
591 * attributes.h (Object_attribute::set_type): Ditto.
592 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
593
91d6fa6a
NC
5942009-12-11 Nick Clifton <nickc@redhat.com>
595
596 * archive.cc: Fix shadowed variable warnings.
597 * arm.cc: Likewise.
598 * compressed_output.cc: Likewise.
599 * compressed_output.h: Likewise.
600 * configure: Likewise.
601 * dwarf_reader.cc: Likewise.
602 * dynobj.cc: Likewise.
603 * dynobj.h: Likewise.
604 * ehframe.cc: Likewise.
605 * ehframe.h: Likewise.
606 * errors.cc: Likewise.
607 * expression.cc: Likewise.
608 * fileread.cc: Likewise.
609 * fileread.h: Likewise.
610 * freebsd.h: Likewise.
611 * i386.cc: Likewise.
612 * icf.cc: Likewise.
613 * incremental.h: Likewise.
614 * layout.cc: Likewise.
615 * layout.h: Likewise.
616 * mapfile.cc: Likewise.
617 * merge.cc: Likewise.
618 * merge.h: Likewise.
619 * object.cc: Likewise.
620 * object.h: Likewise.
621 * options.h: Likewise.
622 * output.cc: Likewise.
623 * output.h: Likewise.
624 * parameters.cc: Likewise.
625 * plugin.cc: Likewise.
626 * powerpc.cc: Likewise.
627 * reduced_debug_output.cc: Likewise.
628 * reduced_debug_output.h: Likewise.
629 * reloc.cc: Likewise.
630 * reloc.h: Likewise.
631 * resolve.cc: Likewise.
632 * script-sections.cc: Likewise.
633 * script.cc: Likewise.
634 * script.h: Likewise.
635 * sparc.cc: Likewise.
636 * symtab.cc: Likewise.
637 * symtab.h: Likewise.
638 * target-select.cc: Likewise.
639 * target-select.h: Likewise.
640 * token.h: Likewise.
641 * workqueue.cc: Likewise.
642 * workqueue.h: Likewise.
643 * x86_64.cc: Likewise.
644
a0351a69
DK
6452009-12-10 Doug Kwan <dougkwan@google.com>
646
647 * arm.cc (attributes.h): New include.
648 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
649 (Arm_relobj::~Arm_relobj): Delete object pointed by
650 attributes_section_data_.
651 (Arm_relobj::attributes_section_data): New method definition.
652 (Arm_relobj::attributes_section_data_): New data member declaration.
653 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
654 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
655 attributes_section_data_.
656 (Arm_dynobj::attributes_section_data): New method definition.
657 (Arm_dynobj::attributes_section_data_): New data member declaration.
658 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
659 initialization value of may_use_blx_ to false.
660 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
661 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
662 object attributes to compute results instead of hard-coding.
663 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
664 Target_arm::get_secondary_compatible_arch,
665 Target_arm::set_secondary_compatible_arch
666 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
667 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
668 New method declarations.
669 (Target_arm::get_aeabi_object_attribute): New method definition.
670 (Target_arm::attributes_section_data_): New data member declaration.
671 (read_arm_attributes_section): New template definition.
672 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
673 (Arm_dynobj::do_read_symbols): Ditto.
674 (Target_arm::do_finalize_sections): Merge attributes sections from
675 input. Check for BLX use after attributes section merging.
676 Fix __exidx_start and __exidx_end visibility. Create an
677 .ARM.attributes section if necessary.
678 (Target_arm::get_secondary_compatible_arch,
679 Target_arm::set_secondary_compatible_arch,
680 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
681 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
682 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
683 New method definitions.
684
b59befec
ILT
6852009-12-09 Ian Lance Taylor <iant@google.com>
686
687 * plugin.cc (Plugin::load): Don't cast from void* to a function
688 pointer.
689
1276bc89
ILT
6902009-12-09 Ian Lance Taylor <iant@google.com>
691
692 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
693 information fields.
694
2f2de248
L
6952009-12-09 H.J. Lu <hongjiu.lu@intel.com>
696
697 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
698 Replace two_file_shared_1.so with two_file_shared_2.so.
699 * testsuite/Makefile.in: Regenerated.
700
4f787271
DK
7012009-12-08 Doug Kwan <dougkwan@google.com>
702
703 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
704 (HFILES): Add attributes.h and int_encoding.h.
705 * Makefile.in: Regenerate.
706 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
707 function definitions to int_encoding.cc
708 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
709 prototypes to int_encoding.h
710 * reduced_debug_output.cc (int_encoding.h): New include.
711 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
712 function definitions to int_encoding.cc
713 (insert_into_vector, read_from_pointer): Move template definitions to
714 int_encoding.h
715 * attributes.cc: New file.
716 * attributes.h: New file.
717 * int_encoding.cc: New file.
718 * int_encoding.h: New file.
719
20b52f1a
RÁE
7202009-12-07 Rafael Avila de Espindola <espindola@google.com>
721
722 PR gold/11055
723 * incremental-dump.cc (dump_incremental_inputs): New.
724 (main): Use dump_incremental_inputs.
725
53d7974c
L
7262009-12-07 H.J. Lu <hongjiu.lu@intel.com>
727
728 PR gold/10893
729 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
730 checking elfcpp::STT_FUNC.
731 (Target_i386::Relocate::relocate): Likewise.
732 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
733
734 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
735 symbols from shared libraries into normal FUNC symbols.
736
737 * symtab.h (Symbol): Add is_func and use it.
738
05a352e6
DK
7392009-12-05 Doug Kwan <dougkwan@google.com>
740
741 * arm.cc (Target_arm::arm_info): Initialize new fields
742 attributes_section and attributes_vendor.
743 * i386.cc (Target_i386::i386_info): Same.
744 * object.cc (Sized_relobj::do_layout): Skip attribute section.
745 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
746 fields attributes_section and attributes_vendor.
53d7974c 747 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
748 * target.h (Target::attributes_section, Target::attributes_vendor,
749 Target::is_attributes_section, Target::attribute_arg_type,
750 Target::attributes_order): New method definitions.
751 (Target::Target_info::attributes_section,
752 Target::Target_info::attributes_vendor): New fields.
753 (Target::do_attribute_arg_type, Target::do_attributes_order): New
754 virtual method definitions.
755 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
756 attributes_section and attributes_vendor.
757 * testsuite/testfile.cc (Target_test::test_target_info): Same.
758
f4e5969c
DK
7592009-12-05 Doug Kwan <dougkwan@google.com>
760
761 * arm.cc: Update comments about interworking and stub generation.
762 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
763 considered as non-PIC.
764 (Arm_relocate_functions::base_abs): Fix formatting.
765 (Arm_relocate_functions::got_prel): Fix comment. Change interface
766 of function to use GOT entry address instead of offset.
767 (Target_arm::Scan::global): Issue an error if a symbol would need a
768 PLT does not get one because it is untyped. Remove code to create
769 dynamic symbols for relative branches.
770 (Target_arm::Relocate::relocate: Use 0 instead of false since function
771 takes unsigned integer instead of boolean.
772
1abce4a6
L
7732009-12-05 H.J. Lu <hongjiu.lu@intel.com>
774
775 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
776 (two_file_test_LDADD): Likewise.
777 (common_test_1_LDADD): Likewise.
778 (exception_test_LDADD) Likewise.
779 (weak_test_LDADD): Likewise.
780 (many_sections_test_LDADD): Likewise.
781 (initpri1_LDADD): Likewise.
782 (script_test_1_LDADD): Likewise.
783 (script_test_2_LDADD): Likewise.
784 (justsyms_LDADD): Likewise.
785 (binary_test_LDADD): Likewise.
786 (large_LDADD): Likewise.
787 * testsuite/Makefile.in: Regenerated.
788
adcf2816 7892009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 790
adcf2816
L
791 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
792 (Symbol_table::override_with_special): Likewise.
793 (Symbol_table::add_from_object): Likewise.
794
28e67f5d
RÁE
7952009-12-04 Rafael Avila de Espindola <espindola@google.com>
796
797 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
798 Don't set the data_offset twice.
799
ae10a101
RÁE
8002009-12-04 Rafael Avila de Espindola <espindola@google.com>
801
802 * testsuite/Makefile.in: Regenerate.
803
f59f41f3
DK
8042009-12-03 Doug Kwan <dougkwan@google.com>
805
806 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
807 (Target_arm::do_finalize_sections): Add parameter for symbol table
808 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
809 * i386.cc (Target_i386::do_finalize_sections): Add an additional
810 parameter for symbol table pointer.
811 * layout.cc (Layout::finalize): Call Target::finalize_sections with
812 an additional parameter for a pointer to symbol table.
813 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
814 parameter for a symbol table pointer.
815 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
816 * target.h (Target::finalize_sections, Target::do_finalize_sections):
817 Ditto.
818 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
819 parameter for a symbol table pointer.
820
ca55d848
RÁE
8212009-12-03 Rafael Avila de Espindola <espindola@google.com>
822
823 * incremental.cc (Incremental_inputs_header)
824 (Incremental_inputs_header_write, Incremental_inputs_entry)
825 (Incremental_inputs_entry_write): Move ...
826 * incremental.h (Incremental_inputs_header)
827 (Incremental_inputs_header_write, Incremental_inputs_entry)
828 (Incremental_inputs_entry_write): here.
829
3aec4f9c
RÁE
8302009-12-02 Rafael Avila de Espindola <espindola@google.com>
831
832 * incremental.cc (make_sized_incremental_binary): Set the target.
833 Error if it is incompatible.
834 * output.h (Output_file): Add filename method.
835
9c0ae74d
RÁE
8362009-12-02 Rafael Avila de Espindola <espindola@google.com>
837
838 * incremental.cc (Incremental_inputs_entry): Remove unused argument
839 from the get_* methods.
840
a45500ae
RÁE
8412009-12-02 Rafael Avila de Espindola <espindola@google.com>
842
843 * incremental-dump.cc (main): Check that the offeset of a script is 0.
844 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
845 Write 0 for the data_offset of scripts.
846
325e6408
RÁE
8472009-12-02 Rafael Avila de Espindola <espindola@google.com>
848
849 * testsuite/Makefile.am: Add the incremental_test.sh test.
850 * testsuite/incremental_test.sh: New.
851 * testsuite/incremental_test_1.c: New.
852 * testsuite/incremental_test_2.c: New.
853
954c3e2e
RÁE
8542009-12-01 Rafael Avila de Espindola <espindola@google.com>
855
856 * incremental-dump.cc (main): Fix typos.
857
f8086623
RÁE
8582009-11-27 Rafael Avila de Espindola <espindola@google.com>
859
860 PR gold/11025
861 * incremental-dump.cc (main): Use llu to print 64 bit values.
862
3b0dd6ac
L
8632009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
864 H.J. Lu <hongjiu.lu@intel.com>
865
866 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
867 $(LIBDL).
868 (incremental_dump_LDADD): Likewise.
869 * Makefile.in: Regenerated.
870
a6d1ef57
DK
8712009-11-25 Doug Kwan <dougkwan@google.com>
872
873 Revert:
874
875 2009-11-25 Doug Kwan <dougkwan@google.com>
876
877 * arm.cc (Target_arm::Target_arm): Move method definition
878 outside of class definition. Add code to handle
879 --target1-rel, --target1-abs and --target2= options.
880 (Target_arm::get_reloc_reloc_type): Change method to be
881 non-static and const.
882 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
883 New data member declaration.
884 (Target_arm::Scan::local, Target_arm::Scan::global,
885 Target_arm::Relocate::relocate,
886 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
887 Adjust call to Target_arm::get_real_reloc_type.
888 (Target_arm::get_real_reloc_type): Use command line options
889 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
890 * options.h (--target1-rel, --target1-abs, --target2): New
891 ARM-only options.
892
50aeb7d4
DK
8932009-11-25 Doug Kwan <dougkwan@google.com>
894
895 * arm.cc (Target_arm::Target_arm): Move method definition outside of
896 class definition. Add code to handle --target1-rel, --target1-abs
897 and --target2= options.
898 (Target_arm::get_reloc_reloc_type): Change method to be non-static
899 and const.
900 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
901 member declaration.
902 (Target_arm::Scan::local, Target_arm::Scan::global,
903 Target_arm::Relocate::relocate,
904 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
905 call to Target_arm::get_real_reloc_type.
906 (Target_arm::get_real_reloc_type): Use command line options to
907 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
908 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
909 options.
910
51938283
DK
9112009-11-25 Doug Kwan <dougkwan@google.com>
912
913 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
914 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
915 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
916 formatting.
917 (Arm_relocate_functions::thm_call): Replace body with a call to
918 Arm_relocate_functions::thumb_branch_common.
919 (Arm_relocate_functions::thm_jump24,
920 Arm_relocate_functions::thm_xpc22): New method definitions.
921 (Arm_relocate_functions::thumb_branch_common): New method definition.
922 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
923 operator.
924 (Target_arm::Relocate::relocate): Adjust call to thm_call.
925 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
926
e2b8f3c4
RÁE
9272009-11-24 Rafael Avila de Espindola <espindola@google.com>
928
929 * Makefile.am: Build incremental-dump
930 * Makefile.in: Regenerate.
931 * incremental-dump.cc: New.
932 * incremental.cc (Incremental_inputs_header_data,
933 Incremental_inputs_entry_data): Move to incremental.h
934 * incremental.h: (Incremental_inputs_header_data,
935 Incremental_inputs_entry_data): Move from incremental.cc
936
bcba9aec
RÁE
9372009-11-24 Rafael Avila de Espindola <espindola@google.com>
938
939 * incremental.cc (Incremental_inputs_header,
940 Incremental_inputs_header_write, Incremental_inputs_entry,
941 Incremental_inputs_entry_write): Add a typedef with the data type.
942
7c3afe08
RÁE
9432009-11-24 Rafael Avila de Espindola <espindola@google.com>
944
945 * incremental.cc (Incremental_inputs_header,
946 Incremental_inputs_header_write, Incremental_inputs_entry,
947 Incremental_inputs_entry_write): Update comment about which
948 type has the filed descriptions.
949
d204b6e9
DK
9502009-11-15 Doug Kwan <dougkwan@google.com>
951
952 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
953 (Arm_relocate_functions::arm_branch_common): Change method defintion
954 in class definition to a method declaration and update list of formal
955 parameters.
956 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
957 Arm_relocation_functions::jump24): Adjust call to
958 Arm_relocate_functions::arm_branch_common. Update list of formal
959 parameters.
960 (Arm_relocate_functions::xpc25): New method definition.
961 (Arm_relocate_functions::arm_branch_common): Move method defintion
962 out from class definition. Use stubs for mode-switching and extending
963 branch ranges.
964 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
965 specially. Change code to enable use of stubs in ARM branches.
966
43d12afe
DK
9672009-11-10 Doug Kwan <dougkwan@google.com>
968
969 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
970 in method declaration.
971 (Target_arm::relocate_stub): New method declaration.
972 (Target_arm::default_target): Change to return a pointer instead of
973 a const reference.
974 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
975 Target_arm::default_target.
976 (Arm_Relobj::do_relocate_sections): Remove options paramater in
977 method definition.
978 (Target_arm::relocate_section): Adjust view.
979 (Target_arm::relocate_stub): New method definition.
980
ac33a407
DK
9812009-11-10 Doug Kwan <dougkwan@google.com>
982
983 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
984 a format warning.
985 * incremental.cc (open_incremental_binary): Initialized local
986 variables to avoid warnings.
987 * object.cc (make_elf_object): Ditto.
988 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
989 a format warning.
990
88ee28e9
L
991009-11-09 H.J. Lu <hongjiu.lu@intel.com>
992
993 PR gold/10930
994 * testsuite/plugin_test.c: Include "config.h".
995
2daedcd6
DK
9962009-11-09 Doug Kwan <dougkwan@google.com>
997
998 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
999 (arm_symbol_value): Remove.
1000 (Arm_relocate_functions::arm_branch_common,
1001 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
1002 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
1003 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
1004 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
1005 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
1006 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
1007 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
1008 Arm_relocate_functions::thm_mobw_abs_nc,
1009 Arm_relocate_functions::thm_mov_abs,
1010 Arm_relocate_functions::movw_prel_nc,
1011 Arm_relocate_functions::thm_movt_abs,
1012 Arm_relocate_functions::movt_prel,
1013 Arm_relocate_functions::thm_movw_prel_nc,
1014 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
1015 (Target_arm::Relocate::relocate): Only decompose address into two
1016 parts if relocation type uses the thumb-bit and pass the actual
1017 bit instead of a flag indicating that the thumb-bit is used. Adjust
1018 calls to methods in Arm_relocate_functions for this change.
1019
1276bc89 10202009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
1021
1022 PR 10925
1023 * reloc.cc: Instantiate
1024 Sized_relobj::initialize_input_to_output_maps and
1025 Sized_relobj:free_input_to_output_maps.
1026
e53ad1b5
ILT
10272009-11-06 Ian Lance Taylor <iant@google.com>
1028
1029 PR 10876
1030 * defstd.cc (in_segment): Set only_if_ref true for "end".
1031
eb44217c
DK
10322009-11-06 Doug Kwan <dougkwan@google.com>
1033
1034 * arm.cc (class Reloc_stub): Correct a comment.
1035 (Target_arm::Target_arm): Initialize arm_input_section_map_.
1036 (Target_arm::scan_section_for_stubs): New method declaration.
1037 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
1038 Change methods from private to protected.
1039 (Target_arm::do_may_relax): New method definition.
1040 (Target_arm::do_relax, Target_arm::group_sections,
1041 Target_arm::scan_reloc_for_stub,
1042 Target_arm::scan_reloc_section_for_stubs): New method declarations.
1043 (Target_arm::arm_input_section_map_): New data member declaration.
1044 (Target_arm::scan_reloc_for_stub,
1045 Target_arm::scan_reloc_section_for_stubs,
1046 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
1047 Target_arm::do_relax): New method definitions.
1048
5d329b7d
ILT
10492009-11-06 Mikolaj Zalewski <mikolaj@google.com>
1050
1051 * configure.ac: Check for (struct stat)::st_mtim
1052 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
1053 * config.in: Regenerate.
1054 * configure: Regenerate.
1055
96a0d71b
ILT
10562009-11-05 Ian Lance Taylor <iant@google.com>
1057
1058 PR 10910
1059 * output.cc (Output_segment::add_output_section): Add missing
1060 return statement.
1061
594c8e5e
ILT
10622009-11-04 Ian Lance Taylor <iant@google.com>
1063
1064 PR 10880
1065 * object.h (class Object): Add is_needed and set_is_needed
1066 methods. Add is_needed_ field. Make bool fields into bitfields.
1067 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
1068 defined in a dynamic object and referenced by a regular object,
1069 set is_needed for the dynamic object.
1070 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
1071 if the file is marked with as_needed and it is not needed.
1072
22b127cc
ILT
10732009-11-04 Ian Lance Taylor <iant@google.com>
1074
1075 PR 10887
1076 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
1077 tags if data is discarded by linker script.
1078 * i386.cc (Target_i386::do_finalize_sections): Likewise.
1079 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
1080 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
1081 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1082
f5c870d2
ILT
10832009-11-04 Ian Lance Taylor <iant@google.com>
1084
1085 * layout.cc (Layout::get_output_section): Add is_interp and
1086 is_dynamic_linker_section parameters. Change all callers.
1087 (Layout::choose_output_section): Likewise.
1088 (Layout::make_output_section): Likewise.
1089 (Layout::add_output_section_data): Add is_dynamic_linker_section
1090 parameter. Change all callers.
1091 * layout.h (class Layout): Update declarations.
1092 * output.h (class Output_section): Add is_interp, set_is_interp,
1093 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
1094 Add is_interp_, is_dynamic_linker_section_ fields. Change
1095 generate_code_fills_at_write_ to a bitfield.
1096 * output.cc (Output_section::Output_sections): Initialize new
1097 fields.
1098 (Output_segment::add_output_section): Add do_sort parameter.
1099 Change all callers.
1100
1ae4d23b
ILT
11012009-11-03 Ian Lance Taylor <iant@google.com>
1102
1103 PR 10860
1104 * options.h (class General_options): Add --warn-common.
1105 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
1106 merging two common symbols.
1107 (Symbol_table::should_override): Handle --warn-common when merging
1108 a common symbol with a defined symbol. Use report_resolve_problem
1109 for multiple definitions.
1110 (Symbol_table::report_resolve_problem): New function.
1111 * symtab.h (class Symbol_table): Declare report_resolve_problem.
1112
55da9579
DK
11132009-11-03 Doug Kwan <dougkwan@google.com>
1114
1115 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
1116 stub_factory_.
1117 (Target_arm::stub_factory): New method definition.
1118 (Target_arm::new_arm_input_section,
1119 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
1120 Target_arm::reloc_uses_thumb_bit): New method declarations.
1121 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
1122 New type definitions.
1123 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
1124 member declarations.
1125 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
1126 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
1127 New method definitions.
1128
37a9ac43
ILT
11292009-11-03 Ian Lance Taylor <iant@google.com>
1130
1131 * options.h (class General_options): Add --warn_constructors.
1132
b3d6a3d4
ILT
11332009-11-03 Ian Lance Taylor <iant@google.com>
1134
1135 PR 10893
1136 * defstd.cc (in_section): Add entries for __rel_iplt_start,
1137 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
1138
934b01dd
ILT
11392009-11-03 Ian Lance Taylor <iant@google.com>
1140
1141 PR 10895
1142 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
1143 --msgid-bugs-address.
1144 (install-pdf): New target.
1145 (install-data_yes): Look up one directory to find mkinstalldirs.
1146
03c1939b
L
11472009-11-03 H.J. Lu <hongjiu.lu@intel.com>
1148
1149 * po/Make-in (.po.gmo): Don't generate .gmo files in source
1150 tree.
1151
ebd95253
DK
11522009-10-30 Doug Kwan <dougkwan@google.com>
1153
1154 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
1155
e9bbb538
DK
11562009-10-30 Doug Kwan <dougkwan@google.com>
1157
1158 * arm.cc (Stub_addend_reader): New struct template definition
1159 and partial specializations.
1160 (Stub_addend_reader::operator()): New method definition for a
1161 partially specialized template.
1162
d5b40221
DK
11632009-10-30 Doug Kwan <dougkwan@google.com>
1164
1165 * arm.cc (Arm_relobj::processor_specific_flags): New method
1166 definition.
1167 (Arm_relobj::do_read_symbols): New method declaration.
1168 (Arm_relobj::processor_specific_flags_): New data member declaration.
1169 (Arm_dynobj): New class definition.
1170 (Target_arm::do_finalize_sections): Add input_objects parameter.
1171 (Target_arm::do_adjust_elf_header): New method declaration.
1172 (Target_arm::are_eabi_versions_compatible,
1173 (Target_arm::merge_processor_specific_flags): New method declaration.
1174 (Target_arm::do_make_elf_object): New overloaded method definitions
1175 and declaration.
1176 (Arm_relobj::do_read_symbols): New method definition.
1177 (Arm_dynobj::do_read_symbols): Ditto.
1178 (Target_arm::do_finalize_sections): Add input_objects parameters.
1179 Merge processor-specific flags from all input objects.
1180 (Target_arm::are_eabi_versions_compatible,
1181 Target_arm::merge_processor_specific_flags,
1182 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
1183 New method definitions.
1184 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
1185 Input_objects pointer type parameter.
1186 * layout.cc (Layout::finalize): Pass input objects to target's.
1187 finalize_sections function.
1188 * output.cc (Output_file_header::do_sized_write): Set ELF file
1189 header's processor-specific flags.
1190 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
1191 Input_objects pointer type parameter.
1192 * sparc.cc (Target_sparc::do_finalize_sections): Same.
1193 * target.h (Input_objects): New forward class declaration.
1194 (Target::processor_specific_flags,
1195 Target::are_processor_specific_flags_sect): New method definitions.
1196 (Target::finalize_sections): Add input_objects parameter.
1197 (Target::Target): Initialize processor_specific_flags_ and
1198 are_processor_specific_flags_set_.
1199 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
1200 parameter.
1201 (Target::set_processor_specific_flags): New method definition.
1202 (Target::processor_specific_flags_,
1203 Target::are_processor_specific_flags_set_): New data member
1204 declarations.
1205 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
1206 Input_objects pointer type parameter.
1207
ebabffbd
DK
12082009-10-30 Doug Kwan <dougkwan@google.com>
1209
1210 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
1211
ad0f2072
ILT
12122009-10-28 Ian Lance Taylor <iant@google.com>
1213
1214 * object.h (class Relobj): Drop options parameter from
1215 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
1216 do_scan_relocs, do_relocate. Change all callers.
1217 (class Sized_relobj): Drop options parameters from
1218 do_gc_process_relocs, do_scan_relocs, do_relocate,
1219 do_relocate_sections, relocate_sections, emit_relocs_scan,
1220 emit_relocs_scan_reltype. Change all callers.
1221 (struct Relocate_info): Remove options field and all references to
1222 it.
1223 * reloc.h (class Read_relocs): Remove options constructor
1224 parameter and options_ field. Change all callers.
1225 (class Gc_process_relocs, class Scan_relocs): Likewise.
1226 (class Relocate_task): Likewise.
1227 * target-reloc.h (scan_relocs): Remove options parameter. Change
1228 all callers.
1229 (scan_relocatable_relocs): Likewise.
1230 * target.h (class Sized_target): Remove options parameter from
1231 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
1232 all callers.
1233 * gc.h (gc_process_relocs): Remove options parameter. Change all
1234 callers.
1235 * arm.cc: Update functions to remove options parameters.
1236 * i386.cc: Likewise.
1237 * powerpc.cc: Likewise.
1238 * sparc.cc: Likewise.
1239 * x86_64.cc: Likewise.
1240 * testsuite/testfile.cc: Likewise.
1241
8ffa3667
DK
12422009-10-28 Doug Kwan <dougkwan@google.com>
1243
1244 * arm.cc (Arm_relobj): New class definition.
1245 (Arm_relobj::scan_sections_for_stubs,
1246 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
1247 New method definitions.
1248
40f36857
CC
12492009-10-28 Cary Coutant <ccoutant@google.com>
1250
1251 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
1252 (Plugin::cleanup_done_): New member.
1253 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
1254 (Plugin_manager::cleanup_done_): Remove.
1255 (Plugin_manager::add_input_file): Edit error message.
1256 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
1257 (Plugin_manager::cleanup): Remove use of cleanup_done_.
1258
2c849493
ILT
12592009-10-27 Mikolaj Zalewski <mikolajz@google.com>
1260
1261 * fileread.cc: (File_read::View::~View): Use the new
1262 data_ownership_ filed.
1263 (File_read::~File_read): Dispose the new whole_file_view_.
1264 (File_read::open): Mmap the whole file if needed.
1265 (File_read::open): Use whole_file_view_ instead of contents_.
1266 (File_read::find_view): Use whole_file_view_ if applicable.
1267 (File_read::do_read): Use whole_file_view_ instead of contents_.
1268 (File_read::make_view): Use whole_file_view_ instead of contents_,
1269 update File_read::View::View call.
1270 (File_read::find_or_make_view): Update File_read::View::View
1271 call.
1272 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
1273 remove contents_
1274 (File_read::View::Data_ownership): New enum.
1275 (File_read::View::View): Replace bool mapped_ with Data_ownership
1276 argument.
1277 (File_read::View::mapped_): Remove (replaced by data_ownership_).
1278 (File_read::View::data_ownership_): New field.
1279 (File_read::contents_): Remove (replaced by whole_file_view_).
1280 (File_read::whole_file_view_): New field.
1281 * options.h (class General_options): Add --keep-files-mapped.
1282
24998053
CC
12832009-10-27 Cary Coutant <ccoutant@google.com>
1284
1285 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
1286 * testsuite/Makefile.am (plugin_test_5): New test case.
1287 * testsuite/Makefile.in: Regenerate.
1288
72adc4fa
DK
12892009-10-25 Doug Kwan <dougkwan@google.com>
1290
1291 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
1292 from private to protected to allow access by child class.
1293 (Sized_relobj::do_relocate_sections): New method declaration.
1294 (Sized_relobj::relocate_sections): Virtualize.
1295 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
1296 Sized_relobj::relocate_sections. Instantiate template explicitly
1297 for different target sizes and endianity.
1298
07f508a2
DK
12992009-10-24 Doug Kwan <dougkwan@google.com>
1300
1301 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
1302 (Arm_input_section::as_arm_input_section): New method.
1303 (Arm_output_section): New class definition.
1304 (Arm_output_section::create_stub_group,
1305 Arm_output_section::group_sections): New method definitions.
1306
10ad9fe5
DK
13072009-10-22 Doug Kwan <dougkwan@google.com>
1308
1309 * arm.cc (Arm_input_section): New class definition.
1310 (Arm_input_section::init, Arm_input_section:do_write,
1311 Arm_input_section::set_final_data_size,
1312 Arm_input_section::do_reset_address_and_file_offset): New method
1313 definitions.
1314
56ee5e00
DK
13152009-10-21 Doug Kwan <dougkwan@google.com>
1316
1317 * arm.cc (Stub_table, Arm_input_section): New forward class
1318 declarations.
1319 (Stub_table): New class defintion.
1320 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
1321 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
1322 New method definition.
1323
b569affa
DK
13242009-10-21 Doug Kwan <dougkwan@google.com>
1325
1326 * arm.cc: Update copyright comments.
1327 (Target_arm): New forward class template declaration.
1328 (Arm_address): New type.
1329 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
1330 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
1331 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
1332 constants.
1333 (Insn_template): Same.
1334 (DEF_STUBS): New macro.
1335 (Stub_type): New enum type.
1336 (Stub_template): New class definition.
1337 (Stub): Same.
1338 (Reloc_stub): Same.
1339 (Stub_factory): Same.
1340 (Target_arm::Target_arm): Initialize may_use_blx_ and
1341 should_force_pic_veneer_.
1342 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
1343 Target_arm::should_force_pic_veneer,
1344 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
1345 Target_arm::using_thumb_only, Target_arm:;default_target): New
1346 method defintions.
1347 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
1348 New data member declarations.
1349 (Insn_template::size, Insn_template::alignment): New method defintions.
1350 (Stub_template::Stub_template): New method definition.
1351 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
1352 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
1353 (Stub_factory::Stub_factory): New method definition.
1354 * gold.h (string_hash): New template.
1355 * output.h (Input_section_specifier::hash_value): Use
1356 gold::string_hash.
1357 (Input_section_specifier::string_hash): Remove.
1358 * stringpool.cc (Stringpool_template::string_hash): Use
1359 gold::string_hash.
1360
6c172549
DK
13612009-10-20 Doug Kwan <dougkwan@google.com>
1362
1363 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
1364 symbols of relaxed input sections.
1365 * output.h (Output_section::find_relaxed_input_section): Make
1366 method public.
1367
c5617f2f
DK
13682009-10-16 Doug Kwan <dougkwan@google.com>
1369
1370 * dynobj.cc (Versions::Versions): Initialize version_script_.
1371 Only insert base version symbol definition for a shared object
1372 if version script defines any version versions.
1373 (Versions::define_base_version): New method definition.
1374 (Versions::add_def): Check that base version is not needed.
1375 (Versions::add_need): Define base version lazily.
1376 * dynobj.h (Versions::define_base_version): New method declaration.
1377 (Versions::needs_base_version_): New data member declaration.
1378 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
1379 (check_DATA): Add no_version_test.stdout.
1380 (libno_version_test.so, no_version_test.o no_version_test.stdout):
1381 New make rules.
1382 * testsuite/Makefile.in: Regenerate.
1383 * testsuite/no_version_test.c: New file.
1384 * testsuite/no_version_test.sh: Ditto.
1385
3c12dcdb
DK
13862009-10-16 Doug Kwan <dougkwan@google.com>
1387
1388 * expression.cc (class Segment_start_expression): New class definition.
1389 (Segment_start_expression::value): New method definition.
1390 (script_exp_function_segment_start): Return a new
1391 Segment_start_expression.
1392 * gold/script-c.h (script_saw_segment_start_expression): New function
1393 prototype.
1394 * script-sections.cc (Script_sections::Script_sections): Initialize
1395 SAW_SEGMENT_START_EXPRESSION_ to false.
1396 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
1397 and -Tbbs options to specify section addresses if given in
1398 command line and no SEGMENT_START expression is seen in a script.
1399 * script-sections.h (Script_sections::saw_segment_start_expression,
1400 Script_sections::set_saw_segment_start_expression): New method
1401 definition.
1402 (Script_sections::saw_segment_start_expression_): New data member
1403 declaration.
1404 * script.cc (script_saw_segment_start_expression): New function.
1405 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
1406 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
1407 script_test_7.sh and script_test_8.sh.
1408 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
1409 script_test_8.stdout.
1410 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
1411 (script_test_6, script_test_6.stdout, script_test_7,
1412 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
1413 * Makefile.in: Regenerate.
1414 * testsuite/script_test_6.sh: New file.
1415 * testsuite/script_test_6.t: Same.
1416 * testsuite/script_test_7.sh: Same.
1417 * testsuite/script_test_7.t: Same.
1418 * testsuite/script_test_8.sh: Same.
1419
64b1ae37
DK
14202009-10-16 Doug Kwan <dougkwan@google.com>
1421
1422 * output.cc (Output_segment::set_section_list_address): Cast
1423 expressions to unsigned long long type to avoid format warnings.
1424
661be1e2
ILT
14252009-10-15 Ian Lance Taylor <iant@google.com>
1426
12edd763 1427 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 1428 dot assignment to script_sections_.
12edd763
ILT
1429 * script-sections.cc (Script_sections::add_dot_assignment):
1430 Initialize if necessary.
1431
68b6574b
ILT
1432 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
1433 program headers with no load segment if there is a linker script.
1434
661be1e2
ILT
1435 * layout.cc (Layout::set_segment_offsets): Align the file offset
1436 to the segment aligment for -N or -n with no load segment.
1437 * output.cc (Output_segment::add_output_section): Don't crash if
1438 the first section is a TLS section.
1439 (Output_segment::set_section_list_addresses): Print an error
1440 message if the address moves backward in a linker script.
1441 * script-sections.cc
1442 (Output_section_element_input::set_section_addresses): Don't
1443 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
1444 (Orphan_output_section::set_section_addresses): Likewise.
1445
f15f61a7
DK
14462009-10-15 Doug Kwan <dougkwan@google.com>
1447
1448 * layout.cc (Layout::finish_dynamic_section): Generate tags
1449 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
1450 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
1451 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
1452
82bb573a
ILT
14532009-10-14 Ian Lance Taylor <iant@google.com>
1454
1455 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
1456 fields.
1457 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
1458 data_shdr fields of relinfo.
1459 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
1460 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
1461 R_386_TLS_LDO_32, adjust based on section flags.
1462 (Target_i386::Relocate::fix_up_ldo): Remove.
1463
374ad285
ILT
14642009-10-13 Ian Lance Taylor <iant@google.com>
1465
1466 Add support for -pie.
1467 * options.h (class General_options): Add -pie and
1468 --pic-executable.
1469 (General_options::output_is_position_independent): Test -pie.
1470 (General_options::output_is_executable): Return true if not shared
1471 and not relocatable.
1472 (General_options::output_is_pie): Remove.
1473 * options.cc (General_options::finalize): Reject incompatible uses
1474 of -pie.
1475 * gold.cc (queue_middle_tasks): A -pie link is not static.
1476 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
1477 * symtab.cc (Symbol::final_value_is_known): Return false if
1478 output_is_position_independent.
1479 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
1480 output_is_position_independent.
1481 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
1482 output_is_position_independent.
1483 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
1484 output_is_position_independent.
1485 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
1486 two_file_pie_test.
1487 (basic_pie_test.o, basic_pie_test): New targets.
1488 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
1489 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
1490 (two_file_pie_test): New target.
1491 * testsuite/Makefile.in: Rebuild.
1492 * README: Remove note saying that -pie is not supported.
1493
c6585162
ILT
14942009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1495
1496 * options.h (class General_options): Add -init and -fini.
1497 * layout.cc (Layout::finish_dynamic_section): Emit
1498 given init and fini functions.
1499
032ce4e9
ST
15002009-10-13 Sriraman Tallam <tmsriram@google.com>
1501
1502 * gc.h (gc_process_relocs): Check if icf is enabled using new
1503 function.
1504 * gold.cc (queue_initial_tasks): Likewise.
1505 (queue_middle_tasks): Likewise.
1506 * object.cc (do_layout): Likewise.
1507 * symtab.cc (is_section_folded): Likewise.
1508 * main.cc (main): Likewise.
1509 * reloc.cc (Read_relocs::run): Likewise.
1510 (Sized_relobj::do_scan_relocs): Likewise.
1511 * icf.cc (is_function_ctor_or_dtor): New function.
1512 (Icf::find_identical_sections): Check if function is ctor or dtor when
1513 safe icf is chosen.
1514 * options.h (General_options::icf): Change option to be an enum.
1515 (Icf_status): New enum.
1516 (icf_enabled): New method.
1517 (icf_safe_folding): New method.
1518 (set_icf_status): New method.
1519 (icf_status_): New variable.
1520 * (options.cc) (General_options::finalize): Set icf_status_.
1521 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
1522 icf_test and icf_keep_unique_test to use the --icf enum flag.
1523 * testsuite/icf_safe_test.sh: New file.
1524 * testsuite/icf_safe_test.cc: New file.
1525
f345227a
ST
15262009-10-12 Sriraman Tallam <tmsriram@google.com>
1527
1528 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
1529 includes to gc.h and icf.h.
1530 * arm.cc: Include gc.h.
1531 * gold.cc: Likewise.
1532 * i386.cc: Likewise.
1533 * powerpc.cc: Likewise.
1534 * sparc.cc: Likewise.
1535 * x86_64.cc: Likewise.
1536 * gc.h: Include icf.h.
1537
1c7814ed
ILT
15382009-10-11 Ian Lance Taylor <iant@google.com>
1539
1540 * plugin.cc: Include "gold.h" before other header files.
1541
ae3b5189
CD
15422009-10-10 Chris Demetriou <cgd@google.com>
1543
1544 * options.h (Input_file_argument::Input_file_type): New enum.
1545 (Input_file_argument::is_lib_): Replace with...
1546 (Input_file_argument::type_): New member.
1547 (Input_file_argument::Input_file_argument): Take Input_file_type
1548 'type' rather than boolean 'is_lib' as second argument.
1549 (Input_file_argument::is_lib): Use type_.
1550 (Input_file_argument::is_searched_file): New function.
1551 (Input_file_argument::may_need_search): Handle is_searched_file.
1552 * options.cc (General_options::parse_library): Support -l:filename.
1553 (General_options::parse_just_symbols): Update for Input_file_argument
1554 changes.
1555 (Command_line::process): Likewise.
1556 * archive.cc (Archive::get_file_and_offset): Likewise.
1557 * plugin.cc (Plugin_manager::release_input_file): Likewise.
1558 * script.cc (read_script_file, script_add_file): Likewise.
1559 * fileread.cc (Input_file::Input_file): Likewise.
1560 (Input_file::will_search_for): Handle is_searched_file.
1561 (Input_file::open): Likewise.
1562 * readsyms.cc (Read_symbols::get_name): Likewise.
1563 * testsuite/Makefile.am (searched_file_test): New test.
1564 * testsuite/Makefile.in: Regenerate.
1565 * testsuite/searched_file_test.cc: New file.
1566 * testsuite/searched_file_test_lib.cc: New file.
1567
f3048a1d
ILT
15682009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
1569 Ian Lance Taylor <iant@google.com>
1570
1571 * descriptor.cc: Include <cstdio> and "binary-io.h".
1572 (Descriptors::open): Open the files in binary mode always.
1573 * script.cc (Lex::get_token): Treat \r as whitespace.
1574
d4780e57
ILT
15752009-10-09 Ian Lance Taylor <iant@google.com>
1576
1577 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
1578
d9a893b8
ILT
15792009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
1580 Ian Lance Taylor <iant@google.com>
1581
1582 * configure.ac: Check for readv function also.
1583 * fileread.cc (readv): Define if not HAVE_READV.
1584 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
1585 does not exist.
1586 * config.in: Regenerate.
1587 * configure: Regenerate.
1588
c0a62865
DK
15892009-10-09 Doug Kwan <dougkwan@google.com>
1590
1591 * layout.cc (Layout::make_output_section): Call target hook to make
1592 ordinary output section.
1593 (Layout::finalize): Adjust parameter list of call the
1594 Target::may_relax().
1595 * layout.h (class Layout::section_list): New method.
1596 * merge.h (Output_merge_base::entsize): Change visibility to public.
1597 (Output_merge_base::is_string, Output_merge_base::do_is_string):
1598 New methods.
1599 (Output_merge_string::do_is_string): New method.
1600 * object.cc (Sized_relobj::do_setup): renamed from
1601 Sized_relobj::set_up.
1602 * object.h (Sized_relobj::adjust_shndx,
1603 Sized_relobj::initializ_input_to_output_maps,
1604 Sized_relobj::free_input_to_output_maps): Change visibilities to
1605 protected.
1606 (Sized_relobj::setup): Virtualize.
1607 (Sized_relobj::do_setup): New method declaration.
1608 (Sized_relobj::invalidate_section_offset,
1609 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
1610 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
1611 * options.cc (parse_int): New function.
1612 * options.h (parse_int): New declaration.
1613 (DEFINE_int): New macro.
1614 (stub_group_size): New option.
1615 * output.cc (Output_section::Output_section): Initialize memebers
1616 merge_section_map_, merge_section_by_properties_map_,
1617 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
1618 (Output_section::add_input_section): Handled deferred code-fill
1619 generation and remove an old comment.
1620 (Output_section::add_relaxed_input_section): New method definition.
1621 (Output_section::add_merge_input_section): Use merge section by
1622 properties map to speed to search. Update merge section maps
1623 as appropriate.
1624 (Output_section::build_relaxation_map): New method definition.
1625 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1626 Same.
1627 (Output_section::relax_input_section): Renamed to
1628 Output_section::convert_input_sections_to_relaxed_sections and change
1629 interface to take a vector of pointers to relaxed sections.
1630 (Output_section::find_merge_section,
1631 Output_section::find_relaxed_input_section): New method definitions.
1632 (Output_section::is_input_address_mapped,
1633 Output_section::output_offset, Output_section::output_address):
1634 Use output section data maps to speed up searching.
1635 (Output_section::find_starting_output_address): Add comments.
1636 (Output_section::do_write,
1637 Output_section::write_to_postprocessing_buffer): Do code-fill
1638 generation as appropriate.
1639 (Output_section::get_input_sections): Invalidate relaxed input section
1640 map.
1641 (Output_section::restore_states): Adjust type of checkpoint .
1642 Invalidate relaxed input section map.
1643 * output.h (Output_merge_base): New class declaration.
1644 (Input_section_specifier): New class defintion.
1645 (class Output_relaxed_input_section) Change base class to
1646 Output_section_data_build.
1647 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
1648 base class initializer.
1649 (Output_section::add_relaxed_input_section): New method declaration.
1650 (Output_section::Input_section): Change visibility to protected.
1651 (Output_section::Input_section::relobj,
1652 Output_section::Input_section::shndx): Handle relaxed input sections.
1653 Output_section::input_sections) Change visibility to protected. Also
1654 define overload to return a non-const pointer.
1655 (Output_section::Merge_section_properties): New class defintion.
1656 (Output_section::Merge_section_by_properties_map,
1657 Output_section::Output_section_data_by_input_section_map,
1658 Output_section::Relaxation_map): New types.
1659 (Output_section::relax_input_section): Rename method to
1660 Output_section::convert_input_sections_to_relaxed_sections and change
1661 interface to take a vector of relaxed section pointers.
1662 (Output_section::find_merge_section,
1663 Output_section::find_relaxed_input_section,
1664 Output_section::build_relaxation_map,
1665 Output_section::convert_input_sections_in_list_to_relaxed_sections):
1666 New method declarations.
1667 (Output_section::merge_section_map_
1668 Output_section::merge_section_by_properties_map_,
1669 Output_section::relaxed_input_section_map_,
1670 Output_section::is_relaxed_input_section_map_valid_,
1671 Output_section::generate_code_fills_at_write_): New data members.
1672 * script-sections.cc
1673 (Output_section_element_input::set_section_addresses): Call
1674 current_data_size and addralign methods of relaxed input sections.
1675 (Orphan_output_section::set_section_addresses): Call current_data_size
1676 and addralign methods of relaxed input sections.
1677 * symtab.cc (Symbol_table::compute_final_value): Extract template
1678 from the body of Symbol_table::sized_finalize_symbol.
1679 (Symbol_table::sized_finalized_symbol): Call
1680 Symbol_table::compute_final_value.
1681 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
1682 (Symbol_table::compute_final_value): New templated method declaration.
1683 * target.cc (Target::do_make_output_section): New method defintion.
1684 * target.h (Target::make_output_section): New method declaration.
1685 (Target::relax): Add more parameters for input objects, symbol table
1686 and layout. Adjust call to do_relax.
1687 (Target::do_make_output_section): New method declaration.
1688 (Target::do_relax): Add parameters for input objects, symbol table
1689 and layout.
1690
d446d6c4
ILT
16912009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
1692
1693 * pread.c: Include stdio.h.
1694
bc06c745
ILT
16952009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
1696
1697 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
1698 defined.
1699
75aea3d0
ILT
17002009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
1701
1702 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1703 Change read_shndx type to unsigned int.
1704 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
1705 int.
1706 (Sized_dwarf_line_info::read_line_mappings): Likewise.
1707 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
1708 Change read_shndx type to unsigned int.
1709 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
1710 int.
1711 (Sized_dwarf_line_info::read_line_mappings): Likewise.
1712 * layout.cc (Layout::create_symtab_sections): Cast the result of
1713 local_symcount * symsize to off_t in the gold_assert.
1714
be8fcb75
ILT
17152009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1716
1717 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
1718 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
1719 R_ARM_BASE_ABS.
1720 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
1721 (Arm_relocate_functions::thm_abs5): New function.
1722 (Arm_relocate_functions::abs12): New function.
1723 (Arm_relocate_functions::abs16): New function.
1724 (Arm_relocate_functions::base_abs): New function.
1725 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
1726 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
1727 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
1728 R_ARM_BASE_ABS.
1729 (Scan::global): Likewise.
1730 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
1731 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
1732 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
1733 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
1734 R_ARM_BASE_ABS.
1735
c2a122b6
ILT
17362009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1737
1738 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
1739 (Arm_relocate_functions::movt_prel): New function.
1740 (Arm_relocate_functions::thm_movw_prel_nc): New function.
1741 (Arm_relocate_functions::thm_movt_prel): New function.
1742 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
1743 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
1744 (Scan::global, Relocate::relocate): Likewise.
1745 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
1746
c4aa1e2d
ILT
17472009-10-09 Mikolaj Zalewski <mikolajz@google.com>
1748
1749 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
1750 Incremental_checker.
1751 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
1752 unsigned int.
1753 (class Incremental_inputs_header): New class.
1754 (Incremental_inputs_header_writer): Edit comment.
1755 (Incremental_inputs_entry): New class.
1756 (Incremental_inputs_entry_writer): Edit comment.
1757 (Sized_incremental_binary::do_find_incremental_inputs_section):
1758 Add *strtab_shndx parameter, fill it.
1759 (Sized_incremental_binary::do_check_inputs): New method.
1760 (Incremental_checker::can_incrementally_link_output_file): Use
1761 Sized_incremental_binary::check_inputs.
1762 (Incremental_inputs::report_command_line): Save command line in
1763 command_line_.
1764 * incremental.h:
1765 (Incremental_binary::find_incremental_inputs_section): New
1766 method.
1767 (Incremental_binary::do_find_incremental_inputs_section): Add
1768 strtab_shndx parameter.
1769 (Incremental_binary::do_check_inputs): New pure virtual method.
1770 (Sized_incremental_binary::do_check_inputs): Declare.
1771 (Incremental_checker::Incremental_checker): Add incremental_inputs
1772 parameter, use it to initialize incremental_inputs_.
1773 (Incremental_checker::incremental_inputs_): New field.
1774 (Incremental_checker::command_line): New method.
1775 (Incremental_checker::inputs): New method.
1776 (Incremental_checker::command_line_): New field.
1777
c549a694
ILT
17782009-10-09 Mikolaj Zalewski <mikolajz@google.com>
1779
1780 * incremental.cc: Include <cstdarg> and "target-select.h".
1781 (vexplain_no_incremental): New function.
1782 (explain_no_incremental): New function.
1783 (Incremental_binary::error): New method.
1784 (Sized_incremental_binary::do_find_incremental_inputs_section): New
1785 method.
1786 (make_sized_incremental_binary): New function.
1787 (open_incremental_binary): New function.
1788 (can_incrementally_link_file): Add checks if output is ELF and has
1789 inputs section.
1790 * incremental.h: Include "elfcpp_file.h" and "output.h".
1791 (Incremental_binary): New class.
1792 (Sized_incremental_binary): New class.
1793 (open_incremental_binary): Declare.
1794 * object.cc (is_elf_object): Use
1795 elfcpp::Elf_recognizer::is_elf_file.
1796 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
1797 * output.h (Output_file::filesize): New method.
1798
fd3c5f0b
ILT
17992009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1800
1801 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
1802 New function.
1803 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
1804 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
1805 function.
1806 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
1807 function.
1808 (Arm_relocate_functions::movw_abs_nc): New function.
1809 (Arm_relocate_functions::movt_abs): New function.
1810 (Arm_relocate_functions::thm_movw_abs_nc): New function.
1811 (Arm_relocate_functions::thm_movt_abs): New function.
1812 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
1813 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
1814 (Scan::global): Likewise.
1815 (Relocate::relocate): Likewise.
1816 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
1817
7f5309a5
ILT
18182009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1819
1820 * arm.cc (Arm_relocate_functions::got_prel) New function.
1821 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
1822 (Relocate::relocate): Likewise.
1823 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
1824
364c7fa5
ILT
18252009-10-06 Ian Lance Taylor <iant@google.com>
1826
1827 * options.h (class General_options): Define
1828 split_stack_adjust_size parameter.
1829 * object.h (class Object): Add uses_split_stack_ and
1830 has_no_split_stack_ fields. Add uses_split_stack and
1831 has_no_split_stack accessor functions. Declare
1832 handle_split_stack_section.
1833 (class Reloc_symbol_changes): Define.
1834 (class Sized_relobj): Define Function_offsets. Declare
1835 split_stack_adjust, split_stack_adjust_reltype, and
1836 find_functions.
1837 * object.cc (Object::handle_split_stack_section): New function.
1838 (Sized_relobj::do_layout): Call handle_split_stack_section.
1839 * dynobj.cc (Sized_dynobj::do_layout): Call
1840 handle_split_stack_section.
1841 * reloc.cc (Sized_relobj::relocate_sections): Call
1842 split_stack_adjust for executable sections in split_stack
1843 objects. Pass reloc_map to relocate_section.
1844 (Sized_relobj::split_stack_adjust): New function.
1845 (Sized_relobj::split_stack_adjust_reltype): New function.
1846 (Sized_relobj::find_functions): New function.
1847 * target-reloc.h: Include "object.h".
1848 (relocate_section): Add reloc_symbol_changes parameter. Change
1849 all callers.
1850 * target.h (class Target): Add calls_non_split method. Declare
1851 do_calls_non_split virtual method. Declare match_view and
1852 set_view_to_nop.
1853 * target.cc: Include "elfcpp.h".
1854 (Target::do_calls_non_split): New function.
1855 (Target::match_view): New function.
1856 (Target::set_view_to_nop): New function.
1857 * gold.cc (queue_middle_tasks): Give an error if mixing
1858 split-stack and non-split-stack objects with -r.
1859 * i386.cc (Target_i386::relocate_section): Add
1860 reloc_symbol_changes parameter.
1861 (Target_i386::do_calls_non_split): New function.
1862 * x86_64.cc (Target_x86_64::relocate_section): Add
1863 reloc_symbol_changes parameter.
1864 (Target_x86_64::do_calls_non_split): New function.
1865 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
1866 parameter.
1867 * powerpc.cc (Target_powerpc::relocate_section): Add
1868 reloc_symbol_changes parameter.
1869 * sparc.cc (Target_sparc::relocate_section): Add
1870 reloc_symbol_changes parameter.
1871 * configure.ac: Call AM_CONDITIONAL for the default target.
1872 * configure: Rebuild.
1873 * testsuite/Makefile.am (TEST_AS): New variable.
1874 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
1875 (check_DATA): Add split_i386 and split_x86_64 files.
1876 (SPLIT_DEFSYMS): Define.
1877 (split_i386_[1234n].o): New targets.
1878 (split_i386_[124]): New targets.
1879 (split_i386_[1234r].stdout): New targets.
1880 (split_x86_64_[1234n].o): New targets.
1881 (split_x86_64_[124]): New targets.
1882 (split_x86_64_[1234r].stdout): New targets.
1883 (MOSTLYCLEANFILES): Add new executables.
1884 * testsuite/split_i386.sh: New file.
1885 * testsuite/split_x86_64.sh: New file.
1886 * testsuite/split_i386_1.s: New file.
1887 * testsuite/split_i386_2.s: New file.
1888 * testsuite/split_i386_3.s: New file.
1889 * testsuite/split_i386_4.s: New file.
1890 * testsuite/split_i386_n.s: New file.
1891 * testsuite/split_x86_64_1.s: New file.
1892 * testsuite/split_x86_64_2.s: New file.
1893 * testsuite/split_x86_64_3.s: New file.
1894 * testsuite/split_x86_64_4.s: New file.
1895 * testsuite/split_x86_64_n.s: New file.
1896 * testsuite/testfile.cc (Target_test): Update relocation_section
1897 function.
1898 * testsuite/Makefile.in: Rebuild.
1899
e8a9fcda
ILT
19002009-10-06 Ian Lance Taylor <iant@google.com>
1901
1902 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
1903 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
1904 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
1905 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
1906 the address on ldo_addrs_.
1907 (Target_i386::Relocate::fix_up_ldo): New function.
1908
e99daf92
ILT
19092009-10-06 Rafael Espindola <espindola@google.com>
1910
1911 * plugin.cc (add_input_library): New.
1912 (Plugin::load): Add add_input_library to tv.
1913 (Plugin_manager::add_input_file): Add the is_lib argument.
1914 (add_input_file): Update call to Plugin_manager::add_input_file.
1915 (add_input_library): New.
1916 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
1917
966d4097
DK
19182009-09-30 Doug Kwan <dougkwan@google.com>
1919
1920 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
1921 symbol and call Symbol::may_need_copy_reloc to determine if
1922 a copy reloc is needed.
1923 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
1924 nocopyreloc is given in command line.
1925 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
1926 given in command line.
1927 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
1928 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
1929 of the removed Target_i386::may_need_copy_reloc.
1930 * options.h (copyreloc): New option with default value false.
1931 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
1932 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
1933 instead of the removed Target_powerpc::may_need_copy_reloc.
1934 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
1935 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
1936 instead of the removed Target_sparc::may_need_copy_reloc.
1937 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
1938 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
1939 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
1940 instead of the removed Target_x86_64::may_need_copy_reloc.
1941
029ba973
ILT
19422009-09-30 Ian Lance Taylor <iant@google.com>
1943
1944 * object.h (class Object): Remove target_ field, and target,
1945 sized_target, and set_target methods.
1946 (Object::sized_target): Remove.
1947 (class Sized_relobj): Update declarations. Remove sized_target.
1948 * object.cc (Sized_relobj::setup): Remove target parameter.
1949 Change all callers.
1950 (Input_objects::add_object): Don't do anything with the target.
1951 (make_elf_sized_object): Add punconfigured parameter. Change all
1952 callers. Set or test parameter target.
1953 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
1954 Change all callers.
1955 * parameters.cc (Parameters::set_target): Change parameter type to
1956 be non-const.
1957 (Parameters::default_target): Remove.
1958 (set_parameters_target): Change parameter type to be non-const.
1959 (parameters_force_valid_target): New function.
1960 (parameters_clear_target): New function.
1961 * parameters.h (class Parameters): Update declarations. Remove
1962 default_target method. Add sized_target and clear_target
1963 methods. Change target_ to be non-const.
1964 (set_parameters_target): Update declaration.
1965 (parameters_force_valid_target): Declare.
1966 (parameters_clear_target): Declare.
1967 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
1968 as NULL if we aren't searching.
1969 (Add_symbols::run): Don't check for compatible target.
1970 * fileread.cc (Input_file::open_binary): Call
1971 parameters_force_valid_target.
1972 * gold.cc (queue_middle_tasks): Likewise.
1973 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
1974 set_target on object.
1975 * dynobj.h (class Sized_dynobj): Update declarations.
1976 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
1977 make_elf_object returns NULL.
1978 (Archive::include_member): Don't check whether object target is
1979 compatible.
1980 * output.cc (Output_section::add_input_section): Get target from
1981 parameters.
1982 (Output_section::relax_input_section): Likewise.
1983 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
1984 parameters.
1985 (Sized_relobj::do_scan_relocs): Likewise.
1986 (Sized_relobj::relocate_sections): Likewise.
1987 * resolve.cc (Symbol_table::resolve): Likewise.
1988 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
1989 parameter. Change all callers.
1990 (Symbol_table::add_from_object): Get target from parameters.
1991 (Symbol_table::add_from_relobj): Don't check object target.
1992 (Symbol_table::add_from_dynobj): Likewise.
1993 (Symbol_table::define_special_symbol): Get target from
1994 parameters.
1995 * symtab.h (class Symbol_table): Update declaration.
1996 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
1997 parameter. Change all callers. Clear parameter target.
1998 (Binary_test): Test target here.
1999 * testsuite/object_unittest.cc (gold_testsuite): Remove
2000 target_test_pointer parameter. Change all callers.
2001 (Object_test): Test target here.
2002
a6a22b83
ILT
20032009-09-26 Ian Lance Taylor <iant@google.com>
2004
2005 * testsuite/initpri1.c: Don't try to use constructor priorities if
2006 compiling with gcc before 4.3.
2007
6a8f49fe
ILT
20082009-09-22 Mikolaj Zalewski <mikolajz@google.com>
2009
2010 * testsuite/retain_symbols_file_test.sh (check_present): Change
2011 output file name to retain_symbols_file_test.stdout.
2012 (check_absent): Likewise.
2013
8c604651
CS
20142009-09-18 Craig Silverstein <csilvers@google.com>
2015
2016 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
2017 * options.cc: Include <cerrno> and <fstream>.
2018 (General_options::finalize): Parse -retain-symbols-file tag.
2019 * options.h: New flag.
2020 (General_options): New method should_retain_symbol, new
2021 variable symbols_to_retain.
2022 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
2023 should_retain_symbol map.
2024 * testsuite/Makefile.am (retain_symbols_file_test): New test.
2025 * testsuite/Makefile.in: Regenerate.
2026 * testsuite/retain_symbols_file_test.sh: New file.
2027
ca58b19f
NC
20282009-09-18 Nick Clifton <nickc@redhat.com>
2029
2030 * po/es.po: Updated Spanish translation.
2031
20e6d0d6
DK
20322009-09-17 Doug Kwan <dougkwan@google.com>
2033
2034 * debug.h (DEBUG_RELAXATION): New constant.
2035 (DEBUG_ALL): Add DEBUG_RELAXATION.
2036 (debug_string_to_enum): Add relaxation debug option.
2037 * layout.cc
2038 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
2039 Layout::Relaxation_debug_check::read_sections,
2040 Layout::Relaxation_debug_check::read_sections): New method definitions.
2041 (Layout::Layout): Initialize data members
2042 record_output_section_data_from_scrips_,
2043 script_output_section_data_list_ and relaxation_debug_check_.
2044 (Layout::save_segments, Layout::restore_segments,
2045 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
2046 Layout::relaxation_loop_body): New method definitions.
2047 (Layout::finalize): Support relaxation. Move section layout code to
2048 Layout::relaxation_loop_body.
2049 (Layout::set_asection_address_from_script): Move code for orphan
2050 section placement out.
2051 (Layout::place_orphan_sections_in_script): New method definition.
2052 * layout.h (Output_segment_headers, Output_file_header):
2053 New forward class declarations.
2054 (Layout::~Layout): Define.
2055 (Layout::new_output_section_data_from_script): New method definition.
2056 (Layout::place_orphan_sections_in_script): New method declaration.
2057 (Layout::Segment_states): New type declaration.
2058 (Layout::save_segments, Layout::restore_segments,
2059 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
2060 Layout::relaxation_loop_body): New method declarations.
2061 (Layout::Output_section_data_list): New type declaration.
2062 (Layout::Relaxation_debug_check): New class definition.
2063 (Layout::record_output_section_data_from_script_,
2064 Layout::script_output_section_data_list_, Layout::segment_states_,
2065 Layout::relaxation_debug_check_): New data members.
2066 * output.cc: (Output_section_headers::do_size): New method definition.
2067 (Output_section_headers::Output_section_headers): Move size
2068 computation to Output_section_headers::do_size.
2069 (Output_segment_headers::do_size): New method definition.
2070 (Output_file_header::Output_file_header): Move size computation to
2071 Output_file_header::do_size and call it.
2072 (Output_file_header::do_size): New method definition.
2073 (Output_data_group::Output_data_group): Adjust call to
2074 Output_section_data.
2075 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
2076 (Output_symtab_xindex::do_write): Add array bound check.
2077 (Output_section::Input_section::print_to_mapfile): Handle
2078 RELAXED_INPUT_SECTION_CODE.
2079 (Output_section::Output_section): Initialize data member checkpoint_.
2080 (Output_section::~Output_section): Delete checkpoint object pointed
2081 by checkpoint_.
2082 (Output_section::add_input_section): Always add an Input_section if
2083 relaxing.
2084 (Output_section::add_merge_input_section): Add assert.
2085 (Output_section::relax_input_section): New method definition.
2086 (Output_section::set_final_data_size): Set load address to zero for
2087 an unallocated section.
2088 (Output_section::do_address_and_file_offset_have_reset_values):
2089 New method definition.
2090 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
2091 Handle relaxed input section.
2092 (Output_section::sort_attached_input_sections): Checkpoint input
2093 section list lazily.
2094 (Output_section::get_input_sections): Change type of input_sections to
2095 list of Simple_input_section pointers. Checkpoint input section list
2096 lazily. Also handle relaxed input sections.
2097 (Output_section::add_input_section_for_script): Take a reference to
2098 a Simple_input_section object instead of Relobj pointer and section
2099 index as parameter. Handle relaxed input sections.
2100 (Output_section::save_states, Output_section::restore_states): New
2101 method definitions.
2102 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
2103 (Output_data::is_data_size_fixed): New method definition.
2104 (Output_data::reset_addresss_and_file_offset): Do not reset data size
2105 if it is fixed.
2106 (Output_data::address_and_file_offset_have_reset_values): New method
2107 definition.
2108 (Output_data::do_address_and_file_offset_have_reset_values): New method
2109 definition.
2110 (Output_data::set_data_size): Check that data size is not fixed.
2111 (Output_data::fix_data_size): New method definition.
2112 (Output_data::is_data_size_fixed_): New data member.
2113 (Output_section_headers::set_final_data_size): New method definition.
2114 (Output_section_headers::do_size): New method declaration.
2115 (Output_segment_headers::set_final_data_size): New method definition.
2116 (Output_segment_headers::do_size): New method declaration.
2117 (Output_file_header::set_final_data_size)::New method definition.
2118 (Output_file_header::do_size)::New method declaration.
2119 (Output_section_data::Output_section_data): Add new parameter
2120 is_data_size_fixed and use it to fix data size.
2121 (Output_data_const::Output_data_const): Adjust call to base class
2122 constructor and fix data size.
2123 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
2124 base class constructor and fix data size.
2125 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
2126 base class constructor and fix data size.
2127 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
2128 class constructor and fix data size.
2129 (Output_data_group::set_final_data_size): New method definition.
2130 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
2131 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
2132 class constructor and fix data size.
2133 (Output_relaxed_input_section): New class definition.
2134 (Output_section::Simple_input_section): New class definition.
2135 (Output_section::get_input_sections): Adjust parameter list.
2136 (Output_section::add_input_section_for_script): Same.
2137 (Output_section::save_states, Output_section::restore_states,
2138 Output_section::do_address_and_file_offset_have_reset_values,
2139 (Output_section::Input_section::Input_section): Handle
2140 RELAXED_INPUT_SECTION_CODE. Add new overload for
2141 Output_relaxed_input_section.
2142 (Output_section::Input_section::is_input_section,
2143 Output_section::Input_section::set_output_section): Handle relaxed
2144 input section.
2145 (Output_section::Input_section::is_relaxed_input_section,
2146 Output_section::Input_section::output_section_data,
2147 Output_section::Input_section::relaxed_input_section): New method
2148 definitions.
2149 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
2150 value.
2151 (Output_section::Input_section::u1_): Update comments.
2152 (Output_section::Input_section::u2_): Add new union member poris.
2153 (Output_section::Checkpoint_output_section): New classs definition.
2154 (Output_section::relax_input_section): New method declaration.
2155 (Output_section::checkpoint_): New data member.
2156 (Output_segment): Update comments.
2157 (Output_segment::Output_segment): Un-privatize copy constructor.
2158 (Output_segment::operator=): Un-privatize.
2159 * script-sections.cc (Output_section_element::Input_section_list):
2160 Change element type to Output_section::Simple_input_section.
2161 (Output_section_element_dot_assignment::set_section_addresses):
2162 Register output section data for relaxation clean up.
2163 (Output_data_exression::Output_data_expression): Adjust call to base
2164 constructor to fix data size.
2165 (Output_section_element_data::set_section_addresses): Register
2166 Output_data_expression object for relaxation clean up.
2167 (struct Input_section_info): Replace Relobj pointer and section index
2168 pair with Output_section::Simple_input_section and Convert struct to a
2169 class.
2170 (Input_section_sorter::operator()): Adjust access to
2171 Input_section_info data member to use accessors.
2172 (Output_section_element_input::set_section_addresses): Use layout
2173 parameter. Adjust code to use Output_section::Simple_input_section
2174 and Input_secction_info classes. Register filler for relaxation
2175 clean up.
2176 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
2177 and section index pair with Output_section::Simple_input_section
2178 class. Adjust code accordingly.
2179 (Phdrs_element::release_segment): New method definition.
2180 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
2181 segment list.
2182 (Script_sections::release_segments): New method definition.
2183 * gold/script-sections.h (Script_sections::release_segments): New
2184 method declaration.
2185 * gold/target.h (Target::may_relax, Target::relax,
2186 Target::do_may_relax, Target::do_relax): New method definitions.
2187
5e445df6
ILT
21882009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2189
2190 * arm.cc (has_signed_unsigned_overflow): New function.
2191 (Arm_relocate_functions::abs8): New function.
2192 (Target_arm::Scan::local): Handle R_ARM_ABS8.
2193 (Target_arm::Scan::global): Likewise.
2194 (Target_arm::relocate::relocate): Likewise.
2195 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2196 Likewise.
2197
8c604651 21982009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
2199
2200 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
2201 * testsuite/Makefile.in: Regenerate.
2202
1e9cc1c2
NC
22032009-09-11 Nick Clifton <nickc@redhat.com>
2204
2205 * po/gold.pot: Updated by the Translation project.
2206
6a89f575
CC
22072009-09-08 Cary Coutant <ccoutant@google.com>
2208
2209 * output.cc (Output_file::open): Add execute permission to empty file.
2210 * testsuite/Makefile.am (permission_test): New test.
2211 * testsuite/Makefile.in: Regenerate.
2212
fdcac5af
ILT
22132009-09-02 Ian Lance Taylor <iant@google.com>
2214
2215 * output.cc (Output_file::resize): Call map_no_anonymous rather
2216 than map.
2217
44453f85
ILT
22182009-09-01 Mikolaj Zalewski <mikolajz@google.com>
2219
2220 * gold.cc: Include "incremental.h".
2221 (queue_initial_tasks): Call Incremental_checker methods.
2222 * incremental.cc: Include "output.h".
2223 (Incremental_checker::can_incrementally_link_output_file): New
2224 method.
2225 * incremental.h (Incremental_checker): New class.
2226
2227 * output.cc (Output_file::open_for_modification): New method.
2228 (Output_file::map_anonymous): Changed return type to bool. Record
2229 map in base_ field.
2230 (Output_file::map_no_anonymous): New method, broken out of map.
2231 (Output_file::map): Use map_no_anonymous and map_anonymous.
2232 * output.h (class Output_file): Update declarations.
2233
293c1386
CC
22342009-08-24 Cary Coutant <ccoutant@google.com>
2235
2236 * options.h (Command_line::Pre_options): New class.
2237 (Command_line::pre_options): New member.
2238 * options.cc (gold::options::ready_to_register): New variable.
2239 (One_option::register_option): Do nothing if not registering options.
2240 Assert if same short option registered twice.
2241 (General_options::General_options): Turn off option registration when
2242 done constructing.
2243 (Command_line::Pre_options::Pre_options): New constructor.
2244
f773f3d2
CC
22452009-08-24 Cary Coutant <ccoutant@google.com>
2246
06a73cfe
CC
2247 * options.h (General_options::no_keep_memory): Remove incorrect
2248 short option.
f773f3d2 2249
a15af8e2
RW
22502009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2251
2252 * Makefile.am (am__skiplex, am__skipyacc): New.
2253 * Makefile.in: Regenerate.
2254
c462b41b
RW
22552009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2256
14ec8efd
RW
2257 * Makefile.am (AM_CPPFLAGS): Renamed from ...
2258 (INCLUDES): ... this.
2259 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
2260 (AM_CPPFLAGS): Renamed from ...
2261 (INCLUDE): ... this.
2262 * Makefile.in, testsuite/Makefile.in: Regenerate.
2263
81ecdfbb
RW
2264 * Makefile.in: Regenerate.
2265 * aclocal.m4: Likewise.
2266 * config.in: Likewise.
2267 * configure: Likewise.
2268 * testsuite/Makefile.in: Likewise.
2269
c462b41b
RW
2270 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
2271 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
2272 * Makefile.in: Regenerate.
2273 * testsuite/Makefile.in: Regenerate.
2274
2da73f13
CC
22752009-08-19 Cary Coutant <ccoutant@google.com>
2276
2277 * resolve.cc (Symbol_table::resolve): Don't complain about defined
2278 symbols in shared libraries overridden by hidden or internal symbols
2279 in the main program.
2280
2db70501
CD
22812009-08-19 Chris Demetriou <cgd@google.com>
2282
2283 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
2284 checking source file names in error messages.
2285
f733487b
DK
22862009-08-18 Doug Kwan <dougkwan@google.com>
2287
2288 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
2289 an elcpp::Ehdr as parameter. Adjust call to set_target.
2290 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
2291 an elfcpp::Ehdr as parameter.
2292 * object.cc (Object::set_target): Remove the version that looks up
2293 a target and sets it.
2294 (Sized_relobj::setup): Take a Target object instead of
2295 an elfcpp::Ehdr as parameter. Adjust call to set_target.
2296 (make_elf_sized_object): Find target and ask target to
2297 make an ELF object.
2298 * object.h: (Object::set_target): Remove the version that looks up
2299 a target and sets it.
2300 (Sized_relobj::setup): Take a Target object instead of
2301 an elfcpp:Ehdr as parameter.
2302 * target.cc: Include dynobj.h.
2303 (Target::do_make_elf_object_implementation): New.
2304 (Target::do_make_elf_object): New.
2305 * target.h (Target::make_elf_object): New template declaration.
2306 (Target::do_make_elf_object): New method declarations.
2307 (Target::do_make_elf_object_implementation): New template declaration.
2308
cc70f101
ILT
23092009-08-14 Ian Lance Taylor <iant@google.com>
2310
2311 * gold.h (FUNCTION_NAME): Define.
2312 (gold_unreachable): Use FUNCTION_NAME.
2313
ef5e0cb1
ST
23142009-08-12 Sriraman Tallam <tmsriram@google.com>
2315
2316 * icf.cc (Icf::find_identical_sections): Issue a warning when a
2317 symbol in the --keep-unique list is not found.
2318
48c187ce
ST
23192009-08-12 Sriraman Tallam <tmsriram@google.com>
2320
2321 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
2322 been maked as --keep-unique.
2323 (Icf::unfold_section): New function.
2324 * icf.h (Icf::unfold_section): New function.
2325 * options.h (General_options::keep_unique): New option.
2326 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
2327 * testsuite/Makefile.in: Regenerate.
2328 * testsuite/icf_keep_unique_test.sh: New file.
2329 * testsuite/icf_keep_unique_test.cc: New file.
2330
645afe0c
CC
23312009-08-12 Cary Coutant <ccoutant@google.com>
2332
2333 PR 10471
2334 * resolve.cc (Symbol_table::resolve): Check for references from
2335 dynamic objects to hidden and internal symbols.
2336 * testsuite/Makefile.am (hidden_test.sh): New test.
2337 * testsuite/Makefile.in: Regenerate.
2338 * testsuite/hidden_test.sh: New script.
2339 * testsuite/hidden_test_1.c: New test source.
2340 * testsuite/hidden_test_main.c: New test source.
2341
11af873f
DK
23422009-08-11 Doug Kwan <dougkwan@google.com>
2343
2344 * arm.cc: Update comments.
2345 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
2346 segment to locate the .ARM.exidx section if present.
2347
b9f7d72d
DK
23482009-08-09 Doug Kwan <dougkwan@google.com>
2349
2350 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
2351 patch.
2352
ddd3c53c
ST
23532009-08-07 Sriraman Tallam <tmsriram@google.com>
2354 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
2355 compiler warnings.
2356
27721062
ST
23572009-08-06 Sriraman Tallam <tmsriram@google.com>
2358
2359 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
2360 valid tls_segment only for non-debug-section relocations.
2361 * testsuite/Makefile.am: Add gc_tls_test.
2362 * testsuite/Makefile.in: Regenerate.
2363 * testsuite/gc_tls_test.cc: New file.
2364 * testsuite/gc_tls_test.sh: New file.
2365
ef15dade
ST
23662009-08-05 Sriraman Tallam <tmsriram@google.com>
2367
2368 * icf.cc: New file.
2369 * icf.h: New file.
2370 * Makefile.am (CCFILES): Add icf.cc.
2371 (HFILES): Add icf.h
2372 * Makefile.in: Regenerate.
2373 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
2374 * gc.h (gc_process_relocs): Populate lists used by icf to contain
2375 section, symbol and addend information for the relocs.
2376 * gold.cc (queue_middle_tasks): Call identical code folding.
2377 * gold.h: Add defines for multimap.
2378 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
2379 to the call of finalize_local_symbols.
2380 * main.cc (main): Create object of class Icf.
2381 * object.cc (Sized_relobj::do_layout): Allow this function to be
2382 called twice during icf.
2383 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
2384 to sections marked as identical by icf.
2385 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
2386 when available.
2387 (Sized_relobj::do_section_entsize): New function.
2388 * object.h (Object::section_entsize): New function.
2389 (Object::do_section_entsize): New pure virtual function.
2390 (Relobj::finalize_local_symbols): Add new parameter.
2391 (Relobj::do_section_entsize): New function.
2392 * options.h (General_options::icf): New option.
2393 (General_options::icf_iterations): New option.
2394 (General_options::print_icf_sections): New option.
2395 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
2396 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
2397 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
2398 icf.
2399 * symtab.cc (Symbol_table::is_section_folded): New function.
2400 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
2401 to sections marked as identical by icf.
2402 * symtab.h (Symbol_table::set_icf): New function.
2403 (Symbol_table::icf): New function.
2404 (Symbol_table::is_section_folded): New function.
2405 (Symbol_table::icf_): New data member.
2406 * target-reloc.h (relocate_section): Ignore sections folded by icf.
2407 * testsuite/Makefile.am: Add commands to build icf_test.
2408 * testsuite/Makefile.in: Regenerate.
2409 * testsuite/icf_test.sh: New file.
2410 * testsuite/icf_test.cc: New file.
2411
c3b65ac4
CD
24122009-07-24 Chris Demetriou <cgd@google.com>
2413
2414 * layout.cc (is_compressible_debug_section): Fix incorrect
2415 comment about compressed section names.
2416
1caf2c51
ILT
24172009-07-20 Ian Lance Taylor <ian@airs.com>
2418
2419 PR 10419
2420 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
2421
1ef4d87f
ILT
24222009-07-16 Ian Lance Taylor <iant@google.com>
2423
2424 PR 10400
2425 * layout.h: #include <map>.
2426 (class Kept_section): Change from struct to class. Add accessors
2427 and setters. Add section size to Comdat_group mapping. Change
2428 Comdat_group to std::map. Add is_comdat_ field. Add
2429 linkonce_size field in union.
2430 (class Layout): Update declaration of find_or_add_kept_section.
2431 Don't declare find_kept_object.
2432 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
2433 parameter. Add object, shndx, is_comdat, and is_group_name
2434 parameters. Change all callers. Adjust for new Kept_section.
2435 (Layout::find_kept_object): Remove.
2436 * object.cc (Sized_relobj::include_section_group): Update use of
2437 Kept_section. Rename secnum to shndx. Only record
2438 Kept_comdat_section if sections are the same size.
2439 (Sized_relobj::include_linkonce_section): Update use of
2440 Kept_section. Only record Kept_comdat_section if sections are the
2441 same size. Set size of linkonce section.
2442 (Sized_relobj::map_to_kept_section): Update call to
2443 get_kept_comdat_section.
2444 * object.h (class Sized_relobj): Rename fields in
2445 Kept_comdat_section to drop trailing underscores; change object
2446 field to Relobj*. Change Kept_comdat_section_table to store
2447 struct rather than pointer.
2448 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
2449 Add kept_object and kept_shndx parameters. Change all callers.
2450 (Sized_relobj::get_kept_comdat_section): Change return type to
2451 bool. Add kept_object and kept_shndx parameters. Change all
2452 callers.
2453 * plugin.cc (Pluginobj::include_comdat_group): Update call to
2454 Layout::find_or_add_kept_section.
2455
37c3b7b0
ILT
24562009-07-09 Ian Lance Taylor <iant@google.com>
2457
2458 * merge.cc (Object_merge_map::initialize_input_to_output_map):
2459 Reserve space in the hash table.
2460
98fa85cb
ILT
24612009-07-06 Mikolaj Zalewski <mikolajz@google.com>
2462
2463 * fileread.cc (File_read::get_mtime): New method.
2464 * fileread.h (Timespec): New structure.
2465 (File_read::get_mtime): New method.
2466 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
2467 Renamed from timestamp_nsec.
2468 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
2469 Elf_Xword.
2470 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
2471 timestamp_nsec.
2472 (Incremental_inputs::report_archive): Save mtime; style fix.
2473 (Incremental_inputs::report_obejct): Save mtime; style fix.
2474 (Incremental_inputs::report_script): Save mtime; style fix.
2475 (Incremental_inputs::finalize_inputs): Style fix.
2476 (Incremental_inputs::finalize): Style fix.
2477 (Incremental_inputs::create_input_section_data): Store inputs
2478 mtime.
2479 * incremental.h (Incremental_inputs::report_script): Add mtime
2480 argument.
2481 (Incremental_inputs::Input_info::Input_info): Intialize only one
2482 union member.
2483 (Incremental_inputs::Input_info::archive): Move to nameless
2484 union.
2485 (Incremental_inputs::Input_info::obejct): Move to nameless union.
2486 (Incremental_inputs::Input_info::script): Move to nameless union.
2487 (Incremental_inputs::mtime): New field.
2488 * script.cc (read_input_script): Pass file mtime to
2489 Incremental_input.
2490 * script.h (Script_info::inputs): Style fix.
2491
c9d70757
ILT
24922009-07-01 Ian Lance Taylor <ian@airs.com>
2493
2494 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
2495 instead of 32.
2496
9c547ec3
ILT
24972009-06-24 Ian Lance Taylor <iant@google.com>
2498
2499 PR 10156
2500 * layout.cc (Layout::choose_output_section): If we find an
2501 existing section, update the flags.
2502 (Layout::create_notes): New function, broken out of
2503 Layout::finalize.
2504 (Layout::finalize): Don't create note sections.
2505 (Layout::create_note): Don't crash if linker script discards
2506 section.
2507 (Layout::create_gold_note): Likewise.
2508 (Layout::create_build_id): Likewise. Don't set
2509 after_input_sections on the section.
2510 (Layout::create_executable_stack_info): Remove target parameter.
2511 Change caller.
2512 * layout.h (class Layout): Declare create_notes. Update
2513 declaration of create_executable_stack_info.
2514 * gold.cc (queue_middle_tasks): Call create_notes.
2515 * output.cc (Output_section::update_flags_for_input_section): Move
2516 here from output.h. If SHF_ALLOC flag is newly set, mark address
2517 invalid.
2518 * output.h (Output_data::mark_address_invalid): New function.
2519 (class Output_section): Only declare, not define,
2520 update_flags_for_input_section. Remove set_flags.
2521
55458500
ILT
25222009-06-24 Ian Lance Taylor <iant@google.com>
2523
2524 * script-sections.cc (Output_section_definition::
2525 set_section_addresses): Rename shadowing local load_address to
2526 laddr.
2527
1307d6cd
ILT
25282009-06-24 Ian Lance Taylor <iant@google.com>
2529
2530 PR 10244
2531 * reloc.cc (relocate_sections): Skip empty relocation sections.
2532
ec3f783e
ILT
25332009-06-23 Ian Lance Taylor <iant@google.com>
2534
2535 PR 10156
2536 * layout.cc (Layout::create_note): Use choose_output_section
2537 rather than make_output_section.
2538
459c9f1c
ILT
25392009-06-23 Ian Lance Taylor <iant@google.com>
2540
2541 PR 10237
2542 * options.cc (General_options::parse_V): Set printed_version_.
2543 (General_options::General_options): Initialize printed_version_.
2544 * options.h (class General_options): Add printed_version_ field.
2545 * gold.cc (queue_initial_tasks): If there are no input files,
2546 don't give a fatal error if we printed the version information.
2547 (queue_middle_tasks): If using -r with a shared object, give a
2548 fatal error rather than an ordinary error.
2549
1518dc8f
ILT
25502009-06-23 Ian Lance Taylor <iant@google.com>
2551
2552 PR 10219
2553 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
2554 (Layout::make_output_section): Set have_stabstr_section_ if we see
2555 a .stab*str section.
2556 (Layout::finalize): Call link_stabs_sections.
2557 (Layout::link_stabs_sections): New file.
2558 * layout.h (class Layout): Add have_stabstr_section_ field.
2559 Declare link_stabs_sections.
2560
3d857b98
DK
25612009-06-23 Doug Kwan <dougkwan@google.com>
2562
2563 * Makefile.am (libgold_a_LIBADD): New.
2564 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2565 * Makefile.in: Regenerate.
2566 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
2567 * configure: Regenerate.
2568 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
2569 * fileread.cc: Include sys/state.h
2570 * gold.h: Declare memmem and strndup if found missing.
2571 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
2572
0639a6f6
ILT
25732009-06-23 Ian Lance Taylor <iant@google.com>
2574
2575 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
2576 * configure: Rebuild.
2577
8d63875c
ILT
25782009-06-23 Ian Lance Taylor <iant@google.com>
2579
2580 PR 10147
2581 * object.cc (Object::section_contents): Don't try to get a view if
2582 the section has length zero.
2583 (Object::handle_gnu_warning_section): If the section is empty, use
2584 the name of the section as the warning.
2585
f7c8a183
ILT
25862009-06-23 Ian Lance Taylor <iant@google.com>
2587
2588 PR 10133
2589 * stringpool.h (class Stringpool_template): Add optimize_ field.
2590 (Stringpool_template::set_optimize): New function.
2591 * stringpool.cc (Stringpool_template::Stringpool_template):
2592 Initialize optimize_ field.
2593 (Stringpool_template::set_string_offsets): Test local optimize
2594 fild rather than parameter.
2595 * layout.cc (Layout::Layout): Call set_optimize on the section
2596 name stringpool.
2597
e6a307ba
ILT
25982009-06-22 Ian Lance Taylor <iant@google.com>
2599
2600 PR 10030
2601 * yyscript.y: Parse TARGET.
2602 * script.cc (script_set_target): New function.
2603 * script-c.h (script_set_target): Declare.
2604 * options.cc (General_options::string_to_object_format): Rename
2605 from string_to_object_format in anonymous namespace. Change
2606 callers.
2607 * options.h (class General_options): Declare
2608 string_to_object_format.
2609
3ee173de
ILT
26102009-06-22 Ian Lance Taylor <iant@google.com>
2611
2612 * script-sections.cc (Script_sections::create_segments): Don't put
2613 program headers in a PT_LOAD segment if -n or -N.
2614
26152009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
2616
2617 PR 10141
2618 * options.h (class General_options): Add -z lazy and -z now. Sort
2619 -z options into alphabetical order.
2620 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
2621
cd6739a1 26222009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
2623
2624 * layout.cc (Layout::make_output_section): Call
2625 Target::new_output_section.
2626 (Layout::attach_allocated_section_to_segment): Put large section
2627 sections in a separate load segment with the large segment flag
2628 set.
2629 (Layout::segment_precedes): Sort large data segments after other
2630 load segments.
2631 (align_file_offset): New static function.
2632 (Layout::set_segment_offsets): Use align_file_offset.
2633 * output.h (class Output_section): Add is_small_section_ and
2634 is_large_section_ fields.
2635 (Output_section::is_small_section): New function.
2636 (Output_section::set_is_small_section): New function.
2637 (Output_section::is_large_section): New function.
2638 (Output_section::set_is_large_section): New function.
2639 (Output_section::is_large_data_section): New function.
2640 (class Output_segment): Add is_large_data_segment_ field.
2641 (Output_segment::is_large_data_segment): New function.
2642 (Output_segment::set_is_large_data_segment): New function.
2643 * output.cc (Output_section::Output_section): Initialize new
2644 fields.
2645 (Output_segment::Output_segment): Likewise.
2646 (Output_segment::add_output_section): Add assertion that large
2647 data sections always go in large data segments. Force small data
2648 sections to the end of the list of data sections. Force small BSS
2649 sections to the start of the list of BSS sections. For large BSS
2650 sections to the end of the list of BSS sections.
2651 * symtab.h (class Symbol): Declare is_common_shndx.
2652 (Symbol::is_defined): Check Symbol::is_common_shndx.
2653 (Symbol::is_common): Likewise.
2654 (class Symbol_table): Define enum Commons_section_type. Update
2655 declarations. Add small_commons_ and large_commons_ fields.
2656 * symtab.cc (Symbol::is_common_shndx): New function.
2657 (Symbol_table::Symbol_table): Initialize new fields.
2658 (Symbol_table::add_from_object): Put small and large common
2659 symbols in the right list.
2660 (Symbol_table::sized_finalized_symbol): Check
2661 Symbol::is_common_shndx.
2662 (Symbol_table::sized_write_globals): Likewise.
2663 * common.cc (Symbol_table::do_allocate_commons): Allocate new
2664 common symbol lists. Don't call do_allocate_commons_list if the
2665 list is empty.
2666 (Symbol_table::do_allocate_commons_list): Remove is_tls
2667 parameter. Add comons_section_type parameter. Change all
2668 callers. Handle small and large common symbols.
2669 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
2670 Symbol::is_common_shndx.
2671 * resolve.cc (symbol_to_bits): Likewise.
2672 * target.h (Target::small_common_shndx): New function.
2673 (Target::small_common_section_flags): New function.
2674 (Target::large_common_shndx): New function.
2675 (Target::large_common_section_flags): New function.
2676 (Target::new_output_section): New function.
2677 (Target::Target_info): Add small_common_shndx, large_common_shndx,
2678 small_common_section_flags, and large_common_section_flags
2679 fields.
2680 (Target::do_new_output_section): New virtual function.
2681 * arm.cc (Target_arm::arm_info): Initialize new fields.
2682 * i386.cc (Target_i386::i386_info): Likewise.
2683 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2684 Likewise.
2685 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
2686 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2687 (Target_x86_64::do_new_output_section): New function.
2688 * configure.ac: Define conditional MCMODEL_MEDIUM.
2689 * testsuite/Makefile.am (check_PROGRAMS): Add large.
2690 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
2691 (large_LDFLAGS): Define.
2692 * testsuite/large.c: New file.
2693 * testsuite/testfile.cc (Target_test::test_target_info):
2694 Initialize new fields.
2695 * configure, testsuite/Makefile.in: Rebuild.
2696
bb04269c
DK
26972009-06-05 Doug Kwan <dougkwan@google.com>
2698
2699 * Makefile.am (CCFILES): Add target.cc.
2700 * Makefile.in: Regenerate.
2701 * i386.cc (class Target_i386): Define new virtual method to
2702 override do_is_local_label_name in parent.
2703 * object.cc (Sized_relobj::do_count_local_symbols): Discard
2704 local symbols if --discard-locals or -X is given.
2705 * options.h (class General_options): Declare new options
2706 '--discard-locals' and '-X' for discarding locals.
2707 * target.h (class Target): Define new methods is_local_label_name.
2708 Declare new virtual method do_is_local_label_name.
2709 * target.cc: New file.
2710 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
2711 (check_SCRIPTS): Add discard_locals_test.sh.
2712 (check_DATA): Add discard_local_tests.syms.
2713 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
2714 (discard_local_tests.syms, discard_locals_test.o): New make rules.
2715 * testsuite/Makefile.in: Regenerate.
2716 * testsuite/discard_locals_test.c: New file.
2717 * testsuite/discard_locals_test.sh: Same.
2718
805bb01c
DK
27192009-06-05 Doug Kwan <dougkwan@google.com>
2720
2721 * object.cc (Sized_relobj::Sized_relobj): Initialize
2722 discarded_eh_frame_shndx_ to -1U.
2723 (Sized_relobj::do_layout): Record index of a discard .eh_frame
2724 section.
2725 (Sized_relobj::do_count_local_symbols): Skip local symbols in
2726 a discarded .eh_frame section.
2727 (Sized_relobj::do_finalize_local_symbols): Ditto.
2728 * object.h (class Sized_relobj): Declare new member
2729 discarded_eh_frame_shndx_.
2730 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
2731 (local_labels_test.o, local_labels_test): New rules.
2732 * testsuite/Makefile.in: Regenerate.
2733
1dcd334d
DK
27342009-06-04 Doug Kwan <dougkwan@google.com>
2735
2736 * layout.cc (Layout::section_name_mapping): Add mapping for
2737 special ARM sections.
2738
96d49306
DK
27392009-06-03 Doug Kwan <dougkwan@google.com>
2740
2741 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
2742 (utils::has_overflow): Same.
2743
dff16297
ILT
27442009-06-03 Ian Lance Taylor <iant@google.com>
2745
2746 * layout.cc (Layout::section_name_mapping): New array, replacing
2747 Layout::linkonce_mapping.
2748 (Layout::section_name_mapping_count): New variable, replacing
2749 Layout::linkonce_mapping_count.
2750 (Layout::linkonce_output_name): Remove.
2751 (Layout::output_section_name): Rewrite.
2752 * layout.h (class Layout): Rename Linkonce_mapping to
2753 Section_name_mapping, linkonce_mapping to section_name_mapping,
2754 linkonce_mapping_count to section_name_mapping_count. Don't
2755 declare linkonce_output_name.
2756
c121c671
DK
27572009-06-03 Doug Kwan <dougkwan@google.com>
2758
2759 * gold/arm.cc (namespace utils): New.
2760 (Target_arm::reloc_is_non_pic): Define new method.
2761 (class Arm_relocate_functions): New.
2762 (Target_arm::Relocate::relocate): Handle relocation types used by
2763 Android.
2764
07800fab
ILT
27652009-06-03 Ian Lance Taylor <iant@google.com>
2766
2767 * arm.cc (Target_arm::scan::global): Use || instead of |.
2768
c121c671
DK
27692009-06-02 Doug Kwan <dougkwan@google.com>
2770
2771 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
2772 issued_non_pic_error_.
2773 (class Target_arm::Scan): Declare new method check_non_pic.
2774 Define new method symbol_needs_plt_entry.
2775 Declare new data member issued_non_pic_error_.
2776 (class Target_arm::Relocate): Declare new method
2777 should_apply_static_reloc.
2778 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
2779 (Target_arm::Scan::check_non_pic): Define new method.
2780 (Target_arm::Scan::local): Handle a small subset of reloc types used
2781 by Android.
2782 (Target_arm::Scan::local): Same.
2783 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
2784
b19b0c6d
ILT
27852009-05-31 Mikolaj Zalewski <mikolajz@google.com>
2786
2787 * incremental.cc (Incremental_inputs::report_command_line): Filter
2788 out --incremental-* options.
2789
94cdfcff
DK
27902009-05-29 Doug Kwan <dougkwan@google.com>
2791
2792 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
2793 template class.
2794 (class Target_arm): Update comment.
2795 (Target_arm::Target_arm): Initialize new data members GOT_,
2796 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
2797 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
2798 and Target_arm::rel_dyn_section.
2799 Declare new_enum Target_arm::Got_type.
2800 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
2801 and DYNBSS_.
2802 Update commments for member do_dynsym_value.
2803 (Target_arm::got_size, Target_arm::plt_section,
2804 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
2805 new methods inside class defintion.
2806 (Target_arm::got_section): Define new method.
2807 (Target_arm::rel_dyn_section): Same.
2808 (Output_data_plt_arm): New template class.
2809 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
2810 (Output_data_plt_arm:do_adjust_output_section): Define new method.
2811 (Output_data_plt_arm::add_entry): Same.
2812 (Output_data_plt_arm::first_plt_entry): Define new
2813 static data member for PLT instruction template.
2814 (Output_data_plt_arm::plt_entry): Same.
2815 (Output_data_plt_arm::do_write): Define new method.
2816 (Target_arm::make_plt_entry): Same.
2817 (Target_arm::do_finalize_sections): Same.
2818 (Target_arm::do_dynsym_value): Same.
2819
4a657b0d
DK
28202009-05-28 Doug Kwan <dougkwan@google.com>
2821
2822 * Makefile.am (TARGETSOURCES): Add arm.cc.
2823 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
2824 * Makefile.in: Regenerate.
2825 * arm.cc: New file.
2826 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
2827
e7ae8c36
DK
28282009-05-26 Doug Kwan <dougkwan@google.com>
2829
2830 * options.cc (General_options::parse_exclude_libs). Fix a comment.
2831 (General_options::check_excluded_libs): Strip off directories in
2832 archive name before matching like GNU ld does.
2833 * testsuite/Makefile.am (MOSTLYCLEANFILES,
2834 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
2835 (exclude_libs_test_LDFLAGS): Add linker option
2836 -Wl,--exclude-libs,libexclude_libs_test_3
2837 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
2838 an explicit archive without using -l.
2839 (alt/libexclude_libs_test_3.a): New make rule.
2840 * testsuite/Makefile.in: Regenerate.
2841 * testsuite/exclude_libs_test.c : Declare lib3_default().
2842 (main): Call it.
2843 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
2844 * exclude_libs_test_3.c: New file.
2845
f12e7348
NC
28462009-05-26 Nick Clifton <nickc@redhat.com>
2847
2848 * po/id.po: New Indonesian translation.
2849 * po/gold.pot: Updated template file.
2850
4daadc0d
ST
28512009-05-22 Sriraman Tallam <tmsriram@google.com>
2852
2853 * testsuite/Makefile.am: Add -ffunction-sections to compile
2854 gc_comdat_test files. Add -Wl,--gc-sections to build
2855 gc_comdat_test.
2856 * testsuite/Makefile.in: Regenerate.
2857 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
2858
531813ad
ST
28592009-05-21 Sriraman Tallam <tmsriram@google.com>
2860
2861 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
2862 kept comdat section was garbage collected.
2863 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
2864 * testsuite/Makefile.in: Regenerate.
2865 * testsuite/gc_comdat_test.sh: New file.
2866 * testsuite/gc_comdat_test_1.cc: New file.
2867 * testsuite/gc_comdat_test_2.cc: New file.
2868
65514900
CC
28692009-05-19 Doug Kwan <dougkwan@google.com>
2870
2871 * archive.cc (Archive::Archive): Move constructor from archive.h
2872 to here. Initialize no_export_.
2873 (Archive::get_elf_object_for_member): Set no_export flag of object.
2874 * archive.h (Archive::Archive): Move constructor body to
2875 archive.cc.
2876 (Archive::no_export): New method.
2877 (Archive::no_export_): New field.
2878 * object.h (Object::Object): Initialize no_export_ to false.
2879 (Object::no_export, Object::set_no_export): New methods.
2880 (Object::no_export_): New field.
2881 * options.cc (General_options::parse_exclude_libs): New method.
2882 (General_options::check_excluded_libs) Same.
2883 * options.h (exclude_libs): New option.
2884 (General_options::check_excluded_libs): New method declaration.
2885 (General_options::excluded_libs_): New field.
2886 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
2887 default or protected visibility if an object has no-export flag set.
2888 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
2889 (check_SCRIPTS): Add exclude_libs_test.sh.
2890 (check_DATA): Add exclude_libs_test.syms.
2891 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
2892 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
2893 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
2894 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
2895 (exclude_libs_test.syms, libexclude_libs_test_1.a,
2896 libexclude_libs_test_2.a): New rules.
2897 * testsuite/Makefile.in: Regenerate.
2898 * testsuite/exclude_libs_test.c: New file.
2899 * testsuite/exclude_libs_test.sh: Ditto.
2900 * testsuite/exclude_libs_test_1.c: Ditto.
2901 * testsuite/exclude_libs_test_2.c: Ditto.
2902
1b77ea50
ILT
29032009-05-15 Ian Lance Taylor <iant@google.com>
2904
2905 * configure.ac: Check for declarations for cases where libiberty.h
2906 checks HAVE_DECL_xxx.
2907 * configure, config.in: Rebuild.
2908
072fe7ce
ILT
29092009-05-15 Mikolaj Zalewski <mikolajz@google.com>
2910
2911 * gold.h (Incremental_argument_list): Remove (invalid) forward
2912 declaration.
2913 * incremental.cc (Incremental_inputs::report_achive): New method.
2914 (Incremental_inputs::report_object): New method.
2915 (Incremental_inputs::report_script): New method.
2916 (Incremental_inputs::finalize_inputs): New method.
2917 (Incremental_inputs::finalize): Call finalize_inputs().
2918 (Incremental_inputs::sized_create_incremental_inputs_section_data):
2919 Create inputs entries.
2920 * incremental.h (Incremental_input_type): New enum.
2921 (Incremental_inputs::Incremental_input): Initialize new fields.
2922 (Incremental_inputs::report_inputs): New method.
2923 (Incremental_inputs::report_achive): New method.
2924 (Incremental_inputs::report_object): New method.
2925 (Incremental_inputs::report_script): New method.
2926 (Incremental_inputs::finalize_inputs): New method.
2927 (Incremental_inputs::Input_info): New struct.
2928 (Incremental_inputs::Input_info_map): New typedef.
2929 (Incremental_inputs::lock_): New field.
2930 (Incremental_inputs::Inputs_): New field.
2931 (Incremental_inputs::Inputs_map): New field.
2932 * main.cc (main): Call Incremental_input::report_inputs.
2933 * options.h (Input_argument_list): Typedef moved from
2934 Input_arguments.
2935 (Input_file_group::Files): Remove, use ::Input_argument_list.
2936 (Input_file_group::Input_argument_list): Remove, use
2937 ::Input_argument_list.
2938 * plugin.cc (Plugin_manager::add_input_file): Add error in
2939 incremental build.
2940 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
2941 functions.
2942 * script.cc (read_input_script): Call
2943 Incremental_input::report_script.
2944 * script.h (Script_info): New class.
2945
b0481b0b
ILT
29462009-04-27 Ian Lance Taylor <iant@google.com>
2947
2948 * x86_64.cc (do_adjust_output_section): Set entsize to
2949 plt_entry_size.
2950
b22a5a41 29512009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
2952
2953 * output.cc (Output_file::close): After short writes, continue
2954 writing from the correct offset in the buffer being written.
2955
40fde488
CD
29562009-04-23 Chris Demetriou <cgd@google.com>
2957
2958 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
2959 * configure: Regenerate.
2960 * config.in: Regenerate.
2961 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
2962 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
2963
3ce2c28e
ILT
29642009-04-21 Mikolaj Zalewski <mikolajz@google.com>
2965
2966 * incremental.cc (Incremental_inputs_header_data): Renamed from
2967 Incremental_input_header_data.
2968 (Incremental_inputs_header_data::data_size): New field.
2969 (Incremental_inputs_header_data::put_input_file_count): Renamed
2970 from input_file_count.
2971 (Incremental_inputs_header_data::put_command_line_offset): Renamed
2972 from command_line_offset.
2973 (Incremental_inputs_header_data::put_reserved): Renamed from
2974 put_reserved.
2975 (Incremental_inputs_entry_data): Renamed from
2976 Incremental_input_entry_data.
2977 (Incremental_inputs_entry_data::data_size): New field.
2978 (Incremental_inputs::report_command_line): New method.
2979 (Incremental_inputs::finalize): New method.
2980 (Incremental_inputs::create_incremental_inputs_data): New method.
2981 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
2982 * incremental.h: New file.
2983 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
2984 (Layout::finalize): Create incremental inputs section in
2985 incremental builds.
2986 (Layout::create_incremental_info_sections): New method.
2987 * layout.h (Layout::incremental_inputs): New method.
2988 (Layout::create_incremental_info_sections): New method.
2989 (Layout::incremental_inputs_): New field.
2990 * main.cc (main): Notify Incremental_input of the command line.
2991
e55bde5e
ILT
29922009-04-01 Ian Lance Taylor <iant@google.com>
2993 Mikolaj Zalewski <mikolajz@google.com>
2994
2995 * gold.h (reserve_unordered_map): Define, three versions, one for
2996 each version of Unordered_map.
2997 * layout.cc (Layout::Layout): Remove options parameter. Add
2998 number_of_input_files parameter. Don't initialize options_.
2999 Initialize number_of_input_files_ and resized_signatures_. Move
3000 sections_are_attached_.
3001 (Layout::layout_group): Reserve space for group_signatures_.
3002 (Layout::find_or_add_kept_section): Change name parameter to be a
3003 reference. Resize signatures_ map when it gets large enough.
3004 (Layout::layout_eh_frame): Use parameters->options() instead of
3005 this->options_.
3006 (Layout::make_output_section): Likewise.
3007 (Layout::attach_allocated_section_to_segment): Likewise.
3008 (Layout::finalize, Layout::create_executable_stack): Likewise.
3009 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
3010 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
3011 * layout.h (class Layout): Update declarations. Remove options_
3012 field. Add number_of_input_files_ and resized_signatures_
3013 fields. Move sections_are_attached_ field.
3014 * main.cc (main): Pass number of input files to Layout
3015 constructor. Don't pass options.
3016
154b857c
ILT
30172009-03-30 Ian Lance Taylor <iant@google.com>
3018
3019 * ffsll.c (ffsll): Correct implementation.
3020
2f35ab9b
ILT
30212009-03-27 Ian Lance Taylor <iant@google.com>
3022
fd03461a
ILT
3023 * ffsll.c: New file.
3024 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
3025 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
3026 * ftruncate.c (ftruncate): Declare before definition.
3027 * mremap.c (mremap): Likewise.
3028 * pread.c (pread): Likewise.
3029 * configure, Makefile.in, config.in: Rebuild.
3030
2f35ab9b
ILT
3031 * mremap.c: New file.
3032 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
3033 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
3034 (mremap): Declare if HAVE_MREMAP is not defined.
3035 * configure, Makefile.in, config.in: Rebuild.
3036
33aea2fd
CC
30372009-03-27 Cary Coutant <ccoutant@google.com>
3038
3039 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
3040 position independent.
3041 * sparc.cc (Target_sparc::check_non_pic): Likewise.
3042 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
3043
6d479619
CC
30442009-03-24 Cary Coutant <ccoutant@google.com>
3045
3046 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
3047 an executable.
3048 (needs_dynamic_reloc): Likewise.
3049
afc06bb8
ILT
30502009-03-24 Ian Lance Taylor <iant@google.com>
3051
3052 * yyscript.y (file_cmd): Recognize EXTERN.
3053 (extern_name_list, extern_name_list_body): New nonterminals.
3054 * script.cc (script_add_extern): Define.
3055 * script-c.h (script_add_extern): Declare.
3056
f6060a4d
ILT
30572009-03-24 Rafael Avila de Espindola <espindola@google.com>
3058
3059 * object.cc (is_elf_object): Define.
3060 * object.h (is_elf_object): Declare.
3061 * archive.cc (Archive::get_elf_object_for_member): Call
3062 is_elf_object.
33aea2fd 3063 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 3064
26736d8e
ILT
30652009-03-24 Elliott Hughes <enh@google.com>
3066
3067 * output.cc (Output_file::map_anonymous): Define.
3068 (Output_file::map): Use map_anonymous. If the regular mmap fails,
3069 try an anonymous one. Report the size if the mmap fails.
3070 * output.h (class Output_file): Declare map_anonymous.
3071
22fd9730
ILT
30722009-03-24 Ian Lance Taylor <iant@google.com>
3073
3074 * target-select.cc (instantiate_target): Don't acquire the lock if
3075 the instantiated_target_ field has already been set.
3076
cb010894
ILT
30772009-03-23 Ian Lance Taylor <iant@google.com>
3078
7f055c20
ILT
3079 * gold-threads.h (class Initialize_lock): Define.
3080 * gold-threads.cc (class Initialize_lock_once): Define.
3081 (initialize_lock_control): New static variable.
3082 (initialize_lock_pointer): New static variable.
3083 (initialize_lock_once): New static function.
3084 (Initialize_lock::Initialize_lock): Define.
3085 (Initialize_lock::initialize): Define.
3086 * target-select.h: Include "gold-threads.h".
3087 (class Target_selector): Add lock_ and initialize_lock_ fields.
3088 Don't define instantiate_target, just declare it.
3089 * target-select.cc (Target_selector::Target_selector): Initialize
3090 new fields.
3091 (Target_selector::instantiate_target): Define.
3092 * descriptors.h: Include "gold-threads.h".
3093 (class Descriptors): Add initialize_lock_ field.
3094 * descriptors.cc (Descriptors::Descriptors): Initialize new
3095 field.
3096 (Descriptors::open): Use initialize_lock_ field
3097 * errors.h (class Errors): Add initialize_lock_ field.
3098 * errors.cc (Errors::Errors): Initialize new field.
3099 (Errors::initialize_lock): Use initialize_lock_ field.
3100 * powerpc.cc (class Target_selector_powerpc): Remove
3101 instantiated_target_ field. In do_recognize call
3102 instantiate_target rather than do_instantiate_target. In
3103 do_instantiate_target just allocate a new target.
3104 * sparc.cc (class Target_selector_sparc): Likewise.
3105
36959681
ILT
3106 * freebsd.h: New file.
3107 * i386.cc: Include "freebsd.h".
3108 (Target_i386): Derive from Target_freebsd rather than
3109 Sized_target.
3110 (Target_selector_i386): Derive from Target_selector_freebsd rather
3111 than Target_selector.
3112 * x86_64.cc: Include "freebsd.h".
3113 (Target_x86_64): Derive from Target_freebsd rather than
3114 Sized_target.
3115 (Target_selector_x86_64): Derive from Target_selector_freebsd
3116 rather than Target_selector.
3117 * target.h (class Target): Add adjust_elf_header and
3118 do_adjust_elf_header.
3119 * output.cc (Output_file_header:: do_sized_write): Call target
3120 adjust_elf_header routine.
3121 * configure.tgt: Set targ_osabi.
3122 * configure.ac: Define GOLD_DEFAULT_OSABI.
3123 * parameters.cc (Parameters::default_target): Pass
3124 GOLD_DEFAULT_OSABI to select_target.
3125 * target-select.h (class Target_selector): Make instantiate_target
3126 protected rather than private.
3127 * Makefile.am (HFILES): Add freebsd.h.
3128 * configure, Makefile.in, config.in: Rebuild.
3129
cb010894
ILT
3130 * merge.cc (do_add_input_section): Correct pend value. Change
3131 message about last entry not being null terminated from error to
3132 warning.
3133
0e879927
ILT
31342009-03-20 Mikolaj Zalewski <mikolajz@google.com>
3135
3136 * incremental.cc: New file.
3137 * Makefile.am (CCFILES): Add incremental.cc.
3138 * Makefile.in: Rebuild.
3139
41105937
PP
31402009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
3141
3142 * layout.cc (Layout::output_section_name): Preserve names
3143 of '.note.' sections.
3144
60439920
ILT
31452009-03-19 Ian Lance Taylor <iant@google.com>
3146
3147 * descriptors.cc (Descriptors::open): Check that the options are
3148 valid before using them.
3149
0d371ad3
ILT
31502009-03-18 Ian Lance Taylor <iant@google.com>
3151
3152 * script-sections.h: Include <list>.
3153 (class Script_sections): Change Sections_elements from std::vector
3154 to std::list. Typedef public Elements_iterator. Add
3155 orphan_section_placement_, data_segment_align_start_, and
3156 saw_data_segment_align_ fields. Remove data_segment_align_index_
3157 field.
3158 * script-sections.cc (class Orphan_section_placement): New class.
3159 (class Sections_element): Add virtual functions is_relro and
3160 orphan_section_init. Remove virtual function place_orphan_here.
3161 (class Output_section_definition): Add is_relro and
3162 orphan_section_init. Remove place_orphan_here.
3163 (class Orphan_output_section): Likewise.
3164 (Script_sections::Script_sections): Update for field changes.
3165 (Script_sections::data_segment_align): Set saw_data_segment_align_
3166 and data_segment_align_start_, not data_segment_align_index.
3167 (Script_sections::data_segment_relro_end): Check
3168 saw_data_segment_align_. Use data_segment_align_start_ rather
3169 than data_segment_align_index_.
3170 (Script_sections::place_orphan): Rewrite to use
3171 Orphan_section_placement.
3172
9201d894
ILT
31732009-03-17 Ian Lance Taylor <iant@google.com>
3174
9c5b8369
ILT
3175 * archive.cc (Archive::add_symbols): Check for a version attached
3176 to the symbol name in the archive map.
3177 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
3178 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
3179 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
3180 (ver_test_11.a): New target.
3181 * testsuite/Makefile.in: Rebuild.
3182
9201d894
ILT
3183 * configure.ac: Check for chsize and posix_fallocate. Replace
3184 ftruncate.
3185 * ftruncate.c: New file, from gnulib.
3186 * output.cc (posix_fallocate): Define dummy version if not
3187 HAVE_POSIX_FALLOCATE.
3188 (Output_file::map): Call posix_fallocate rather than lseek and
3189 write.
3190 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
3191 * configure, Makefile.in, config.in: Rebuild.
3192
ef4ab7a8
PP
31932009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
3194
3195 * layout.h (Layout::create_note): Add section_name parameter.
3196 * layout.cc (Layout::create_note): Likewise.
3197 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
3198
8c500701
ILT
31992009-03-17 Ian Lance Taylor <iant@google.com>
3200
e85b18e1
ILT
3201 * descriptors.cc: Include "options.h".
3202 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
3203 (Descriptors::open): Always use O_CLOEXEC when opening a new
3204 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
3205 then set FD_CLOEXEC.
3206
9efe6174
ILT
3207 * sparc.cc (class Target_sparc): Add has_got_section.
3208 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
3209 make sure we have a GOT section.
3210
3211 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
3212 (Target_sparc::Scan::local): Likewise.
3213 (Target_sparc::Scan::global): Likewise.
3214 (Target_sparc::Relocate::relocate): Likewise.
3215 (Target_sparc::Relocate::relocate_tls): Likewise.
3216
8c500701
ILT
3217 * symtab.cc (Symbol_table::define_default_version): New function,
3218 broken out of add_from_object.
3219 (Symbol_table::add_from_object): Call define_default_version.
3220 (Symbol_table::define_special_symbol): Add resolve_oldsym
3221 parameter. Change all callers. If the version for a symbol comes
3222 from a version script, resolve it with the symbol with the same
3223 name with no version. Also add the symbol without a version if
3224 appropriate.
3225 (do_define_in_output_data): If resolving with oldsym, don't delete
3226 sym.
3227 (do_define_in_output_segment): Likewise.
3228 (do_define_as_constant): Likewise.
3229 * symtab.h (class Symbol_table): Update declarations.
3230
f1ed28fb
ILT
32312009-03-13 Ian Lance Taylor <iant@google.com>
3232
15f8229b
ILT
3233 * readsyms.cc (Read_symbols::incompatible_warning): New function.
3234 (Read_symbols::requeue): New function.
3235 (Read_symbols::do_read_symbols): If make_elf_object fails because
3236 the target type is not configured, and the file was searched for,
3237 issue a warning and retry with the next directory.
3238 (Add_symbols::run): If the file has an incompatible format, and
3239 it was searched for, requeue the Read_symbols task. On error,
3240 release the object.
3241 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
3242 dirindex parameter to constructor. Change all callers. Declare
3243 incompatible_warning and requeue.
3244 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
3245 input_argument_ and input_group_ fields. Add them to
3246 constructor. Change all callers.
3247 (class Read_script): Add dirindex_ field. Add it to constructor.
3248 Change all callers.
3249 * archive.cc (Archive::setup): Remove input_objects parameter.
3250 Change all callers.
3251 (Archive::get_file_and_offset): Likewise.
3252 (Archive::read_all_symbols): Likewise.
3253 (Archive::read_symbols): Likewise.
3254 (Archive::get_elf_object_for_member): Remove input_objects
3255 parameter. Add punconfigured parameter. Change all callers.
3256 (Archive::add_symbols): Change return type to bool. Check return
3257 value of include_member.
3258 (Archive::include_all_members): Likewise.
3259 (Archive::include_member): Change return type to bool. Return
3260 false if first included object has incompatible target. Set
3261 included_member_ field.
3262 (Add_archive_symbols::run): If add_symbols returns false, requeue
3263 Read_symbols task.
3264 * archive.h (class Archive): Add included_member_ field.
3265 Initialize it in constructor. Add input_file and searched_for
3266 methods. Update declarations.
3267 (class Add_archive_symbols): Add dirpath_, dirindex_, and
3268 input_argument_ fields. Add them to constructor. Change all
3269 callers.
3270 * script.cc: Include "target-select.h".
3271 (class Parser_closure): Add skip_on_incompatible_target_ and
3272 found_incompatible_target_ fields. Add
3273 skip_on_incompatible_target parameter to constructor. Change all
3274 callers. Add methods skip_on_incompatible_target,
3275 clear_skip_on_incompatible_target, found_incompatible_target, and
3276 set_found_incompatible_target.
3277 (read_input_script): Add dirindex parameter. Change all callers.
3278 If parser finds an incompatible target, requeue Read_symbols
3279 task.
3280 (script_set_symbol): Clear skip_on_incompatible_target in
3281 closure.
3282 (script_add_assertion, script_parse_option): Likewise.
3283 (script_start_sections, script_add_phdr): Likewise.
3284 (script_check_output_format): New function.
3285 * script.h (read_input_script): Update declaration.
3286 * script-c.h (script_check_output_format): Declare.
3287 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
3288 (ignore_cmd): Remove OUTPUT_FORMAT.
3289 * fileread.cc (Input_file::Input_file): Add explicit this.
3290 (Input_file::will_search_for): New function.
3291 (Input_file::open): Add pindex parameter. Change all callers.
3292 * fileread.h (class Input_file): Add input_file_argument method.
3293 Declare will_search_for. Update declarations.
3294 * object.cc (make_elf_object): Add punconfigured parameter.
3295 Change all callers.
3296 * object.h (class Object): Make input_file public. Add
3297 searched_for method.
3298 (make_elf_object): Update declaration.
3299 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
3300 restart search.
3301 * dirsearch.h (class Dirsearch): Update declaration.
3302 * options.h (class General_options): Add --warn-search-mismatch.
3303 * parameters.cc (Parameters::is_compatible_target): New function.
3304 * parameters.h (class Parameters): Declare is_compatible_target.
3305 * workqueue.cc (Workqueue::add_blocker): New function.
3306 * workqueue.h (class Workqueue): Declare add_blocker.
3307
f1ed28fb
ILT
3308 * fileread.cc (Input_file::open): Remove options parameter.
3309 Change all callers.
3310 (Input_file::open_binary): Likewise.
3311 * script.cc (read_input_script): Likewise.
3312 * readsyms.h (class Read_symbols): Remove options_ field. Remove
3313 options parameter from constructor. Change all callers.
3314 (class Read_script): Likewise.
3315 * fileread.h (class Input_file): Update declarations.
3316 * script.h (read_input_script): Update declaration.
3317
34dd024a
NC
33182009-03-10 Nick Clifton <nickc@redhat.com>
3319
3320 * po/es.po: New Spanish translation.
3321
6d71b17c
CC
33222009-03-06 Cary Coutant <ccoutant@google.com>
3323
3324 * options.cc (parse_short_option): Keep dash_z from registering itself.
3325
031cdbed
ILT
33262009-03-03 Ian Lance Taylor <iant@google.com>
3327
3328 PR 9918
3329 * target-reloc.h (relocate_section): Pass output_section to
3330 relocate.
3331 * i386.cc (Target_i386::should_apply_static_reloc): Add
3332 output_section parameter. Change all callers.
3333 (Target_i386::Relocate::relocate): Add output_section parameter.
3334 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3335 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3336 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3337 * testsuite/two_file_shared.sh: New script.
3338 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
3339 (check_DATA): Add two_file_shared.dbg.
3340 (two_file_shared.dbg): New target.
3341 * testsuite/Makefile.in: Rebuild.
3342
15d5fa16
ILT
33432009-03-01 Ian Lance Taylor <iant@google.com>
3344
3345 * configure.ac: Check for byteswap.h.
3346 * configure: Rebuild.
3347 * config.in: Rebuild.
3348
8a4c0b0d
ILT
33492009-03-01 Mikolaj Zalewski <mikolajz@google.com>
3350
3351 * layout.cc (Layout::find_or_add_kept_section): New function.
3352 (Layout::add_comdat): Removed.
3353 * layout.h (struct Kept_section): Move out of class Layout.
3354 Remove trailing underscores from field names. Add group_sections
3355 field. Rename group_ field to is_group. Change all uses.
3356 (class Layout): Declare find_or_add_kept_section, not add_comdat.
3357 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
3358 comdat_groups_ field.
3359 (Sized_relobj::include_section_group): Use
3360 find_or_add_kept_section and Kept_section::group_sections.
3361 (Sized_relobj::include_linkonce_section): Likewise.
3362 * object.cc (class Sized_relobj): Don't define Comdat_group or
3363 Comdat_group_table. Remove find_comdat_group and
3364 add_comdat_group. Remove comdat_groups_ field.
3365 * plugin.cc (include_comdat_group): Use
3366 Layout::find_or_add_kept_section.
3367
b4ecf66b
ILT
33682009-02-28 Ian Lance Taylor <iant@google.com>
3369
14359ca0
ILT
3370 * README: --gc-sections and map files are now supported. Document
3371 some build requirements.
3372
b4ecf66b
ILT
3373 PR 6992
3374 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
3375 relocatable link set the value of the section symbol to zero.
3376 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
3377 relocatable link don't include the section address in the local
3378 symbol value.
3379
0602e05a
ILT
33802009-02-27 Ian Lance Taylor <iant@google.com>
3381
fd9d194f
ILT
3382 PR 6811
3383 * options.h (class Search_directory): Add is_system_directory.
3384 (class General_options): Declare is_in_system_directory.
3385 * options.cc (get_relative_sysroot): Make static.
3386 (get_default_sysroot): Make static.
3387 (General_optoins::is_in_system_directory): New function.
3388 * fileread.cc (Input_file::is_in_system_directory): New function.
3389 * fileread.h (class Input_file): Declare is_in_system_directory.
3390 * object.h (class Object): Add is_in_system_directory.
3391 (class Input_objects): Remove system_library_directory_ field.
3392 * object.cc (Input_objects::add_object): Don't set
3393 system_library_directory_.
3394 (input_objects::found_in_system_library_directory): Remove.
3395 * symtab.cc (Symbol_table::write_globals): Remove input_objects
3396 parameter. Change all callers.
3397 (Symbol_table::sized_write_globals): Likewise.
3398 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
3399 Call Object::is_in_system_directory.
3400 * symtab.h (class Symbol_table): Update declarations.
3401
61edd21f
ILT
3402 PR 5990
3403 * descriptors.h (Open_descriptor): Add is_on_stack field.
3404 * descriptors.cc (Descriptors::open): If the descriptor is on the
3405 top of the stack, remove it. Initialize is_on_stack field.
3406 (Descriptors::release): Only add pod to stack if it is not on the
3407 stack already.
3408 (Descriptors::close_some_descriptor): Clear stack_next and
3409 is_on_stack fields.
3410
e29e076a
ILT
3411 PR 7091
3412 * output.cc (Output_section::find_starting_output_address): Rename
3413 from starting_output_address; add PADDR parameter; change return
3414 type.
3415 * output.h (class Output_section): Declare
3416 find_starting_output_address instead of starting_output_address.
3417 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
3418 section symbol for which we can't find a merge section.
3419
0602e05a
ILT
3420 PR 9836
3421 * symtab.cc (Symbol_table::add_from_object): If the visibility is
3422 hidden or internal, force the symbol to be local.
3423 * resolve.cc (Symbol::override_visibility): Define.
3424 (Symbol::override_base): Use override_visibility.
3425 (Symbol_table::resolve): Likewise.
3426 (Symbol::override_base_with_special): Likewise.
3427 (Symbol_table::override_with_special): If the visibility is hidden
3428 or internal, force the symbol to be local.
3429 * symtab.h (class Symbol): Add set_visibility and
3430 override_visibility.
3431 * testsuite/ver_test_1.sh: New file.
3432 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
3433 (check_DATA): Add ver_test_1.syms.
3434 (ver_test_1.syms): New target.
3435 * testsuite/Makefile.in: Rebuild.
3436
401a9a73
CC
34372009-02-25 Cary Coutant <ccoutant@google.com>
3438
3439 * layout.cc (Layout::choose_output_section): Don't rename sections
3440 when using a linker script that has a SECTIONS clause.
3441 * Makefile.in: Regenerate.
3442
3443 * testsuite/Makefile.am (script_test_5.sh): New test case.
3444 * testsuite/Makefile.in: Regenerate.
3445 * testsuite/script_test_5.cc: New file.
3446 * testsuite/script_test_5.sh: New file.
3447 * testsuite/script_test_5.t: New file.
3448
f488e4b0
CC
34492009-02-13 Rafael Avila de Espindola <espindola@google.com>
3450
3451 * archive.cc (Archive::include_member): Update calls to add_symbols.
3452 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
3453 the Layout argument.
3454 * dynobj.h (do_add_symbols): Add the Layout argument.
3455 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
3456 Layout argument.
3457 * object.h (Object::add_symbols): Add the Layout argument.
3458 (Object::do_add_symbols): Add the Layout argument.
3459 (Sized_relobj::do_add_symbols): Add the Layout argument.
3460 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
3461 Unify the two versions.
3462 (Add_plugin_symbols): Remove.
3463 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
3464 (Sized_pluginobj::do_add_symbols): Unify the two versions.
3465 (Add_plugin_symbols): Remove.
3466 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
3467 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
3468 (Add_symbols::run): Make it work with Pulginobj.
3469
89dd1680
ILT
34702009-02-06 Ian Lance Taylor <iant@google.com>
3471
3472 * object.cc (Sized_relobj::do_layout): Make info message start
3473 with lower case letter.
3474
266d0a74
ILT
34752009-02-06 Mikolaj Zalewski <mikolajz@google.com>
3476
602b464e
ILT
3477 * binary.cc: Fix file comment.
3478
266d0a74
ILT
3479 * options.h (enum Incremental_disposition): Define.
3480 (class General_options): Add new options: --incremental,
3481 --incremental_changed, --incremental_unchanged,
3482 --incremental_unknown. Add incremental_disposition_ and
3483 implicit_incremental_ fields.
3484 (General_options::incremental_disposition): New function.
3485 (class Position_dependent_options): Add incremental_disposition
3486 option.
3487 (Position_dependent_options::copy_from_options): Set incremental
3488 dispositions.
3489 * options.cc (General_options::parse_incremental_changed): New
3490 function.
3491 (General_options::parse_incremental_unchanged): New function.
3492 (General_options::parse_incremental_unknown): New function.
3493 (General_options::General_options): Initialize new fields
3494 incremental_disposition_ and implicit_incremental_.
3495 (General_options::finalize): Check for uasge of --incremental-*
3496 without --incremental.
3497
f073bbf7
CD
34982009-02-06 Chris Demetriou <cgd@google.com>
3499
3500 * gold.h (gold_undefined_symbol): Change to take only a Symbol
3501 pointer and to report location as the file name associated with
3502 the symbol.
3503 (gold_undefined_symbol_at_location): New function to replace the
3504 old gold_undefined_symbol functionality.
3505 * target-reloc.h (relocate_section): Update to use
3506 gold_undefined_symbol_at_location.
3507 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
3508 Call gold_undefined_symbol function rather than gold_error.
3509 * errors.h (Errors::undefined_symbol): Take location as a
3510 string, rather than calculating it from a relocation.
3511 * errors.cc (Errors::fatal): Print "fatal error:" before the
3512 formatted message.
3513 (Errors::error, Errors::error_at_location): Print "error: "
3514 before the formatted message.
3515 (Errors::undefined_symbol): Take location as a string, rather
3516 than calculating it from a relocation.
3517 (gold_undefined_symbol_at_location): New function akin to
3518 old gold_undefined_symbol, calculates location from relocation.
3519 (gold_undefined_symbol): Change to take only a Symbol pointer
3520 and to report location as the file name associated with the symbol.
3521 * testsuite/debug_msg.sh: Update for changed error messages.
3522 * testsuite/undef_symbol.sh: Likewise.
3523
8e94a90c
ILT
35242009-02-04 Duncan Sands <baldrick@free.fr>
3525
3526 PR 9812
3527 * reduced_debug_output.h
3528 (Output_reduced_debug_abbrev_section::failed): Use format for
3529 gold_warning.
3530 (Output_reduced_debug_info_section::faild): Likewise.
3531
88a0e15b
ILT
35322009-01-31 Mikolaj Zalewski <mikolajz@google.com>
3533
3534 * script.cc (Lazy_demangler): New class.
3535 (Version_script_info::get_symbol_version_helper): Demangle a
3536 symbol only once.
3537
5efc7cd2
CC
35382009-01-29 Cary Coutant <ccoutant@google.com>
3539
3540 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
3541 to __tls_get_addr.
3542 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3543
e0ebcf42
ILT
35442009-01-28 Ian Lance Taylor <iant@google.com>
3545
5efc7cd2 3546 * version.cc (version_string): Bump to 1.9.
75fe7426 3547
e0ebcf42
ILT
3548 * gold.h: Include <cstring> and <stdint.h>.
3549 * version.cc: Include <cstdio>.
3550 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
3551 warning.
3552 * reduced_debug_output.cc (insert_into_vector): Rename from
3553 Insert_into_vector; change all callers. Use Swap_unaligned to
3554 avoid aliasing issue; remove union since it is unnecessary.
3555
8e2813be 35562009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
3557
3558 * Makefile.am (CCFILES): Add gc.cc.
3559 (HFILES): Add gc.h.
3560 * Makefile.in: Regenerate.
3561 * gold.cc (Gc_runner): New class.
3562 (queue_initial_tasks): Call garbage collection related tasks
3563 when corresponding options are invoked.
3564 (queue_middle_gc_tasks): New function.
3565 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
3566 processed early before laying out sections during garbage collection.
3567 * gold.h (queue_middle_gc_tasks): New function.
3568 (is_prefix_of): Move from "layout.cc".
3569 * i386.cc (Target_i386::gc_process_relocs): New function.
3570 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
3571 * main.cc (main): Create object of class "Garbage_collection".
3572 * object.cc (Relobj::copy_symbols_data): New function.
3573 (Relobj::is_section_name_included): New function.
3574 (Sized_relobj::do_layout): Allow this function to be called twice
3575 during garbage collection and defer layout of section during the
3576 first call.
3577 * object.h (Relobj::get_symbols_data): New function.
3578 (Relobj::is_section_name_included): New function.
3579 (Relobj::copy_symbols_data): New function.
3580 (Relobj::set_symbols_data): New function.
3581 (Relobj::get_relocs_data): New function.
3582 (Relobj::set_relocs_data): New function.
3583 (Relobj::is_output_section_offset_invalid): New pure virtual function.
3584 (Relobj::gc_process_relocs): New function.
3585 (Relobj::do_gc_process_relocs): New pure virtual function.
3586 (Relobj::sd_): New data member.
3587 (Sized_relobj::is_output_section_offset_invalid): New function.
3588 (Sized_relobj::do_gc_process_relocs): New function.
3589 * options.h (General_options::gc_sections): Modify to not be a no-op.
3590 (General_options::print_gc_sections): New option.
3591 * plugin.cc (Plugin_finish::run): Remove function call to
3592 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
3593 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
3594 * reloc.cc (Read_relocs::run): Add task to process relocs and
3595 determine unreferenced sections when doing garbage collection.
3596 (Gc_process_relocs): New class.
3597 (Sized_relobj::do_gc_process_relocs): New function.
3598 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
3599 sections that are garbage collected.
3600 * reloc.h (Gc_process_relocs): New class.
3601 * sparc.cc (Target_sparc::gc_process_relocs): New function.
3602 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
3603 symbols whose corresponding sections are garbage collected.
3604 (Symbol_table::Symbol_table): Add new parameter for the garbage
3605 collection object.
3606 (Symbol_table::gc_mark_undef_symbols): New function.
3607 (Symbol_table::gc_mark_symbol_for_shlib): New function.
3608 (Symbol_table::gc_mark_dyn_syms): New function.
3609 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
3610 as garbage.
3611 (Symbol_table::add_from_object): Likewise.
3612 (Symbol_table::add_from_relobj): When building shared objects, do not
3613 treat externally visible symbols as garbage.
3614 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
3615 table information for static and relocatable links.
3616 * symtab.h (Symbol_table::set_gc): New function.
3617 (Symbol_table::gc): New function.
3618 (Symbol_table::gc_mark_undef_symbols): New function.
3619 (Symbol_table::gc_mark_symbol_for_shlib): New function.
3620 (Symbol_table::gc_mark_dyn_syms): New function.
3621 (Symbol_table::gc_): New data member.
3622 * target.h (Sized_target::gc_process_relocs): New pure virtual
3623 function.
3624 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
3625 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
3626
3b293544
CF
36272009-01-20 Chris Faylor <me.sourceware@sourceware.org>
3628
3629 * options.h (General_options::gc_sections): Define as a no-op for now.
3630 (General_options::no_keep_memory): Ditto.
3631 (General_options::Bshareable): Define.
3632 * options.cc (General_options::finalize): Honor -Bshareable.
3633
83d22aa8
AS
36342009-01-20 Andreas Schwab <schwab@suse.de>
3635
3636 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
3637 read the value in the contents, since we don't use it. Use the
3638 template endianness when writing.
3639 (Relocate::relocate): Use it for R_PPC_REL16_HA.
3640
cd536b21
AS
36412009-01-19 Andreas Schwab <schwab@suse.de>
3642
3643 * configure.tgt (powerpc64-*): Fix targ_obj.
3644
99e9a495
ILT
36452009-01-15 Ian Lance Taylor <iant@google.com>
3646
3647 * object.cc (Sized_relobj::write_local_symbols): Don't write out
3648 local symbols when stripping all symbols.
3649
bbbfea06
CC
36502009-01-14 Cary Coutant <ccoutant@google.com>
3651
99e9a495 3652 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 3653
0f7c0701
CC
36542009-01-14 Cary Coutant <ccoutant@google.com>
3655
3656 * archive.cc (Archive::get_elf_object_for_member): Remove call
3657 to File_read::claim_for_plugin.
3658 * descriptors.cc (Descriptors::open): Remove reference to
3659 is_claimed.
3660 (Descriptors::claim_for_plugin): Remove.
3661 * descriptors.h (Descriptors::claim_for_plugin): Remove.
3662 (Descriptors::is_claimed): Remove.
3663 (claim_descriptor_for_plugin): Remove.
3664 * fileread.cc (File_read::claim_for_plugin): Remove.
3665 * fileread.h (File_read::claim_for_plugin): Remove.
3666 (File_read::descriptor): Reopen descriptor if necessary.
3667 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
3668 (Plugin_manager::all_symbols_read): Add task parameter. Change
3669 all callers.
3670 (Plugin_manager::get_input_file): New function.
3671 (Plugin_manager::release_input_file): New function.
3672 (Pluginobj::Pluginobj): Add filesize parameter and initialize
3673 corresponding data member.
3674 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
3675 and pass to base constructor. Change all callers.
3676 (get_input_file, release_input_file): New functions.
3677 (make_sized_plugin_object): Add filesize parameter. Change all callers.
3678 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
3679 (Plugin_manager::all_symbols_read): Add task parameter.
3680 (Plugin_manager::get_input_file): New function.
3681 (Plugin_manager::release_input_file): New function.
3682 (Plugin_manager::task_): New data member.
3683 (Pluginobj::Pluginobj): Add filesize parameter.
3684 (Pluginobj::filename): New function.
3685 (Pluginobj::descriptor): New function.
3686 (Pluginobj::filesize): New function.
3687 (Pluginobj::filesize_): New data member.
3688 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
3689 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
3690 File_read::claim_for_plugin; use Object::unlock to unlock the file.
3691
3692 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
3693 with archive libraries.
3694 * testsuite/Makefile.in: Regenerate.
3695 * testsuite/plugin_test.c (struct sym_info): New type.
3696 (get_input_file, release_input_file): New static variables.
3697 (onload): Capture new transfer vector entries.
3698 (claim_file_hook): Stop reading at end of file according to filesize.
3699 Factor out parsing of readelf output into separate function.
3700 (all_symbols_read_hook): Exercise get_input_file and release_input_file
3701 APIs and get the source file name from the symbol table. Convert
3702 source file name to corresponding object file name. Print info
3703 message when adding new input files.
3704 (parse_readelf_line): New function.
3705 * testsuite/plugin_test_1.sh: Add checks for new info messages.
3706 * testsuite/plugin_test_2.sh: Likewise.
3707 * testsuite/plugin_test_3.sh: Likewise.
3708 * testsuite/plugin_test_4.sh: New test case.
3709
62a6d109
ILT
37102009-01-07 Ian Lance Taylor <iant@google.com>
3711
3712 * version.cc (version_string): Bump to 1.8.
3713
483620e8
CC
37142008-12-23 Cary Coutant <ccoutant@google.com>
3715
3716 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
3717 * plugin.cc (Plugin_manager::finish): Rename as
3718 layout_deferred_objects. Move cleanup to separate function.
3719 (Plugin_manager::cleanup): New function.
3720 (Plugin_finish::run): Call layout_deferred_objects and cleanup
3721 separately.
3722 * plugin.h (Plugin_manager::finish): Rename as
3723 layout_deferred_objects.
3724 (Plugin_manager::cleanup): New function.
3725 (Plugin_manager::cleanup_done): New field.
3726
d66a9eb3
CC
37272008-12-23 Cary Coutant <ccoutant@google.com>
3728
3729 * plugin.cc (is_visible_from_outside): New function.
3730 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
3731 so we don't return "IR only" status for exported symbols or -r links.
3732
3733 * testsuite/Makefile.am (plugin_test_3): New test case.
3734 * testsuite/Makefile.in: Regenerate.
3735 * testsuite/plugin_test_3.sh: New file.
3736
5995b570
CC
37372008-12-22 Cary Coutant <ccoutant@google.com>
3738
3739 * object.cc (Sized_relobj::layout_section): New function.
3740 (Sized_relobj::do_layout): Defer layout of input sections until after
3741 plugin has provided replacement files.
3742 (Sized_relobj::do_layout_deferred_sections): New function.
3743 * object.h (Relobj::set_section_offset): Remove virtual keyword.
3744 (Relobj::layout_deferred_sections): New function.
3745 (Relobj::do_layout_deferred_sections): New function.
3746 (Sized_relobj::do_layout_deferred_sections): New function.
3747 (Sized_relobj::layout_section): New function.
3748 (Sized_relobj::Deferred_layout): New structure.
3749 (Sized_relobj::deferred_layout_): New field.
3750 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
3751 Change all callers. Layout deferred sections.
3752 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
3753 references.
3754 (Plugin_hook::run): Move code from do_plugin_hook inline.
3755 (Plugin_hook::do_plugin_hook): Remove.
3756 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
3757 (Plugin_manager::finish): Renamed, was cleanup.
3758 (Plugin_manager::should_defer_layout): New function.
3759 (Plugin_manager::add_deferred_layout_object): New function.
3760 (Plugin_manager::Deferred_layout_list): New type.
3761 (Plugin_manager::deferred_layout_objects_): New field.
3762 (Plugin_hook::do_plugin_hook): Remove.
3763
ee769c88
ILT
37642008-12-17 Ian Lance Taylor <iant@google.com>
3765
3766 * options.h (class General_options): Add --no case for
3767 --export-dynamic.
3768
abc8dcba
CC
37692008-12-16 Cary Coutant <ccoutant@google.com>
3770
3771 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
3772 vector.
3773 (Plugin_manager::claim_file): Create plugin object even if
3774 plugin did not call the add_symbols callback.
3775 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
3776 asking for more symbols than were added.
3777 * testsuite/Makefile.am (plugin_test_1): Add test case with
3778 no global symbols.
3779 (empty.syms): New target.
3780 * testsuite/Makefile.in: Regenerate.
3781 * testsuite/plugin_test.c (claim_file_hook): Add new debug
3782 message. Don't call add_symbols if no globals.
3783 (all_symbols_read_hook): Don't provide replacement for empty
3784 claimed file.
3785
b0074644
ILT
37862008-12-12 Ian Lance Taylor <iant@google.com>
3787
68943102
ILT
3788 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
3789 r_type == 0 for a local symbol with r_sym == 0.
3790 (scan_relocatable_relocs): Pass r_sym to
3791 local_non_section_strategy.
3792 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
3793 r_sym parameter.
3794
b0074644
ILT
3795 * configure.ac: Update test for TLS descriptors: they are
3796 supported as of glibc 2.9.
3797 * configure: Rebuild.
3798
c2508178
ILT
37992008-12-11 Ian Lance Taylor <iant@google.com>
3800
3801 PR 7091
3802 * target-reloc.h (Default_scan_relocatable_relocs): For each
3803 function, map r_type == 0 to RELOC_DISCARD.
3804
2756a258
CC
38052008-12-10 Cary Coutant <ccoutant@google.com>
3806
3807 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
3808 object to override a kept COMDAT group from a plugin object.
3809
bb6f53d3
ILT
38102008-12-09 Ian Lance Taylor <iant@google.com>
3811
fbc558e1
ILT
3812 PR 7088
3813 * yyscript.y (file_cmd): Handle INPUT.
3814
bb6f53d3
ILT
3815 * testsuite/initpri1.c: Change all declarations to be full
3816 prototypes by adding void, to avoid compiler warnings.
3817
4674ecfc
CC
38182008-12-05 Rafael Avila de Espindola <espindola@google.com>
3819
3820 * options.cc (General_options::parse_plugin_opt): New.
3821 (General_options::add_plugin): The argument now is just the filename.
3822 (General_options::add_plugin_option): New.
3823 * options.h (plugin_opt): New.
3824 (add_plugin): Change argument name.
3825 (add_plugin_option): New.
3826 * plugin.cc (Plugin::load): Don't parse the plugin option.
3827 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
3828 (Plugin::add_option): New.
3829 (Plugin::args_): Change type.
3830 (Plugin::filename_): New.
3831 (Plugin_manager::add_plugin_option): New.
3832 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
3833 * testsuite/Makefile.in: Regenerate.
3834
fd06b4aa
CC
38352008-12-05 Cary Coutant <ccoutant@google.com>
3836
3837 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
3838 Handle --strip-lto-sections option.
3839 * options.h (strip_lto_sections): New option.
3840
6c52134c
CC
38412008-12-01 Cary Coutant <ccoutant@google.com>
3842
3843 * plugin.cc (ld_plugin_message): Change format parameter to const.
3844 Fix mismatch between new[] and delete.
3845
a45248e0
CC
38462008-11-14 Cary Coutant <ccoutant@google.com>
3847
3848 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
3849 instead of -1U.
3850
c82fbeee
CS
38512008-11-05 Craig Silverstein <csilvers@google.com>
3852
3853 * options.cc (General_options::parse_dynamic_list): New function.
3854 * options.h (General_options): New flags dynamic_list,
3855 dynamic_list_data, dynamic_list_cpp_new, and
3856 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
3857 (General_options::in_dynamic_list): New function.
3858 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
3859 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
3860 (Lex::can_continue_name): Likewise.
3861 (yylex): Likewise.
3862 (read_script_file): New parameter script_options.
3863 (read_dynamic_list): New function.
3864 (Script_options::define_dynamic_list): New function.
3865 (dynamic_list_keyword_parsecodes): New variable.
3866 (dynamic_list_keywords): New variable.
3867 * script.h (Script_options::define_dynamic_list): New function
3868 prototype.
3869 (read_dynamic_list): New function prototype.
3870 * symtab.cc (strprefix): New macro.
3871 (Symbol::should_add_dynsym_entry): Support dynamic_list,
3872 dynamic_list_data, dynamic_list_cpp_new, and
3873 dynamic_list_cpp_typeinfo.
3874 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
3875 (dynamic_list_expr): New rule.
3876 (dynamic_list_nodes): Likewise.
3877 (dynamic_list_node): Likewise.
3878 * testsuite/Makefile.am (dynamic_list): New test.
3879 * testsuite/Makefile.in: Regenerated.
3880 * testsuite/dynamic_list.t: New file.
3881 * testsuite/dynamic_list.sh: New file.
3882
e0bb29a5
CS
38832008-11-05 Craig Silverstein <csilvers@google.com>
3884
3885 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
3886 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
3887 (t11_last): Likewise.
3888 * testsuite/ver_test_6.c (main): Likewise.
3889
4e1e25e0
CC
38902008-10-07 Cary Coutant <ccoutant@google.com>
3891
3892 * options.c (General_options::finalize): Add check for -static and
3893 -shared.
3894 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
3895 is not empty.
3896
92f03fcb
CC
38972008-10-02 Cary Coutant <ccoutant@google.com>
3898
3899 * plugin.cc (make_sized_plugin_object): Fix conditional
3900 compilation to work when not all targets are enabled.
3901
fbd8a257
CC
39022008-09-29 Cary Coutant <ccoutant@google.com>
3903
3904 * archive.cc (Archive::get_file_and_offset): Use filename instead
3905 of name to get library path.
3906 (Archive::include_member): Unlock external member of a thin archive.
3907
3908 * testsuite/Makefile.am (TEST_AR): New variable.
3909 (thin_archive_test_1): New test.
3910 (thin_archive_test_2): New test.
81636b3f
CC
3911 * testsuite/Makefile.in: Regenerate.
3912 * testsuite/thin_archive_main.cc: New file.
3913 * testsuite/thin_archive_test_1.cc: New file.
3914 * testsuite/thin_archive_test_2.cc: New file.
3915 * testsuite/thin_archive_test_3.cc: New file.
3916 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 3917
eff45813
CC
39182008-09-29 Cary Coutant <ccoutant@google.com>
3919
3920 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
3921 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
3922 instead of -1U.
3923 (Sized_relobj::do_finalize_local_symbols): Likewise.
3924 (Sized_relobj::map_to_kept_section): Likewise.
3925 * object.h (Sized_relobj::invalid_address): New constant.
3926 (Sized_relobj::do_output_section_offset): Check for invalid_address
3927 and return -1ULL.
3928 * output.cc (Output_reloc::local_section_offset): Use constant
3929 invalid_address instead of -1U.
3930 (Output_reloc::get_address): Likewise.
3931 (Output_section::output_address): Change -1U to -1ULL.
3932 * output.h (Output_reloc::invalid_address): New constant.
3933 * reloc.cc (Sized_relobj::write_sections): Use constant
3934 invalid_address instead of -1U.
3935 (Sized_relobj::relocate_sections): Likewise.
3936 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
3937 values for merge sections.
3938 * target-reloc.h (relocate_for_relocatable): Use constant
3939 invalid_address instead of -1U.
3940
89fc3421
CC
39412008-09-19 Cary Coutant <ccoutant@google.com>
3942
3943 Add plugin functionality for link-time optimization (LTO).
3944 * configure.ac (plugins): Add --enable-plugins option.
3945 * configure: Regenerate.
3946 * config.in: Regenerate.
3947 * Makefile.am (LIBDL): New variable.
3948 (CCFILES): Add plugin.cc.
3949 (HFILES): Add plugin.h.
3950 (ldadd_var): Add LIBDL.
3951 * Makefile.in: Regenerate.
3952
3953 * archive.cc: Include "plugin.h".
3954 (Archive::setup): Don't preread archive symbols when using a plugin.
3955 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
3956 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
3957 files.
3958 (Archive::include_member): Add symbols from plugin objects.
3959 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
3960 * descriptors.cc (Descriptors::open): Check for file descriptors
3961 abandoned by plugins.
3962 (Descriptors::claim_for_plugin): New function.
3963 * descriptors.h (Descriptors::claim_for_plugin): New function.
3964 (Open_descriptor::is_claimed): New field.
3965 (claim_descriptor_for_plugin): New function.
3966 * fileread.cc (File_read::claim_for_plugin): New function.
3967 * fileread.h (File_read::claim_for_plugin): New function.
3968 (File_read::descriptor): New function.
3969 * gold.cc: Include "plugin.h".
3970 (queue_initial_tasks): Add task to call plugin hooks for generating
3971 new object files.
3972 * main.cc: Include "plugin.h".
3973 (main): Load plugin libraries.
3974 * object.h (Pluginobj): Declare.
3975 (Object::pluginobj): New function.
3976 (Object::do_pluginobj): New function.
3977 (Object::set_target): New function.
3978 * options.cc: Include "plugin.h".
3979 (General_options::parse_plugin): New function.
3980 (General_options::General_options): Initialize plugins_ field.
3981 (General_options::add_plugin): New function.
3982 * options.h (Plugin_manager): Declare.
3983 (General_options): Add --plugin option.
3984 (General_options::has_plugins): New function.
3985 (General_options::plugins): New function.
3986 (General_options::add_plugin): New function.
3987 (General_options::plugins_): New field.
3988 * plugin.cc: New file.
3989 * plugin.h: New file.
3990 * readsyms.cc: Include "plugin.h".
3991 (Read_symbols::do_read_symbols): Check for archive before checking
3992 for ELF file. Call plugin hooks to claim files.
3993 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
3994 from a real object file; force override when processing replacement
3995 files.
3996 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
3997 (Symbol::init_base_object): Likewise.
3998 (Symbol::init_base_output_data): Likewise.
3999 (Symbol::init_base_output_segment): Likewise.
4000 (Symbol::init_base_constant): Likewise.
4001 (Symbol::init_base_undefined): Likewise.
4002 (Symbol::output_section): Assert that object is not a plugin.
4003 (Symbol_table::add_from_pluginobj): New function.
4004 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
4005 undefined.
4006 (Symbol_table::sized_write_globals): Likewise.
4007 (Symbol_table::add_from_pluginobj): Instantiate template.
4008 * symtab.h (Sized_pluginobj): Declare.
4009 (Symbol::in_real_elf): New function.
4010 (Symbol::set_in_real_elf): New function.
4011 (Symbol::in_real_elf_): New field.
4012 (Symbol_table::add_from_pluginobj): New function.
4013
4014 * testsuite/Makefile.am (AM_CFLAGS): New variable.
4015 (LIBDL): New variable.
4016 (LDADD): Add LIBDL.
4017 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
4018 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
4019 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
4020 (MOSTLYCLEANFILES): Likewise.
4021 * testsuite/Makefile.in: Regenerate.
4022 * testsuite/plugin_test.c: New file.
4023 * testsuite/plugin_test_1.sh: New file.
4024 * testsuite/plugin_test_2.sh: New file.
4025
de31bda5
ILT
40262008-09-16 Ian Lance Taylor <iant@google.com>
4027
9c2d0ef9
ILT
4028 * target-reloc.h (relocate_section): Check whether a symbol is
4029 defined by the ABI before reporting an undefined symbol error.
4030 * target.h (Target::is_defined_by_abi): Make parameter const.
4031 (Target::do_is_defined_by_abi): Likewise.
4032 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
4033 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
4034 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
4035 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
4036 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
4037 * testsuite/Makefile.in: Rebuild.
4038
de31bda5
ILT
4039 * fileread.cc (make_view): Add casts to avoid warning.
4040
9fa33bee
AO
40412008-09-16 Alexandre Oliva <aoliva@redhat.com>
4042
4043 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
4044 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
4045
183fd0e3
AO
40462008-09-16 Alexandre Oliva <aoliva@redhat.com>
4047
4048 * options.h (General_options::output_is_executable): New.
4049 (General_options::output_is_pie): New.
4050 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
4051 for shared libraries.
4052 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
4053
7be8330a
CD
40542008-09-11 Chris Demetriou <cgd@google.com>
4055
4056 * options.h (origin): New -z option.
4057 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
4058 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
4059 in DT_FLAGS_1.
4060
a9caad02
CC
40612008-09-05 Cary Coutant <ccoutant@google.com>
4062
4063 * fileread.cc (File_read::make_view): Add check for attempt to map
4064 beyond end of file.
4065
ae6dce4d
CC
40662008-09-05 Cary Coutant <ccoutant@google.com>
4067
4068 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
4069 explicit instantiations.
4070
d7ab2a47
KVH
40712008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
4072
4073 PR gold/6858
4074 * options.cc (General_options::finalize): Allow undefined symbols
4075 in shlibs if linking -shared.
4076
4077 PR gold/6859
4078 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
4079 symbols as not needing a dynsym entry.
4080
1e52a9c1
CS
40812008-08-20 Craig Silverstein <csilvers@google.com>
4082
4083 * fileread.cc (File_read::open): Do not lock the file unless it
4084 was successfully opened.
4085
d85c80a3
CC
40862008-08-14 Cary Coutant <ccoutant@google.com>
4087
4088 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
4089 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
4090 * testsuite/tls_test.cc (struct int128): 128-bit struct
4091 for testing TLS relocs with non-zero addend.
4092 (v12): New TLS variable.
4093 (t12): New test.
4094 (t_last): Add check for v12.
4095 * testsuite/tls_test.h (t12): New function.
4096 * testsuite/tls_test_main.cc (thread_routine): Call new test.
4097
2d924fd9
ILT
40982008-08-13 Ian Lance Taylor <iant@google.com>
4099
4100 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
4101 set tls_segment_ or relro_segment_.
4102 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
4103 when appropriate.
4104 * output.h (Output_section::clear_is_relro): New function.
4105 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
4106 sections specially even when output_data_ is empty.
4107 (Output_segment::maximum_alignment): When first section is relro,
4108 only force alignment for PT_LOAD segments.
4109 * script.cc (script_data_segment_align): New function.
4110 (script_data_segment_relro_end): New function.
4111 * script-c.h (script_data_segment_align): Declare.
4112 (script_data_segment_relro_end): Declare.
4113 * script-sections.h (class Script_sections): Declare
4114 data_segment_align and data_segment_relro_end. Add fields
4115 segment_align_index_ and saw_relro_end_.
4116 * script-sections.cc (class Sections_element): Add set_is_relro
4117 virtual function. Add new bool* parameter to place_orphan_here.
4118 Add get_output_section virtual function.
4119 (class Output_section_definition): Add set_is_relro. Add new
4120 bool* parameter to place_orphan_here. Add get_output_section.
4121 Add is_relro_ field.
4122 (Output_section_definition::Output_section_definition): Initialize
4123 evaluated_address_, evaluated_load_address, evaluated_addralign_,
4124 and is_relro_ fields.
4125 (Output_section_definition::place_orphan_here): Add is_relro
4126 parameter.
4127 (Output_section_definition::set_section_addresses): Set relro for
4128 output section.
4129 (Output_section_definition::alternate_constraint): Likewise.
4130 (class Orphan_output_section): Add new bool* parameter to
4131 place_orphan_here. Add get_output_section.
4132 (Orphan_output_section::place_orphan_here): Add is_relro
4133 parameter.
4134 (Script_sections::Script_sections): Initialize
4135 data_segment_align_index_ and saw_relro_end_.
4136 (Script_sections::data_segment_align): New function.
4137 (Script_sections::data_segment_relro_end): New function.
4138 (Script_sections::place_orphan): Set or clear is_relro.
4139 (Script_sections::set_section_addresses): Force alignment of first
4140 TLS section.
4141 * yyscript.y (exp): Call script_data_segment_align and
4142 script_data_segment_relro_end.
4143 * testsuite/relro_script_test.t: New file.
4144 * testsuite/relro_test.cc (using_script): Declare.
4145 (t1, t2): Test using_script.
4146 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
4147 (relro_script_test_SOURCES): Define.
4148 (relro_script_test_DEPENDENCIES): Define.
4149 (relro_script_test_LDFLAGS): Define.
4150 (relro_script_test_LDADD): Define.
4151 (relro_script_test.so): New target.
4152 * testsuite/Makefile.in: Rebuild.
4153
f827c9a9
CC
41542008-08-06 Cary Coutant <ccoutant@google.com>
4155
4156 * archive.cc (Archive::total_archives, Archive::total_members)
4157 (Archive::total_members_loaded): New variables.
4158 (Archive::setup): Add parameter. Add option to preread
4159 archive symbols.
4160 (Archive::read_armap): Add counter.
4161 (Archive::get_file_and_offset): New function.
4162 (Archive::get_elf_object_for_member): New function.
4163 (Archive::read_all_symbols): New function.
4164 (Archive::read_symbols): New function.
4165 (Archive::add_symbols): Add counters.
4166 (Archive::include_all_members): Use armap to find members if it's
4167 already built.
4168 (Archive::include_member): Skip reading symbols if already read.
4169 Factored code into Archive::get_file_and_offset and
4170 Archive::get_elf_object_for_member. Changed call to
4171 Mapfile::report_include_archive_member.
4172 (Archive::print_stats): New function.
4173 * archive.h: Declare Object and Read_symbols_data classes.
4174 (Archive::Archive): Add initializers for new members.
4175 (Archive::setup): Add parameter.
4176 (Archive::print_stats): New function.
4177 (Archive::total_archives, Archive::total_members)
4178 (Archive::total_members_loaded): New variables.
4179 (Archive::get_file_and_offset): New function.
4180 (Archive::get_elf_object_for_member): New function.
4181 (Archive::read_all_symbols): New function.
4182 (Archive::read_symbols): New function.
4183 (Archive::Archive_member): New class.
4184 (Archive::members_): New member.
4185 (Archive::num_members_): New member.
4186 * main.cc: Include archive.h.
4187 (main): Call Archive::print_stats.
4188 * mapfile.cc (Mapfile::report_include_archive_member): Delete
4189 archive parameter; member_name is now the fully-decorated name.
4190 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
4191 * options.h: (General_options): Add --preread-archive-symbols option.
4192 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
4193 Archive::setup.
4194
de4c45bd
ILT
41952008-08-04 Ian Lance Taylor <iant@google.com>
4196
4197 * symtab.h (Symbol::use_plt_offset): New function.
4198 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
4199 * powerpc.cc (Relocate::relocate): Likewise.
4200 * sparc.cc (Relocate::relocate): Likewise.
4201 * x86_64.cc (Relocate::relocate): Likewise.
4202 * testsuite/weak_plt.sh: New test.
4203 * testsuite/weak_plt_main.cc: New test.
4204 * testsuite/weak_plt_shared.cc: New test.
4205 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
4206 (check_PROGRAMS): Add weak_plt.
4207 (check_DATA): Add weak_plt_shared.so.
4208 (weak_plt_main_pic.o, weak_plt): New targets.
4209 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
4210 * testsuite/Makefile.in: Rebuild.
4211
4212 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
4213 gcctestdir/ld.
4214 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
4215 * testsuite/Makefile.in: Rebuild.
4216
323ee3f4
AM
42172008-08-04 Alan Modra <amodra@bigpond.net.au>
4218
4219 * Makefile.am (POTFILES.in): Set LC_ALL=C.
4220 * Makefile.in: Regenerate.
4221 * po/POTFILES.in: Regenerate.
4222
7c07ecec
ILT
42232008-07-29 Ian Lance Taylor <iant@google.com>
4224
4225 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
4226 symbols before other symbols.
4227 * testsuite/script_test_2.cc (test_addr): Declare.
4228 (test_addr_alias): Declare.
4229 (main): Check that test_addr and test_addr_alias have the right
cd536b21 4230 values.
7c07ecec
ILT
4231 * testsuite/script_test_2.t: Define test_addr_alias and
4232 test_addr.
4233
5778530e
ILT
42342008-07-24 Ian Lance Taylor <iant@google.com>
4235
2a00e4fb
ILT
4236 PR 5990
4237 * descriptors.cc: New file.
4238 * descriptors.h: New file.
4239 * gold-threads.h (class Hold_optional_lock): New class.
4240 * fileread.cc: Include "descriptors.h".
4241 (File_read::~File_read): Release descriptor rather than closing
4242 it.
4243 (File_read::open) [file]: Call open_descriptor rather than open.
4244 Set is_descriptor_opened_.
4245 (File_read::open) [memory]: Assert that descriptor is not open.
4246 (File_read::reopen_descriptor): New function.
4247 (File_read::release): Release descriptor.
4248 (File_read::do_read): Make non-const. Reopen descriptor.
4249 (File_read::read): Make non-const.
4250 (File_read::make_view): Reopen descriptor.
4251 (File_read::do_readv): Likewise.
4252 * fileread.h (class File_read): Add is_descriptor_opened_ field.
4253 Update declarations.
4254 * layout.cc: Include "descriptors.h".
4255 (Layout::create_build_id): Use open_descriptor rather than open.
4256 * output.cc: Include "descriptors.h".
4257 (Output_file::open): Use open_descriptor rather than open.
4258 * archive.cc (Archive::const_iterator): Change Archive to be
4259 non-const.
4260 (Archive::begin, Archive::end): Make non-const.
4261 (Archive::count_members): Likewise.
4262 * archive.h (class Archive): Update declarations.
4263 * object.h (Object::read): Make non-const.
4264 * Makefile.am (CCFILES): Add descriptors.cc.
4265 (HFILES): Add descriptors.h.
4266 * Makefile.in: Rebuild.
4267
801647d1
ILT
4268 PR 6716
4269 * gold.h: Always include <clocale>. Add Solaris workarounds
4270 following code in binutils/sysdep.h.
4271
5edd166e
ILT
4272 PR 6048
4273 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
4274 this->eh_frame_hdr_ is NULL before using it.
4275
c89ad728
ILT
4276 * dynobj.cc (Versions::Versions): Update comment.
4277
aa86f06b
ILT
4278 * dynobj.cc (Versions::Versions): If there is an soname, use it as
4279 the base version name.
4280
5778530e
ILT
4281 * stringpool.cc (Stringpool_template::add_with_length): Set key to
4282 array size plus one.
4283 (Stringpool_template::set_string_offsets): Subtract one from key
4284 before using it as an array index.
4285 (Stringpool_template::get_offset_with_length): Likewise.
4286 (Stringpool_template::write_to_buffer): Likewise.
4287 * stringpool.h (Stringpool_template::get_offset_from_key):
4288 Likewise.
4289
057ead22
ILT
42902008-07-23 Ian Lance Taylor <iant@google.com>
4291
7f649c59
ILT
4292 PR 6658
4293 * object.h (Merged_symbol_value::value): Do our best to handle a
4294 negative addend.
4295
057ead22
ILT
4296 PR 6647
4297 * script.cc (Version_script_info::get_versions): Don't add empty
4298 version tag to return value.
4299 (Version_script_info::get_symbol_version_helper): Change return
4300 type to bool. Add pversion parameter. Change all callers.
4301 (script_register_vers_node): Don't require a non-NULL tag.
4302 * script.h (class Version_script_info): Update declarations.
4303 (Version_script_info::get_symbol_version): Change return type to
4304 bool. Add version parameter. Change all callers.
4305 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
4306 handling. Handle an empty version from a version script.
4307 (Symbol_table::define_special_symbol): Likewise.
4308 * testsuite/ver_test_10.script: New file.
4309 * testsuite/ver_test_10.sh: New file.
4310 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
4311 (check_DATA): Add ver_test_10.syms.
4312 (ver_test_10.syms, ver_test_10.so): New target.
4313 * testsuite/Makefile.in: Rebuild.
4314
58e54ac2
CD
43152008-07-23 Simon Baldwin <simonb@google.com>
4316
4317 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
4318 to zero for undefined symbols from dynamic libraries.
4319
95d14cd3
ILT
43202008-07-23 Ian Lance Taylor <iant@google.com>
4321
4322 * symtab.cc (Symbol_table::resolve): Remove version parameter.
4323 Change all callers.
4324 * symtab.h (class Symbol_table): Update declaration.
4325 * testsuite/ver_test_9.cc: New file.
4326 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
4327 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
4328 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
4329 (ver_test_9.so, ver_test_9.o): New targets.
4330 * testsuite/Makefile.in: Rebuild.
4331
92de84a6
ILT
43322008-07-22 Ian Lance Taylor <iant@google.com>
4333
34810851
ILT
4334 * options.h (class General_options): Define --check-sections.
4335 * layout.cc (Layout::set_segment_offsets): Handle
4336 --check-sections.
4337
af6156ef
ILT
4338 * options.h (class General_options): Define -n/--nmagic and
4339 -N/--omagic.
4340 * options.cc (General_options::finalize): For -n/--nmagic or
4341 -N/--omagic, set -static.
4342 * layout.cc (Layout::attach_allocated_section_to_segment): If
4343 -N/--omagic, don't put read-only and read-write sections in
4344 different segments.
4345 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
4346 finding a read-only segment.
4347 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
4348 don't set the minimum segment alignment to the common page size,
4349 and don't set the file offset to the address modulo the page size.
4350 * script-sections.cc (Script_sections::create_segments): If
4351 -n/--omagic, don't put read-only and read-write sections in
4352 different segments.
4353
92de84a6
ILT
4354 * cref.cc: New file.
4355 * cref.h: New file.
4356 * options.h (class General_options): Add --print-symbol-counts.
4357 * main.cc (main): Issue defined symbol report if requested.
4358 * archive.cc (Archive::interpret_header): Make into a const member
4359 function.
4360 (Archive::add_symbols): Call Input_objects::archive_start and
4361 archive_stop.
4362 (Archive::const_iterator): Define new class.
4363 (Archive::begin, Archive::end): New functions.
4364 (Archive::include_all_members): Rewrite to use iterator.
4365 (Archive::count_members): New function.
4366 * archive.h (class Archive): Update declarations.
4367 (Archive::filename): New function.
4368 * object.cc: Include "cref.h".
4369 (Sized_relobj::Sized_relobj): Initialize defined_count_.
4370 (Sized_relobj::do_get_global_symbol_counts): New function.
4371 (Input_objects::add_object): Add object to cross-referencer.
4372 (Input_objects::archive_start): New function.
4373 (Input_objects::archive_stop): New function.
4374 (Input_objects::print_symbol_counts): New function.
4375 * object.h: Declare Cref and Archive.
4376 (Object::get_global_symbol_counts): New function.
4377 (Object::do_get_global_symbol_counts): New pure virtual function.
4378 (class Sized_relobj): Add defined_count_ field. Update
4379 declarations.
4380 (class Input_objects): Add cref_ field. Update constructor.
4381 Update declarations.
4382 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
4383 defined_count_.
4384 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
4385 symbol counts.
4386 (Sized_dynobj::do_get_global_symbol_counts): New function.
4387 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
4388 defined_count_. Update declarations. Define Symbols typedef.
4389 * symtab.cc (Symbol_table::add_from_relobj): Add defined
4390 parameter. Change all callers.
4391 (Symbol_table::add_from_dynobj): Add sympointers and defined
4392 parameters. Change all callers.
4393 * symtab.h (class Symbol_table): Update declarations.
4394 * Makefile.am (CCFILES): Add cref.cc.
4395 (HFILES): Add cref.h.
4396 * Makefile.in: Rebuild.
4397
3f7c5e1d
CD
43982008-07-22 Simon Baldwin <simonb@google.com>
4399
4400 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
4401 to zero when writing undefined symbols.
4402
e0b64032
ILT
44032008-07-22 Ian Lance Taylor <iant@google.com>
4404
4405 * output.cc (Output_section::add_input_section): Don't try to
4406 merge empty merge sections.
4407
096b02cf
CS
44082008-07-21 Craig Silverstein <csilvers@google.com>
4409
4410 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
4411 Include symbol version in error message.
cd536b21 4412
1d1f116d
CD
44132008-07-20 Chris Demetriou <cgd@google.com>
4414
cd536b21 4415 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
4416 (RANDOM_SEED_CFLAGS): New substituted variable.
4417 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
4418 * configure: Rebuild.
4419 * Makefile.in: Likewise.
4420 * testsuite/Makefile.in: Likewise.
4421
a18f591e
ILT
44222008-07-18 Ian Lance Taylor <iant@google.com>
4423
4424 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
4425 where we see NAME/NULL and NAME/VERSION as separate symbols.
4426 * testsuite/ver_test_main.cc (main): Call t4.
4427 (t4, t4_2a): Define.
4428 * testsuite/ver_test_2.cc (t4_2): Define.
4429 * testsuite/ver_test_2.script: Put t4_2a in VER2.
4430 * testsuite/ver_test_4.cc (t4_2a): Define.
4431 * testsuite/ver_test_4.script: Put t4_2a in VER2.
4432 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
4433
c6e3f6ed
ILT
44342008-07-17 Ian Lance Taylor <iant@google.com>
4435
4436 * dynobj.cc (Versions::add_def): If we give an error about a
4437 missing version, go ahead and create the version anyhow.
4438
ef9beddf
ILT
44392008-07-10 Ian Lance Taylor <iant@google.com>
4440
4441 Handle output sections with more than 0x7fffffff bytes.
4442 * object.h (class Relobj): Change map_to_output_ to
4443 output_sections_, and just keep a section pointer. Change all
4444 uses. Move comdat group support to Sized_relobj.
4445 (Relobj::is_section_specially_mapped): Remove.
4446 (Relobj::output_section): Remove poff parameter. Change all
4447 callers.
4448 (Relobj::output_section_offset): New function.
4449 (Relobj::set_section_offset): Rewrite.
4450 (Relobj::map_to_output): Remove.
4451 (Relobj::output_sections): New function.
4452 (Relobj::do_output_section_offset): New pure virtual function.
4453 (Relobj::do_set_section_offset): Likewise.
4454 (class Sized_relobj): Add section_offsets_ field. Add comdat
4455 group support from Relobj. Update declarations.
4456 (Sized_relobj::get_output_section_offset): New function.
4457 (Sized_relobj::do_output_section_offset): New function.
4458 (Sized_relobj::do_set_section_offset): New function.
4459 * object.cc (Relobj::output_section_address): Remove.
4460 (Sized_relobj::Sized_relobj): Initialize new fields.
4461 (Sized_relobj::include_section_group): Cast find_kept_object to
4462 Sized_relobj.
4463 (Sized_relobj::include_linkonce_section): Likewise.
4464 (Sized_relobj::do_layout): Use separate arrays for output section
4465 and output offset.
4466 (Sized_relobj::do_count_local_symbols): Change map_to_output to
4467 output_sections.
4468 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
4469 output_sections and section_offsets.
4470 (Sized_relobj::write_local_symbols): Likewise.
4471 (map_to_kept_section): Compute output address directly.
4472 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
4473 output_sections and section_offsets.
4474 (Sized_relobj::write_sections): Likewise.
4475 (Sized_relobj::relocate_sections): Likewise.
4476 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
4477 * output.h (class Output_reloc): Update declarations. Change
4478 u2_.relobj to Sized_relobj*.
4479 (class Output_data_reloc): Change add functions to use
4480 Sized_relobj*.
4481 * output.cc (Output_reloc::Output_reloc): Change relobj to
4482 Sized_relobj*.
4483 (Output_reloc::local_section_offset): Change return type to
4484 Elf_Addr. Use get_output_section_offset.
4485 (Output_reloc::get_address): Likewise.
4486 (Output_section::is_input_address_mapped): Don't call
4487 is_section_specially_mapped.
4488 (Output_section::output_offset): Likewise.
4489 (Output_section::output_address): Likewise.
4490 (Output_section::starting_output_address): Likewise.
4491 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
4492 parameter to Sized_relobj*.
4493 (Copy_relocs::need_copy_reloc): Likewise.
4494 (Copy_relocs::save): Likewise.
4495 * copy-relocs.h (class Copy_relocs): Update declarations.
4496 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
4497 Sized_relobj*. Change relobj_ field to Sized_relobj*.
4498 * target-reloc.h (relocate_for_relocatable): Change
4499 offset_in_output_section type to Elf_Addr. Change code that uses
4500 it as well.
4501 * layout.cc (Layout::layout): Always set *off.
4502 * mapfile.cc (Mapfile::print_input_section): Use
4503 output_section_offset.
4504 * i386.cc (Target_i386::copy_reloc): Change object parameter to
4505 Sized_relobj*.
4506 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
4507 * sparc.cc (Target_sparc::copy_reloc): Likewise.
4508 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
4509
5cb66f97
ILT
45102008-07-03 Ian Lance Taylor <iant@google.com>
4511
4512 * layout.cc (Layout::include_section): Do not discard unrecognized
4513 SHT_STRTAB sections.
4514
afe47622
CS
45152008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
4516
4517 * script.cc (Lex::can_continue_name): Make '?' allowable in
4518 version-script names.
4519 * testsuite/version_script.map: Change glob pattern to use '?'
4520
5adf9721
ILT
45212008-06-30 Manish Singh <yosh@gimp.org>
4522
4523 PR 6585
4524 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
4525 Correct typo.
4526
e6fde208
ILT
45272008-06-30 Ian Lance Taylor <iant@google.com>
4528
4529 PR 6660
4530 PR 6682
4531 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
4532 versions]: Don't try to read the value in the contents, since we
4533 don't use it. Use the template endianness when writing.
4534
3f2e6a2d
CC
45352008-06-25 Cary Coutant <ccoutant@google.com>
4536
4537 * fileread.cc (File_read::make_view): Assert on zero-length view.
4538 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
4539 symbol table when there are no symbols to read.
4540
c43d3a48
CS
45412008-06-23 Craig Silverstein <csilvers@google.com>
4542
4543 * version.cc (version_string): Bump to 1.7
4544
5f494ea0
CS
45452008-06-18 Craig Silverstein <csilvers@google.com>
4546
4547 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
4548 constant 0xFFFF to type Valtype.
4549 (Powerpc_relocate_functions::rel16_ha): Likewise.
4550
c42e122e
ILT
45512008-06-17 Ian Lance Taylor <iant@google.com>
4552
f34787f8
ILT
4553 * output.h (Output_section::Input_section): Initialize p2align_ to
4554 zero for Output_section_data constructors.
4555 (Output_section::Input_section::addralign): If not an input
4556 section, return the alignment of the Output_section_data.
4557 * testsuite/copy_test.cc: New file.
4558 * testsuite/copy_test_1.cc: New file.
4559 * testsuite/copy_test_2.cc: New file.
4560 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
4561 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
4562 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
4563 (copy_test_1_pic.o, copy_test_1.so): New targets.
4564 (copy_test_2_pic.o, copy_test_2.so): New targets.
4565 * testsuite/Makefile.in: Rebuild.
4566
c42e122e
ILT
4567 * script-sections.cc (Script_sections::place_orphan): Initialize
4568 local variable exact.
4569
ce3ac18a
DE
45702008-06-13 David Edelsohn <edelsohn@gnu.org>
4571
4572 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
4573
42cacb20
DE
45742008-06-12 David Edelsohn <edelsohn@gnu.org>
4575 David S. Miller <davem@davemloft.net>
4576
4577 * powerpc.cc: New file.
4578 * Makefile.am (TARGETSOURCES): Add powerpc.cc
4579 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
4580 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
4581 * Makefile.in: Rebuild.
4582
7b308235
ILT
45832008-06-09 Ian Lance Taylor <iant@google.com>
4584
4585 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
4586 <exception>.
4587 (throwing, orig_terminate): New static variables.
4588 (terminate_handler): New static function.
4589 (t2): Set terminate handler.
4590
f0b886e3
ILT
45912008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
4592
4593 PR 6584
cd536b21 4594 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
4595 alignment.
4596
3e90f135
CC
45972008-05-30 Cary Coutant <ccoutant@google.com>
4598
4599 * archive.cc (Archive::include_all_members) Correct to step
4600 over symbol table and extended name table in thin archives.
4601
e09ad04a
ILT
46022008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
4603
4604 PR 6407
4605 * target-reloc.h (relocate_for_relocatable): Fix new_offset
4606 calculation.
4607
62b01cb5
ILT
46082008-05-28 Caleb Howe <cshowe@google.com>
4609
4610 * reduced_debug_output.cc: New file.
4611 * reduced_debug_output.h: New file.
92de84a6 4612 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
4613 * options.cc (General_options::finalize): Add strip_debug_non_line
4614 to the strip heirarchy.
4615 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
4616 fields.
4617 * layout.cc: Include "reduced_debug_output.h".
4618 (Layout::Layout): Initialize new fields.
4619 (line_only_debug_sections): New static array.
4620 (is_lines_only_debug_sections): New static inline function.
4621 (Layout::include_section): Handle --strip-debug-non-line.
4622 (Layout::make_output_section): If --strip-debug-non-line, build
4623 new output sections for .debug_abbrev and .debug_info.
4624 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
4625 gold. Warn about possible overflow.
4626 (read_signed_LEB_128): Likewise.
4627 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
4628 (read_signed_LEB_128): Declare.
4629 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
4630 (HFILES): Add reduced_debug_output.h.
4631 * Makefile.in: Rebuild.
4632
7d9e3d98
ILT
46332008-05-21 Ian Lance Taylor <iant@google.com>
4634
4635 * mapfile.cc: New file.
4636 * mapfile.h: New file.
4637 * options.h (class General_options): Add -M/--print-map and -Map.
4638 * options.cc (General_options::finalize): Make -M equivalent to
4639 -Map -.
4640 * main.cc: Include <cstdio> and "mapfile.h".
4641 (main): Open mapfile if requested.
4642 * gold.cc (class Middle_runner): Add mapfile_ field. Update
4643 constructor. Change caller.
4644 (queue_initial_tasks): Add mapfile parameter. Change caller.
4645 (queue_middle_tasks): Likewise.
4646 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
4647 declarations.
4648 * archive.cc: Include "mapfile.h".
4649 (Archive::add_symbols): Add mapfile parameter. Change all
4650 callers. Pass mapfile, symbol, and reason to include_member.
4651 (Archive::include_all_members): Add mapfile parameter. Change all
4652 callers.
4653 (Archive::include_member): Add mapfile, sym, and why parameters.
4654 Change all callers. Report inclusion to map file.
4655 * archive.h: Include "fileread.h".
4656 (class Archive): Update declarations.
4657 (Archive::file): New const method.
4658 (class Add_archive_symbols): Add mapfile_ field. Update
4659 constructor. Change all callers.
4660 * readsyms.h (class Read_symbols): Likewise.
4661 (class Finish_group): Likewise.
4662 (class Read_script): Likewise.
4663 * common.cc: Include "mapfile.h".
4664 (Symbol_table::allocate_commons): Add mapfile parameter. Change
4665 all callers.
4666 (Symbol_table::do_allocate_commons): Likewise.
4667 (Symbol_table::do_allocate_commons_list): Likewise. Report common
4668 symbol allocation to mapfile.
4669 * common.h (class Allocate_commons_task): Add mapfile_ field.
4670 Update constructor. Change all callers.
4671 * symtab.h (class Symbol_table): Update declarations.
4672 * layout.cc: Include "mapfile.h".
4673 (Layout_task_runner::run): Print information to mapfile.
4674 (Layout::create_gold_note): Change Output_data_fixed_space to
4675 Output_data_zero_fill.
4676 (Layout::create_build_id): Likewise.
4677 (Layout::print_to_mapfile): New function.
4678 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
4679 constructor. Change caller.
4680 (class Layout): Declare print_to_mapfile.
4681 * output.cc (Output_section::Input_section::print_to_mapfile): New
4682 function.
4683 (Output_section::add_input_section): If producing a map, always
4684 add to input_sections_ list.
4685 (Output_section::do_print_to_mapfile): New function.
4686 (Output_segment::print_sections_to_mapfile): New function.
4687 (Output_segment::print_section_list_to_mapfile): New function.
4688 * output.h: Include "mapfile.h".
4689 (Output_data::print_to_mapfile): New function.
4690 (Output_data::do_print_to_mapfile): New virtual function.
4691 (Output_segment_headers::do_print_to_mapfile): New function.
4692 (Output_file_header::do_print_to_mapfile): New function.
4693 (Output_data_const::do_print_to_mapfile): New function.
4694 (class Output_data_const_buffer): Add map_name_ field. Update
4695 constructor. Change all callers. Add do_print_to_mapfile
4696 function.
4697 (class Output_data_fixed_space): Likewise.
4698 (class Output_data_space): Likewise.
4699 (class Output_data_zero_fill): New class.
4700 (Output_data_strtab::do_print_to_mapfile): New function.
4701 (Output_data_reloc_base::do_print_to_mapfile): New function.
4702 (Output_relocatable_relocs::do_print_to_mapfile): New function.
4703 (Output_data_group::do_print_to_mapfile): New function.
4704 (Output_data_got::do_print_to_mapfile): New function.
4705 (Output_data_dynamic::do_print_to_mapfile): New function.
4706 (Output_symtab_xindex::do_print_to_mapfile): New function.
4707 (class Output_section): Declare do_print_to_mapflie. Declare
4708 print_to_mapfile in Input_section.
4709 (class Output_segment): Declare new functions.
4710 * object.h (Sized_relobj::symbol_count): New function.
4711 * script-sections.cc
4712 (Output_section_element_dot_assignment::set_section_addresses):
4713 Change Output_data_fixed_space to Output_data_zero_fill.
4714 (Output_data_expression::do_print_to_mapfile): New function.
4715 * script.cc (read_input_script): Add mapfile parameter. Change
4716 all callers.
4717 * script.h (read_input_script): Update declaration.
4718 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
4719 (Eh_frame::do_print_to_mapfile): New function.
4720 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
4721 (Output_merge_string::do_print_to_mapfile): New function.
4722 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
4723 function.
4724 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
4725 function.
4726 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
4727 function.
4728 * Makefile.am (CCFILES): Add mapfile.cc.
4729 (HFILES): Add mapfile.h.
4730 * Makefile.in: Rebuild.
4731
9f1d377b
ILT
47322008-05-19 Ian Lance Taylor <iant@google.com>
4733
4734 * options.h (class General_options): Add -z relro.
4735 * layout.cc (Layout::Layout): Initialize relro_segment_.
4736 (Layout::add_output_section_data): Return the output section.
4737 (Layout::make_output_section): Rcognize relro sections and mark
4738 them appropriately.
4739 (Layout::attach_allocated_section_to_segment): Put relro sections
4740 in a PT_GNU_RELRO segment.
4741 (Layout::create_initial_dynamic_sections): Mark the .dynamic
4742 section as relro.
4743 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
4744 PT_TLS segments.
4745 (Layout::linkonce_mapping): Map d.rel.ro.local to
4746 .data.rel.ro.local.
4747 (Layout::output_section_name): Us .data.rel.ro.local for any
4748 section which begins with that.
4749 * layout.h (class Layout): Update add_output_section_data
4750 declaration. Add relro_segment_ field.
4751 * output.cc (Output_section::Output_section): Initialize is_relro_
4752 and is_relro_local_ fields.
4753 (Output_segment::add_output_section): Group relro sections.
4754 (Output_segment::is_first_section_relro): New function.
4755 (Output_segment::maximum_alignment): If there is a relro section,
4756 align the segment to the common page size.
4757 (Output_segment::set_section_addresses): Track whether we are
4758 looking at relro sections. If the last section is a relro
4759 section, align to the common page size.
4760 (Output_segment::set_section_list_addresses): Add in_relro
4761 parameter. Change all callers. Align to the page size when
4762 moving from relro to non-relro section.
4763 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
4764 segment.
4765 * output.h (class Output_section): Add is_relro_ and
4766 is_relro_local_ fields.
4767 (Output_section::is_relro): New function.
4768 (Output_section::set_is_relro): New function.
4769 (Output_section::is_relro_local): New function.
4770 (Output_section::set_is_relro_local): New function.
4771 (class Output_segment): Update declarations.
4772 * i386.cc (Target_i386::got_section): Mark .got section as relro.
4773 * sparc.cc (Target_sparc::got_section): Likewise.
4774 * x86_64.cc (Target_x86_64::got_section): Likewise.
4775 * testsuite/relro_test_main.cc: New file.
4776 * testsuite/relro_test.cc: New file.
4777 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
4778 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
4779 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
4780 (relro_test.so, relro_test_pic.o): New targets.
4781 * testsuite/Makefile.in: Rebuild.
4782
a984ee1d
ILT
47832008-05-16 Ian Lance Taylor <iant@google.com>
4784
01676dcd
ILT
4785 * output.cc (Output_segment::add_output_section): Remove front
4786 parameter.
4787 * output.h (class Output_segment): Remove
4788 add_initial_output_section and overloaded add_output_section.
4789 Update declaration of remaining add_output_section.
4790 * layout.cc (Layout::create_interp): Call add_output_section
4791 rather than add_initial_output_section.
4792 (Layout::finish_dynamic_section): Likewise.
4793
497897f9
ILT
4794 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
4795 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
4796 know the dynamic type.
4797 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
4798 field. Initialize it in constructor.
4799 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
4800 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
4801 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
4802 reloc.
4803
a984ee1d
ILT
4804 * output.cc (Output_reloc::get_address): Change return type to
4805 Elf_Addr.
4806 * output.h (class Output_reloc): Update get_address declaration.
4807 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
4808 for section addresses.
4809
55ba0940
ILT
48102008-05-09 Ian Lance Taylor <iant@google.com>
4811
4812 PR 6493
4813 * gold.cc (gold_nomem): Use return value of write.
4814
75517b77
ILT
48152008-05-08 Ian Lance Taylor <iant@google.com>
4816
4817 * symtab.c (Symbol::init_base_output_data): Add version
4818 parameter. Change all callers.
4819 (Symbol::init_base_output_segment): Likewise.
4820 (Symbol::init_base_constant): Likewise.
4821 (Symbol::init_base_undefined): Likewise.
4822 (Sized_symbol::init_output_data): Likewise.
4823 (Sized_symbol::init_output_segment): Likewise.
4824 (Sized_symbol::init_constant): Likewise.
4825 (Sized_symbol::init_undefined): Likewise.
4826 (Symbol_table::do_define_in_output_data): If the new symbol has a
4827 version, mark it as the default.
4828 (Symbol_table::do_define_in_output_segment): Likewise.
4829 (Symbol_table::do_define_as_constant): Likewise.
4830 * symtab.h (class Symbol): Update declarations.
4831 (class Sized_symbol): Likewise.
4832 * resolve.cc (Symbol::override_version): New function.
c42e122e 4833 (Symbol::override_base): Call override_version.
75517b77
ILT
4834 (Symbol::override_base_with_special): Likewise.
4835 * testsuite/ver_script_8.script: New file.
4836 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
4837 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
4838 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
4839 (ver_test_8_1.so, ver_test_8_2.so): New targets.
4840
f1f70eae
ILT
48412008-05-06 Ian Lance Taylor <iant@google.com>
4842
f3e9c5c5
ILT
4843 PR 6049
4844 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
4845 functions.
4846 (class General_options): Remove existing --undefined, and add
4847 --no-undefined instead. Add new --undefined as synonym for -u.
4848 * archive.cc (Archive::add_symbols): Check whether symbol was
4849 named with -u.
4850 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
4851 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
4852 all uses. Add IS_UNDEFINED. Update declarations to split
4853 different versions of init_base. Declare init_base_undefined.
4854 (Symbol::is_defined): Handle IS_UNDEFINED.
4855 (Symbol::is_undefined): Likewise.
4856 (Symbol::is_weak_undefined): Call is_undefined.
4857 (Symbol::is_absolute): Handle IS_CONSTANT.
4858 (class Sized_symbol): Update declarations to split different
4859 versions of init. Declare init_undefined.
4860 (class Symbol_table): Declare new functions.
4861 * symtab.cc (Symbol::init_base_object): Rename from init_base.
4862 Change all callers.
4863 (Symbol::init_base_output_data): Likewise.
4864 (Symbol::init_base_output_segment): Likewise.
4865 (Symbol::init_base_constant): Likewise.
4866 (Symbol::init_base_undefined): New function.
4867 (Sized_symbol::init_object): Rename from init. Change all
4868 callers.
4869 (Sized_symbol::init_output_data): Likewise.
4870 (Sized_symbol::init_output_segment): Likewise.
4871 (Sized_symbol::init_constant): Likewise.
4872 (Sized_symbol::init_undefined): New function.
4873 (Symbol_table::add_undefined_symbols_from_command_line): New
4874 function.
4875 (Symbol_table::do_add_undefined_symbols_from_command_line): New
4876 function.
4877 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
4878 (Symbol::output_section): Likewise.
4879 (Symbol::set_output_section): Likewise.
4880 (Symbol_table::sized_finalize_symbol): Likewise.
4881 (Symbol_table::sized_write_globals): Likewise.
4882 * resolve.cc (Symbol_table::should_override): Likewise.
4883 (Symbol::override_base_with_special): Likewise.
4884
8bdcdf2c
ILT
4885 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
4886 symbol, change it to have default visibility.
4887 * testsuite/protected_1.cc: New file.
4888 * testsuite/protected_2.cc: New file.
4889 * testsuite/protected_3.cc: New file.
4890 * testsuite/protected_main_1.cc: New file.
4891 * testsuite/protected_main_2.cc: New file.
4892 * testsuite/protected_main_3.cc: New file.
4893 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
4894 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
4895 (protected_1_LDFLAGS, protected_1_LDADD): Define.
4896 (protected_1.so): New target.
4897 (protected_1_pic.o, protected_2_pic.o): New targets.
4898 (protected_3_pic.o): New target.
4899 (check_PROGRAMS): Add protected_2.
4900 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
4901 (protected_2_LDFLAGS, protected_2_LDADD): Define.
4902 * testsuite/Makefile.in: Rebuild.
4903
2b706932
ILT
4904 * options.h (DEFINE_var): Add set_user_set_##varname__.
4905 (DEFINE_bool_alias): New macro.
4906 (class General_options): Define -Bstatic using DEFINE_bool_alias
4907 rather than DEFINE_special. Add --undefined as an alias for -z
4908 defs.
4909 * options.cc (General_options::parse_Bstatic): Remove.
4910
d82a5bcc
ILT
4911 * options.h (class General_options): Add --fatal-warnings.
4912 * main.cc (main): Implement --fatal-warnings.
4913 * errors.h (Errors::warning_count): New function.
4914
f1f70eae
ILT
4915 * options.h (class General_options): Add -Bsymbolic-functions.
4916 * symtab.h (Symbol::is_preemptible): Check for
4917 -Bsymbolic-functions.
4918
8825ac63
ILT
49192008-05-05 Ian Lance Taylor <iant@google.com>
4920
d98bc257
ILT
4921 * options.h (DEFINE_bool): For DASH_Z, create the negative option
4922 as noVARNAME rather than no-VARNAME.
4923 (class General_options): Add option -z combreloc.
4924 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
4925 get_address.
4926 (Output_reloc::sort_before) [SHT_REL]: New function.
4927 (Output_reloc::sort_before) [SHT_RELA]: New function.
4928 (class Output_data_reloc_base): Add sort_relocs_ field. Define
4929 Sort_relocs_comparison.
4930 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
4931 parameter. Change all callers.
4932 (Output_data_reloc::Output_data_reloc) [both versions]: Add
4933 sort_relocs parameter. Change all callers.
4934 * output.cc (Output_reloc::get_address): New function, broken out
4935 of write_rel.
4936 (Output_reloc::write_rel): Call it.
4937 (Output_reloc::compare): New function.
4938 (Output_data_reloc_base::do_write): Optionally sort relocs.
4939
60b2b4e7
ILT
4940 * configure.ac: If targ_extra_obj is set, link it in.
4941 * configure.tgt: Initialize all variables.
4942 (x86_64*): Set targ_extra_obj and targ_extra_size.
4943 * configure: Rebuild.
4944
8825ac63
ILT
4945 * object.cc (Sized_relobj::include_section_group): Adjust section
4946 indexes read from group data. Build vector to pass to
4947 layout_group.
4948 * layout.cc (Layout::layout_group): Add flags and shndxes
4949 parameters. Remove contents parameter. Change caller. Update
4950 explicit instantiations.
4951 * layout.h (class Layout): Update layout_group declaration.
4952 * output.cc (Output_data_group::Output_data_group): Add flags and
4953 input_shndxes parameters. Remove contents parameter. Change
4954 caller.
4955 (Output_data_group::do_write): Change input_sections_ to
4956 input_shndxes_.
4957 * output.h (class Output_data_group): Update constructor
4958 declaration. Rename input_sections_ to input_shndxes_.
4959 * testsuite/many_sections_test.cc: Add template.
4960
e94cf127
CC
49612008-04-30 Cary Coutant <ccoutant@google.com>
4962
4418b2d5
CC
4963 * target-reloc.h (relocate_section): Fix dead-pointer bug.
4964
e94cf127
CC
4965 * layout.cc (Layout::include_section): Refactored check for debug
4966 info section.
4967 (Layout::add_comdat): Add new parameters. Change type
4968 of signature parameter. Add object and shndx to signatures table.
4969 (Layout::find_kept_object): New function.
4970 * layout.h: Include <cstring>.
4971 (Layout::is_debug_info_section): New function.
4972 (Layout::add_comdat): Add new parameters.
4973 (Layout::find_kept_object): New function.
4974 (Layout::Kept_section): New struct.
4975 (Layout::Signatures): Change type of map range.
4976 * object.cc (Relobj::output_section_address): New function.
4977 (Sized_relobj::include_section_group): Add new parameters. Change
4978 calls to Layout::add_comdat. Change to build table of kept comdat
4979 groups and table mapping discarded sections to kept sections.
4980 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
4981 (Sized_relobj::do_layout): Change calls to include_section_group and
4982 include_linkonce_section.
4983 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
4984 value to zero when section is discarded.
4985 (Sized_relobj::map_to_kept_section): New function.
4986 * object.h (Relobj::output_section_address): New function.
4987 (Relobj::Comdat_group): New type.
4988 (Relobj::find_comdat_group): New function.
4989 (Relobj::Comdat_group_table): New type.
4990 (Relobj::Kept_comdat_section): New type.
4991 (Relobj::Kept_comdat_section_table): New type.
4992 (Relobj::add_comdat_group): New function.
4993 (Relobj::set_kept_comdat_section): New function.
4994 (Relobj::get_kept_comdat_section): New function.
4995 (Relobj::comdat_groups_): New field.
4996 (Relobj::kept_comdat_sections_): New field.
4997 (Symbol_value::input_value): Update comment.
4998 (Sized_relobj::map_to_kept_section) New function.
4999 (Sized_relobj::include_linkonce_section): Add new parameter.
5000 * target-reloc.h (Comdat_behavior): New type.
5001 (get_comdat_behavior): New function.
5002 (relocate_section): Add code to map a discarded section to the
5003 corresponding kept section when applying a relocation.
5004
e4e5049b
CS
50052008-04-30 Craig Silverstein <csilvers@google.com>
5006
5007 * dwarf_reader.cc (next_generation_count): New static var.
5008 (Addr2line_cache_entry): New struct.
5009 (addr2line_cache): New static var.
5010 (Dwarf_line_info::one_addr2line): Added caching.
5011 (Dwarf_line_info::clear_addr2line_cache): New function.
5012 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
5013 cache-size parameter.
5014 (Dwarf_line_info::one_addr2line_cache): New function.
5015 * symtab.cc (Symbol_table::detect_odr_violations): Pass
5016 new cache-size argument to one_addr2line(), and clear cache.
5017
d09e9154
CC
50182008-04-28 Cary Coutant <ccoutant@google.com>
5019
5020 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
5021 R_386_PC8 relocations.
5022
7ef73768
ILT
50232008-04-23 Ian Lance Taylor <iant@google.com>
5024
55438702
ILT
5025 * object.cc (Sized_relobj::include_section_group): Check for
5026 invalid section group.
5027
c165fb93
ILT
5028 * object.cc (make_elf_object): Correct test for 64-bit ELF file
5029 header size.
5030
7ef73768
ILT
5031 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
5032 than read for file header.
5033 * archive.cc (Archive::include_member): Likewise.
5034
6194aaab
L
50352008-04-23 Paolo Bonzini <bonzini@gnu.org>
5036
5037 * aclocal.m4: Regenerate.
5038 * configure: Regenerate.
5039
d491d34e
ILT
50402008-04-19 Ian Lance Taylor <iant@google.com>
5041
5ea2bac6
ILT
5042 * version.cc (version_string): Bump to 1.6.
5043
7bc3e21a
ILT
5044 * testsuite/Makefile.am (many_sections_r_test): New target.
5045 (many_sections_r_test_SOURCES): Remove.
5046 (many_sections_r_test_DEPENDENCIES): Remove.
5047 (many_sections_r_test_LDFLAGS): Remove.
5048 (many_sections_r_test_LDADD): Remove.
5049
7fcd3aa9
ILT
5050 * object.cc (Sized_relobj::do_add_symbols): Always pass
5051 local_symbol_count_ to add_from_relobj.
5052
4c94d6ae
ILT
5053 * testsuite/Makefile.am (many_sections_check.h): Only check one in
5054 every thousand variables.
5055 * testsuite/Makefile.in: Rebuild.
5056
d491d34e
ILT
5057 * object.cc (Xindex::initialize_symtab_xindex): New function.
5058 (Xindex::read_symtab_xindex): New function.
5059 (Xindex::sym_xindex_to_shndx): New function.
5060 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
5061 available.
5062 (Sized_relobj::do_initialize_xindex): New function.
5063 (Sized_relobj::do_read_symbols): Adjust section links.
5064 (Sized_relobj::symbol_section_and_value): Add is_ordinary
5065 parameter. Change all callers.
5066 (Sized_relobj::include_section_group): Adjust section links and
5067 symbol section indexes.
5068 (Sized_relobj::do_layout): Adjust section links.
5069 (Sized_relobj::do_count_local_symbols): Adjust section links and
5070 symbol section indexes.
5071 (Sized_relobj::do_finalize_local_symbols): Distinguish between
5072 ordinary and special symbols.
5073 (Sized_relobj::write_local_symbols): Add symtab_xindex and
5074 dynsym_xindex parameters. Change all callers. Adjust section
5075 links. Use SHN_XINDEX when needed.
5076 (Sized_relobj::get_symbol_location_info): Adjust section links.
5077 Don't get fooled by special symbols.
5078 * object.h (class Xindex): Define.
5079 (class Object): Add xindex_ parameter. Declare virtual functoin
5080 do_initialize_xindex.
5081 (Object::adjust_sym_shndx): New function.
5082 (Object::set_xindex): New protected function.
5083 (class Symbol_value): Add is_ordinary_shndx_ field.
5084 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
5085 (Symbol_value::value): Assert ordinary section.
5086 (Symbol_value::initialize_input_to_output_map): Likewise.
5087 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
5088 Change all callers.
5089 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
5090 all callers.
5091 (class Sized_relobj): Update declarations.
5092 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
5093 parameter. Change all callers.
5094 (Sized_relobj::adjust_shndx): New function.
5095 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
5096 field.
5097 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
5098 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
5099 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
5100 (Sized_dynobj::read_dynsym_section): Adjust section links.
5101 (Sized_dynobj::read_dynamic): Likewise.
5102 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
5103 section links.
5104 (Sized_dynobj::do_initialize_xindex): New function.
5105 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
5106 do_initialize_xindex.
5107 (Sized_dynobj::adjust_shndx): New function.
5108 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
5109 dynsym_xindex_ fields.
5110 (Layout::finalize): Add a call to set_section_indexes before
5111 creating the symtab sections.
5112 (Layout::set_section_indexes): Don't do anything if the section
5113 already has a section index.
5114 (Layout::create_symtab_sections): Add shnum parameter. Change
5115 caller. Create .symtab_shndx section if needed.
5116 (Layout::create_shdrs): Add shstrtab_section parameter. Change
5117 caller.
5118 (Layout::allocated_output_section_count): New function.
5119 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
5120 needed.
5121 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
5122 fields. Update declarations.
5123 (Layout::symtab_xindex): New function.
5124 (Layout::dynsym_xindex): New function.
5125 (class Write_symbols_task): Add layout_ field.
5126 (Write_symbols_task::Write_symbols_task): Add layout parameter.
5127 Change caller.
5128 * output.cc (Output_section_headers::Output_section_headers): Add
5129 shstrtab_section parameter. Change all callers.
5130 (Output_section_headers::do_sized_write): Store overflow values
5131 for section count and section string table section index in
5132 section header zero.
5133 (Output_file_header::do_sized_write): Check for overflow of
5134 section count and section string table section index.
5135 (Output_symtab_xindex::do_write): New function.
5136 (Output_symtab_xindex::endian_do_write): New function.
5137 * output.h (class Output_section_headers): Add shstrtab_section_.
5138 Update declarations.
5139 (class Output_symtab_xindex): Define.
5140 (Output_section::has_out_shndx): New function.
5141 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
5142 field.
5143 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
5144 Change all callers.
5145 (Sized_symbol::init): Likewise.
5146 (Symbol::output_section): Check for ordinary symbol.
5147 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
5148 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
5149 callers.
5150 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
5151 Change all callers. Simplify handling of symbols from sections
5152 not included in the link.
5153 (Symbol_table::add_from_dynobj): Handle ordinary symbol
5154 distinction.
5155 (Weak_alias_sorter::operator()): Assert that symbols are
5156 ordinary.
5157 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
5158 distinction.
5159 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
5160 parameters. Change all callers.
5161 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
5162 symbol distinction. Use SHN_XINDEX when needed.
5163 (Symbol_table::write_section_symbol): Add symtab_xindex
5164 parameter. Change all callers.
5165 (Symbol_table::sized_write_section_symbol): Likewise. Use
5166 SHN_XINDEX when needed.
5167 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
5168 declarations.
5169 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
5170 (Symbol::is_defined): Check is_ordinary.
5171 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
5172 (Symbol::is_absolute, Symbol::is_common): Likewise.
5173 (class Sized_symbol): Update declarations.
5174 (class Symbol_table): Update declarations.
5175 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
5176 parameters. Change all callers.
5177 (Sized_symbol::override): Likewise.
5178 (Symbol_table::override): Likewise.
5179 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
5180 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
5181 is_ordinary, and orig_st_shndx parameters. Change all callers.
5182 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
5183 to be in an ordinary section.
5184 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
5185 object and is_ordinary parameters. Change all callers.
5186 (Sized_dwarf_line_info::read_relocs): Add object parameter.
5187 Change all callers. Don't add undefined or non-ordinary symbols
5188 to reloc_map_.
5189 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
5190 Change all callers.
5191 * dwarf_reader.h (class Sized_dwarf_line_info): Update
5192 declarations.
5193 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
5194 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
5195 (Sized_relobj::relocate_sections): Likewise.
5196 * target-reloc.h (scan_relocs): Adjust section symbol index.
5197 (scan_relocatable_relocs): Likewise.
5198 * i386.cc (Scan::local): Check for ordinary symbols.
5199 * sparc.cc (Scan::local): Likewise.
5200 * x86_64.cc (Scan::local): Likewise.
5201 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
5202 to symbol_section_and_value.
5203 * testsuite/many_sections_test.cc: New file.
5204 * testsuite/Makefile.am (BUILT_SOURCES): Define.
5205 (check_PROGRAMS): Add many_sections_test.
5206 (many_sections_test_SOURCES): Define.
5207 (many_sections_test_DEPENDENCIES): Define.
5208 (many_sections_test_LDFLAGS): Define.
5209 (BUILT_SOURCES): Add many_sections_define.h.
5210 (many_sections_define.h): New target.
5211 (BUILT_SOURCES): Add many_sections_check.h.
5212 (many_sections_check.h): New target.
5213 (check_PROGRAMS): Add many_sections_r_test.
5214 (many_sections_r_test_SOURCES): Define.
5215 (many_sections_r_test_DEPENDENCIES): Define.
5216 (many_sections_r_test_LDFLAGS): Define.
5217 (many_sections_r_test_LDADD): Define.
5218 (many_sections_r_test.o): New target.
5219 * testsuite/Makefile.in: Rebuild.
5220
c5818ff1
CC
52212008-04-17 Cary Coutant <ccoutant@google.com>
5222
5223 * errors.cc (Errors::info): New function.
5224 (gold_info): New function.
5225 * errors.h (Errors::info): New function.
5226 * gold.h (gold_info): New function.
5227 * object.cc (Input_objects::add_object): Print trace output.
5228 * options.cc (options::parse_set): New function.
5229 (General_options::parse_wrap): Deleted.
5230 (General_options::General_options): Deleted initializer.
5231 * options.h (options::String_set): New typedef.
5232 (options::parse_set): New function.
5233 (DEFINE_set): New macro.
5234 (General_options::wrap): Changed to use DEFINE_set. Changed
5235 callers of any_wrap_symbols and is_wrap_symbol.
5236 (General_options::trace, General_options::trace_symbol):
5237 New options.
5238 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
5239 (General_options::wrap_symbols_): Deleted.
5240 * symtab.cc (Symbol_table::add_from_object): Print trace output.
5241
b5be4a7c
DM
52422008-04-17 David S. Miller <davem@davemloft.net>
5243
5244 * options.cc (General_options::parse_V): New function.
5245 * options.h: Add entries for -V and -Qy.
5246
155a0dd7
ILT
52472008-04-17 Ian Lance Taylor <iant@google.com>
5248
5249 * common.cc (Symbol_table::allocate_commons): Remove options
5250 parameter. Change caller.
5251 (Symbol_table::do_allocate_commons): Remove options parameter.
5252 Change caller. Just call do_allocate_commons_list twice.
5253 (Symbol_table::do_allocate_commons_list): New function, broken out
5254 of do_allocate_commons.
5255 * common.h (class Allocate_commons_task): Remove options_ field.
5256 Update constructor.
5257 * symtab.cc (Symbol_table::Symbol_table): Initialize
5258 tls_commons_.
5259 (Symbol_table::add_from_object): Put TLS common symbols on
5260 tls_commons_ list.
5261 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
5262 which are IN_OUTPUT_DATA.
5263 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
5264 allocate_commons and do_allocate_commons declarations. Declare
5265 do_allocate_commons_list.
5266 * gold.cc (queue_middle_tasks): Update creation of
5267 Allocate_commons_task to not pass options.
5268 * testsuite/Makefile.am (INCLUDES): Add -I.. .
5269 (TLS_TEST_C_FLAGS): New variable.
5270 (tls_test_c_pic.o): New target.
5271 (tls_test_shared.so): Link in tls_test_c_pic.o.
5272 (tls_test_c_pic_ie.o): New target.
5273 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
5274 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
5275 (tls_test_c.o): New target.
5276 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
5277 (tls_pic_test_LDADD): Likewise.
5278 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
5279 (tls_shared_gd_to_ie_test_LDADD): Likewise.
5280 (tls_test_c_gnu2.o): New target.
5281 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
5282 tls_test_c_gnu2.o.
5283 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
5284 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
5285 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
5286 * testsuite/tls_test.cc: Include "config.h".
5287 (t_last): Call t11_last.
5288 * testsuite/tls_test.h (t11, t11_last): Declare.
5289 * testsuite/tls_test_c.c: New file.
5290 * testsuite/tls_test_main.cc (thread_routine): Call t11.
5291 * configure.ac: Check for OpenMP support.
5292 * configure, config.in, Makefile.in: Rebuild.
5293 * testsuite/Makefile.in: Rebuild.
5294
edfbb029
CC
52952008-04-16 Cary Coutant <ccoutant@google.com>
5296
5297 * i386.cc (Target_i386::define_tls_base_symbol): New function.
5298 (Target_i386::tls_base_symbol_defined_): New field.
5299 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
5300 (Target_i386::Scan::global): Likewise.
5301 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
5302 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
5303 (Target_x86_64::tls_base_symbol_defined_): New field.
5304 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
5305 (Target_x86_64::Scan::global): Likewise.
5306
f3c69fca
CC
53072008-04-16 Cary Coutant <ccoutant@google.com>
5308
5309 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
5310 (Symbol::needs_plt_entry): Allow weak undefined symbols.
5311 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
5312 building shared libraries.
5313 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
5314 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
5315 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
5316 * testsuite/Makefile.in: Rebuild.
5317 * testsuite/weak_undef.h: New file.
5318 * testsuite/weak_undef_file1.cc: Add extra test cases.
5319 * testsuite/weak_undef_file2.cc: Likewise.
5320 * testsuite/weak_undef_test.cc: Likewise.
5321
7c414435
DM
53222008-04-16 David S. Miller <davem@davemloft.net>
5323
32b769e1
DM
5324 * sparc.cc (Target_sparc::Scan): Change from struct to class.
5325 Add issued_non_pic_error_ field. Declare check_non_pic.
5326 (Target_sparc::Scan::check_non_pic): New function.
5327 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
5328 (Target_sparc::Scan::global): Likewise.
5329
11936fb1
DM
5330 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
5331 * configure: Rebuild.
5332
7c414435
DM
5333 * options.h (DEFINE_enable): New macro.
5334 (new_dtags): New enable option.
5335 (initfirst, interpose, loadfltr, nodefaultlib,
5336 nodelete, nodlopen, nodump): New -z options.
5337 * layout.cc (Layout:finish_dynamic_section): If new
5338 dtags enabled, emit DT_RUNPATH. Also, emit a
5339 DT_FLAGS_1 containing any specified -z flags.
5340
85c7bf8b
ILT
53412008-04-16 Ian Lance Taylor <iant@google.com>
5342
12c0daef
ILT
5343 * copy-relocs.cc: New file.
5344 * copy-relocs.h: New file.
5345 * reloc.cc: Remove Copy_relocs code.
5346 * reloc.h: Likewise.
5347 * reloc-types.h (struct Reloc_types) [both versions]: Add
5348 get_reloc_addend_noerror.
5349 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
5350 variants of add_global which take an addend which must be zero.
5351 * i386.cc: Include "copy-relocs.h".
5352 (class Target_i386): Change type of copy_relocs_ to variable,
5353 update initializer.
5354 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
5355 Change all callers.
5356 (Target_i386::do_finalize_sections): Change handling of
5357 copy_relocs_.
5358 * sparc.cc: Include "copy-relocs.h".
5359 (class Target_sparc): Change type of copy_relocs_ to variable,
5360 update initializer.
5361 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
5362 Change all callers.
5363 (Target_sparc::do_finalize_sections): Change handling of
5364 copy_relocs_.
5365 * x86_64.cc: Include "copy-relocs.h".
5366 (class Target_x86_64): Change type of copy_relocs_ to variable,
5367 update initializer.
5368 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
5369 class. Change all callers.
5370 (Target_x86_64::do_finalize_sections): Change handling of
5371 copy_relocs_.
5372 * Makefile.am (CCFILES): Add copy-relocs.cc.
5373 (HFILES): Add copy-relocs.h.
5374
4f4995b6
ILT
5375 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
5376
85c7bf8b
ILT
5377 * testsuite/script_test_4.sh: Permit leading zeroes.
5378
4f2a9edd
ILT
53792008-04-15 Ian Lance Taylor <iant@google.com>
5380
e6188289
ILT
5381 * script-sections.cc (Script_sections::create_segments): Use
5382 header_size_adjustment even when there is enough room for the
5383 headers.
5384 * testsuite/script_test_4.sh: New file.
5385 * testsuite/script_test_4.t: New file.
5386 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
5387 (check_DATA): Add script_test_4.stdout.
5388 (MOSTLYCLEANFILES): Likewise.
5389 (script_test_4): New target.
5390 (script_test_4.stdout): New target.
5391 * testsuite/Makefile.in: Rebuild.
5392
4f2a9edd
ILT
5393 * sparc.cc: Add definitions for Output_data_plt_sparc class
5394 constants.
5395
f5314dd5
DM
53962008-04-14 David S. Miller <davem@davemloft.net>
5397
5398 * sparc.cc: New file.
5399 * Makefile.am (TARGETSOURCES): Add sparc.cc
5400 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
5401 * configure.tgt: Document targ_extra_size and
5402 targ_extra_big_endian. Add entries for sparc-* and
5403 sparc64-*.
5404 * configure.ac: Handle targ_extra_size and
5405 targ_extra_big_endian.
5406 * Makefile.in: Rebuild.
5407 * configure: Likewise.
5408 * po/POTFILES.in: Likewise.
5409 * po/gold.pot: Likewise.
5410
154e0e9a
ILT
54112008-04-14 Ian Lance Taylor <iant@google.com>
5412
5413 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
5414 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
5415 in the name/type/flags to section mapping. Don't call
5416 allocate_output_section.
5417 (Layout::choose_output_section): Change parameter from adjust_name
5418 to is_input_section. Don't permit input sections after sections
5419 are attached to segments. Don't call allocate_output_section.
5420 (Layout::layout_eh_frame): Call update_flags_for_input_section,
5421 not write_enable_output_section.
5422 (Layout::make_output_section): Don't push to
5423 unattached_section_list_ nor call attach_to_segment. Call
5424 attach_section_to_segment if sections are attached.
5425 (Layout::attach_sections_to_segments): New function.
5426 (Layout::attach_section_to_segment): New function.
5427 (Layout::attach_allocated_section_to_segment): Rename from
5428 attach_to_segment. Remove flags parameter.
5429 (Layout::allocate_output_section): Remove function.
5430 (Layout::write_enable_output_section): Remove function.
5431 * layout.h (class Layout): Update for above changes. Add new
5432 field sections_are_attached_.
5433 * output.h (Output_section::update_flags_for_input_section): New
5434 function.
5435 * output.cc (Output_section::add_input_section): Call
5436 update_flags_for_input_section.
5437 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
5438
009a67a2
CC
54392008-04-11 Cary Coutant <ccoutant@google.com>
5440
5441 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
5442 thought unnecessary.
5443 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
5444
759b1a24
ILT
54452008-04-11 Ian Lance Taylor <iant@google.com>
5446
5447 * output.h (class Output_section_data): Remove inline definition
5448 of set_addralign.
5449 * output.cc (Output_section_data::set_addralign): New function.
5450
c2b45e22
CC
54512008-04-11 Cary Coutant <ccoutant@google.com>
5452
5453 Add support for TLS descriptors for i386 and x86_64.
5454 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
5455 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
5456 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
5457 GOT_TYPE_TLS_DESC.
5458 (Target_i386::got_mod_index_entry): Remove unnecessary code.
5459 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
5460 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
5461 relocations.
5462 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
5463 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
5464 Fix problem with initial-exec relocations.
5465 (Target_i386::Relocate::relocate_tls): Likewise.
5466 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
5467 relaxation.
5468 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
5469 support for section-plus-offset dynamic table entries.
5470 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
5471 (Output_data_dynamic::Dynamic_entry): Add support for
5472 section-plus-offset dynamic table entries.
5473 (Output_data_dynamic::Classification): Likewise.
5474 (Output_data_dynamic::classification_): Renamed offset_.
5475 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
5476 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
5477 (Target_x86_64::make_plt_section): New function.
5478 (Target_x86_64::reserve_tlsdesc_entries): New function.
5479 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
5480 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
5481 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
5482 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
5483 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
5484 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
5485 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
5486 add extra PLT entry for TLS descriptors.
5487 (Output_data_plt_x86_64::got_): New field.
5488 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
5489 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
5490 fields.
5491 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
5492 descriptors.
5493 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
5494 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
5495 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
5496 R_386_TLS_DESC_CALL relocations.
5497 (Target_x86_64::Scan::global): Likewise.
5498 (Target_x86_64::do_finalize_sections): Add dynamic table entries
5499 for TLS descriptors.
5500 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
5501 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
5502 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
5503 GD-to-IE relaxation.
5504 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
5505 and TLS_DESCRIPTORS.
5506 * Makefile.in: Rebuild.
5507 * configure: Rebuild.
5508 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
5509 (tls_test_shared2.so): New target.
5510 (tls_shared_gd_to_ie_test_SOURCES): New variable.
5511 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
5512 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
5513 (tls_shared_gd_to_ie_test_LDADD): New variable.
5514 (tls_shared_gnu2_gd_to_ie_test): New target.
5515 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
5516 New targets.
5517 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
5518 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
5519 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
5520 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
5521 (tls_shared_gnu2_test): New target.
5522 (tls_test_gnu2_shared.so): New target.
5523 (tls_shared_gnu2_test_SOURCES): New variable.
5524 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
5525 (tls_shared_gnu2_test_LDFLAGS): New variable.
5526 (tls_shared_gnu2_test_LDADD): New variable.
5527 * testsuite/Makefile.in: Rebuild.
5528 * testsuite/Makefile.
5529
83bfb6b7
ILT
55302008-04-11 Ian Lance Taylor <iant@google.com>
5531
5532 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
5533 justsyms.t.
5534 * testsuite/Makefile.in: Rebuild.
5535
5536 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
5537 long.
5538 * testsuite/script_test_2.cc (main): Adjust test.
5539
706e1f5e
ILT
55402008-04-11 David S. Miller <davem@davemloft.net>
5541 Ian Lance Taylor <iant@google.com>
5542
5543 * options.h (General_options): Add entries for '-Y' and
5544 '-relax'.
5545 * options.cc (General_options:finalize): If -Y was used, add those
5546 entries to the library path instead of the default "/lib" and
5547 "/usr/lib".
5548
7c98e6bb
DM
55492008-04-11 David S. Miller <davem@davemloft.net>
5550
5551 * testsuite/justsyms.t: Start at 0x100.
5552 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
5553 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
5554 long.
5555 * testsuite/script_test_2.cc: Adjust string and section length
5556 checks.
7c98e6bb 5557
99a37bfd
ILT
55582008-04-09 Ian Lance Taylor <iant@google.com>
5559
2cefc357
ILT
5560 PR gold/5996
5561 * script-sections.cc (Sections_element::allocate_to_segment): Add
5562 orphan parameter.
5563 (Output_section_definition::allocate_to_segment): Likewise.
5564 (Orphan_output_section::allocate_to_segment): Likewise.
5565 (Script_sections::attach_sections_using_phdrs_clause): Don't
5566 propagate non-PT_LOAD segments to orphan sections.
5567 * testsuite/Makefile.am (script_test_3.stdout): Generate using
5568 readelf rather than objdump.
5569 * testsuite/script_test_3.sh: Adjust accordingly. Test that
5570 .interp section and PT_INTERP segment are the same size.
5571 * testsuite/Makefile.in: Rebuild.
5572
99a37bfd
ILT
5573 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
5574 aliases for symbols defined in the same object.
5575 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
5576 (weak_alias_test_SOURCES): New variable.
5577 (weak_alias_test_DEPENDENCIES): New variable.
5578 (weak_alias_test_LDFLAGS): New variable.
5579 (weak_alias_test_LDADD): New variable.
5580 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
5581 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
5582 (weak_alias_test_3.o): New target.
5583 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
5584 * testsuite/weak_alias_test_main.cc: New file.
5585 * testsuite/weak_alias_test_1.cc: New file.
5586 * testsuite/weak_alias_test_2.cc: New file.
5587 * testsuite/weak_alias_test_3.cc: New file.
5588
780e49c5
ILT
55892008-04-08 Ian Lance Taylor <iant@google.com>
5590
cdb0b8f5
ILT
5591 * options.h (class General_options): Add --noinhibit-exec option.
5592 * main.cc (main): Check --noinhibit-exec.
5593
0864d551
ILT
5594 * options.h (class General_options): Define --wrap as a special
5595 option. Add wrap_symbols_ field.
5596 (General_options::any_wrap_symbols): New function.
5597 (General_options::is_wrap_symbol): New function.
5598 * options.cc (General_options::parse_wrap): New function.
5599 (General_options::General_options): Initialize wrap_symbols_.
5600 * symtab.cc (Symbol_table::wrap_symbol): New function.
5601 (Symbol_table::add_from_object): Handle --wrap.
5602 * symtab.h (class Symbol_table): Declare wrap_symbol.
5603 * target.h (Target::wrap_char): New function.
5604 (Target::Target_info): Add wrap_char field.
5605 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
5606 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
5607 * testsuite/testfile.cc (Target_test::test_target_info):
5608 Likewise.
5609
789aa6de
ILT
5610 * errors.cc (Errors::undefined_symbol): Mention symbol version if
5611 there is one.
5612
2c38906f
ILT
5613 * layout.h (class Layout): Add added_eh_frame_data_ field.
5614 * layout.cc (Layout::Layout): Initialize new field.
5615 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
5616 output section until we find a section we merged successfully.
5617 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
5618 that the size be non-zero.
5619
780e49c5
ILT
5620 * merge.cc (Object_merge_map::get_output_offset): Remove inline
5621 qualifier.
5622
7fcd0256
ILT
56232008-04-08 Craig Silverstein <csilvers@google.com>
5624
5625 * configure.ac: Export new conditional variable HAVE_ZLIB.
5626 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
5627 on HAVE_ZLIB.
5628 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
5629 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
5630
6835af53
ILT
56312008-04-07 Ian Lance Taylor <iant@google.com>
5632
e24f324c
ILT
5633 * version.cc (version_string): Set to "1.5".
5634
a036edd8
ILT
5635 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
5636 Add issued_non_pic_error_ field. Declare check_non_pic.
5637 (Target_x86_64::Scan::check_non_pic): New function.
5638 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
5639 (Target_x86_64::Scan::global): Likewise.
5640
624f8810
ILT
5641 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
5642 addend parameter. Change caller. Handle merge sections.
5643 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
5644 Address to Addend. Don't add in the result of
5645 local_section_offset, pass down the addend and use the returned
5646 value.
5647 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
5648 Update declarations of local_section_offset and symbol_value.
5649 * testsuite/two_file_test_1.cc (t18): New function.
5650 * testsuite/two_file_test_2.cc (f18): New function.
5651 * testsuite/two_file_test_main.cc (main): Call t18.
5652 * testsuite/two_file_test.h (t18, f18): Declare.
5653
6835af53
ILT
5654 * configure.ac: Don't test for objdump, c++filt, or readelf.
5655 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
5656 conditionals.
5657 (TEST_READELF): New variable.
5658 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
5659 (check_PROGRAMS): Add two_file_strip_test.
5660 (two_file_strip_test): New target.
5661 (check_PROGRAMS): Add two_file_same_shared_strip_test.
5662 (two_file_same_shared_strip_test_SOURCES): New variable.
5663 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
5664 (two_file_same_shared_strip_test_LDFLAGS): New variable.
5665 (two_file_same_shared_strip_test_LDADD): New variable.
5666 (two_file_shared_strip.so): New target.
5667 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
5668 (ver_test_5.syms, ver_test_7.syms): Likewise.
5669 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
5670 (strip_test_3.stdout): Use TEST_OBJDUMP.
5671 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
5672
86925eef
CC
56732008-04-04 Cary Coutant <ccoutant@google.com>
5674
5675 * symtab.h (Symbol::is_weak_undefined): New function.
5676 (Symbol::is_strong_undefined): New function.
5677 (Symbol::is_absolute): New function.
5678 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
5679 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
5680 absolute symbols.
5681 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
5682 (weak_undef_test): New target.
5683 * testsuite/Makefile.in: Rebuild.
5684 * testsuite/weak_undef_file1.cc: New file.
5685 * testsuite/weak_undef_file2.cc: New file.
5686 * testsuite/weak_undef_test.cc: New file.
5687
126f3ece
ILT
56882008-04-03 Craig Silverstein <csilvers@google.com>
5689
5690 * compressed_output.h (class Output_compressed_section): Use
5691 unsigned buffer.
5692 * compressed_output.cc (zlib_compress): Use unsigned buffers,
5693 add zlib header.
5694 (zlib_compressed_suffix): Removed.
5695 (Output_compressed_section::set_final_data_size): Use unsigned
5696 buffers.
5697 * testsuite/Makefile.am (flagstest_compress_debug_sections):
5698 Fix linker invocation.
5699 (flagstest_o_specialfile_and_compress_debug_sections):
5700 Likewise.
5701 * testsuite/Makefile.in: Regenerated.
5702
deae2a14
DM
57032008-04-02 David S. Miller <davem@davemloft.net>
5704
5705 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
5706 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
5707
70752818
ILT
57082008-04-02 Craig Silverstein <csilvers@google.com>
5709
5710 * TODO: New file.
5711
39d0cb0e
ILT
57122008-04-02 Ian Lance Taylor <iant@google.com>
5713
5714 * fileread.cc (File_read::find_view): Add byteshift and vshifted
5715 parameters. Update for new key type to views_. Change all
5716 callers.
5717 (File_read::read): Adjust for byteshift in returned view.
5718 (File_read::add_view): New function, broken out of
5719 find_and_make_view.
5720 (File_read::make_view): New function, broken out of
5721 find_and_make_view.
5722 (File_read::find_or_make_view): Add offset and aligned
5723 parameters. Rewrite accordingly. Change all callers.
5724 (File_read::get_view): Add offset and aligned parameters. Adjust
5725 for byteshift in return value.
5726 (File_read::get_lasting_view): Likewise.
5727 * fileread.h (class File_read): Update declarations.
5728 (class File_read::View): Add byteshift_ field. Add byteshift to
5729 constructor. Add byteshift method.
5730 * archive.h (Archive::clear_uncached_views): New function.
5731 (Archive::get_view): Add aligned parameter. Change all callers.
5732 * object.h (Object::get_view): Add aligned parameter. Change all
5733 callers.
5734 (Object::get_lasting_view): Likewise.
5735
5736 * fileread.cc (File_read::release): Don't call clear_views if
5737 there are multiple objects.
5738 * fileread.h (File_read::clear_uncached_views): New function.
5739 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
5740 on the archive.
5741
a1207466
CC
57422008-03-31 Cary Coutant <ccoutant@google.com>
5743
5744 Add thin archive support.
5745 * archive.cc (Archive::armagt): New const.
5746 (Archive::setup): Remove task parameter and calls to unlock.
5747 (Archive::unlock_nested_archives): New function.
5748 (Archive::read_header): Add nested_off parameter. Change
5749 all callers.
5750 (Archive::interpret_header): Likewise.
5751 (Archive::include_all_members): Change to handle thin
5752 archives.
5753 (Archive::include_member): Likewise.
5754 * archive.h (Archive::Archive): Add new parameters and
5755 initializers.
5756 (Archive::armagt): New const.
5757 (Archive::setup): Remove task parameter.
5758 (Archive::unlock_nested_archives): New function.
5759 (Archive::read_header): Add nested_off parameter.
5760 (Archive::interpret_header): Likewise.
5761 (Archive::Nested_archive_table): New typedef.
5762 (Archive::is_thin_archive_): New field.
5763 (Archive::nested_archives_): New field.
5764 (Archive::options_): New field.
5765 (Archive::dirpath_): New field.
5766 (Archive::task_): New field.
5767 * readsyms.cc (Read_symbols::do_read_symbols): Add check
5768 for thin archives. Pass additional parameters to
5769 Archive::Archive. Unlock the archive file after calling
5770 Archive::setup.
cd536b21 5771
479f6503
ILT
57722008-03-29 Ian Lance Taylor <iant@google.com>
5773
686c8caf
ILT
5774 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
5775 version symbol to be local.
5776 * testsuite/ver_test_4.sh: New file.
5777 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
5778 (check_DATA): Add ver_test_4.syms.
5779 (ver_test_4.syms): New target.
5780 * testsuite/Makefile.in: Rebuild.
5781
ab794b6b
ILT
5782 * output.cc
5783 (Output_section::Input_section_sort_entry::has_priority): New
5784 function.
5785 (Output_section::Input_section_sort_entry::match_file_name): New
5786 function.
5787 (Output_section::Input_section_sort_entry::match_section_name):
5788 Remove.
5789 (Output_section::Input_section_sort_entry::match_section_name_prefix):
5790 Remove.
5791 (Output_section::Input_section_sort_entry::match_section_file):
5792 Remove.
5793 (Output_section::Input_section_sort_compare::operator()): Rewrite
5794 using new Input_section_sort_entry functions. Sort crtbegin and
5795 crtend first. Sort sections with no priority before sections with
5796 a priority.
5797 * testsuite/initpri1.c (d3): Check j != 4.
5798 (cd5): New constructor/destructor function.
5799 (main): Check j != 2.
5800
479f6503
ILT
5801 * symtab.cc (Symbol_table::add_from_object): If we don't use the
5802 new symbol when resolving, don't call set_is_default.
5803 * testsuite/ver_test_7.cc: New file.
5804 * testsuite/ver_test_7.sh: New file.
5805 * testsuite/Makefile.am (ver_test_7.so): New target.
5806 (ver_test_7.o): New target.
5807 (check_SCRIPTS): Add ver_test_7.sh.
5808 (check_DATA): Add ver_test_7.syms.
5809 (ver_test_7.syms): New target.
5810
2fd32231
ILT
58112008-03-28 Ian Lance Taylor <iant@google.com>
5812
5813 * layout.cc (Layout::layout): If we see an input section with a
5814 name that needs sorting, set the must_sort flag for the output
5815 section.
5816 (Layout::make_output_section): If the name of the output section
5817 indicates that it might require sorting, set the may_sort flag.
5818 * output.h (Output_section::may_sort_attached_input_sections): New
5819 function.
5820 (Output_section::set_may_sort_attached_input_sections): New
5821 function.
5822 (Output_section::must_sort_attached_input_sections): New
5823 function.
5824 (Output_section::set_must_sort_attached_input_sections): New
5825 function.
5826 (class Output_section): Declare Input_section_sort_entry. Define
5827 Input_section_sort_compare. Declare
5828 sort_attached_input_sections. Add new fields:
5829 may_sort_attached_input_sections_,
5830 must_sort_attached_input_sections_,
5831 attached_input_sections_are_sorted_.
5832 * output.cc (Output_section::Output_section): Initialize new
5833 fields.
5834 (Output_section::add_input_section): Add an entry to
5835 input_sections_ if may_sort or must_sort are true.
5836 (Output_section::set_final_data_size): Call
5837 sort_attached_input_sections if necessary.
5838 (Output_section::Input_section_sort_entry): Define new class.
5839 (Output_section::Input_section_sort_compare::operator()): New
5840 function.
5841 (Output_section::sort_attached_input_sections): New function.
5842 * configure.ac: Check whether the compiler supports constructor
5843 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
5844 * testsuite/initpri1.c: New file.
5845 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
5846 CONSTRUCTOR_PRIORITY.
5847 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
5848 (initpri1_LDFLAGS): New variable.
5849 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
5850
18e6b24e
ILT
58512008-03-27 Ian Lance Taylor <iant@google.com>
5852
49bdd526
ILT
5853 * common.cc (Sort_commons::operator): Correct sorting algorithm.
5854 * testsuite/common_test_1.c: New file.
5855 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
5856 (common_test_1_SOURCES): New variable.
5857 (common_test_1_DEPENDENCIES): New variable.
5858 (common_test_1_LDFLAGS): New variable.
5859
18e6b24e
ILT
5860 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
5861 and commons_ correctly when NAME/VERSION does not override
5862 NAME/NULL.
5863 * testsuite/ver_test_6.c: New file.
5864 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
5865 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
5866 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
5867
04bf7072
ILT
58682008-03-26 Ian Lance Taylor <iant@google.com>
5869
5871526f
ILT
5870 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
5871 of an undefined symbol from a version script.
5872 * testsuite/Makefile.am (ver_test_5.so): New target.
5873 (ver_test_5.o): New target.
5874 (check_SCRIPTS): Add ver_test_5.sh.
5875 (check_DATA): Add ver_test_5.syms.
5876 (ver_test_5.syms): New target.
5877 * testsuite/ver_test_5.cc: New file.
5878 * testsuite/ver_test_5.script: New file.
5879 * testsuite/ver_test_5.sh: New file.
5880 * Makefile.in, testsuite/Makefile.in: Rebuild.
5881
04bf7072
ILT
5882 PR gold/5986
5883 Fix problems building gold with gcc 4.3.0.
5884 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
5885 (gold_error_at_location, gold_warning_at_location): Use it.
5886 * configure.ac: Check whether we can compile and use a template
5887 function with a printf attribute.
5888 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
5889 when jumping over bytes.
5890 * object.cc: Instantiate Object::read_section_data.
5891 * debug.h: Include <cstring>
5892 * dwarf_reader.cc: Include <algorithm>
5893 * main.cc: Include <cstring>.
5894 * options.cc: Include <cstring>.
5895 * output.cc: Include <cstring>.
5896 * script.cc: Include <cstring>.
5897 * script.h: Include <string>.
5898 * symtab.cc: Include <cstring> and <algorithm>.
5899 * target-select.cc: Include <cstring>.
5900 * version.cc: Include <string>.
5901 * testsuite/testmain.cc: Include <cstdlib>.
5902 * configure, config.in: Rebuild.
5903
874c5b28
ILT
59042008-03-25 Ian Lance Taylor <iant@google.com>
5905
819d6c3a
ILT
5906 * options.cc: Include "../bfd/bfdver.h".
5907 (options::help): Print bug reporting address.
5908
f4b2c6f5
ILT
5909 * version.cc (print_version): Adjust output for current value of
5910 BFD_VERSION_STRING.
5911
5912 * NEWS: New file.
5913
e96caa79
ILT
5914 * options.cc (options::help): Print list of supported targets.
5915 * target-select.h: Include <vector>.
5916 (class Target_selector): Make machine_, size_, and is_big_endian_
5917 fields const. Add bfd_name_ and instantiated_target_ fields.
5918 (Target_selector::Target_selector): Add bfd_name parameter.
5919 (Target_selector::recognize): Make non-virtual, call
5920 do_recognize.
5921 (Target_selector::recognize_by_name): Make non-virtual, call
5922 do_recognize_by_name.
5923 (Target_selector::supported_names): New function.
5924 (Target_selector::bfd_name): New function.
5925 (Target_selector::do_instantiate_target): New pure virtual
5926 function.
5927 (Target_selector::do_recognize): New virtual function.
5928 (Target_selector::do_recognize_by_name): New virtual function.
5929 (Target_selector::instantiate_target): New private function.
5930 (supported_target_names): Declare.
5931 * target-select.cc (Target_selector::Target_selector): Update for
5932 new parameter and fields.
5933 (select_target_by_name): Check that the name matches before
5934 calling recognize_by_name.
5935 (supported_target_names): New function.
5936 * i386.cc (class Target_selector_i386): Update Target_selector
5937 constructor call. Remove recognize and recognize_by_name. Add
5938 do_instantiate_target.
5939 * x86_64.cc (class Target_selector_x86_64): Likewise.
5940 * testsuite/testfile.cc (class Target_selector_test): Update for
5941 changes to Target_selector.
5942
874c5b28
ILT
5943 * README: Rewrite, with some notes on unsupported features.
5944
0a65a3a7
CC
59452008-03-24 Cary Coutant <ccoutant@google.com>
5946
5947 * i386.cc (Target_i386::Got_type): New enum declaration.
5948 (Target_i386::Scan::local): Updated callers of Output_data_got
5949 member functions.
5950 (Target_i386::Scan::global): Likewise.
5951 (Target_i386::Relocate::relocate): Likewise.
5952 (Target_i386::Relocate::relocate_tls): Likewise.
5953 * object.h (Got_offset_list): New class.
5954 (Sized_relobj::local_has_got_offset): Added got_type parameter.
5955 (Sized_relobj::local_got_offset): Likewise.
5956 (Sized_relobj::set_local_got_offset): Likewise.
5957 (Sized_relobj::local_has_tls_got_offset): Removed.
5958 (Sized_relobj::local_tls_got_offset): Removed.
5959 (Sized_relobj::set_local_tls_got_offset): Removed.
5960 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
5961 * output.cc (Output_data_got::add_global): Added got_type parameter.
5962 (Output_data_got::add_global_with_rel): Likewise.
5963 (Output_data_got::add_global_with_rela): Likewise.
5964 (Output_data_got::add_global_pair_with_rel): New function.
5965 (Output_data_got::add_global_pair_with_rela): New function.
5966 (Output_data_got::add_local): Added got_type parameter.
5967 (Output_data_got::add_local_with_rel): Likewise.
5968 (Output_data_got::add_local_with_rela): Likewise.
5969 (Output_data_got::add_local_pair_with_rel): New function.
5970 (Output_data_got::add_local_pair_with_rela): New function.
5971 (Output_data_got::add_global_tls): Removed.
5972 (Output_data_got::add_global_tls_with_rel): Removed.
5973 (Output_data_got::add_global_tls_with_rela): Removed.
5974 (Output_data_got::add_local_tls): Removed.
5975 (Output_data_got::add_local_tls_with_rel): Removed.
5976 (Output_data_got::add_local_tls_with_rela): Removed.
5977 * output.h (Output_data_got::add_global): Added got_type parameter.
5978 (Output_data_got::add_global_with_rel): Likewise.
5979 (Output_data_got::add_global_with_rela): Likewise.
5980 (Output_data_got::add_global_pair_with_rel): New function.
5981 (Output_data_got::add_global_pair_with_rela): New function.
5982 (Output_data_got::add_local): Added got_type parameter.
5983 (Output_data_got::add_local_with_rel): Likewise.
5984 (Output_data_got::add_local_with_rela): Likewise.
5985 (Output_data_got::add_local_pair_with_rel): New function.
5986 (Output_data_got::add_local_pair_with_rela): New function.
5987 (Output_data_got::add_global_tls): Removed.
5988 (Output_data_got::add_global_tls_with_rel): Removed.
5989 (Output_data_got::add_global_tls_with_rela): Removed.
5990 (Output_data_got::add_local_tls): Removed.
5991 (Output_data_got::add_local_tls_with_rel): Removed.
5992 (Output_data_got::add_local_tls_with_rela): Removed.
5993 * resolve.cc (Symbol::override_base_with_special): Removed
5994 reference to has_got_offset_ field.
5995 * symtab.cc (Symbol::init_fields): Replaced initialization
5996 of got_offset_ with got_offsets_. Removed initialization
5997 of has_got_offset_
53fcba31 5998 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
5999 (Symbol::got_offset): Likewise.
6000 (Symbol::set_got_offset): Likewise.
6001 (Symbol::has_tls_got_offset): Removed.
6002 (Symbol::tls_got_offset): Removed.
6003 (Symbol::set_tls_got_offset): Removed.
6004 (Symbol::got_offset_): Removed.
6005 (Symbol::tls_mod_got_offset_): Removed.
6006 (Symbol::tls_pair_got_offset_): Removed.
6007 (Symbol::got_offsets_): New field.
6008 (Symbol::has_got_offset): Removed.
6009 (Symbol::has_tls_mod_got_offset): Removed.
6010 (Symbol::has_tls_pair_got_offset): Removed.
6011 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
6012 (Target_x86_64::Scan::local): Updated callers of Output_data_got
6013 member functions.
6014 (Target_x86_64::Scan::global): Likewise.
6015 (Target_x86_64::Relocate::relocate): Likewise.
6016 (Target_x86_64::Relocate::relocate_tls): Likewise.
6017
bd52eafb
BE
60182008-03-25 Ben Elliston <bje@au.ibm.com>
6019
6020 * yyscript.y: Fix spelling error in comment.
6021
8b105e34
ILT
60222008-03-24 Ian Lance Taylor <iant@google.com>
6023
8ed814a9
ILT
6024 * options.h (class General_options): Define build_id option.
6025 * layout.h (class Layout): Declare write_build_id, create_note,
6026 create_build_id. Add build_id_note_ member.
6027 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
6028 "libiberty.h", "md5.h", "sha1.h".
6029 (Layout::Layout): Initialize eh_frame_data_,
6030 eh_frame_hdr_section_, and build_id_note_.
6031 (Layout::finalize): Call create_build_id.
6032 (Layout::create_note): New function, broken out of
6033 Layout::create_gold_note.
6034 (Layout::create_gold_note): Call create_note.
6035 (Layout::create_build_id): New function.
6036 (Layout::write_build_id): New function.
6037 (Close_task_runner::run): Call write_build_id.
6038
8b105e34
ILT
6039 * x86_64.cc: Correct license to GPLv3.
6040
086a1841
ILT
60412008-03-23 Ian Lance Taylor <iant@google.com>
6042
6043 * options.cc: Include "demangle.h".
6044 (parse_optional_string): New function.
6045 (parse_long_option): Handle takes_optional_argument.
6046 (parse_short_option): Update dash_z initializer. Handle
6047 takes_optional_argument.
6048 (General_options::General_options): Initialize do_demangle_.
6049 (General_options::finalize): Set do_demangle_. Handle demangling
6050 style.
6051 * options.h (parse_optional_string): Declare.
6052 (struct One_option): Add optional_arg field. Update constructor.
6053 Update call constructor calls. Add takes_optional_argument
6054 function.
6055 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
6056 (DEFINE_optional_string): Define.
6057 (General_options::demangle): Change from DEFINE_bool to
6058 DEFINE_optional_string.
6059 (General_options::no_demangle): New function.
6060 (General_options::do_demangle): New function.
6061 (General_options::set_do_demangle): New function.
6062 (General_options::execstack_status_): Move definition to end of
6063 class definition.
6064 (General_options::static_): Likewise.
6065 (General_options::do_demangle_): New field.
6066 * object.cc (big_endian>::get_symbol_location_info): Call
6067 Options::do_demangle, not Options::demangle.
6068 * symtab.cc (demangle): Likewise.
6069
cbb93e63
ILT
60702008-03-22 Ian Lance Taylor <iant@google.com>
6071
6072 * gold.h: Include <cstddef> and <sys/types.h>
6073 * options.h: Include <cstring>.
6074
ec531623
ILT
60752008-03-21 Ian Lance Taylor <iant@google.com>
6076
6077 * Added source code to GNU binutils.
This page took 0.364129 seconds and 4 git commands to generate.