daily update
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
07a60597
ILT
12011-07-01 Ian Lance Taylor <iant@google.com>
2
3 PR gold/12571
4 * options.h (class General_options): Add
5 --ld-generated-unwind-info.
6 * ehframe.cc (Fde::write): Add address parameter. Change all
7 callers. If associated with PLT, fill in address and size.
8 (Cie::set_output_offset): Only add merge mapping if there is an
9 object.
10 (Cie::write): Add address parameter. Change all callers.
11 (Eh_frame::add_ehframe_for_plt): New function.
12 * ehframe.h (class Fde): Update declarations. Move shndx_ and
13 input_offset_ fields into union u_, with new plt field.
14 (Fde::Fde): Adjust for new union field.
15 (Fde::Fde) [Output_data version]: New constructor.
16 (Fde::add_mapping): Only add merge mapping if there is an object.
17 (class Cie): Update declarations.
18 (class Eh_frame): Declare add_ehframe_for_plt.
19 * layout.cc (Layout::layout_eh_frame): Break out code into
20 make_eh_frame_section, and call it.
21 (Layout::make_eh_frame_section): New function.
22 (Layout::add_eh_frame_for_plt): New function.
23 * layout.h (class Layout): Update declarations.
24 * merge.cc (Merge_map::add_mapping): Add assertion.
25 * i386.cc: Include "dwarf.h".
26 (class Output_data_plt_i386): Make first_plt_entry,
27 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
28 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
29 and plt_eh_frame_fde.
30 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
31 boundary. Call add_eh_frame_for_plt if appropriate.
32 * x86_64.cc: Include "dwarf.h".
33 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
34 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
35 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
36 and plt_eh_frame_fde.
37 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
38 appropriate.
39
14788a3f
ILT
402011-06-29 Ian Lance Taylor <iant@google.com>
41
42 PR gold/12629
43 * object.cc (Sized_relobj_file::layout_section): Change shdr
44 parameter to be const.
45 (Sized_relobj_file::layout_eh_frame_section): New function, broken
46 out of do_layout.
47 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
48 appropriate. Call layout_eh_frame_section.
49 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
50 sections.
51 * object.h (class Sized_relobj_file): Update declarations.
52
6c21fce1
ILT
532011-06-29 Ian Lance Taylor <iant@google.com>
54
37e41b03 55 PR gold/12652
6c21fce1
ILT
56 * script.cc (Token::integer_value): Accept trailing M/m/K/k
57 modifier.
58 (Lex::gather_token): Accept trailing M/m/K/k for integers.
59
4d5e4e62
ILT
602011-06-29 Ian Lance Taylor <iant@google.com>
61
62 PR gold/12675
63 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
64 SHT_X86_64_UNWIND.
65 * layout.cc (Layout::layout_eh_frame): Likewise.
66
886f533a
ILT
672011-06-29 Ian Lance Taylor <iant@google.com>
68
69 PR gold/12695
70 * layout.cc (Layout::symtab_section_shndx): New function.
71 * layout.h (class Layout): Declare symtab_section_shndx.
72 * output.cc (Output_section::write_header): Call it.
73
f3ae1b28
ILT
742011-06-29 Ian Lance Taylor <iant@google.com>
75
76 PR gold/12818
77 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
78 symbols which are not used in a relocation.
79
aecf301f
ILT
802011-06-28 Ian Lance Taylor <iant@google.com>
81
82 PR gold/12898
83 * layout.cc (Layout::segment_precedes): Don't crash if a linker
84 script create indistinguishable segments.
85 (Layout::set_segment_offsets): Use stable_sort when sorting
86 segments. Pass this to Compare_segments constructor.
87 * layout.h (class Layout): Make segment_precedes non-static.
88 (class Compare_segments): Change from struct to class. Add
89 layout_ field. Add constructor.
90 * script-sections.cc
91 (Script_sections::attach_sections_using_phdrs_clause): Rename
92 local orphan to is_orphan. Don't report failure to put empty
93 section in segment. On attachment failure, report name of
94 section, and attach to first PT_LOAD segment.
95
03ef7571
ILT
962011-06-28 Ian Lance Taylor <iant@google.com>
97
98 PR gold/12934
99 * target-select.cc (Target_selector::Target_selector): Add
100 emulation parameter. Change all callers.
101 (select_target_by_bfd_name): Rename from select_target_by_name.
102 Change all callers.
103 (select_target_by_emulation): New function.
104 (supported_emulation_names): New function.
105 * target-select.h (class Target_selector): Add emulation_ field.
106 Update declarations.
107 (Target_selector::recognize_by_bfd_name): Rename from
108 recognize_by_name. Change all callers.
109 (Target_selector::supported_bfd_names): Rename from
110 supported_names. Change all callers.
111 (Target_selector::recognize_by_emulation): New function.
112 (Target_selector::supported_emulations): New function.
113 (Target_selector::emulation): New function.
114 (Target_selector::do_recognize_by_bfd_name): Rename from
115 do_recognize_by_name. Change all callers.
116 (Target_selector::do_supported_bfd_names): Rename from
117 do_supported_names. Change all callers.
118 (Target_selector::do_recognize_by_emulation): New function.
119 (Target_selector::do_supported_emulations): New function.
120 (select_target_by_bfd_name): Change name in declaration.
121 (select_target_by_emulation): Declare.
122 (supported_emulation_names): Declare.
123 * parameters.cc (parameters_force_valid_target): Try to find
124 target based on emulation from -m option.
125 * options.h (class General_options): Change doc string for -m.
126 * options.cc (help): Print emulations.
127 (General_options::parse_V): Likewise.
128 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
129 Add emulation parameter. Change all callers.
130
200b2bb9
ILT
1312011-06-28 Ian Lance Taylor <iant@google.com>
132
133 * target.h (class Target): Add osabi_ field.
134 (Target::osabi): New function.
135 (Target::set_osabi): New function.
136 (Target::Target): Initialize osabi_.
137 (Target::do_adjust_elf_header): Make pure virtual.
138 (Sized_target::do_adjust_elf_header): Declare.
139 * target.cc (Sized_target::do_adjust_elf_header): New function.
140 (class Sized_target): Instantiate all versions.
141 * freebsd.h (class Target_freebsd): Remove.
142 (Target_selector_freebsd::do_recognize): Call set_osabi on
143 Target.
144 (Target_selector_freebsd::do_recognize_by_name): Likewise.
145 (Target_selector_freebsd::set_osabi): Remove.
146 * i386.cc (class Target_i386): Inherit from Sized_target rather
147 than Target_freebsd.
148 * x86_64.cc (class Target_x86_64): Likewise.
149
b3ce541e
ILT
1502011-06-28 Ian Lance Taylor <iant@google.com>
151
152 * target.h (Target::can_check_for_function_pointers): Rewrite.
153 Make non-virtual.
154 (Target::can_icf_inline_merge_sections): Likewise.
155 (Target::section_may_have_icf_unsafe_poineters): Likewise.
156 (Target::Target_info): Add can_icf_inline_merge_sections field.
157 (Target::do_can_check_for_function_pointers): New virtual
158 function.
159 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
160 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
161 from can_check_for_function_pointers, move in file.
162 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
163 section_may_have_icf_unsafe_poineters, move in file.
164 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
165 * i386.cc (Target_i386::do_can_check_for_function_pointers):
166 Rename from can_check_for_function_pointers, move in file.
167 (Target_i386::can_icf_inline_merge_sections): Remove.
168 (Target_i386::i386_info): Initialize
169 can_icf_inline_merge_sections.
170 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
171 Initialize can_icf_inline_merge_sections.
172 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
173 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
174 Rename from can_check_for_function_pointers, move in file.
175 (Target_x86_64::can_icf_inline_merge_sections): Remove.
176 (Target_x86_64::x86_64_info): Initialize
177 can_icf_inline_merge_sections.
178 * testsuite/testfile.cc (Target_test::test_target_info):
179 Likewise.
180 * icf.cc (get_section_contents): Correct formatting.
181
6d1c4efb
ILT
1822011-06-27 Ian Lance Taylor <iant@google.com>
183
184 * symtab.cc (Symbol::versioned_name): New function.
185 (Symbol_table::add_to_final_symtab): Use versioned_name when
186 appropriate.
187 (Symbol_table::sized_write_symbol): Likewise.
188 * symtab.h (class Symbol): Declare versioned_name.
189 * stringpool.h (class Stringpool_template): Add variant of add
190 which takes a std::basic_string.
191 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
192 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
193 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
194 (ver_test_12.o): New target.
195 * testsuite/Makefile.in: Rebuild.
196
57eb9b50
DK
1972011-06-27 Doug Kwan <dougkwan@google.com>
198
199 * arm.cc (Arm_relocate_functions::thm_jump8,
200 Arm_relocate_functions::thm_jump11): Use a wider signed
201 type to compute offset.
202 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
203 arm_thm_jump8.
204 * testsuite/Makefile.in: Regenerate.
205 * testsuite/arm_branch_in_range.sh: Check test results of
206 arm_thm_jump11 and arm_thm_jump8.
207 * testsuite/arm_thm_jump11.s: New test source file.
208 * testsuite/arm_thm_jump11.t: New linker script.
209 * testsuite/arm_thm_jump8.s: New test source file.
210 * testsuite/arm_thm_jump8.t: New linker script.
211
487b39df
ILT
2122011-06-24 Ian Lance Taylor <iant@google.com>
213
214 * layout.cc: Include "object.h".
215 (ctors_sections_in_init_array): New static variable.
216 (Layout::is_ctors_in_init_array): New function.
217 (Layout::layout): Add entry to ctors_sections_in_init_array if
218 appropriate.
219 * layout.h (class Layout): Declare is_ctors_in_init_array.
220 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
221 is_ctors_reverse_view is set.
222 (Sized_relobj_file::write_sections): Add layout parameter. Change
223 all callers. Set is_ctors_reverse_view field of View_size.
224 (Sized_relobj_file::reverse_words): New function.
225 * object.h (Sized_relobj_file::View_size): Add
226 is_ctors_reverse_view field.
227 (class Sized_relobj_file): Update declarations.
228 * testsuite/initpri3.c: New test.
229 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
230 initpri3b.
231 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
232 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
233 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
234 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
235 * testsuite/Makefile.in: Rebuild.
236
472076e4
CC
2372011-06-24 Cary Coutant <ccoutant@google.com>
238
239 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
240 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
241 (debug_msg_cdebug.err): New targets.
242 * testsuite/Makefile.in: Regenerate.
243 * testsuite/debug_msg.sh: Check output of link with compressed debug.
244 Fix checks for link with shared library.
245
a60af0db
DK
2462011-06-24 Doug Kwan <dougkwan@google.com>
247
248 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
249 skip empty text sections.
250 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
251
5393d741
ILT
2522011-06-22 Ian Lance Taylor <iant@google.com>
253
254 PR gold/12910
255 * options.h (class General_options): Add --ctors-in-init-array.
256 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
257 friends as SHT_PROGBITS for merging sections.
258 (Layout::layout): Remove special handling of .init_array and
259 friends. Don't sort if doing relocatable link. Sort for .ctors
260 and .dtors if ctors_in_init_array.
261 (Layout::make_output_section): Force correct section types for
262 .init_array and friends. Don't sort if doing relocatable link,
263 Don't sort .ctors and .dtors if ctors_in_init_array.
264 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
265 (Layout::output_section_name): Add relobj parameter. Change all
266 callers. Handle .ctors. and .dtors. in code rather than table.
267 Handle .ctors and .dtors if ctors_in_init_array.
268 (Layout::match_file_name): New function, moved from output.cc.
269 * layout.h (class Layout): Update declarations.
270 * output.cc: Include "layout.h".
271 (Input_section_sort_entry::get_priority): New function.
272 (Input_section_sort_entry::match_file_name): Just call
273 Layout::match_file_name.
274 (Output_section::Input_section_sort_init_fini_compare::operator()):
275 Handle .ctors and .dtors. Sort by explicit priority rather than
276 by name.
277 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
278 * testsuite/initpri2.c: New test.
279 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
280 (check_PROGRAMS): Add initpri2.
281 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
282 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
283 * configure, testsuite/Makefile.in: Rebuild.
284
e1f74f98
ILT
2852011-06-19 Ian Lance Taylor <iant@google.com>
286
287 PR gold/12880
288 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
289 .interp section to a PT_INTERP segment even if we have seen a
290 --dynamic-linker option. Don't do it if we have seen a PHDRS
291 clause in a linker script.
292 (Layout::finalize): Don't create a .interp section if we've
293 already create a PT_INTERP segment.
294 (Layout::create_interp): Always call choose_output_section (revert
295 patch of 2011-06-17). Don't create PT_INTERP segment.
296 * script-sections.cc
297 (Script_sections::create_note_and_tls_segments): Add a .interp
298 section to a PT_INTERP segment even if we have seen a
299 --dynamic-linker option.
300
766f91bb
ILT
3012011-06-18 Ian Lance Taylor <iant@google.com>
302
303 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
304 merely because a non-PT_LOAD segment has a dynamic reloc.
305
0d212c3a
ILT
3062011-06-18 Ian Lance Taylor <iant@google.com>
307
308 * layout.cc (Layout::finish_dynamic_section): Don't create
309 DT_FLAGS entry if not needed.
310
911a5072
ILT
3112011-06-18 Ian Lance Taylor <iant@google.com>
312
313 PR gold/12745
314 * layout.cc (Layout::layout_eh_frame): Correct handling of
315 writable .eh_frame section.
316
534b4e5f
ILT
3172011-06-17 Ian Lance Taylor <iant@google.com>
318
319 PR gold/12893
320 * resolve.cc (Symbol_table::resolve): Don't give an error if a
321 symbol is redefined with the exact same object and value.
322
10b4f102
ILT
3232011-06-17 Ian Lance Taylor <iant@google.com>
324
325 PR gold/12880
326 * layout.h (class Layout): Add interp_segment_ field.
327 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
328 (Layout::attach_allocated_section_to_segment): If making shared
329 library, put .interp section in PT_INTERP segment.
330 (Layout::finalize): Also call create_interp if -dynamic-linker
331 option was used.
332 (Layout::create_interp): Assert that there is no PT_INTERP
333 segment. If not using a SECTIONS clause, use make_output_section.
334 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
335 * script-sections.cc
336 (Script_sections::create_note_and_tls_segments): If making shared
337 library, put .interp section in PT_INTERP segment.
338
a29b0dad
ILT
3392011-06-17 Ian Lance Taylor <iant@google.com>
340
e588ea8d
ILT
341 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
342 when making a shared library.
343
3442011-06-17 Ian Lance Taylor <iant@google.com>
345
346 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
347 parameter. Change all callers. Don't issue warning about PC32
348 against locally defined symbol.
a29b0dad 349
9d3b0698
ILT
3502011-06-16 Ian Lance Taylor <iant@google.com>
351
352 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
353 occurs in same object.
354
85b0f90c
AM
3552011-06-14 Alan Modra <amodra@gmail.com>
356
357 * po/POTFILES.in: Regenerate.
358
a94907d9
ILT
3592011-06-09 Ian Lance Taylor <iant@google.com>
360
361 * script-sections.cc
362 (Orphan_output_section::set_section_addresses): For a relocatable
363 link set address to 0.
364
4fb3a1c3
CC
3652011-06-09 Cary Coutant <ccoutant@google.com>
366
367 PR gold/12804
368 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
369 used with --compress-debug-sections.
370 * gold/object.cc (Sized_relobj_file::do_layout): Report
371 uncompressed size of compressed input sections.
372
61220854
CC
3732011-06-08 Cary Coutant <ccoutant@google.com>
374
375 PR gold/12804
376 * testsuite/two_file_test_2_v1.cc: Change initialization of
377 v2 to keep it in .data.
378
e6455dfb
CC
3792011-06-07 Cary Coutant <ccoutant@google.com>
380
381 * common.cc (Symbol_table::do_allocate_commons_list): Call
382 gold_fallback.
383 * errors.cc (Errors::fatal): Adjust call to gold_exit.
384 (Errors::fallback): New function.
385 (gold_fallback): New function.
386 * errors.h (Errors::fallback): New function.
387 * gold.cc (gold_exit): Change status parameter to enum; adjust
388 all callers.
389 (queue_initial_tasks): Call gold_fallback.
390 * gold.h: Include cstdlib.
391 (Exit_status): New enum type.
392 (gold_exit): Change status parameter to enum.
393 (gold_fallback): New function.
394 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
395 (Layout::create_symtab_sections): Likewise.
396 (Layout::create_shdrs): Likewise.
397 * main.cc (main): Adjust call to gold_exit.
398 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
399 (Output_data_got::add_got_entry_pair): Likewise.
400 (Output_section::add_input_section): Likewise.
401 (Output_section::add_output_section_data): Likewise.
402 (Output_segment::set_section_list_addresses): Likewise.
403 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
404
fb0e076f
CC
4052011-06-07 Cary Coutant <ccoutant@google.com>
406
407 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
408 for incremental links.
409 * output.cc (Output_segment::set_section_list_addresses): Remove
410 FIXME and test for TLS or BSS.
411
a5ee4d5d
CC
4122011-06-07 Cary Coutant <ccoutant@google.com>
413
414 * testsuite/Makefile.am: Add incremental_copy_test,
415 incremental_common_test_1.
416 * testsuite/Makefile.in: Regenerate.
417 * testsuite/common_test_1_v1.c: New source file.
418 * testsuite/common_test_1_v2.c: New source file.
419 * testsuite/copy_test_v1.cc: New source file.
420
5146f448
CC
4212011-06-07 Cary Coutant <ccoutant@google.com>
422
423 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
424 update, allocate common from bss section's free list.
425 * incremental-dump.cc (dump_incremental_inputs): Print flag for
426 linker-defined symbols.
427 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
428 Skip GOT and PLT entries that are no longer referenced.
429 (Output_section_incremental_inputs::write_info_blocks): Mark
430 linker-defined symbols.
431 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
432 * output.cc (Output_section::allocate): New function.
433 * output.h (Output_section::allocate): New function.
434 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
435 linker-defined symbols.
436 (Symbol::override_base_with_special): Copy is_predefined_ flag.
437 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
438 (Symbol::init_base_output_data): Likewise.
439 (Symbol::init_base_output_segment): Likewise.
440 (Symbol::init_base_constant): Likewise.
441 (Sized_symbol::init_output_data): Likewise.
442 (Sized_symbol::init_output_segment): Likewise.
443 (Sized_symbol::init_constant): Likewise.
444 (Symbol_table::do_define_in_output_data): Likewise.
445 (Symbol_table::do_define_in_output_segment): Likewise.
446 (Symbol_table::do_define_as_constant): Likewise.
447 * symtab.h (Symbol::is_predefined): New function.
448 (Symbol::init_base_output_data): Add is_predefined parameter.
449 (Symbol::init_base_output_segment): Likewise.
450 (Symbol::init_base_constant): Likewise.
451 (Symbol::is_predefined_): New data member.
452 (Sized_symbol::init_output_data): Add is_predefined parameter.
453 (Sized_symbol::init_output_segment): Likewise.
454 (Sized_symbol::init_constant): Likewise.
455 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
456
26d3c67d
CC
4572011-06-07 Cary Coutant <ccoutant@google.com>
458
459 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
460 instead of emit_copy_reloc.
461 (Copy_relocs::emit_copy_reloc): Refactor.
462 (Copy_relocs::make_copy_reloc): New function.
463 (Copy_relocs::add_copy_reloc): Remove.
464 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
465 section.
466 (Copy_relocs::make_copy_reloc): New function.
467 (Copy_relocs::add_copy_reloc): Remove.
468 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
469 unchanged input files.
470 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
471 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
472 Reserve BSS space for COPY relocations.
473 (Sized_incremental_binary::do_emit_copy_relocs): New function.
474 (Output_section_incremental_inputs::write_info_blocks): Record
475 whether a symbol is copied from a shared object.
476 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
477 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
478 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
479 (Incremental_input_entry_reader::get_output_symbol_index): Add
480 is_copy parameter.
481 (Incremental_binary::emit_copy_relocs): New function.
482 (Incremental_binary::do_emit_copy_relocs): New function.
483 (Sized_incremental_binary::Sized_incremental_binary): Initialize
484 new data member.
485 (Sized_incremental_binary::add_copy_reloc): New function.
486 (Sized_incremental_binary::do_emit_copy_relocs): New function.
487 (Sized_incremental_binary::Copy_reloc): New struct.
488 (Sized_incremental_binary::Copy_relocs): New typedef.
489 (Sized_incremental_binary::copy_relocs_): New data member.
490 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
491 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
492 * target.h (Sized_target::emit_copy_reloc): New function.
493 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
494
7cdb37d9
CC
4952011-06-02 Cary Coutant <ccoutant@google.com>
496
497 PR gold/12163
498 * gold/archive.cc (Archive::Archive): Initialize new data member.
499 (Archive::include_all_members): Return if archive has already been
500 included.
501 * gold/archive.h (Archive::include_all_members_): New data member.
502
cc643b88
NC
5032011-06-02 Nick Clifton <nickc@redhat.com>
504
505 * dynobj.h: Fix spelling mistake in comment.
506 * output.cc: Likewise.
507
f62a3ca7
DK
5082011-05-31 Doug Kwan <dougkwan@google.com>
509 Asier Llano
510
511 PR gold/12826
cc643b88 512 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
513 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
514 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
515 redundant arm_exidx_test.so.
516 * testsuite/Makefile.in: Regenerate.
517 (check_SCRIPTS): Add pr12826.sh
518 (check_DATA): Add pr12826.stdout
519 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
520 * testsuite/pr12826.sh: New file.
521 * testsuite/pr12826_1.s: Ditto.
522 * testsuite/pr12826_1.s: Ditto.
523
8dbe1edc
ILT
5242011-05-30 Ian Lance Taylor <iant@google.com>
525
526 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
527 sections.
528
c49875be
ILT
5292011-05-29 Ian Lance Taylor <iant@google.com>
530
531 PR gold/12804
532 * testsuite/Makefile.am: Use different file name for two_file_test
533 temporary file for each incremental test.
534 * testsuite/Makefile.in: Rebuild.
535
69d53f7a
ILT
5362011-05-29 Ian Lance Taylor <iant@google.com>
537
538 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
539 binary input file is empty.
540
41d0ab5f
ILT
5412011-05-27 Ian Lance Taylor <iant@google.com>
542
543 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
544 (ver_test_9.so): Likewise.
545 * testsuite/Makefile.in: Rebuild.
546
89d8a36b
CC
5472011-05-26 Cary Coutant <ccoutant@google.com>
548
549 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
550 * incremental.cc (Incremental_inputs::report_input_section): Fix
551 comment, indentation.
552 (Incremental_inputs::report_comdat_group): New function.
553 (Output_section_incremental_inputs::set_final_data_size): Adjust size
554 of data for incremental input file entry.
555 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
556 group count, COMDAT group signatures.
557 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
558 an unchanged input file.
559 * incremental.h (Incremental_object_entry::Incremental_object_entry):
560 Initialize new data member.
561 (Incremental_object_entry::add_comdat_group): New function.
562 (Incremental_object_entry::get_comdat_group_count): New function.
563 (Incremental_object_entry::get_comdat_signature_key): New function.
564 (Incremental_object_entry::groups_): New data member.
565 (Incremental_inputs::report_comdat_group): New function.
566 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
567 data for incremental input file entry.
568 (Incremental_input_entry_reader::get_comdat_group_count): New function.
569 (Incremental_input_entry_reader::get_input_section): Adjust size of
570 data for incremental input file entry.
571 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
572 (Incremental_input_entry_reader::get_comdat_group_signature): New
573 function.
574 * object.cc (Sized_relobj::include_section_group): Report kept
575 COMDAT groups for incremental links.
576
1706a06f
ILT
5772011-05-24 David Meyer <pdox@google.com>
578
579 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
580 with name parameter. Add found_name parameter.
581 * fileread.cc (Input_file::find_file): Adjust code accordingly.
582 * dirsearch.h (class Dirsearch): Update declaration.
583
a10ae760
ILT
5842011-05-24 Ian Lance Taylor <iant@google.com>
585
586 * archive.cc (Library_base::should_include_member): Pull in object
587 from archive if it defines the entry symbol.
588 * parameters.cc (Parameters::entry): New function.
589 * parameters.h (class Parameters): Declare entry.
590 * output.h (class Output_file_header): Remove entry_ field.
591 * output.cc (Output_file_header::Output_file_header): Remove entry
592 parameter. Change all callers.
593 (Output_file_header::entry): Use parameters->entry.
594 * gold.cc (queue_middle_tasks): Likewise.
595 * plugin.cc (Plugin_hook::run): Likewise.
596
aa92d6ed
CC
5972011-05-24 Cary Coutant <ccoutant@google.com>
598
599 * gold.cc (queue_initial_tasks): Pass incremental base filename
600 to Output_file::open_base_file; don't print error message.
601 * incremental-dump.cc (main): Adjust call to
602 Output_file::open_for_modification.
603 * incremental-dump.cc (main): Likewise.
604 * incremental.cc (Incremental_inputs::report_command_line):
605 Ignore --incremental-base option when comparing command lines.
606 Ignore parameter when given as separate argument.
607 * options.h (class General_options): Add --incremental-base.
608 * output.cc (Output_file::Output_file):
609 (Output_file::open_base_file): Add base_name and writable parameters;
610 read base file into new file; print error message here.
611 (Output_file::map_no_anonymous): Add writable parameter; adjust all
612 callers.
613 * output.h (Output_file::open_for_modification): Rename to...
614 (Output_file::open_base_file): ...this; add base_name and
615 writable parameters; adjust all callers.
616 (Output_file::map_no_anonymous): Add writable parameter; adjust all
617 callers.
618 * testsuite/Makefile.am (incremental_test_4): Test
619 --incremental-base.
620 * testsuite/Makefile.in: Regenerate.
621
2eedd706
CC
6222011-05-24 Cary Coutant <ccoutant@google.com>
623
624 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
625 incremental_test_4.
626 * testsuite/Makefile.in: Regenerate.
627 * testsuite/two_file_test_1_v1.cc: New test source file.
628 * testsuite/two_file_test_1b_v1.cc: New test source file.
629 * testsuite/two_file_test_2_v1.cc: New test source file.
630
0f1c85a6
CC
6312011-05-24 Cary Coutant <ccoutant@google.com>
632
633 * dynobj.h (Dynobj::do_dynobj): New function.
634 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
635 flag and soname for shared objects.
636 * incremental.cc (Incremental_inputs::report_object): Make
637 either Incremental_object_entry or Incremental_dynobj_entry; add
638 soname to string table.
639 (Incremental_inputs::report_input_section): Add assertion.
640 (Output_section_incremental_inputs::set_final_data_size): Adjust
641 type of input file entry for shared libraries; adjust size of
642 shared library info entry.
643 (Output_section_incremental_inputs::write_input_files): Write
644 as_needed flag for shared libraries.
645 (Output_section_incremental_inputs::write_info_blocks): Adjust type
646 of input file entry for shared libraries; write soname.
647 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
648 soname from incremental info.
649 * incremental.h (enum Incremental_input_flags): Add
650 INCREMENTAL_INPUT_AS_NEEDED.
651 (Incremental_input_entry::Incremental_input_entry): Initialize new
652 data member.
653 (Incremental_input_entry::set_as_needed): New function.
654 (Incremental_input_entry::as_needed): New function.
655 (Incremental_input_entry::do_dynobj_entry): New function.
656 (Incremental_input_entry::as_needed_): New data member.
657 (Incremental_object_entry::Incremental_object_entry): Don't check
658 for shared library.
659 (Incremental_object_entry::do_type): Likewise.
660 (class Incremental_dynobj_entry): New class.
661 (Incremental_input_entry_reader::as_needed): New function.
662 (Incremental_input_entry_reader::get_soname): New function.
663 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
664 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
665 size of shared library info entry.
666 * layout.cc (Layout::finish_dynamic_section): Don't test for
667 incremental link when adding DT_NEEDED entries.
668 * object.h (Object::Object): Initialize new data member.
669 (Object::dynobj): New function.
670 (Object::set_as_needed): New function.
671 (Object::as_needed): New function.
672 (Object::do_dynobj): New function.
673 (Object::as_needed_): New data member.
674
6fa2a40b
CC
6752011-05-24 Cary Coutant <ccoutant@google.com>
676
677 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
678 info; adjust display of GOT entries.
679 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
680 vector of input objects; remove file_status_.
681 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
682 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
683 got_plt reader; call target hooks to reserve GOT entries.
684 (Output_section_incremental_inputs::set_final_data_size): Adjust size
685 of input file info header and GOT info entry.
686 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
687 relocation info.
688 (Got_plt_view_info::got_descriptor): Remove.
689 (Got_plt_view_info::sym_index): New data member.
690 (Got_plt_view_info::input_index): New data member.
691 (Local_got_offset_visitor::visit): Write input file index.
692 (Global_got_offset_visitor::visit): Write 0 for input file index.
693 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
694 with sym_index and input_index.
695 (Output_section_incremental_inputs::write_got_plt): Adjust size of
696 incremental info GOT entry; replace got_descriptor with input_index.
697 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
698 map from input file index to object.
699 (Sized_relobj_incr::do_layout): Replace direct data member reference
700 with accessor function.
701 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
702 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
703 Adjust size of input file info header.
704 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
705 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
706 (Incremental_input_entry_reader::get_input_section): Adjust size of
707 input file info header.
708 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
709 of incremental info GOT entry.
710 (Incremental_got_plt_reader::get_got_desc): Remove.
711 (Incremental_got_plt_reader::get_got_symndx): New function.
712 (Incremental_got_plt_reader::get_got_input_index): New function.
713 (Sized_incremental_binary::Sized_incremental_binary): Remove
714 file_status_; add input_objects_.
715 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
716 (Sized_incremental_binary::set_file_is_unchanged): Remove.
717 (Sized_incremental_binary::file_is_unchanged): Remove.
718 (Sized_incremental_binary::set_input_object): New function.
719 (Sized_incremental_binary::input_object): New function.
720 (Sized_incremental_binary::file_status_): Remove.
721 (Sized_incremental_binary::input_objects_): New data member.
722 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
723 references.
724 (Sized_relobj_incr::invalid_address): Move to base class.
725 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
726 class.
727 (Sized_relobj_incr::do_output_section_offset): Likewise.
728 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
729 (Sized_relobj_incr::section_offsets_): Likewise.
730 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
731 function.
732 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
733 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
734 with accessor function.
735 (Sized_relobj_file::do_layout): Likewise.
736 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
737 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
738 (Sized_relobj_file::compute_final_local_value): Replace refs to
739 section_offsets_ with accessor function.
740 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
741 * object.h (Relobj::Relobj): Initialize new data members.
742 (Relobj::add_dyn_reloc): New function.
743 (Relobj::first_dyn_reloc): New function.
744 (Relobj::dyn_reloc_count): New function.
745 (Relobj::first_dyn_reloc_): New data member.
746 (Relobj::dyn_reloc_count_): New data member.
747 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
748 references.
749 (Sized_relobj::Address): New typedef.
750 (Sized_relobj::invalid_address): Move here from child class.
751 (Sized_relobj::Sized_relobj): Initialize new data members.
752 (Sized_relobj::sized_relobj): New function.
753 (Sized_relobj::is_output_section_offset_invalid): Move here from
754 child class.
755 (Sized_relobj::get_output_section_offset): Likewise.
756 (Sized_relobj::local_has_got_offset): Likewise.
757 (Sized_relobj::local_got_offset): Likewise.
758 (Sized_relobj::set_local_got_offset): Likewise.
759 (Sized_relobj::do_for_all_local_got_entries): Likewise.
760 (Sized_relobj::clear_got_offsets): New function.
761 (Sized_relobj::section_offsets): Move here from child class.
762 (Sized_relobj::do_output_section_offset): Likewise.
763 (Sized_relobj::do_set_section_offset): Likewise.
764 (Sized_relobj::Local_got_offsets): Likewise.
765 (Sized_relobj::local_got_offsets_): Likewise.
766 (Sized_relobj::section_offsets_): Likewise.
767 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
768 references.
769 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
770 class.
771 (Sized_relobj_file::sized_relobj): New function
772 (Sized_relobj_file::local_has_got_offset): Move to base class.
773 (Sized_relobj_file::local_got_offset): Likewise.
774 (Sized_relobj_file::set_local_got_offset): Likewise.
775 (Sized_relobj_file::get_output_section_offset): Likewise.
776 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
777 (Sized_relobj_file::do_output_section_offset): Likewise.
778 (Sized_relobj_file::do_set_section_offset): Likewise.
779 (Sized_relobj_file::Local_got_offsets): Likewise.
780 (Sized_relobj_file::local_got_offsets_): Likewise.
781 (Sized_relobj_file::section_offsets_): Likewise.
782 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
783 (all constructors).
784 (set_needs_dynsym_index): Convert relobj to derived class pointer.
785 (Output_reloc::get_symbol_index): Likewise.
786 (Output_reloc::local_section_offset): Likewise.
787 (Output_reloc::get_address): Likewise.
788 (Output_reloc::symbol_value): Likewise.
789 (Output_data_got::reserve_slot): Move to class definition.
790 (Output_data_got::reserve_local): New function.
791 (Output_data_got::reserve_slot_for_global): Remove.
792 (Output_data_got::reserve_global): New function.
793 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
794 (all constructors, two instantiations).
795 (Output_reloc::get_relobj): New function (two instantiations).
796 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
797 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
798 (Output_data_reloc::add_global): Adjust type of relobj.
799 (Output_data_reloc::add_global_relative): Likewise.
800 (Output_data_reloc::add_symbolless_global_addend): Likewise.
801 (Output_data_reloc::add_local): Likewise.
802 (Output_data_reloc::add_local_relative): Likewise.
803 (Output_data_reloc::add_symbolless_local_addend): Likewise.
804 (Output_data_reloc::add_local_section): Likewise.
805 (Output_data_reloc::add_output_section): Likewise.
806 (Output_data_reloc::add_absolute): Likewise.
807 (Output_data_reloc::add_target_specific): Likewise.
808 (Output_data_got::reserve_slot): Move definition here.
809 (Output_data_got::reserve_local): New function.
810 (Output_data_got::reserve_global): New function.
811 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
812 section_offsets_ with accessor function.
813 (Sized_relobj_file::write_sections): Likewise.
814 (Sized_relobj_file::do_relocate_sections): Likewise.
815 * target.h (Sized_target::reserve_local_got_entry): New function.
816 (Sized_target::reserve_global_got_entry): New function.
817 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
818 (Target_x86_64::reserve_global_got_entry): New function.
819 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
820
4829d394
CC
8212011-05-23 Cary Coutant <ccoutant@google.com>
822
823 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
824 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
825 bit when checking got_type.
826 * incremental.cc (Sized_incremental_binary::setup_readers):
827 Store symbol table and string table locations; initialize bit vector
828 of file status flags.
829 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
830 unchanged files.
831 (Sized_incremental_binary::do_process_got_plt): New function.
832 (Sized_incremental_binary::get_symtab_view): Use stored locations.
833 (Output_section_incremental_inputs::set_final_data_size): Record
834 file index for each input file.
835 (Output_section_incremental_inputs::write_got_plt): Store file index
836 instead of input entry offset for each GOT entry.
837 * incremental.h
838 (Incremental_input_entry::Incremental_input_entry): Initialize new
839 data member.
840 (Incremental_input_entry::set_offset): Store file index.
841 (Incremental_input_entry::get_file_index): New function.
842 (Incremental_input_entry::file_index_): New data member.
843 (Incremental_binary::process_got_plt): New function.
844 (Incremental_binary::do_process_got_plt): New function.
845 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
846 data members.
847 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
848 (Sized_incremental_binary::set_file_is_unchanged): New function.
849 (Sized_incremental_binary::file_is_unchanged): New function.
850 (Sized_incremental_binary::do_process_got_plt): New function.
851 (Sized_incremental_binary::file_status_): New data member.
852 (Sized_incremental_binary::main_symtab_loc_): New data member.
853 (Sized_incremental_binary::main_strtab_loc_): New data member.
854 * output.cc (Output_data_got::Got_entry::write): Add case
855 RESERVED_CODE.
856 (Output_data_got::add_global): Call add_got_entry.
857 (Output_data_got::add_global_plt): Likewise.
858 (Output_data_got::add_global_with_rel): Likewise.
859 (Output_data_got::add_global_with_rela): Likewise.
860 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
861 (Output_data_got::add_global_pair_with_rela): Likewise.
862 (Output_data_got::add_local): Call add_got_entry.
863 (Output_data_got::add_local_plt): Likewise.
864 (Output_data_got::add_local_with_rel): Likewise.
865 (Output_data_got::add_local_with_rela): Likewise.
866 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
867 (Output_data_got::add_local_pair_with_rela): Likewise.
868 (Output_data_got::reserve_slot): New function.
869 (Output_data_got::reserve_slot_for_global): New function.
870 (Output_data_got::add_got_entry): New function.
871 (Output_data_got::add_got_entry_pair): New function.
872 (Output_section::add_output_section_data): Edit FIXME.
873 * output.h
874 (Output_section_data_build::Output_section_data_build): New
875 constructor with size parameter.
876 (Output_data_space::Output_data_space): Likewise.
877 (Output_data_got::Output_data_got): Initialize new data member; new
878 constructor with size parameter.
879 (Output_data_got::add_constant): Call add_got_entry.
880 (Output_data_got::reserve_slot): New function.
881 (Output_data_got::reserve_slot_for_global): New function.
882 (class Output_data_got::Got_entry): Add RESERVED_CODE.
883 (Output_data_got::add_got_entry): New function.
884 (Output_data_got::add_got_entry_pair): New function.
885 (Output_data_got::free_list_): New data member.
886 * target.h (Sized_target::init_got_plt_for_update): New function.
887 (Sized_target::register_global_plt_entry): New function.
888 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
889 Initialize new data member; call init; add constructor with PLT count.
890 (Output_data_plt_x86_64::init): New function.
891 (Output_data_plt_x86_64::add_relocation): New function.
892 (Output_data_plt_x86_64::reserve_slot): New function.
893 (Output_data_plt_x86_64::free_list_): New data member.
894 (Target_x86_64::init_got_plt_for_update): New function.
895 (Target_x86_64::register_global_plt_entry): New function.
896 (Output_data_plt_x86_64::add_entry): Allocate from free list for
897 incremental updates.
898 (Output_data_plt_x86_64::add_relocation): New function.
899 * testsuite/object_unittest.cc (Object_test): Set default options.
900
ec69d6da
ILT
9012011-05-16 Ian Lance Taylor <iant@google.com>
902
903 * options.h (class General_options): Make -i a synonym for -r.
904
732e31de
ILT
9052011-05-16 Ian Lance Taylor <iant@google.com>
906
907 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
908
403676b5
CC
9092011-05-10 Cary Coutant <ccoutant@google.com>
910
911 * object.cc (Sized_relobj::do_count_local_symbols): Check for
912 strip_all (-s).
913
5b7b7d6e
ILT
9142011-05-06 Ian Lance Taylor <iant@google.com>
915
916 * layout.cc (Layout::layout): If the output section flags change,
917 update the ordering.
918
f0f9babf
CC
9192011-04-25 Cary Coutant <ccoutant@google.com>
920
921 * incremental-dump.cc (dump_incremental_inputs): Print local
922 symbol info for each input file.
923 * incremental.cc
924 (Output_section_incremental_inputs::set_final_data_size): Add local
925 symbol info to input file entries in incremental info.
926 (Output_section_incremental_inputs::write_info_blocks): Likewise.
927 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
928 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
929 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
930 implementation.
931 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
932 (Sized_incr_relobj::do_relocate): Write the local symbols.
933 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
934 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
935 Adjust size of input file header.
936 (Incremental_inputs_reader::get_local_symbol_offset): New function.
937 (Incremental_inputs_reader::get_local_symbol_count): New function.
938 (Incremental_inputs_reader::get_input_section): Adjust size of input
939 file header.
940 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
941 (Sized_incr_relobj::This): New typedef.
942 (Sized_incr_relobj::sym_size): New const data member.
943 (Sized_incr_relobj::Local_symbol): New struct.
944 (Sized_incr_relobj::do_output_local_symbol_count): New function.
945 (Sized_incr_relobj::do_local_symbol_offset): New function.
946 (Sized_incr_relobj::local_symbol_count_): New data member.
947 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
948 (Sized_incr_relobj::local_symbol_index_): New data member.
949 (Sized_incr_relobj::local_symbol_offset_): New data member.
950 (Sized_incr_relobj::local_dynsym_offset_): New data member.
951 (Sized_incr_relobj::local_symbols_): New data member.
952 * object.h (Relobj::output_local_symbol_count): New function.
953 (Relobj::local_symbol_offset): New function.
954 (Relobj::do_output_local_symbol_count): New function.
955 (Relobj::do_local_symbol_offset): New function.
956 (Sized_relobj::do_output_local_symbol_count): New function.
957 (Sized_relobj::do_local_symbol_offset): New function.
958
d0a9ace3
ILT
9592011-04-22 Vladimir Simonov <sv@sw.ru>
960
961 * descriptors.cc (set_close_on_exec): New function.
962 (Descriptors::open): Use set_close_on_exec.
963 * output.cc (S_ISLNK): Define if not defined.
964
94a3fc8b
CC
9652011-04-22 Cary Coutant <ccoutant@google.com>
966
967 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
968 global symbol map.
969 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
970 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
971 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
972 relocations.
973 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
974 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
975 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
976 * incremental.h
977 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
978 function.
979 (Incremental_binary::apply_incremental_relocs): New function.
980 (Incremental_binary::do_apply_incremental_relocs): New function.
981 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
982 data member.
983 (Sized_incremental_binary::add_global_symbol): New function.
984 (Sized_incremental_binary::global_symbol): New function.
985 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
986 (Sized_incremental_binary::symbol_map_): New data member.
987 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
988 * target.h (Sized_target::apply_relocation): New function.
989 * target-reloc.h (apply_relocation): New function.
990 * x86_64.cc (Target_x86_64::apply_relocation): New function.
991
c87e4302
DK
9922011-04-22 Doug Kwan <dougkwan@google.com>
993
994 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
995 flag of a SHT_ARM_EXIDX section.
996 * testsuite/Makefile.am (arm_exidx_test): New test rules.
997 * testsuite/Makefile.in: Regenerate.
998 * testsuite/arm_exidx_test.s: New file.
999 * testsuite/arm_exidx_test.sh: Same.
1000
e7782cf6
CC
10012011-04-20 Cary Coutant <ccoutant@google.com>
1002
1003 PR gold/12689
1004 * archive.h (Incremental_archive_entry::Archive_member):
1005 Initialize arg_serial_ (second constructor).
1006
308ecdc7
ILT
10072011-04-17 Ian Lance Taylor <iant@google.com>
1008
1009 * object.cc (Relocate_info::location): Simplify location string.
1010 * errors.cc (Errors::error_at_location): Don't print program
1011 name.
1012 (Errors::warning_at_location): Likewise.
1013 (Errors::undefined_symbol): Likewise.
1014 * testsuite/debug_msg.sh: Update accordingly.
1015
bec5b579
CC
10162011-04-14 Cary Coutant <ccoutant@google.com>
1017
1018 * gold/layout.cc (Layout::symtab_section_offset): New function.
1019 * gold/layout.h (Layout::symtab_section_offset): New function.
1020 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
1021
88597d34
ILT
10222011-04-12 Ian Lance Taylor <iant@google.com>
1023
1024 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
1025 with MREMAP_MAYMOVE.
1026 * output.h (class Output_file): Add map_is_allocated_ field.
1027 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
1028 not available, provide stubs. If mremap is not available, #define
1029 it to gold_mremap.
1030 (MREMAP_MAYMOVE): Define if not defined.
1031 (Output_file::Output_file): Initialize map_is_allocated_.
1032 (Output_file::resize): Check map_is_allocated_.
1033 (Output_file::map_anonymous): If mmap fails, use malloc.
1034 (Output_file::unmap): Don't do anything for an anonymous map.
1035 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
1036 is not available, provide stubs.
1037 (File_read::View::~View): Use free rather than delete[].
1038 (File_read::make_view): Use malloc rather than new[]. If mmap
1039 fails, use malloc.
1040 (File_read::find_or_make_view): Use malloc rather than new[].
1041 * gold.h: Remove HAVE_REMAP code.
1042 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
1043 exists. Rename mremap to gold_mremap. If mmap is not available
1044 don't do anything.
1045 * configure, config.in: Rebuild.
1046
11e361bc
ILT
10472011-04-11 Ian Lance Taylor <iant@google.com>
1048
1049 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
1050 initialize local variable v.
1051
cdc29364
CC
10522011-04-11 Cary Coutant <ccoutant@google.com>
1053
1054 * archive.cc (Archive::include_member): Adjust call to
1055 report_object.
1056 (Add_archive_symbols::run): Track argument serial numbers.
1057 (Lib_group::include_member): Likewise.
1058 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1059 * archive.h (Incremental_archive_entry::Archive_member):
1060 Initialize arg_serial_.
1061 (Archive_member::arg_serial_): New data member.
1062 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1063 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1064 incremental link.
1065 (Sized_dynobj::do_for_all_local_got_entries): New function.
1066 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1067 function.
1068 * fileread.cc (get_mtime): New function.
1069 * fileread.h (get_mtime): New function.
1070 * gold.cc (queue_initial_tasks): Check for incremental update.
1071 (process_incremental_input): New function.
1072 (queue_middle_tasks): Don't force valid target for incremental
1073 update.
1074 * incremental-dump.cc (find_input_containing_global): Adjust
1075 size of symbol info entry.
1076 (dump_incremental_inputs): Dump argument serial number and
1077 in_system_directory flag; bias shndx by 1; print symbol names
1078 when dumping per-file symbol lists; use new symbol info readers.
1079 * incremental.cc
1080 (Output_section_incremental_inputs:update_data_size): New function.
1081 (Sized_incremental_binary::setup_readers): Setup input readers
1082 for each input file; build maps for files added from libraries
1083 and scripts.
1084 (Sized_incremental_binary::check_input_args): New function.
1085 (Sized_incremental_binary::do_check_inputs): Build map of argument
1086 serial numbers to input arguments.
1087 (Sized_incremental_binary::do_file_has_changed): Rename
1088 do_file_is_unchanged to this; compare file modification times.
1089 (Sized_incremental_binary::do_init_layout): New function.
1090 (Sized_incremental_binary::do_reserve_layout): New function.
1091 (Sized_incremental_binary::do_get_input_reader): Remove.
1092 (Sized_incremental_binary::get_symtab_view): New function.
1093 (Incremental_checker::can_incrementally_link_output_file): Remove.
1094 (Incremental_inputs::report_command_line): Exclude --debug options.
1095 (Incremental_inputs::report_archive_begin): Add parameter; track
1096 argument serial numbers; don't put input file entry for archive
1097 before archive members.
1098 (Incremental_inputs::report_archive_end): Put input file entry
1099 for archive after archive members.
1100 (Incremental_inputs::report_object): Add parameter; track argument
1101 serial numbers and in_system_directory flag.
1102 (Incremental_inputs::report_script): Add parameter; track argument
1103 serial numbers.
1104 (Output_section_incremental_inputs::set_final_data_size): Adjust
1105 size of symbol info entry; check for forwarding symbols.
1106 (Output_section_incremental_inputs::write_input_files): Write
1107 in_system_directory flag and argument serial number.
1108 (Output_section_incremental_inputs::write_info_blocks): Map section
1109 indices between incremental info and original input file; store
1110 input section index for each symbol.
1111 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1112 change operator() to visit().
1113 (class Global_got_offset_visitor): Likewise.
1114 (class Global_symbol_visitor_got_plt):
1115 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1116 classes.
1117 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1118 (Sized_incr_relobj::do_read_symbols): New function.
1119 (Sized_incr_relobj::do_layout): New function.
1120 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1121 (Sized_incr_relobj::do_add_symbols): New function.
1122 (Sized_incr_relobj::do_should_include_member): New function.
1123 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1124 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1125 (Sized_incr_relobj::do_section_size): New function.
1126 (Sized_incr_relobj::do_section_name): New function.
1127 (Sized_incr_relobj::do_section_contents): New function.
1128 (Sized_incr_relobj::do_section_flags): New function.
1129 (Sized_incr_relobj::do_section_entsize): New function.
1130 (Sized_incr_relobj::do_section_address): New function.
1131 (Sized_incr_relobj::do_section_type): New function.
1132 (Sized_incr_relobj::do_section_link): New function.
1133 (Sized_incr_relobj::do_section_info): New function.
1134 (Sized_incr_relobj::do_section_addralign): New function.
1135 (Sized_incr_relobj::do_initialize_xindex): New function.
1136 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1137 (Sized_incr_relobj::do_read_relocs): New function.
1138 (Sized_incr_relobj::do_gc_process_relocs): New function.
1139 (Sized_incr_relobj::do_scan_relocs): New function.
1140 (Sized_incr_relobj::do_count_local_symbols): New function.
1141 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1142 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1143 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1144 (Sized_incr_relobj::do_relocate): New function.
1145 (Sized_incr_relobj::do_set_section_offset): New function.
1146 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1147 (Sized_incr_dynobj::do_read_symbols): New function.
1148 (Sized_incr_dynobj::do_layout): New function.
1149 (Sized_incr_dynobj::do_add_symbols): New function.
1150 (Sized_incr_dynobj::do_should_include_member): New function.
1151 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1152 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1153 (Sized_incr_dynobj::do_section_size): New function.
1154 (Sized_incr_dynobj::do_section_name): New function.
1155 (Sized_incr_dynobj::do_section_contents): New function.
1156 (Sized_incr_dynobj::do_section_flags): New function.
1157 (Sized_incr_dynobj::do_section_entsize): New function.
1158 (Sized_incr_dynobj::do_section_address): New function.
1159 (Sized_incr_dynobj::do_section_type): New function.
1160 (Sized_incr_dynobj::do_section_link): New function.
1161 (Sized_incr_dynobj::do_section_info): New function.
1162 (Sized_incr_dynobj::do_section_addralign): New function.
1163 (Sized_incr_dynobj::do_initialize_xindex): New function.
1164 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1165 (make_sized_incremental_object): New function.
1166 (Incremental_library::copy_unused_symbols): New function.
1167 (Incremental_library::do_for_all_unused_symbols): New function.
1168 * incremental.h (enum Incremental_input_flags): New type.
1169 (class Incremental_checker): Remove.
1170 (Incremental_input_entry::Incremental_input_entry): Add argument
1171 serial number.
1172 (Incremental_input_entry::arg_serial): New function.
1173 (Incremental_input_entry::set_is_in_system_directory): New function.
1174 (Incremental_input_entry::is_in_system_directory): New function.
1175 (Incremental_input_entry::arg_serial_): New data member.
1176 (Incremental_input_entry::is_in_system_directory_): New data member.
1177 (class Script_info): Move here from script.h.
1178 (Script_info::Script_info): Add filename parameter.
1179 (Script_info::filename): New function.
1180 (Script_info::filename_): New data member.
1181 (Incremental_script_entry::Incremental_script_entry): Add argument
1182 serial number.
1183 (Incremental_object_entry::Incremental_object_entry): Likewise.
1184 (Incremental_object_entry::add_input_section): Build list of input
1185 sections with map to original shndx.
1186 (Incremental_object_entry::get_input_section_index): New function.
1187 (Incremental_object_entry::shndx_): New data member.
1188 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1189 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1190 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1191 serial number.
1192 (Incremental_inputs::report_archive_begin): Likewise.
1193 (Incremental_inputs::report_object): Likewise.
1194 (Incremental_inputs::report_script): Likewise.
1195 (class Incremental_global_symbol_reader): New class.
1196 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1197 and store flags and input file type.
1198 (Incremental_input_entry_reader::arg_serial): New function.
1199 (Incremental_input_entry_reader::type): Extract type from flags.
1200 (Incremental_input_entry_reader::is_in_system_directory): New function.
1201 (Incremental_input_entry_reader::get_input_section_count): Call
1202 accessor function for type.
1203 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1204 function for type; adjust size of global symbol entry.
1205 (Incremental_input_entry_reader::get_global_symbol_count): Call
1206 accessor function for type.
1207 (Incremental_input_entry_reader::get_object_count): Likewise.
1208 (Incremental_input_entry_reader::get_object_offset): Likewise.
1209 (Incremental_input_entry_reader::get_member_count): Likewise.
1210 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1211 (Incremental_input_entry_reader::get_member_offset): Likewise.
1212 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1213 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1214 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1215 (Incremental_input_entry_reader::get_global_symbol_reader): New
1216 function.
1217 (Incremental_input_entry_reader::get_output_symbol_index): New
1218 function.
1219 (Incremental_input_entry_reader::type_): Remove.
1220 (Incremental_input_entry_reader::flags_): New data member.
1221 (Incremental_inputs_reader::input_file_offset): New function.
1222 (Incremental_inputs_reader::input_file_index): New function.
1223 (Incremental_inputs_reader::input_file): Call input_file_offset.
1224 (Incremental_inputs_reader::input_file_at_offset): New function.
1225 (Incremental_relocs_reader::get_r_type): Reformat.
1226 (Incremental_relocs_reader::get_r_shndx): Reformat.
1227 (Incremental_relocs_reader::get_r_offset): Reformat.
1228 (Incremental_relocs_reader::data): New function.
1229 (Incremental_binary::Incremental_binary): Initialize new data members.
1230 (Incremental_binary::check_inputs): Add cmdline parameter.
1231 (Incremental_binary::file_is_unchanged): Remove.
1232 (Input_reader::arg_serial): New function.
1233 (Input_reader::get_unused_symbol_count): New function.
1234 (Input_reader::get_unused_symbol): New function.
1235 (Input_reader::do_arg_serial): New function.
1236 (Input_reader::do_get_unused_symbol_count): New function.
1237 (Input_reader::do_get_unused_symbol): New function.
1238 (Incremental_binary::input_file_count): New function.
1239 (Incremental_binary::get_input_reader): Change signature to use
1240 index instead of filename.
1241 (Incremental_binary::file_has_changed): New function.
1242 (Incremental_binary::get_input_argument): New function.
1243 (Incremental_binary::get_library): New function.
1244 (Incremental_binary::get_script_info): New function.
1245 (Incremental_binary::init_layout): New function.
1246 (Incremental_binary::reserve_layout): New function.
1247 (Incremental_binary::output_file): New function.
1248 (Incremental_binary::do_check_inputs): New function.
1249 (Incremental_binary::do_file_is_unchanged): Remove.
1250 (Incremental_binary::do_file_has_changed): New function.
1251 (Incremental_binary::do_init_layout): New function.
1252 (Incremental_binary::do_reserve_layout): New function.
1253 (Incremental_binary::do_input_file_count): New function.
1254 (Incremental_binary::do_get_input_reader): Change signature.
1255 (Incremental_binary::input_args_map_): New data member.
1256 (Incremental_binary::library_map_): New data member.
1257 (Incremental_binary::script_map_): New data member.
1258 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1259 new data members.
1260 (Sized_incremental_binary::output_section): New function.
1261 (Sized_incremental_binary::inputs_reader): Add const.
1262 (Sized_incremental_binary::symtab_reader): Add const.
1263 (Sized_incremental_binary::relocs_reader): Add const.
1264 (Sized_incremental_binary::got_plt_reader): Add const.
1265 (Sized_incremental_binary::get_symtab_view): New function.
1266 (Sized_incremental_binary::Inputs_reader): New typedef.
1267 (Sized_incremental_binary::Input_entry_reader): New typedef.
1268 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1269 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1270 (Sized_incremental_binary::do_file_has_changed): New function.
1271 (Sized_incremental_binary::do_init_layout): New function.
1272 (Sized_incremental_binary::do_reserve_layout): New function.
1273 (Sized_input_reader::Inputs_reader): Remove.
1274 (Sized_input_reader::Input_entry_reader): Remove.
1275 (Sized_input_reader::do_arg_serial): New function.
1276 (Sized_input_reader::do_get_unused_symbol_count): New function.
1277 (Sized_input_reader::do_get_unused_symbol): New function.
1278 (Sized_incremental_binary::do_input_file_count): New function.
1279 (Sized_incremental_binary::do_get_input_reader): Change signature;
1280 use index instead of filename.
1281 (Sized_incremental_binary::section_map_): New data member.
1282 (Sized_incremental_binary::input_entry_readers_): New data member.
1283 (class Sized_incr_relobj): New class.
1284 (class Sized_incr_dynobj): New class.
1285 (make_sized_incremental_object): New function.
1286 (class Incremental_library): New class.
1287 * layout.cc (Free_list::num_lists): New static data member.
1288 (Free_list::num_nodes): New static data member.
1289 (Free_list::num_removes): New static data member.
1290 (Free_list::num_remove_visits): New static data member.
1291 (Free_list::num_allocates): New static data member.
1292 (Free_list::num_allocate_visits): New static data member.
1293 (Free_list::init): New function.
1294 (Free_list::remove): New function.
1295 (Free_list::allocate): New function.
1296 (Free_list::dump): New function.
1297 (Free_list::print_stats): New function.
1298 (Layout_task_runner::run): Resize output file for incremental updates.
1299 (Layout::Layout): Initialize new data members.
1300 (Layout::set_incremental_base): New function.
1301 (Layout::init_fixed_output_section): New function.
1302 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1303 incremental updates.
1304 (Layout::create_gold_note): Do not create gold note section for
1305 incremental updates.
1306 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1307 for incremental updates.
1308 (Layout::set_section_offsets): For incremental updates, allocate space
1309 from free list.
1310 (Layout::create_symtab_sections): Layout with offsets relative to
1311 start of section; for incremental updates, allocate space from free
1312 list.
1313 (Layout::create_shdrs): For incremental updates, allocate space from
1314 free list.
1315 (Layout::finish_dynamic_section): For incremental updates, do not
1316 check --as-needed (fixed in subsequent patch).
1317 * layout.h (class Free_list): New class.
1318 (Layout::set_incremental_base): New function.
1319 (Layout::incremental_base): New function.
1320 (Layout::init_fixed_output_section): New function.
1321 (Layout::allocate): New function.
1322 (Layout::incremental_base_): New data member.
1323 (Layout::free_list_): New data member.
1324 * main.cc (main): Print Free_list statistics.
1325 * object.cc (Relobj::finalize_incremental_relocs): Add
1326 clear_counts parameter; clear counts only when clear_counts is set.
1327 (Sized_relobj::Sized_relobj): Initialize new base class.
1328 (Sized_relobj::do_layout): Don't report special sections.
1329 (Sized_relobj::do_for_all_local_got_entries): New function.
1330 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
1331 symtab_off to all symbol table offsets.
1332 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
1333 * object.h (class Got_offset_list): Move to top of file.
1334 (Object::Object): Allow case where input_file == NULL.
1335 (Object::~Object): Likewise.
1336 (Object::input_file): Assert that input_file != NULL.
1337 (Object::lock): Allow case where input_file == NULL.
1338 (Object::unlock): Likewise.
1339 (Object::is_locked): Likewise.
1340 (Object::token): Likewise.
1341 (Object::release): Likewise.
1342 (Object::is_incremental): New function.
1343 (Object::get_mtime): New function.
1344 (Object::for_all_local_got_entries): New function.
1345 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1346 (Object::set_is_in_system_directory): New function.
1347 (Object::is_in_system_directory): New function.
1348 (Object::do_is_incremental): New function.
1349 (Object::do_get_mtime): New function.
1350 (Object::do_for_all_local_got_entries): New function.
1351 (Object::is_in_system_directory_): New data member.
1352 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1353 (class Sized_relobj_base): New class.
1354 (class Sized_relobj): Derive from Sized_relobj_base.
1355 (class Sized_relobj::Symbols): Redeclare from base class.
1356 (class Sized_relobj::local_got_offset_list): Remove.
1357 (class Sized_relobj::Output_sections): Redeclare from base class.
1358 (class Sized_relobj::do_for_all_local_got_entries): New function.
1359 (class Sized_relobj::write_local_symbols): Add offset parameter.
1360 (class Sized_relobj::local_symbol_offset_): Update comment.
1361 (class Sized_relobj::local_dynsym_offset_): Update comment.
1362 * options.cc (Input_arguments::add_file): Remove const.
1363 * options.h (Input_file_argument::Input_file_argument):
1364 Initialize arg_serial_ (all constructors).
1365 (Input_file_argument::set_arg_serial): New function.
1366 (Input_file_argument::arg_serial): New function.
1367 (Input_file_argument::arg_serial_): New data member.
1368 (Input_arguments::Input_arguments): Initialize file_count_.
1369 (Input_arguments::add_file): Remove const.
1370 (Input_arguments::number_of_input_files): New function.
1371 (Input_arguments::file_count_): New data member.
1372 (Command_line::number_of_input_files): Call
1373 Input_arguments::number_of_input_files.
1374 * output.cc (Output_segment_headers::Output_segment_headers):
1375 Set current size.
1376 (Output_section::Input_section::current_data_size): New function.
1377 (Output_section::Output_section): Initialize new data members.
1378 (Output_section::add_input_section): Don't do merge sections for
1379 an incremental link; allocate space from free list for an
1380 incremental update.
1381 (Output_section::add_output_section_data): Allocate space from
1382 free list for an incremental update.
1383 (Output_section::update_data_size): New function.
1384 (Output_section::set_fixed_layout): New function.
1385 (Output_section::reserve): New function.
1386 (Output_segment::set_section_addresses): Remove const.
1387 (Output_segment::set_section_list_addresses): Remove const; allocate
1388 space from free list for an incremental update.
1389 (Output_segment::set_offset): Adjust size of RELRO segment for an
1390 incremental update.
1391 * output.h (Output_data::current_data_size): Move here from
1392 child classes.
1393 (Output_data::pre_finalize_data_size): New function.
1394 (Output_data::update_data_size): New function.
1395 (Output_section_headers::update_data_size): new function.
1396 (Output_section_data_build::current_data_size): Move to Output_data.
1397 (Output_data_strtab::update_data_size): New function.
1398 (Output_section::current_data_size): Move to Output_data.
1399 (Output_section::set_fixed_layout): New function.
1400 (Output_section::has_fixed_layout): New function.
1401 (Output_section::reserve): New function.
1402 (Output_section::update_data_size): New function.
1403 (Output_section::has_fixed_layout_): New data member.
1404 (Output_section::free_list_): New data member.
1405 (Output_segment::set_section_addresses): Remove const.
1406 (Output_segment::set_section_list_addresses): Remove const.
1407 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
1408 New function.
1409 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
1410 New function.
1411 * readsyms.cc (Read_symbols::do_read_symbols): Add library
1412 parameter when calling Add_symbols constructor; store argument
1413 serial number for members of a lib group.
1414 (Add_symbols::locks): Allow case where token == NULL.
1415 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
1416 (Read_member::~Read_member): New function.
1417 (Read_member::is_runnable): New function.
1418 (Read_member::locks): New function.
1419 (Read_member::run): New function.
1420 (Check_script::~Check_script): New function.
1421 (Check_script::is_runnable): New function.
1422 (Check_script::locks): New function.
1423 (Check_script::run): New function.
1424 (Check_library::~Check_library): New function.
1425 (Check_library::is_runnable): New function.
1426 (Check_library::locks): New function.
1427 (Check_library::run): New function.
1428 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
1429 (Add_symbols::library_): New data member.
1430 (class Read_member): New class.
1431 (class Check_script): New class.
1432 (class Check_library): New class.
1433 * reloc.cc (Read_relocs::is_runnable): Allow case where
1434 token == NULL.
1435 (Read_relocs::locks): Likewise.
1436 (Scan_relocs::locks): Likewise.
1437 (Relocate_task::locks): Likewise.
1438 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
1439 to clear counters.
1440 (Sized_relobj::incremental_relocs_scan): Fix comment.
1441 (Sized_relobj::do_relocate): Pass output file offset to
1442 write_local_symbols.
1443 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
1444 from class declaration.
1445 * script.cc (read_input_script): Allocate Script_info; pass
1446 argument serial number to report_script.
1447 * script.h (class Script_info): Move to incremental.h.
1448 * symtab.cc (Symbol_table::add_from_incrobj): New function.
1449 * symtab.h (Symbol_table::add_from_incrobj): New function.
1450 (Symbol_table::set_file_offset): New function.
1451
b961d0d7
CC
14522011-04-05 Cary Coutant <ccoutant@google.com>
1453
1454 * incremental-dump.cc (dump_incremental_inputs): Change signature
1455 to take a Sized_incremental_binary; change caller. Use readers
1456 in Sized_incremental_binary.
1457 * incremental.cc
1458 (Sized_incremental_binary::find_incremental_inputs_sections):
1459 Rename do_find_incremental_inputs_sections to this.
1460 (Sized_incremental_binary::setup_readers): New function.
1461 (Sized_incremental_binary::do_check_inputs): Check
1462 has_incremental_info_ flag; move setup code to setup_readers;
1463 use input readers.
1464 (Sized_incremental_binary::do_file_is_unchanged): New function.
1465 (Sized_incremental_binary::do_get_input_reader): New function.
1466 * incremental.h (class Incremental_binary): Move to end of file.
1467 (Incremental_binary::file_is_unchanged): New function.
1468 (Incremental_binary::do_file_is_unchanged): New function.
1469 (Incremental_binary::Input_reader): New class.
1470 (Incremental_binary::get_input_reader): New function.
1471 (class Sized_incremental_binary): Move to end of file.
1472 (Sized_incremental_binary::Sized_incremental_binary): Setup the
1473 input section reader classes.
1474 (Sized_incremental_binary::has_incremental_info): New function.
1475 (Sized_incremental_binary::inputs_reader): New function.
1476 (Sized_incremental_binary::symtab_reader): New function.
1477 (Sized_incremental_binary::relocs_reader): New function.
1478 (Sized_incremental_binary::got_plt_reader): New function.
1479 (Sized_incremental_binary::do_file_is_unchanged): New function.
1480 (Sized_incremental_binary::Sized_input_reader): New class.
1481 (Sized_incremental_binary::get_input_reader): New function.
1482 (Sized_incremental_binary::find_incremental_inputs_sections):
1483 Rename do_find_incremental_inputs_sections to this.
1484 (Sized_incremental_binary::setup_readers): New function.
1485 (Sized_incremental_binary::has_incremental_info_): New data member.
1486 (Sized_incremental_binary::inputs_reader_): New data member.
1487 (Sized_incremental_binary::symtab_reader_): New data member.
1488 (Sized_incremental_binary::relocs_reader_): New data member.
1489 (Sized_incremental_binary::got_plt_reader_): New data member.
1490 (Sized_incremental_binary::current_input_file_): New data member.
1491
a869183f
PP
14922011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
1493
1494 PR gold/12640
1495 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
1496 violation.
1497
14982011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
1499
1500 * archive.cc (Archive::include_member): Adjust call to report_object.
1501 (Add_archive_symbols::run): Add script_info to call to
1502 report_archive_begin.
1503 (Lib_group::include_member): Adjust call to report_object.
1504 (Add_lib_group_symbols::run): Adjust call to report_object.
1505 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
1506 blocks. Add object count for script input files.
1507 * incremental.cc (Incremental_inputs::report_archive_begin): Add
1508 script_info parameter; change all callers.
1509 (Incremental_inputs::report_object): Add script_info parameter;
1510 change all callers.
1511 (Incremental_inputs::report_script): Store backpointer to
1512 incremental info entry.
1513 (Output_section_incremental_inputs::set_final_data_size): Record
1514 additional information for scripts.
1515 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1516 * incremental.h (Incremental_script_entry::add_object): New function.
1517 (Incremental_script_entry::get_object_count): New function.
1518 (Incremental_script_entry::get_object): New function.
1519 (Incremental_script_entry::objects_): New data member; adjust
1520 constructor.
1521 (Incremental_inputs::report_archive_begin): Add script_info parameter.
1522 (Incremental_inputs::report_object): Add script_info parameter.
1523 (Incremental_inputs_reader::get_object_count): New function.
1524 (Incremental_inputs_reader::get_object_offset): New function.
1525 * options.cc (Input_arguments::add_file): Return reference to
1526 new input argument.
1527 * options.h (Input_argument::set_script_info): New function.
1528 (Input_argument::script_info): New function.
1529 (Input_argument::script_info_): New data member; adjust all
1530 constructors.
1531 (Input_file_group::add_file): Return reference to new input argument.
1532 (Input_file_lib::add_file): Likewise.
1533 (Input_arguments::add_file): Likewise.
1534 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
1535 * script.cc (Parser_closure::Parser_closure): Add script_info
1536 parameter; adjust all callers.
1537 (Parser_closure::script_info): New function.
1538 (Parser_closure::script_info_): New data member.
1539 (read_input_script): Report scripts earlier to incremental info.
1540 (script_add_file): Set script_info in Input_argument.
1541 (script_add_library): Likewise.
1542 * script.h (Script_options::Script_info): Rewrite class.
1543
a869183f 15442011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
1545
1546 * archive.cc (Library_base::should_include_member): Move
1547 method here from class Archive.
1548 (Archive::Archive): Initialize base class.
1549 (Archive::should_include_member): Move to base class.
1550 (Archive::do_for_all_unused_symbols): New function.
1551 (Add_archive_symbols::run): Remove redundant access to
1552 incremental_inputs.
1553 (Lib_group::Lib_group): Initialize base class.
1554 (Lib_group::do_filename): New function.
1555 (Lib_group::include_member): Pass pointer to Lib_group to
1556 report_object.
1557 (Lib_group::do_for_all_unused_symbols): New function.
1558 (Add_lib_group_symbols::run): Report archive information for
1559 incremental links.
1560 * archive.h (class Library_base): New base class.
1561 (class Archive): Derive from Library_base.
1562 (Archive::filename): Move to base class.
1563 (Archive::set_incremental_info): Likewise.
1564 (Archive::incremental_info): Likewise.
1565 (Archive::Should_include): Likewise.
1566 (Archive::should_include_member): Likewise.
1567 (Archive::Armap_entry): Remove.
1568 (Archive::Unused_symbol_iterator): Remove.
1569 (Archive::unused_symbols_begin): Remove.
1570 (Archive::unused_symbols_end): Remove.
1571 (Archive::do_filename): New function.
1572 (Archive::do_get_mtime): New function.
1573 (Archive::do_for_all_unused_symbols): New function.
1574 (Archive::task_): Move to base class.
1575 (Archive::incremental_info_): Likewise.
1576 (class Lib_group): Derive from Library_base.
1577 (Lib_group::do_filename): New function.
1578 (Lib_group::do_get_mtime): New function.
1579 (Lib_group::do_for_all_unused_symbols): New function.
1580 (Lib_group::task_): Move to base class.
1581 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
1582 function.
1583 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1584 function.
1585 * incremental.cc (Incremental_inputs::report_archive_begin):
1586 Use Library_base; call library's get_mtime; add incremental inputs
1587 entry before members.
1588 (class Unused_symbol_visitor): New class.
1589 (Incremental_inputs::report_archive_end): Use Library_base; use
1590 visitor class to record unused symbols; don't add incremental inputs
1591 entry after members.
1592 (Incremental_inputs::report_object): Use Library_base.
1593 * incremental.h
1594 (Incremental_archive_entry::Incremental_archive_entry): Remove
1595 unused Archive parameter.
1596 (Incremental_inputs::report_archive_begin): Use Library_base.
1597 (Incremental_inputs::report_archive_end): Likewise.
1598 (Incremental_inputs::report_object): Likewise.
1599 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1600 function.
1601 * object.h (Object::for_all_global_symbols): New function.
1602 (Object::do_for_all_global_symbols): New function.
1603 (Sized_relobj::do_for_all_global_symbols): New function.
1604 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1605 function.
1606 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1607 function.
1608
61ab3e40
ILT
16092011-03-27 Ian Lance Taylor <iant@google.com>
1610
1611 * archive.cc (Archive::interpret_header): Return -1 if something
1612 goes wrong. Change callers accordingly.
1613
30e1f9e6
CC
16142011-03-25 Cary Coutant <ccoutant@google.com>
1615
1616 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1617 * testsuite/Makefile.in: Regenerate.
1618
9c793f14
RÁE
16192010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1620
1621 * plugin.cc (get_view): New.
1622 (Plugin::load): Pass get_view to the plugin.
1623 (Plugin_manager::get_view): New.
1624
9312bb0a
ILT
16252011-03-21 Ian Lance Taylor <iant@google.com>
1626
1627 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1628 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1629
7e12ba9e
ST
16302011-03-21 Sriraman Tallam <tmsriram@google.com>
1631
1632 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1633 Change == to -eq.
1634 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1635 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1636 Change == to -eq.
1637 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1638 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1639
fd7a005d
ILT
16402011-03-14 Ian Lance Taylor <iant@google.com>
1641
1642 * script-sections.cc (Sort_output_sections::script_compare):
1643 Rename from is_before, change return type.
1644 (Sort_output_sections::operator()): Adjust accordingly.
1645
ed16fd1b
ILT
16462011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1647
1648 PR gold/12572
1649 * testsuite/odr_violation2.cc: Add comment to make all error line
1650 numbers double digits.
1651 * testsuite/debug_msg.sh: Adjust expected errors.
1652
71ff8986
ILT
16532011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1654
1655 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1656 but mark earlier ones as non-canonical
1657 (offset_to_iterator): Update search target and example
1658 (do_addr2line): Return extra lines in a vector*
1659 (format_file_lineno): Extract from do_addr2line
1660 (one_addr2line): Add vector* out-param
1661 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
1662 when a lineno entry appeared last for its instruction
1663 (Dwarf_line_info): Add vector* out-param
1664 * object.cc (Relocate_info): Pass NULL for the vector* out-param
1665 * symtab.cc (Odr_violation_compare): Include the lineno in the
1666 comparison again.
1667 (linenos_from_loc): New. Combine the canonical line for an
1668 address with its other lines.
1669 (True_if_intersect): New. Helper functor to make
1670 std::set_intersection a query.
1671 (detect_odr_violations): Compare sets of lines instead of just
1672 one line for each function. This became less deterministic, but
1673 has fewer false positives.
1674 * symtab.h: Declarations.
1675 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
1676 mix an optimized and non-optimized object in the same binary
1677 (odr_violation2.so): Same.
1678 * testsuite/Makefile.in: Regenerate from Makefile.am.
1679 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
1680 * testsuite/debug_msg.sh: Update line numbers and add
1681 assertions.
1682 * testsuite/odr_violation1.cc: Use OdrDerived, in a
1683 non-optimized context.
1684 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
1685 isn't inlined, and use OdrDerived in an optimized context.
1686 * testsuite/odr_header1.h: Defines OdrDerived, where
1687 optimization will change the
1688 first-instruction-in-the-destructor's file and line number.
1689 * testsuite/odr_header2.h: Defines OdrBase.
1690
a19fefdc
ILT
16912011-03-09 Ian Lance Taylor <iant@google.com>
1692
1693 * fileread.cc (File_read::clear_views): Don't delete the whole
1694 file view.
1695
ecb351e9
ILT
16962011-03-08 Ian Lance Taylor <iant@google.com>
1697
1698 PR gold/12525
1699 * fileread.cc: #include <climits>.
1700 (GOLD_IOV_MAX): Define.
1701 (File_read::read_multiple): Limit number of entries by iov_max.
1702 * fileread.h (class File_read): Always set max_readv_entries to
1703 128.
1704
b821d13c
ILT
17052011-03-07 Ian Lance Taylor <iant@google.com>
1706
1707 PR gold/12525
1708 * options.h (class General_options): Add -dy and -dn.
1709
89243142
CC
17102011-03-02 Cary Coutant <ccoutant@google.com>
1711
1712 * testsuite/script_test_9.t: Add TLS segment.
1713
d0773f31
ILT
17142011-03-02 Simon Baldwin <simonb@google.com>
1715
1716 * configure.ac: Add check for gnu_indirect_function support in
1717 the toolchain building binutils.
1718 * configure: Rebuild.
1719
badc8139
RÁE
17202010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
1721
1722 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
1723 plugin only symbols.
1724 (Symbol_table::sized_finalize_symbol) Mark symbol only present
1725 in plugin files as not needed in the symbol table.
1726
4cf7a849
ST
17272011-02-11 Sriraman Tallam <tmsriram@google.com>
1728
1729 * output.cc (Output_section::add_input_section): Delay fill
1730 generation for section ordering.
1731
b578bd7d
ILT
17322011-02-09 Ian Lance Taylor <iant@google.com>
1733
1734 PR gold/12316
1735 * object.h (class Sized_relobj): Remove clear_local_symbols.
1736 * reloc.cc (Sized_relobj::do_relocate): Don't call
1737 clear_local_symbols.
1738
84ced98a
RÁE
17392010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
1740
1741 * plugin.cc (is_visible_from_outside): Return true for symbols
1742 in the -u option.
1743
55382fb7
ILT
17442011-02-04 Jeffrey Yasskin <jyasskin@google.com>
1745
1746 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
1747 filename.
1748
4e271fff
ST
17492011-02-02 Sriraman Tallam <tmsriram@google.com>
1750
1751 * icf.h (is_section_foldable_candidate): Change type of parameter
1752 to std::string.
1753 * icf.cc (Icf::find_identical_sections): Change type of local variable
1754 section_name to be std::string.
1755 (is_function_ctor_or_dtor): Change type of parameter to std::string.
1756
d433c3ac
ILT
17572011-01-25 Ian Lance Taylor <iant@google.com>
1758
1759 * script.cc (script_add_extern): Rewrite to use
1760 add_symbol_reference.
1761
880473a6
DK
17622011-01-25 Doug Kwan <dougkwan@google.com>
1763
d433c3ac 1764 * icf.cc (get_section_contents): Always lock section's object.
880473a6 1765
f30f86fa
ILT
17662011-01-24 Ian Lance Taylor <iant@google.com>
1767
1768 * options.h (class General_options): Accept
1769 --no-detect-odr-violations.
1770
8e51a0b9
ILT
17712011-01-24 Ian Lance Taylor <iant@google.com>
1772
1773 * version.cc (version_string): Bump to 1.11.
1774
0f3b89d8
ILT
17752011-01-24 Ian Lance Taylor <iant@google.com>
1776
1777 * plugin.cc (class Plugin_rescan): Define new class.
1778 (Plugin_manager::claim_file): Set any_claimed_.
1779 (Plugin_manager::save_archive): New function.
1780 (Plugin_manager::save_input_group): New function.
1781 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
1782 necessary.
1783 (Plugin_manager::new_undefined_symbol): New function.
1784 (Plugin_manager::rescan): New function.
1785 (Plugin_manager::rescannable_defines): New function.
1786 (Plugin_manager::add_input_file): Set any_added_.
1787 * plugin.h (class Plugin_manager): define new fields rescannable_,
1788 undefined_symbols_, any_claimed_, and any_added_. Declare
1789 Plugin_rescan as friend. Declare new functions.
1790 (Plugin_manager::Rescannable): Define type.
1791 (Plugin_manager::Rescannable_list): Define type.
1792 (Plugin_manager::Undefined_symbol_list): Define type.
1793 (Plugin_manager::Plugin_manager): Initialize new fields.
1794 * archive.cc (Archive::defines_symbol): New function.
1795 (Add_archive_symbols::run): Pass archive to plugins if any.
1796 * archive.h (class Archive): Declare defines_symbol.
1797 * readsyms.cc (Input_group::~Input_group): New function.
1798 (Finish_group::run): Pass input_group to plugins if any.
1799 * readsyms.h (class Input_group): Declare destructor.
1800 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
1801 any.
1802
3bb951e5
ILT
18032011-01-10 Ian Lance Taylor <iant@google.com>
1804
1805 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
1806 section as relro.
1807 (Layout::set_segment_offsets): Reset increase_relro before calling
1808 set_section_addresses a second time.
1809
0aa45fac
CC
18102011-01-04 Cary Coutant <ccoutant@google.com>
1811
1812 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
1813 sections before NOBITS sections.
1814
0db46eb4
L
18152011-01-01 H.J. Lu <hongjiu.lu@intel.com>
1816
1817 * version.cc (print_version): Update copyright to 2011.
1818
829c9745
CC
18192010-12-23 Cary Coutant <ccoutant@google.com>
1820
1821 * output.h (Output_data_reloc::add_output_section): Pass OD instead
1822 of OS to this->add. Add OD parameter to second form of the function.
1823
7500420b
ILT
18242010-12-20 Ian Lance Taylor <iant@google.com>
1825
1826 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
1827 second of two consecutive entries with same offset.
1828
f8e9a930
RW
18292010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1830
1831 * testsuite/Makefile.am (ifuncmain2static_LDADD)
1832 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
1833 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
1834 to avoid unneeded links against $(LDADD).
1835 * testsuite/Makefile.in: Regenerate.
1836
2fbb4320
ILT
18372010-12-15 Ian Lance Taylor <iant@google.com>
1838
1839 PR gold/12324
1840 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
1841 for R_X86_64_32 and R_X86_64_PC32.
1842 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
1843 ver_matching_def_pic.o.
1844 (ver_matching_def_pic.o): New target.
1845
fedb228d
RW
18462010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1847
1848 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
1849 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
1850 Move definition before File_read::View member definitions.
1851 (File_read::View::~View): Initialize and hold lock before
1852 updating current_mapped_bytes.
1853
9b547ce6
RW
18542010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1855
1856 * dwarf_reader.cc: Remove outdated comment.
1857 * gold-threads.cc: Fix typo in error message.
1858 * archive.cc: Fix typos in comments.
1859 * archive.h: Likewise.
1860 * arm-reloc-property.cc: Likewise.
1861 * arm-reloc-property.h: Likewise.
1862 * arm-reloc.def: Likewise.
1863 * arm.cc: Likewise.
1864 * attributes.h: Likewise.
1865 * cref.cc: Likewise.
1866 * ehframe.cc: Likewise.
1867 * fileread.h: Likewise.
1868 * gold.h: Likewise.
1869 * i386.cc: Likewise.
1870 * icf.cc: Likewise.
1871 * incremental.h: Likewise.
1872 * int_encoding.cc: Likewise.
1873 * layout.h: Likewise.
1874 * main.cc: Likewise.
1875 * merge.h: Likewise.
1876 * object.cc: Likewise.
1877 * object.h: Likewise.
1878 * options.cc: Likewise.
1879 * readsyms.cc: Likewise.
1880 * reduced_debug_output.cc: Likewise.
1881 * reloc.cc: Likewise.
1882 * script-sections.cc: Likewise.
1883 * sparc.cc: Likewise.
1884 * symtab.h: Likewise.
1885 * target-reloc.h: Likewise.
1886 * target.cc: Likewise.
1887 * target.h: Likewise.
1888 * timer.cc: Likewise.
1889 * timer.h: Likewise.
1890 * x86_64.cc: Likewise.
1891
83e17bd5
CC
18922010-12-09 Cary Coutant <ccoutant@google.com>
1893
1894 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
1895 stack.
1896 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
1897 parameter; change all callers.
1898 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
1899 * options.h (warn_execstack): New option.
1900
017257f8
DK
19012010-12-07 Doug Kwan <dougkwan@google.com>
1902
1903 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1904 like function call relocations.
1905
c20cbc06
ILT
19062010-12-07 Ian Lance Taylor <iant@google.com>
1907
1908 * archive.cc (Archive::get_elf_object_for_member): Permit
1909 punconfigured to be NULL.
1910 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1911 (Archive::include_member): Pass NULL to get_elf_object_for_member
1912 if we searched for the archive and this is the first included
1913 object.
1914
4dbfafcc
ILT
19152010-12-01 Ian Lance Taylor <iant@google.com>
1916
1917 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1918 track_relocs_type_ field.
1919 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1920 Set track_relocs_type_.
1921 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1922 contents when using RELA relocs.
1923 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1924 reloc_map_.
1925 * reloc.cc (Track_relocs::next_addend): New function.
1926 * reloc.h (class Track_relocs): Declare next_addend.
1927
e5e19edd
ILT
19282010-12-01 Ian Lance Taylor <iant@google.com>
1929
1930 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1931 virtual destructor.
1932
9a5ce24c
ILT
19332010-12-01 Ian Lance Taylor <iant@google.com>
1934
1935 * README: Update compilers known to work and fail.
1936
c7791212
NC
19372010-11-23 Matthias Klose <doko@ubuntu.com>
1938
1939 * configure.in: For --enable-gold, handle value `default' instead of
1940 `both*'. Always install ld as ld.bfd, install as ld if gold is
1941 not the default.
1942 * configure: Regenerate.
1943
0ad220c9
DK
19442010-11-18 Doug Kwan <dougkwan@google.com>
1945
1946 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1947 and right_alignment to be zero. Store result alignment only if it is
1948 greater than existing alignment.
1949
ab8056e0
CC
19502010-11-16 Cary Coutant <ccoutant@google.com>
1951
1952 PR gold/12220
1953 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1954 Check for ".zdebug_line".
1955
fd064a5b
CC
19562010-11-16 Doug Kwan <dougkwan@google.com>
1957 Cary Coutant <ccoutant@google.com>
1958
1959 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1960 by reference; adjust all callers.
1961 * output.cc (Output_segment::set_section_addresses): Adjust references
1962 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1963 list is empty.
1964 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1965 end at page boundary.
1966
6fc6ea19
CC
19672010-11-16 Cary Coutant <ccoutant@google.com>
1968
1969 PR gold/12220
1970 * layout.cc (Layout::choose_output_section): Transform names of
1971 compressed sections even when using a script with a SECTIONS clause.
1972 (Layout::output_section_name): Remove code to transform
1973 compressed debug section names.
1974 * output.cc (Output_section::add_input_section): Use uncompressed
1975 section size when tracking input sections.
1976
95a2c8d6
RS
19772010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1978
1979 * symtab.h (Symbol::NON_PIC_REF): Remove.
1980 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1981 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1982 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1983 (Symbol::use_plt_offset): Take a flags argument and pass it
1984 directly to needs_dynamic_reloc. Restrict check for undefined
1985 weak symbols to function calls.
1986 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1987 (Target_arm::Scan::global): Use it.
1988 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1989 (Target_arm::Relocate::relocate): Likewise.
1990 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1991 parameter with an r_type parameter. Use get_reference_flags
1992 to get the flags.
1993 (Target_arm::Relocate::relocate): Update accordingly.
1994 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1995 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1996 (Target_i386::Scan::global): Likewise.
1997 (Target_i386::Relocate::relocate): Likewise.
1998 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1999 parameter with an r_type parameter. Use get_reference_flags
2000 to get the flags.
2001 (Target_i386::Relocate::relocate): Update accordingly.
2002 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
2003 (Target_powerpc::Scan::global): Use it.
2004 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
2005 (Target_powerpc::Relocate::relocate): Likewise.
2006 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
2007 (Target_sparc::Scan::global): Use it.
2008 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
2009 (Target_sparc::Relocate::relocate): Likewise.
2010 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
2011 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
2012 (Target_x86_64::Scan::global): Likewise.
2013 (Target_x86_64::Relocate::relocate): Likewise.
2014
f625ae50
DK
20152010-11-08 Doug Kwan <dougkwan@google.com>
2016 Cary Coutant <ccoutant@google.com>
2017
2018 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
2019 (Arm_exidx_merge_section::section_contents_): New data member.
2020 (Arm_input_section::Arm_input_section): Initialize original_contents_.
2021 (Arm_input_section::~Arm_input_section): De-allocate memory.
2022 (Arm_input_section::original_contents_): New data member.
2023 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
2024 in parameters instead of calling Object::section_contents without
2025 locking.
2026 (Arm_output_section::group_section): New parameter TASK. Pass it
2027 to callees that need locking objects.
2028 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
2029 to lock EXIDX input sections. Fix a formatting issue. Call
2030 Arm_exidx_merged_section::build_contents to create merged section
2031 contents.
2032 (Arm_output_section::create_stub_group): New parameter TASK. Use it
2033 to lock object of stub table owner.
2034 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
2035 TEXT_SIZE to initialize data member TEXT_SIZE_.
2036 (Arm_exidx_input_section::addralign): Fix typo in comment.
2037 (Arm_exidx_input_section::text_size): New method.
2038 (Target_arm::do_relax): New parameter TASK. Pass it to callees
2039 that require locking objects. Lock objects before scanning for stubs
2040 and updating local symbols.
2041 (Arm_input_section<big_endian>::init): Copy contents of original
2042 input section.
2043 (Arm_input_section<big_endian>::do_write): Use saved contents of
2044 original input section instead of calling Object::section_contents
2045 without locking.
2046 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
2047 size without calling Object::section_size().
2048 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
2049 for size. Allocate a buffer for merged EXIDX entries.
2050 (Arm_exidx_merged_section::build_contents): New method.
2051 (Arm_exidx_merged_section::do_write): Move merge section contents
2052 building code to Arm_exidx_merged_section::build_contetns. Write
2053 out contetns in buffer instead of building it on the fly.
2054 (Arm_relobj::make_exidx_input_section): Also pass text section size
2055 to Arm_exidx_input_section constructor.
2056 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
2057 (Arm_dynobj::do_read_symbols): Fix memory leak.
2058 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2059 * target.h: (class Task): Add forward declaration.
2060 (Target::relax): Add new parameter TASK and pass it to
2061 Target::do_relax().
2062 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2063
5f9bcf58
CC
20642010-11-05 Cary Coutant <ccoutant@google.com>
2065
2066 PR gold/10708
2067 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2068 object when reading from the file.
2069 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2070 second layout pass.
2071 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2072 when reading section contents.
2073 (get_section_contents): Likewise.
2074 (icf::find_identical_sections): Likewise.
2075 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2076 object when reading from the file.
2077 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2078 the object when doing deferred section layout.
2079
e597fa08
NC
20802010-11-03 Nick Clifton <nickc@redhat.com>
2081
2082 PR gold/12001
2083 * script.h (class Symbol_assignment: name): New member. Returns
2084 the name of the symbol.
2085 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2086 Returns true if the given symbol name is on the list of
2087 assignments wating to be processed.
2088 * archive.cc (should_incldue_member): If the symbol is undefined,
2089 check to see if it is on the list of symbols pending assignment.
2090
3f9a3278
ILT
20912010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2092
2093 * script-sections.cc (Script_sections::find_memory_region): Check
2094 for a NULL output section pointer.
2095
d06fb4d1
DK
20962010-10-29 Doug Kwan <dougkwan@google.com>
2097
2098 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2099 Output_section::add_relaxed_input_section.
2100 * output.cc (Output_section::add_relaxed_input_section): Add new
2101 arguments LAYOUT and NAME. Set section order index.
2102 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2103 Copy section order index.
2104 * output.h (Output_section::add_relaxed_input_section): Add new
2105 arguments LAYOUT and NAME.
2106
90e24de5
ILT
21072010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2108
2109 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2110 NATIVE_OR_CROSS_LINKER.
2111 * testsuite/Makefile.in: Regenerate.
2112
c9484ea5
DK
21132010-10-20 Doug Kwan <dougkwan@google.com>
2114
2115 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2116 without SHF_LINK_ORDER flags.
2117 * layout.cc (Layout::choose_output_section): Do not filter
2118 SHF_LINK_ORDER flag in a relocatable link.
2119
5bc2f5be
CC
21202010-10-17 Cary Coutant <ccoutant@google.com>
2121
2122 * output.h (Output_segment::set_section_addresses): Change function
2123 signature. Update all callers.
2124 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2125 sections.
2126 (Output_segment::set_section_addresses): Align after last TLS
2127 section. Add padding before last relro section instead of after.
2128
0c91cf04
DK
21292010-10-17 Doug Kwan <dougkwan@google.com>
2130
2131 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2132 GOT output section to be writable.
2133
8c21d9d3
CC
21342010-10-14 Cary Coutant <ccoutant@google.com>
2135
2136 * debug.h (DEBUG_INCREMENTAL): New flag.
2137 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2138 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2139 mode.
2140 * incremental.cc (report_command_line): Ignore all forms of
2141 --incremental.
2142 * layout.cc (Layout::Layout): Check parameters for incremental link
2143 mode.
2144 * options.cc (General_options::parse_incremental): New function.
2145 (General_options::parse_no_incremental): New function.
2146 (General_options::parse_incremental_full): New function.
2147 (General_options::parse_incremental_update): New function.
2148 (General_options::incremental_mode_): New data member.
2149 (General_options::finalize): Check incremental_mode_.
2150 * options.h (General_options): Update help text for --incremental.
2151 Add --no-incremental, --incremental-full, --incremental-update.
2152 (General_options::Incremental_mode): New enum type.
2153 (General_options::incremental_mode): New function.
2154 (General_options::incremental_mode_): New data member.
2155 * parameters.cc (Parameters::incremental_mode_): New data member.
2156 (Parameters::set_options): Set incremental_mode_.
2157 (Parameters::set_incremental_full): New function.
2158 (Parameters::incremental): New function.
2159 (Parameters::incremental_update): New function.
2160 (set_parameters_incremental_full): New function.
2161 * parameters.h (Parameters::set_incremental_full): New function.
2162 (Parameters::incremental): New function.
2163 (Parameters::incremental_update): New function.
2164 (Parameters::incremental_mode_): New data member.
2165 (set_parameters_incremental_full): New function.
2166 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2167 incremental link mode.
2168 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2169 (Sized_relobj::do_relocate_sections): Likewise.
2170 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2171 option.
2172 * testsuite/Makefile.in: Regenerate.
2173 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2174
bb32aa18 21752010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
2176
2177 * script-sections.h (class Script_sections): Make
2178 Sections_elements typedef public.
2179 * script-sections.cc (class Sort_output_sections): Add elements_
2180 field. Add constructor which sets it; change all callers.
2181 (Sort_output_sections::is_before): New function.
2182 (Sort_output_sections::operator()): Call is_before.
2183 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2184 conditional.
2185 * testsuite/script_test_10.sh: New test. Test script section
2186 order.
2187 * testsuite/script_test_10.t: Likewise.
2188 * testsuite/script_test_10.s: Likewise.
2189 * testsuite/Makefile.am: Wrap the cross linker tests and the
2190 common tests into NATIVE_OR_CROSS_LINKER.
2191 (check_SCRIPTS): Add script_test_10.sh.
2192 (check_DATA): Add script_test_10.stdout.
2193 (script_test_10.o, script_test_10): New targets.
2194 (script_test_10.stdout): New target.
2195 * configure, testsuite/Makefile.in: Regenerate.
2196
3cef7179
ILT
21972010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2198
2199 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2200 error for the deprecated relocations.
2201 (Target_arm::Scan::global): Likewise.
2202 (Target_arm::Relocate::relocate): Likewise.
2203
7411e9a8
RS
22042010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2205
2206 * fileread.cc (Input_file::find_file): Initialize *found_name
2207 and *namep when using the fallback search for case 4.
2208
6a9da32a
CC
22092010-10-11 Cary Coutant <ccoutant@google.com>
2210
2211 * options.h (class General_options): Redefine -z lazy as an alias for
2212 the negation of -z now.
2213
ac897c20
ILT
22142010-10-11 Ian Lance Taylor <iant@google.com>
2215
2216 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2217 binding.
2218
ea5cae92
NC
22192010-10-06 Nick Clifton <nickc@redhat.com>
2220
2221 * script-sections.cc(class Memory_region): Remove
2222 current_lma_offset_ field. Rename current_vma_offset_ to
2223 current_offset_. Add last_section_ field.
2224 (Memory_region::get_current_vma_address): Rename to
2225 get_current_address.
2226 (Memory_region::get_current_lma_address): Delete.
2227 (Memory_region::increment_vma_offset): Rename to
2228 increment_offset.
2229 (Memory_region::increment_lma_offset): Delete.
2230 (Memory_region::attributes_compatible): New method. Returns
2231 true if the provided section is compatible with the region.
2232 (Memory_region::get_last_section): New method. Returns the last
2233 section to use the region.
2234 (Memory_region::set_last_section): New method. Stores the last
2235 section to use the region.
2236 (Script_sections::block_in_region): New method. Returns true if
2237 a block of memory is contained within a region.
2238 (Script_sections::find_memory_region): New method. Locates a
2239 memory region to be used to set a VMA or LMA address.
2240 (Output_section_definition::set_section_addresses): Add code to
2241 check for addresses set by memory regions.
2242 (Output_segment::set_section_addresses): Remove memory region
2243 walking code.
2244 (Script_sections::create_segment): Add a warning if a header
2245 segment is created outside of any region.
2246 * script-sections.h (class Script_sections): Add prototypes for
2247 find_memory_region and block_in_region methods.
2248 * testsuite/memory_test.s: Use .long instead of .word.
2249 * testsuite/memory_test.t: Add some more output sections.
2250 * testsuite/memory_test.sh: Update expected output.
2251
a9bfd952
DK
22522010-10-02 Doug Kwan <dougkwan@google.com>
2253
2254 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2255 defintion to symtab.h
2256 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2257 declaration to defintion.
2258
bacff3ab
NC
22592010-10-01 Nick Clifton <nickc@redhat.com>
2260
2261 * expression.cc (eval): Replace dummy argument with NULL.
2262 (eval_maybe_dot): Check for a NULL result section pointer.
2263 (Symbol_expression::value): Likewise.
2264 (Dot_expression::value): Likewise.
2265 (BINARY_EXPRESSION): Likewise.
2266 (Max_expression::value): Likewise.
2267 (Min_expression::value): Likewise.
2268 (Absolute_expression::value): Likewise.
2269 (Addr_expression::value_from_output_section): Likewise.
2270 (Loaddddr_expression::value_from_output_section): Likewise.
2271 (Segment_start_expression::value): Likewise.
2272 * script-sections.cc
2273 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2274 argument with NULL.
2275 (Sections_elememt_dot_assignment::set_section_addresses):
2276 Likewise.
2277 (Output_data_expression::do_write_to_buffer): Likewise.
2278 (Output_section_definition::finalize_symbols): Likewise.
2279 (Output_section_definition::set_section_addresses): Likewise.
2280
f81bc8b5
DK
22812010-09-30 Doug Kwan <dougkwan@google.com>
2282
2283 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2284
c95e9f27
ST
22852010-09-28 Sriraman Tallam <tmsriram@google.com>
2286
2287 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 2288 function.
c95e9f27
ST
2289 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2290 virtual function.
2291 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2292 virtual function.
2293 * icf.cc (get_section_contents): Inline merge sections only when
2294 target allows it.
2295
3cac54d2
RW
22962010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2297
2298 * configure: Regenerate.
2299
2904037a
ILT
23002010-09-17 Ian Lance Taylor <iant@google.com>
2301
2302 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
2303 * testsuite/Makefile.am (memory_test.o): New target.
2304 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2305 memory_test.t.
2306 * testsuite/Makefile.in: Rebuild.
2904037a 2307
bca7fb63
DK
23082010-09-17 Doug Kwan <dougkwan@google.com>
2309
2310 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2311 defintion if relocation uses GOT entries of the symbol.
2312 * testsuite/icf_safe_test.sh: Fix test.
2313 * testsuite/icf_safe_so_test.sh: Fix test.
2314
4ef28648
CC
23152010-09-16 Cary Coutant <ccoutant@google.com>
2316
2317 * script_sections.cc (class Memory_region): Remove "NULL" from
2318 vector initializations.
2319
793990de
CC
23202010-09-15 Cary Coutant <ccoutant@google.com>
2321
2322 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2323 Resolve forwarding symbols.
2324
81e015e2
DK
23252010-09-15 Doug Kwan <dougkwan@google.com>
2326
2327 * gold/testsuite/script_test_3.t: Add ARM special sections.
2328 * gold/testsuite/script_test_4.t: Same.
2329 * gold/testsuite/script_test_5.t: Same.
2330 * gold/testsuite/script_test_6.t: Same.
2331 * gold/testsuite/script_test_7.t: Same.
2332 * gold/testsuite/script_test_7.t: Same.
2333 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2334
36171d64
CC
23352010-09-14 Cary Coutant <ccoutant@google.com>
2336
2337 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
2338 (Target_x86_64::Relocate::relocate_tls): Replace check for
2339 saw_tls_block_reloc_ with test for executable section.
2340
d89051bd
CC
23412010-09-12 Cary Coutant <ccoutant@google.com>
2342
2343 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2344 position-independent executables to shared libraries need dynamic
2345 relocations.
2346 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2347 position-independent executables.
2348 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2349 * testsuite/Makefile.in: Regenerate.
2350
fca41f0f
NC
23512010-09-10 Nick Clifton <nickc@redhat.com>
2352
2353 PR gold/11997
2354 * testsuite/memory_test.t: Discard any sections that are not
2355 needed.
2356
6695e4b3
L
23572010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2358
2359 PR gold/11996
2360 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2361 "This::" to work around a bug in gcc 4.2.
2362
2363 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2364
0f72bf6f
RÁE
23652010-09-09 Rafael Espindola <espindola@google.com>
2366
2367 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
2368 sections with different PF_X flags in the same segment.
2369 (Layout::find_first_load_seg): Search all segments to find the first
2370 one.
2371 * options.h (rosegment): New.
2372
23732010-09-08 Rafael Espindola <espindola@google.com>
a6577478 2374
05a79166 2375 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 2376
aa98ff75
DK
23772010-09-08 Doug Kwan <dougkwan@google.com>
2378
2379 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
2380 (Arm_relobj::do_relocate_sections): Add new parameter for output
2381 file to match the parent.
2382 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
2383 of local symbols instead of input values. Update code to track
2384 changes in gold::relocate_section.
2385 * object.cc (Sized_relobj::compute_final_local_value): New methods.
2386 (Sized_relobj::compute_final_local_value_internal): New methods.
2387 (Sized_relobj::do_finalize_local_symbols): Move code from loop
2388 body into private version of Sized_relobj::compute_final_local_value.
2389 Call the inline method.
2390 * object.h (Symbol_value::Symbol_value): Define destructor. Free
2391 merged symbol value if there is one.
2392 (Symbol_value::has_output_value): New method defintiion.
2393 (Sized_relobj::Compute_final_local_value_status): New enum type.
2394 (Sized_relobj::compute_final_local_value): New methods.
2395 (Sized_relobj::compute_final_local_value_internal): New methods.
2396 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
2397 and arm_cortex_a8.sh.
2398 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
2399 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
2400 New tests.
2401 * Makefile.in: Regenerate.
2402 * testsuite/arm_bl_out_of_range.s: Update test.
2403 * testsuite/thumb_bl_out_of_range.s: Ditto.
2404 * testsuite/thumb_blx_out_of_range.s: Ditto.
2405 * testsuite/arm_branch_out_of_range.sh: New file.
2406 * testsuite/arm_cortex_a8.sh: Ditto.
2407 * testsuite/arm_cortex_a8_b.s: Ditto.
2408 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
2409 * testsuite/arm_cortex_a8_b_local.s: Ditto.
2410 * testsuite/arm_cortex_a8_bl.s: Ditto.
2411 * testsuite/arm_cortex_a8_blx.s: Ditto.
2412 * testsuite/arm_cortex_a8_local.s: Ditto.
2413 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
2414 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2415
05a79166
L
24162010-09-08 Rafael Espindola <espindola@google.com>
2417
2418 * Makefile.am (memory_test.stdout): Run readelf with -W.
2419 * Makefile.in: Regenerate.
2420 * testsuite/memory_test.sh: Make the regexps accept both 32 and
2421 64 bit output.
2422
33dbc701
RÁE
24232010-09-08 Rafael Espindola <espindola@google.com>
2424
2425 * script-sections.cc (Script_sections::add_memory_region): Convert
2426 field precision to int.
2427 * script.cc (script_set_section_region, script_set_section_region):
2428 Convert field precision to int.
2429
731ca54a
RÁE
24302010-09-08 Rafael Espindola <espindola@google.com>
2431
2432 * arm.cc (do_finalize_sections): Create the __exidx_start and
2433 __exdix_end symbols even when the section is missing.
2434
7f8cd844
NC
24352010-09-08 Nick Clifton <nickc@redhat.com>
2436
2437 * README: Remove claim that MEMORY is not supported.
2438 * expression.cc (script_exp_function_origin)
2439 (script_exp_function_length): Move from here to ...
2440 * script.cc: ... here.
2441 (script_set_section_region, script_add_memory)
2442 (script_parse_memory_attr, script_include_directive): New
2443 functions.
2444 * script-sections.cc
2445 (class Memory_region): New class.
2446 (class Output_section_definition): Add set_memory_region,
2447 set_section_vma, set_section_lma and get_section_name methods.
2448 (class Script_Sections): Add add_memory_region,
2449 find_memory_region, find_memory_region_origin,
2450 find_memory_region_length and set_memory_region methods.
2451 Have set_section_addresses method walk the list of set memory
2452 regions.
2453 Extend the print methos to display memory regions.
2454 * script-sections.h: Add prototypes for new methods.
2455 Add enum for MEMORY region attributes.
2456 * yyscript.y: Add support for parsing MEMORY regions.
2457 * script-c.h: Add prototypes for new functions.
2458 * testsuite/Makefile.am: Add test of MEMORY region functionality.
2459 * testsuite/Makefile.in: Regenerate.
2460 * testsuite/memory_test.sh: New script.
2461 * testsuite/memory_test.s: New assembler source file.
2462 * testsuite/memory_test.t: New linker script.
2463
a4649286
DK
24642010-08-27 Doug Kwan <dougkwan@google.com>
2465
2466 * gold/resolve.cc (Symbol_table::should_override): Let a weak
2467 reference override an existing dynamic weak reference.
2468 * testsuite/Makefile.am: Add new test dyn_weak_ref.
2469 * testsuite/Makefile.in: Regenerate.
2470 * testsuite/dyn_weak_ref.sh: New file.
2471 * testsuite/dyn_weak_ref_1.c: Ditto.
2472 * testsuite/dyn_weak_ref_2.c: Ditto.
2473
b56648ad
ILT
24742010-08-27 Ian Lance Taylor <iant@google.com>
2475
2476 * incremental.h (class Incremental_input_entry): Add virtual
2477 destructor.
2478
809313cb
ILT
24792010-08-27 Ian Lance Taylor <iant@google.com>
2480
2481 * testsuite/start_lib_test_3.c: Mark t3 as used.
2482
11e32464
NC
24832010-08-27 Nick Clifton <nickc@redhat.com>
2484
2485 * options.cc (version_script): Fix small typo in previous
2486 whitespace tidyup.
2487
ca09d69a
NC
24882010-08-25 Nick Clifton <nickc@redhat.com>
2489
2490 * archive.cc: Formatting fixes: Remove whitespace between
2491 typename and following asterisk. Remove whitespace between
2492 function name and opening parenthesis.
2493 * archive.h: Likewise.
2494 * arm.cc: Likewise.
2495 * attributes.cc: Likewise.
2496 * attributes.h: Likewise.
2497 * common.cc: Likewise.
2498 * copy-relocs.cc: Likewise.
2499 * dirsearch.h: Likewise.
2500 * dynobj.cc: Likewise.
2501 * ehframe.cc: Likewise.
2502 * ehframe.h: Likewise.
2503 * expression.cc: Likewise.
2504 * fileread.cc: Likewise.
2505 * fileread.h: Likewise.
2506 * gc.h: Likewise.
2507 * gold-threads.cc: Likewise.
2508 * gold.cc: Likewise.
2509 * i386.cc: Likewise.
2510 * icf.h: Likewise.
2511 * incremental-dump.cc: Likewise.
2512 * incremental.cc: Likewise.
2513 * layout.cc: Likewise.
2514 * layout.h: Likewise.
2515 * main.cc: Likewise.
2516 * merge.cc: Likewise.
2517 * merge.h: Likewise.
2518 * object.cc: Likewise.
2519 * object.h: Likewise.
2520 * options.cc: Likewise.
2521 * options.h: Likewise.
2522 * output.cc: Likewise.
2523 * output.h: Likewise.
2524 * plugin.cc: Likewise.
2525 * plugin.h: Likewise.
2526 * powerpc.cc: Likewise.
2527 * reloc.cc: Likewise.
2528 * script-c.h: Likewise.
2529 * script-sections.cc: Likewise.
2530 * script.cc: Likewise.
2531 * stringpool.cc: Likewise.
2532 * symtab.cc: Likewise.
2533 * symtab.h: Likewise.
2534 * target.cc: Likewise.
2535 * timer.cc: Likewise.
2536 * timer.h: Likewise.
2537 * version.cc: Likewise.
2538 * x86_64.cc: Likewise.
2539
b8fa8750
NC
25402010-08-24 Nick Clifton <nickc@redhat.com>
2541
2542 PR 11899
2543 * layout.cc (segment_precedes): Sort segments by their physical
2544 addresses, if they have been set.
2545
9919d93b
CC
25462010-08-23 Cary Coutant <ccoutant@google.com>
2547
2548 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
2549 symbols data.
2550 (Lib_group::include_member): Unlock object after deleting its
2551 symbols data.
2552 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
2553 the bug fixed here.
2554
97b4be1c
CC
25552010-08-19 Neil Vachharajani <nvachhar@google.com>
2556 Cary Coutant <ccoutant@google.com>
2557
2558 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
2559 constructor, and set_blocker.
2560 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
2561 readsyms_blocker_.
2562 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
2563 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
2564 * testsuite/Makefile.am (start_lib_test): New test case.
2565 * testsuite/Makefile.in: Regenerate.
2566 * testsuite/start_lib_test_main.c: New file.
2567 * testsuite/start_lib_test_1.c: New file.
2568 * testsuite/start_lib_test_2.c: New file.
2569 * testsuite/start_lib_test_3.c: New file.
2570
dd0b1884
ILT
25712010-08-19 Ian Lance Taylor <iant@google.com>
2572
2573 * Makefile.in: Rebuild with automake 1.11.1.
2574 * aclocal.m4: Likewise.
2575 * testsuite/Makefile.in: Likewise.
2576
7223e9ca
ILT
25772010-08-19 Ian Lance Taylor <iant@google.com>
2578
2579 PR 10893
2580 * i386.cc (class Output_data_plt_i386): Update declarations.
2581 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
2582 local_ifuncs_ fields.
2583 (Target_i386::do_plt_section_for_global): New function.
2584 (Target_i386::do_plt_section_for_local): New function.
2585 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2586 parameter; change all callers. Initialize global_ifuncs_ and
2587 local_ifuncs_. If doing a static link define __rel_iplt_start and
2588 __rel_iplt_end.
2589 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2590 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2591 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2592 symbols.
2593 (Target_i386::make_plt_section): New function, broken out of
2594 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2595 (Target_i386::make_plt_entry): Call make_plt_section.
2596 (Target_i386::make_local_ifunc_plt_entry): New function.
2597 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2598 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2599 R_386_IRELATIVE to switch.
2600 (Target_i386::Scan::global): Likewise.
2601 (Target_i386::Relocate::relocate): Likewise.
2602 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2603 switch.
2604 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2605 (Target_x86_64::do_plt_section_for_global): New function.
2606 (Target_x86_64::do_plt_section_for_local): New function.
2607 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2608 parameter; change all callers. If doing a static link define
2609 __rela_iplt_start and __rela_iplt_end.
2610 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2611 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2612 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2613 to point to .plt.
2614 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2615 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2616 switch.
2617 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2618 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2619 R_X86_64_IRELATIVE to switch.
2620 (Target_x86_64::Scan::global): Likewise.
2621 (Target_x86_64::Relocate::relocate): Likewise.
2622 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2623 switch.
2624 * target.h (class Target): Add plt_section_for_global and
2625 plt_section_for_local functions. Add do_plt_section_for_global
2626 and do_plt_section_for_local virtual functions.
2627 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2628 clarifying comments.
2629 (Symbol::use_plt_offset): Handle IFUNC symbol.
2630 * object.cc (Sized_relobj::Sized_relobj): Initialize
2631 local_plt_offsets_.
2632 (Sized_relobj::local_has_plt_offset): New function.
2633 (Sized_relobj::local_plt_offset): New function.
2634 (Sized_relobj::set_local_plt_offset): New function.
2635 (Sized_relobj::do_count): Handle IFUNC symbol.
2636 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2637 a bit away from input_shndx_ field. Add set_is_func_symbol and
2638 is_ifunc_symbol functions.
2639 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2640 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2641 local_plt_offsets_ field.
2642 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2643 * output.h (class Output_section_data): Add non-const
2644 output_section function.
2645 (class Output_data_got): Update declarations.
2646 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2647 Add use_plt_offset parameter to global and local constructors.
2648 Change all callers. Change local_sym_index_ field to 31 bits.
2649 Change GSYM_CODE and CONSTANT_CODE accordingly.
2650 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2651 doing a static link don't set sh_link field.
2652 (Output_data_got::Got_entry::write): Use PLT offset if
2653 appropriate.
2654 (Output_data_got::add_global_plt): New function.
2655 (Output_data_got::add_local_plt): New function.
2656 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2657 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2658 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2659 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
2660 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
2661 IFUNC conditional.
2662 * testsuite/ifunc-sel.h: New file.
2663 * testsuite/ifuncmain1.c: New file.
2664 * testsuite/ifuncmain1vis.c: New file.
2665 * testsuite/ifuncmod1.c: New file.
2666 * testsuite/ifuncdep2.c: New file.
2667 * testsuite/ifuncmain2.c: New file.
2668 * testsuite/ifuncmain3.c: New file.
2669 * testsuite/ifuncmod3.c: New file.
2670 * testsuite/ifuncmain4.c: New file.
2671 * testsuite/ifuncmain5.c: New file.
2672 * testsuite/ifuncmod5.c: New file.
2673 * testsuite/ifuncmain6pie.c: New file.
2674 * testsuite/ifuncmod6.c: New file.
2675 * testsuite/ifuncmain7.c: New file.
2676 * configure, testsuite/Makefile.in: Rebuild.
2677
56f75c03
ILT
26782010-08-18 Ian Lance Taylor <iant@google.com>
2679
2680 * incremental.cc
2681 (Output_section_incremental_inputs::write_input_files): Add cast
2682 to avoid signed/unsigned comparison warning.
2683 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2684
55455f89
CC
26852010-08-12 Cary Coutant <ccoutant@google.com>
2686
2687 * common.cc (Sort_commons::operator()): Remove unnecessary code.
2688
e2054bcb
ILT
26892010-08-13 Ian Lance Taylor <iant@google.com>
2690
2691 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2692
74f67560
DK
26932010-08-12 Cary Coutant <ccoutant@google.com>
2694 Doug Kwan <dougkwan@google.com>
2695
2696 * resolve.cc (Symbol_table::should_override): When a weak dynamic
2697 defintion overrides non-weak undef, remember that the original undef
2698 is not weak.
2699 * symtab.cc (Symbol_table::sized_write_global): For undef without
2700 an original weak binding, set binding to global in output.
2701 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
2702 * testsuite/Makefile.in: Regenerate.
2703 * testsuite/strong_ref_weak_def.sh: New file.
2704 * testsuite/strong_ref_weak_def_1.c: Ditto.
2705 * testsuite/strong_ref_weak_def_2.c: Ditto.
2706
d1238d12
CC
27072010-08-12 Cary Coutant <ccoutant@google.com>
2708
2709 * testsuite/incremental_test.sh: Rewrite.
2710 * testsuite/incremental_test_1.c: Rewrite.
2711 * testsuite/incremental_test_2.c: Rewrite.
2712
0e70b911
CC
27132010-08-12 Cary Coutant <ccoutant@google.com>
2714
2715 * arm.cc (Target_arm::got_size): Add const.
2716 (Target_arm::got_entry_count): New function.
2717 (Target_arm::plt_entry_count): New function.
2718 (Target_arm::first_plt_entry_offset): New function.
2719 (Target_arm::plt_entry_size): New function.
2720 (Output_data_plt_arm::entry_count): New function.
2721 (Output_data_plt_arm::first_plt_entry_offset): New function.
2722 (Output_data_plt_arm::get_plt_entry_size): New function.
2723 * i386.cc (Target_i386::got_size): Add const.
2724 (Target_i386::got_entry_count): New function.
2725 (Target_i386::plt_entry_count): New function.
2726 (Target_i386::first_plt_entry_offset): New function.
2727 (Target_i386::plt_entry_size): New function.
2728 (Output_data_plt_i386::entry_count): New function.
2729 (Output_data_plt_i386::first_plt_entry_offset): New function.
2730 (Output_data_plt_i386::get_plt_entry_size): New function.
2731 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
2732 find_incremental_inputs_sections. Dump incremental_got_plt section.
2733 * incremental.cc: Include target.h.
2734 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
2735 parameter. Adjust all callers. Find incremental_got_plt section.
2736 (Incremental_inputs::create_data_sections): Create incremental_got_plt
2737 section.
2738 (Output_section_incremental_inputs::set_final_data_size): Calculate
2739 size of incremental_got_plt section.
2740 (Output_section_incremental_inputs::do_write): Write the
2741 incremental_got_plt section.
2742 (Got_plt_view_info): New struct.
2743 (Local_got_offset_visitor): New class.
2744 (Global_got_offset_visitor): New class.
2745 (Global_symbol_visitor_got_plt): New class.
2746 (Output_section_incremental_inputs::write_got_plt): New function.
2747 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
2748 Add parameter. Adjust all callers.
2749 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2750 (Incremental_inputs::got_plt_section): New function.
2751 (Incremental_inputs::got_plt_section_): New data member.
2752 (Incremental_got_plt_reader): New class.
2753 * layout.cc (Layout::create_incremental_info_sections): Add the
2754 incremental_got_plt section.
2755 * object.h (Got_offset_list::get_list): New function.
2756 (Got offset_list::for_all_got_offsets): New function.
2757 (Sized_relobj::local_got_offset_list): New function.
2758 * powerpc.cc (Target_powerpc::got_size): Add const.
2759 (Target_powerpc::got_entry_count): New function.
2760 (Target_powerpc::plt_entry_count): New function.
2761 (Target_powerpc::first_plt_entry_offset): New function.
2762 (Target_powerpc::plt_entry_size): New function.
2763 (Output_data_plt_powerpc::entry_count): New function.
2764 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
2765 (Output_data_plt_powerpc::get_plt_entry_size): New function.
2766 * sparc.cc (Target_sparc::got_size): Add const.
2767 (Target_sparc::got_entry_count): New function.
2768 (Target_sparc::plt_entry_count): New function.
2769 (Target_sparc::first_plt_entry_offset): New function.
2770 (Target_sparc::plt_entry_size): New function.
2771 (Output_data_plt_sparc::entry_count): New function.
2772 (Output_data_plt_sparc::first_plt_entry_offset): New function.
2773 (Output_data_plt_sparc::get_plt_entry_size): New function.
2774 * symtab.h (Symbol::got_offset_list): New function.
2775 (Symbol_table::for_all_symbols): New function.
2776 * target.h (Sized_target::got_entry_count): New function.
2777 (Sized_target::plt_entry_count): New function.
2778 (Sized_target::plt_entry_size): New function.
2779 * x86_64.cc (Target_x86_64::got_size): Add const.
2780 (Target_x86_64::got_entry_count): New function.
2781 (Target_x86_64::plt_entry_count): New function.
2782 (Target_x86_64::first_plt_entry_offset): New function.
2783 (Target_x86_64::plt_entry_size): New function.
2784 (Output_data_plt_x86_64::entry_count): New function.
2785 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
2786 (Output_data_plt_x86_64::get_plt_entry_size): New function.
2787
09ec0418
CC
27882010-08-12 Cary Coutant <ccoutant@google.com>
2789
2790 * archive.cc: Include incremental.h.
2791 (Archive::Archive): Initialize incremental_info_.
2792 (Archive::include_member): Record archive members in incremental info.
2793 (Add_archive_symbols::run): Record begin and end of an archive in
2794 incremental info.
2795 (Lib_group::include_member): Record objects in incremental info.
2796 * archive.h (Incremental_archive_entry): Forward declaration.
2797 (Archive::set_incremental_info): New member function.
2798 (Archive::incremental_info): New member function.
2799 (Archive::Unused_symbol_iterator): New class.
2800 (Archive::unused_symbols_begin): New member function.
2801 (Archive::unused_symbols_end): New member function.
2802 (Archive::incremental_info_): New data member.
2803 * incremental-dump.cc (find_input_containing_global): New function.
2804 (dump_incremental_inputs): Dump new incremental info sections.
2805 * incremental.cc: Include symtab.h.
2806 (Output_section_incremental_inputs): New class.
2807 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
2808 new incremental info sections.
2809 (Sized_incremental_binary::do_check_inputs): Likewise.
2810 (Incremental_inputs::report_archive): Remove.
2811 (Incremental_inputs::report_archive_begin): New function.
2812 (Incremental_inputs::report_archive_end): New function.
2813 (Incremental_inputs::report_object): New function.
2814 (Incremental_inputs::finalize_inputs): Remove.
2815 (Incremental_inputs::report_input_section): New function.
2816 (Incremental_inputs::report_script): Rewrite.
2817 (Incremental_inputs::finalize): Do nothing but finalize string table.
2818 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2819 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2820 (Incremental_inputs::create_data_sections): New function.
2821 (Incremental_inputs::relocs_entsize): New function.
2822 (Output_section_incremental_inputs::set_final_data_size): New function.
2823 (Output_section_incremental_inputs::do_write): New function.
2824 (Output_section_incremental_inputs::write_header): New function.
2825 (Output_section_incremental_inputs::write_input_files): New function.
2826 (Output_section_incremental_inputs::write_info_blocks): New function.
2827 (Output_section_incremental_inputs::write_symtab): New function.
2828 * incremental.h (Incremental_script_entry): Forward declaration.
2829 (Incremental_object_entry): Forward declaration.
2830 (Incremental_archive_entry): Forward declaration.
2831 (Incremental_inputs): Forward declaration.
2832 (Incremental_inputs_header_data): Remove.
2833 (Incremental_inputs_header): Remove.
2834 (Incremental_inputs_header_write): Remove.
2835 (Incremental_inputs_entry_data): Remove.
2836 (Incremental_inputs_entry): Remove.
2837 (Incremental_inputs_entry_write): Remove.
2838 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
2839 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
2840 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2841 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
2842 Likewise.
2843 (Incremental_input_entry): New class.
2844 (Incremental_script_entry): New class.
2845 (Incremental_object_entry): New class.
2846 (Incremental_archive_entry): New class.
2847 (Incremental_inputs::Incremental_inputs): Initialize new data members.
2848 (Incremental_inputs::report_inputs): Remove.
2849 (Incremental_inputs::report_archive): Remove.
2850 (Incremental_inputs::report_archive_begin): New function.
2851 (Incremental_inputs::report_archive_end): New function.
2852 (Incremental_inputs::report_object): Change prototype.
2853 (Incremental_inputs::report_input_section): New function.
2854 (Incremental_inputs::report_script): Change prototype.
2855 (Incremental_inputs::get_reloc_count): New function.
2856 (Incremental_inputs::set_reloc_count): New function.
2857 (Incremental_inputs::create_data_sections): New function.
2858 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2859 (Incremental_inputs::inputs_section): New function.
2860 (Incremental_inputs::symtab_section): New function.
2861 (Incremental_inputs::relocs_section): New function.
2862 (Incremental_inputs::get_stringpool): Add const.
2863 (Incremental_inputs::command_line): Add const.
2864 (Incremental_inputs::inputs): Remove.
2865 (Incremental_inputs::command_line_key): New function.
2866 (Incremental_inputs::input_file_count): New function.
2867 (Incremental_inputs::input_files): New function.
2868 (Incremental_inputs::relocs_entsize): New function.
2869 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2870 (Incremental_inputs::finalize_inputs): Remove.
2871 (Incremental_inputs::Input_info): Remove.
2872 (Incremental_inputs::lock_): Remove.
2873 (Incremental_inputs::inputs_): Change type.
2874 (Incremental_inputs::inputs_map_): Remove.
2875 (Incremental_inputs::current_object_entry_): New data member.
2876 (Incremental_inputs::inputs_section_): New data member.
2877 (Incremental_inputs::symtab_section_): New data member.
2878 (Incremental_inputs::relocs_section_): New data member.
2879 (Incremental_inputs::reloc_count_): New data member.
2880 (Incremental_inputs_reader): New class.
2881 (Incremental_symtab_reader): New class.
2882 (Incremental_relocs_reader): New class.
2883 * layout.cc (Layout::finalize): Move finalization of incremental info
2884 and creation of incremental info sections to follow finalization of
2885 symbol table. Set offsets for postprocessing sections.
2886 (Layout::create_incremental_info_sections): Call
2887 Incremental_inputs::create_data_sections. Add incremental symtab
2888 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
2889 sections to layout after input sections.
2890 * layout.h (struct Timespec): Forward declaration.
2891 (Layout::incremental_inputs): Add const.
2892 (Layout::create_incremental_info_sections): Add parameter.
2893 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
2894 * object.cc: Include incremental.h.
2895 (Relobj::finalize_incremental_relocs): New function.
2896 (Sized_relobj::do_layout): Record input sections in incremental info.
2897 * object.h (Object::output_section): New function.
2898 (Object::output_section_offset): Moved from Relobj.
2899 (Object::get_incremental_reloc_base): New function.
2900 (Object::get_incremental_reloc_count): New function.
2901 (Object::do_output_section): New function.
2902 (Object::do_output_section_offset): Moved from Relobj.
2903 (Object::do_get_incremental_reloc_base): New function.
2904 (Object::do_get_incremental_reloc_count): New function.
2905 (Object::Object): Initialize new data members.
2906 (Relobj::output_section): Renamed do_output_section and moved to
2907 protected.
2908 (Relobj::output_section_offset): Moved to Object.
2909 (Relobj::do_get_incremental_reloc_base): New function.
2910 (Relobj::do_get_incremental_reloc_count): New function.
2911 (Relobj::allocate_incremental_reloc_counts): New function.
2912 (Relobj::count_incremental_reloc): New function.
2913 (Relobj::finalize_incremental_relocs): New function.
2914 (Relobj::next_incremental_reloc_index): New function.
2915 (Relobj::reloc_counts_): New data member.
2916 (Relobj::reloc_bases_): New data member.
2917 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2918 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2919 (Sized_relobj::incremental_relocs_scan): New function.
2920 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2921 (Sized_relobj::incremental_relocs_write): New function.
2922 (Sized_relobj::incremental_relocs_write_reltype): New function.
2923 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2924 incremental link.
2925 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2926 archives and object files elsewhere.
2927 (Add_symbols::run): Report object files here.
2928 (Finish_group::run): Report end of archive at end of group.
2929 * reloc.cc: Include layout.h, incremental.h.
2930 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2931 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2932 (Sized_relobj::incremental_relocs_scan): New function.
2933 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2934 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2935 (Sized_relobj::incremental_relocs_write): New function.
2936 (Sized_relobj::incremental_relocs_write_reltype): New function.
2937 * script.cc (read_input_script): Rewrite test for incremental link.
2938 Change call to Incremental_inputs::report_script.
2939 * symtab.h (Symbol_table::first_global_index): New function.
2940 (Symbol_table::output_count): New function.
2941
ce0d1972
DK
29422010-08-12 Doug Kwan <dougkwan@google.com>
2943
2944 * arm.cc (Target_arm::merge_object_attributes): Check command line
2945 options --no-wchar-size-warning and --no-enum-size-warning.
2946 * options.h (General_options): Add ld-compatible options
2947 --no-enum-size-warning and --no-wchar-size-warning.
2948
6e5710ce
ILT
29492010-08-04 Ian Lance Taylor <iant@google.com>
2950
2951 * x86_64.cc (Target_x86_64::Scan::local): Use
2952 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2953 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2954 (Target_x86_64::Scan::global): Likewise.
2955 (Target_x86_64::Relocate::relocate): Likewise.
2956 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2957 Likewise.
2958
fef830db
CC
29592010-08-03 Cary Coutant <ccoutant@google.com>
2960
2961 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2962 to reserve space in merged_strings vector. Keep total input size
2963 for stats.
2964 (Output_merge_string::do_print_merge_stats): Print total input size.
2965 * merge.h (Output_merge_string): Add input_size_ field.
2966 * stringpool.cc (Stringpool_template::string_length): Move
2967 implementations out of Stringpool_template class and place in
2968 stringpool.h.
2969 * stringpool.h (string_length): Move out of Stringpool_template.
2970
1e3811b0
ILT
29712010-08-03 Ian Lance Taylor <iant@google.com>
2972
2973 PR 11712
2974 * layout.cc (relaxation_loop_body): If address of load segment is
2975 set, adjust address to include headers if possible.
2976
7af0c620
ILT
29772010-08-03 Ian Lance Taylor <iant@google.com>
2978
2979 * version.cc (version_string): Bump to 1.10.
2980
22f0da72
ILT
29812010-08-03 Ian Lance Taylor <iant@google.com>
2982
2983 PR 11805
2984 * layout.h (enum Output_section_order): Define.
2985 (class Layout): Update declarations.
2986 * layout.cc (Layout::get_output_section): Add order parameter.
2987 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2988 is_first_non_relro parameters. Change all callers.
2989 (Layout::choose_output_section): Likewise.
2990 (Layout::add_output_section_data): Likewise.
2991 (Layout::make_output_section): Likewise. Set order.
2992 (Layout::default_section_order): New function.
2993 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2994 * output.cc (Output_section::Output_section): Initialize order_.
2995 Don't initialize deleted fields.
2996 (Output_segment::Output_segment): Don't initialize deleted
2997 fields.
2998 (Output_segment::add_output_section_to_load): New function
2999 replacing add_output_section. Change all callers to call this or
3000 add_output_section_to_nonload.
3001 (Output_segment::add_output_section_to_nonload): New function.
3002 (Output_segment::remove_output_section): Rewrite.
3003 (Output_segment::add_initial_output_data): Likewise.
3004 (Output_segment::has_any_data_sections): Likewise.
3005 (Output_segment::is_first_section_relro): Likewise.
3006 (Output_segment::maximum_alignment): Likewise.
3007 (Output_segment::has_dynamic_reloc): New function replacing
3008 dynamic_reloc_count. Change all callers.
3009 (Output_segment::has_dynamic_reloc_list): New function replacing
3010 dynamic_reloc_count_list. Change all callers.
3011 (Output_segment::set_section_addresses): Rewrite.
3012 (Output_segment::set_offset): Rewrite.
3013 (Output_segment::find_first_and_last_list): Remove.
3014 (Output_segment::set_tls_offsets): Rewrite.
3015 (Output_segment::first_section_load_address): Likewise.
3016 (Output_segment::output_section_count): Likewise.
3017 (Output_segment::section_with_lowest_load_address): Likewise.
3018 (Output_segment::write_section_headers): Likewise.
3019 (Output_segment::print_sections_to_map): Likewise.
3020 * output.h (class Output_data): Remove dynamic_reloc_count_
3021 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
3022 (Output_data::add_dynamic_reloc): Rewrite.
3023 (Output_data::has_dynamic_reloc): New function.
3024 (Output_data::dynamic_reloc_count): Remove.
3025 (class Output_section): Add order_ field. Remvoe is_relro_local_,
3026 is_last_relro_, is_first_non_relro_, is_interp_,
3027 is_dynamic_linker_section_ fields. Add order and set_order
3028 functions. Remove is_relro_local, set_is_relro_local,
3029 is_last_relro, set_is_last_relro, is_first_non_relro,
3030 set_is_first_non_relro functions, is_interp, set_is_interp,
3031 is_dynamic_linker_section, and set_is_dynamic_linker_section
3032 functions.
3033 (class Output_segment): Change Output_data_list from std::list to
3034 std:;vector. Add output_lists_ field. Remove output_data_ and
3035 output_bss_ fields. Update declarations.
3036
3ff2ccb0
ILT
30372010-08-02 Ian Lance Taylor <iant@google.com>
3038
3039 * arm.cc (Target_arm::gc_process_relocs): Use typename.
3040 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
3041 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
3042
88a4108b
ILT
30432010-08-02 Ian Lance Taylor <iant@google.com>
3044
3045 PR 11855
3046 * script.cc (Script_options::Script_options): Initialize
3047 symbol_definitions_ and symbol_references_.
3048 (Script_options::add_symbol_assignment): Update
3049 symbol_definitions_ and symbol_references_.
3050 (Script_options::add_symbol_reference): New function.
3051 (script_symbol): New function.
3052 * script.h (class Script_options): Add symbol_definitions_ and
3053 symbol_references_ fields.
3054 (Script_options::referenced_const_iterator): New type.
3055 (Script_options::referenced_begin): New function.
3056 (Script_options::referenced_end): New function.
3057 (Script_options::is_referenced): New function.
3058 (Script_options::any_unreferenced): New function.
3059 * script-c.h (script_symbol): Declare.
3060 * yyscript.y (exp): Call script_symbol.
3061 * symtab.cc: Include "script.h".
3062 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3063 Change all callers. Check symbols referenced by scripts.
3064 (Symbol_table::add_undefined_symbols_from_command_line): Add
3065 layout parameter. Change all callers.
3066 (Symbol_table::do_add_undefined_symbols_from_command_line):
3067 Likewise. Break out loop body. Check symbols referenced by
3068 scripts.
3069 (Symbol_table::add_undefined_symbol_from_command_line): New
3070 function broken out of
3071 do_add_undefined_symbols_from_command_line.
3072 * symtab.h (class Symbol_table): Update declarations.
3073 * archive.cc: Include "layout.h".
3074 (Archive::should_include_member): Add layout parameter. Change
3075 all callers. Check for symbol mentioned in expression.
3076 * archive.h (class Archive): Update declaration.
3077 * object.cc (Sized_relobj::do_should_include_member): Add layout
3078 parameter.
3079 * object.h (Object::should_include_member): Add layout parameter.
3080 Change all callers.
3081 (Object::do_should_include_member): Add layout parameter.
3082 (class Sized_relobj): Update declaration.
3083 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3084 parameter.
3085 * dynobj.h (class Sized_dynobj): Update declaration.
3086 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3087 layout parameter.
3088 * plugin.h (class Sized_pluginobj): Update declaration.
3089
5f1ab67a
ILT
30902010-08-02 Ian Lance Taylor <iant@google.com>
3091
3092 PR 11866
3093 * output.cc (Output_segment::set_offset): Search for the first and
3094 last sections rather than assuming that the list is in order.
3095 (Output_segment::find_first_and_last_list): New function.
3096 * output.h (class Output_segment): Update declarations.
3097 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3098 (relro_strip_test_SOURCES): New variable.
3099 (relro_strip_test_DEPENDENCIES): New variable.
3100 (relro_strip_test_LDFLAGS): New variable.
3101 (relro_strip_test_LDADD): New variable.
3102 (relro_strip_test.so): New target.
3103
a8df5856
ILT
31042010-08-02 Ian Lance Taylor <iant@google.com>
3105
3106 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3107 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3108 (Target_i386::got_tlsdesc_section): New function.
3109 (Target_i386::got_section): Create space for GOT entries for
3110 TLSDESC relocations.
3111 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3112 R_386_TLS_GOTDESC.
3113 (Target_i386::Scan::global): Likewise.
3114 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3115 using TLSDESC GOT.
3116 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3117 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3118 (Target_x86_64::got_tlsdesc_section): New function.
3119 (Target_x86_64::got_section): Create space for GOT entries for
3120 TLSDESC relocations.
3121 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3122 R_386_TLS_GOTDESC.
3123 (Target_x86_64::Scan::global): Likewise.
3124 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3125 using TLSDESC GOT.
3126
0c10a0a6
ILT
31272010-08-02 Ian Lance Taylor <iant@google.com>
3128
3129 * testsuite/final_layout.sh: Use dc to convert from hex to
3130 decimal.
3131
41cbeecc
ST
31322010-07-29 Sriraman Tallam <tmsriram@google.com>
3133
3134 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3135 paramter to the call to gold::gc_process_relocs.
3136 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3137 paramter to the call to gold::gc_process_relocs.
3138 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3139 parameter to the call to gold::gc_process_relocs.
3140 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3141 template parameter to the call to gold::gc_process_relocs.
3142 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3143 paramter to the call to gold::gc_process_relocs.
3144 * gc.h (get_embedded_addend_size): New function.
3145 (gc_process_relocs): Save the size of the reloc for use by ICF.
3146 * icf.cc (get_section_contents): Get the addend from the text section
3147 for SHT_REL relocation sections.
3148 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3149 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3150 * int_encoding.h (read_from_pointer): New overloaded function.
3151 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3152 * testsuite/icf_sht_rel_addend_test.sh: New file.
3153 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3154 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3155
6ea55b82
RW
31562010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3157
3158 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3159 * Makefile.in: Regenerate.
3160 * testsuite/Makefile.in: Regenerate.
3161
9691462b
ILT
31622010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3163
3164 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3165 * gold/testsuite/debug_msg.cc: Likewise.
3166 * gold/testsuite/odr_violation1.cc
3167 * gold/testsuite/odr_violation2.cc
3168
76897331
CC
31692010-07-21 Cary Coutant <ccoutant@google.com>
3170
3171 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3172 string, and length fields.
3173 (Output_merge_string::Merged_strings_list): New type.
3174 (Output_merge_string::Merged_strings_lists): New typedef.
3175 (Output_merge_string): Replace merged_strings_ with
3176 merged_strings_lists_.
3177 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3178 Merged_strings_list per input object and section. Don't store pointer
3179 to the string. Don't store length with each merged string entry.
3180 (Output_merge_string::finalize_merged_data): Loop over list of merged
3181 strings lists. Recompute length of each merged string.
3182
78384e8f
CC
31832010-07-15 Cary Coutant <ccoutant@google.com>
3184
3185 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3186 here.
3187
783659f9
ILT
31882010-07-14 Ian Lance Taylor <iant@google.com>
3189
3190 * descriptors.cc (Descriptors::open): Report correct name in error
3191 message.
3192
131687b4
DK
31932010-07-13 Doug Kwan <dougkwan@google.com>
3194
3195 * arm.cc (Arm_input_section::Arm_input_section): For a
3196 SHT_ARM_EXIDX section, always keeps the input sections.
3197 (Arm_input_section::set_exidx_section_link): New method.
3198 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3199 has_errors_ to false.
3200 (Arm_exidx_input_section::has_errors,
3201 Arm_exidx_input_section::set_has_errors): New methods.
3202 (Arm_exidx_input_section::has_errors_): New data member.
3203 (Arm_relobj::get_exidx_shndx_list): New method.
3204 (Arm_output_section::append_text_sections_to_list): Do not skip
3205 section without SHF_EXECINSTR.
3206 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3207 errors.
3208 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3209 section header. Make error messages more verbose. Check for
3210 a non-executable section linked to an EXIDX section.
3211 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3212 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3213 check that there is no deferred EXIDX section if we exit early.
3214 Instead of not making an EXIDX section in case of an error, make one
3215 and set the has_errors flag of it.
3216 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3217 in a relocatable link.
3218 (Target_arm::do_relax): Look for the EXIDX output section instead of
3219 assuming that it is called .ARM.exidx.
3220 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3221 section list. Do not check for SHF_EXECINSTR section flags but
3222 skip any input section with errors.
3223 * output.cc (Output_section::Output_section): Initialize
3224 always_keeps_input_sections_ to false.
3225 (Output_section::add_input_section): Check for
3226 always_keeps_input_sections_.
3227 * output.h (Output_section::always_keeps_input_sections,
3228 Output_section::set_always_keeps_input_sections): New methods.
3229 (Output_section::always_keeps_input_sections): New data member.
3230
69517287
RÁE
32312010-07-13 Rafael Espindola <espindola@google.com>
3232
3233 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3234 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3235
82742395
ILT
32362010-07-13 Philip Herron <herron.philip@googlemail.com>
3237 Ian Lance Taylor <iant@google.com>
3238
3239 * output.h (Output_section_lookup_maps::add_merge_section):
3240 Correct check of whether value was inserted.
3241 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3242 (Output_section_lookup_maps::add_relaxed_input_section):
3243 Likewise.
3244 * arm.cc (Target_arm::got_section): Remove used local os.
3245 * i386.cc (Target_i386::got_section): Likewise.
3246 * x86_64.cc (Target_x86_64::got_section): Likewise.
3247 * sparc.cc (Target_sparc::got_section): Likewise.
3248 (Target_sparc::relocate): Remove unused local have_got_offset.
3249 * powerpc.cc (Target_powerpc::relocate): Likewise.
3250
f2d707b5
ILT
32512010-07-13 Ian Lance Taylor <iant@google.com>
3252
241531d6
ILT
3253 * compressed_output.cc (zlib_decompress): Fix signature in
3254 !HAVE_ZLIB_H case.
3255
f2d707b5
ILT
3256 * archive.cc (Archive::include_member): Unlock an external member
3257 of a thin archive. Don't bother to delete an object we know is
3258 NULL.
3259
a2e47362
CC
32602010-07-12 Cary Coutant <ccoutant@google.com>
3261
3262 * compressed_output.cc (zlib_decompress): New function.
3263 (get_uncompressed_size): New function.
3264 (decompress_input_section): New function.
3265 * compressed_output.h (get_uncompressed_size): New function.
3266 (decompress_input_section): New function.
3267 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3268 Handle compressed debug sections.
3269 * layout.cc (is_compressed_debug_section): New function.
3270 (Layout::output_section_name): Map compressed section names to
3271 canonical names.
3272 * layout.h (is_compressed_debug_section): New function.
3273 (is_debug_info_section): Recognize compressed debug sections.
3274 * merge.cc: Include compressed_output.h.
3275 (Output_merge_data::do_add_input_section): Handle compressed
3276 debug sections.
3277 (Output_merge_string::do_add_input_section): Handle compressed
3278 debug sections.
3279 * object.cc: Include compressed_output.h.
3280 (Sized_relobj::Sized_relobj): Initialize new data members.
3281 (build_compressed_section_map): New function.
3282 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3283 * object.h (Object::section_is_compressed): New method.
3284 (Object::do_section_is_compressed): New method.
3285 (Sized_relobj::Compressed_section_map): New type.
3286 (Sized_relobj::do_section_is_compressed): New method.
3287 (Sized_relobj::compressed_sections_): New data member.
3288 * output.cc (Output_section::add_input_section): Handle compressed
3289 debug sections.
3290 * reloc.cc: Include compressed_output.h.
3291 (Sized_relobj::write_sections): Handle compressed debug sections.
3292
ce279a62
CC
32932010-07-08 Cary Coutant <ccoutant@google.com>
3294
3295 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3296 weak when resolving to a dynamic def.
3297 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3298 for weak undef/dynamic def cases. Adjust callers.
3299 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3300 undef_binding_weak_.
3301 (Symbol_table::sized_write_globals): Adjust symbol binding.
3302 (Symbol_table::sized_write_symbol): Add binding parameter.
3303 * symtab.h (Symbol::set_undef_binding): New method.
3304 (Symbol::is_undef_binding_weak): New method.
3305 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3306 (Symbol_table::should_override): Add new parameter.
3307 (Symbol_table::sized_write_symbol): Add new parameter.
3308
3309 * testsuite/weak_undef_file1.cc: Add new test case.
3310 * testsuite/weak_undef_file2.cc: Fix header comment.
3311 * testsuite/weak_undef_test.cc: Add new test case.
3312
b2286c10
DK
33132010-06-29 Doug Kwan <dougkwan@google.com>
3314
3315 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3316 Initialize USE_SYMBOL_.
3317 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3318 definition.
3319 (Arm_reloc_property::uses_symbol_): New data member declaration.
3320 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3321 uses symbol value and symbol is undefined but not weakly undefined.
3322
4802450a
RÁE
33232010-06-28 Rafael Espindola <espindola@google.com>
3324
3325 * plugin.cc (Plugin::load): Use dlerror.
3326
e5ca47ba
ILT
33272010-06-26 Jeffrey Yaskin <jyasskin@google.com>
3328
3329 * symtab.cc (detect_odr_violations): When reporting an ODR
3330 violation, report an object where the symbol is defined.
3331
8a75a161
DK
33322010-06-25 Doug Kwan <dougkwan@google.com>
3333
3334 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
3335 (Target_arm::section_may_have_icf_unsafe_pointers): New method
3336 definition.
3337 (Target_arm::Scan::local_reloc_may_be_function_pointer,
3338 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
3339 target hook to detect function points.
3340 (Target_arm::Scan::possible_function_pointer_reloc): New method.
3341 * icf.h (Icf::check_section_for_function_pointers): Change type of
3342 parameter SECTION_NAME to const reference to std::string. Use
3343 target hook to determine if section may have unsafe pointers.
3344 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3345 method definition.
3346
42218b9f
RÁE
33472010-06-21 Rafael Espindola <espindola@google.com>
3348
3349 * fileread.cc (Input_file::find_fie): New
3350 (Input_file::open): Use Input_file::find_fie.
3351 * fileread.h (Input_file::find_fie): New
3352 * plugin.cc (set_extra_library_path): New.
3353 (Plugin::load): Add set_extra_library_path to the transfer vector.
3354 (Plugin_manager::set_extra_library_path): New.
3355 (Plugin_manager::add_input_file): Use the extra search path if set.
3356 (set_extra_library_path(): New.
3357 * plugin.h (Plugin_manager): Add set_extra_library_path and
3358 extra_search_path_.
3359
a0506cca
CC
33602010-06-19 Cary Coutant <ccoutant@google.com>
3361
3362 * layout.cc (gdb_sections): Add .debug_types.
3363 (lines_only_debug_sections): Likewise.
3364
6508b958
RÁE
33652010-06-18 Rafael Espindola <espindola@google.com>
3366
3367 * plugin.cc (add_input_file,add_input_library)
3368 (Plugin_manager::add_input_file): Make filename arguments const.
3369 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
3370 const.
3371
3e235302
DK
33722010-06-16 Doug Kwan <dougkwan@google.com>
3373
3374 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
3375 .ARM.attributes section if we have not merged any input
3376 attributes sections.
3377
106e8a6c
DK
33782010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3379
3380 * arm.cc: Allow combining objects with no EABI version
3381 information.
3382
91ff43fe
RÁE
33832010-06-15 Rafael Espindola <espindola@google.com>
3384
3385 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
3386
68ed838c
ILT
33872010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3388
3389 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
3390 (struct iovec): Correct !HAVE_READV definition.
3391
f3a2388f
CC
33922010-06-10 Cary Coutant <ccoutant@google.com>
3393
3394 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
3395 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
3396 reloc sections.
3397 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
3398
3399 PR 11683
3400 * symtab.h (Symbol::is_placeholder): New member function.
3401 * target-reloc.h (relocate_section): Check for placeholder symbols.
3402
3403 * testsuite/Makefile.am (plugin_test_8): New test.
3404 (plugin_test_9): New test.
3405 * testsuite/Makefile.in: Regenerate.
3406
e1df38aa
NC
34072010-06-09 Nick Clifton <nickc@redhat.com>
3408
3409 * yyscript.y (input_list_element): Allow strings prefixed with
3410 the '-' character. Treat these as libraries.
3411 * script.cc (script_add_library): New function. Adds a library
3412 specified by "-l<name>" found in an input script.
3413 * script-c.h: Add prototype for script_add_library.
3414
25bbe950
DK
34152010-06-07 Doug Kwan <dougkwan@google.com>
3416
3417 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
3418 Restrict stub-group size to be within long conditional branch
3419 range when working around cortex-A8 erratum.
3420
0f32ea4c
ILT
34212010-06-07 Damien Diederen <dd@crosstwine.com>
3422
3423 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
3424 #ifdef typo.
3425
8fe2a369
ST
34262010-06-03 Sriraman Tallam <tmsriram@google.com>
3427
3428 PR gold/11658
3429 * output.cc
3430 (Output_section::Input_section_sort_entry::compare_section_ordering):
3431 Change to return non-zero correctly.
3432 (Output_section::Input_section_sort_section_order_index_compare
3433 ::operator()): Change to fix ambiguity in comparisons.
3434
6e9ba2ca
ST
34352010-06-01 Sriraman Tallam <tmsriram@google.com>
3436
3437 * gold.h (is_wildcard_string): New function.
3438 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
3439 (Layout::layout_eh_frame): Ditto.
3440 (Layout::find_section_order_index): New method.
3441 (Layout::read_layout_from_file): New method.
3442 * layout.h (Layout::find_section_order_index): New method.
3443 (Layout::read_layout_from_file): New method.
3444 (Layout::input_section_position_): New private member.
3445 (Layout::input_section_glob_): New private member.
3446 * main.cc (main): Call read_layout_from_file here.
3447 * options.h (--section-ordering-file): New option.
3448 * output.cc (Output_section::input_section_order_specified_): New
3449 member.
3450 (Output_section::Output_section): Initialize new member.
3451 (Output_section::add_input_section): Add new parameter.
3452 Keep input sections when --section-ordering-file is used.
3453 (Output_section::set_final_data_size): Sort input sections when
3454 section ordering file is specified.
3455 (Output_section::Input_section_sort_entry): Add new parameter.
3456 Check sorting type.
3457 (Output_section::Input_section_sort_entry::compare_section_ordering):
3458 New method.
3459 (Output_section::Input_section_sort_compare::operator()): Change to
3460 consider section_order_index.
3461 (Output_section::Input_section_sort_init_fini_compare::operator()):
3462 Change to consider section_order_index.
3463 (Output_section::Input_section_sort_section_order_index_compare
3464 ::operator()): New method.
3465 (Output_section::sort_attached_input_sections): Change to sort
3466 according to section order when specified.
e1df38aa
NC
3467 (Output_section::add_input_section<32, true>): Add new parameter.
3468 (Output_section::add_input_section<64, true>): Add new parameter.
3469 (Output_section::add_input_section<32, false>): Add new parameter.
3470 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
3471 * output.h (Output_section::add_input_section): Add new parameter.
3472 (Output_section::input_section_order_specified): New
3473 method.
3474 (Output_section::set_input_section_order_specified): New method.
3475 (Input_section::Input_section): Initialize section_order_index_.
3476 (Input_section::section_order_index): New method.
3477 (Input_section::set_section_order_index): New method.
3478 (Input_section::section_order_index_): New member.
3479 (Input_section::Input_section_sort_section_order_index_compare): New
3480 struct.
3481 (Output_section::input_section_order_specified_): New member.
3482 * script-sections.cc (is_wildcard_string): Delete and move modified
3483 method to gold.h.
3484 (Output_section_element_input::Output_section_element_input): Modify
3485 call to is_wildcard_string.
3486 (Output_section_element_input::Input_section_pattern
3487 ::Input_section_pattern): Ditto.
3488 (Output_section_element_input::Output_section_element_input): Ditto.
3489 * testsuite/Makefile.am (final_layout): New test case.
3490 * testsuite/Makefile.in: Regenerate.
3491 * testsuite/final_layout.cc: New file.
3492 * testsuite/final_layout.sh: New file.
3493
3537c84b
RÁE
34942010-06-01 Rafael Espindola <espindola@google.com>
3495
3496 * plugin.cc (Plugin::load): Pass the output name to the plugin.
3497
105b6afd
RÁE
34982010-06-01 Rafael Espindola <espindola@google.com>
3499
3500 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
3501 visibility of symbols.
3502
29e11421
DK
35032010-05-27 Doug Kwan <dougkwan@google.com>
3504
3505 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
3506 from start of output section instead of address for a local symbol
3507 in a merged or relaxed section when doing a relocatable link.
3508
5e0f337e
RÁE
35092010-05-26 Rafael Espindola <espindola@google.com>
3510
3511 PR 11604
3512 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
3513 adding sections the garbage collector removed.
3514 * gold/testsuite/Makefile.am: Add test.
3515 * gold/testsuite/Makefile.in: Regenerate.
3516 * gold/testsuite/plugin_test_7.sh: New.
3517 * gold/testsuite/plugin_test_7_1.c: New.
3518 * gold/testsuite/plugin_test_7_2.c: New.
3519
f4187277
RÁE
35202010-05-26 Rafael Espindola <espindola@google.com>
3521
3522 * script-sections.cc (Output_section_definition::set_section_addresses):
3523 Check for --section-start.
3524
5c388529
DK
35252010-05-26 Doug Kwan <dougkwan@google.com>
3526
3527 * arm.cc (Arm_scan_relocatable_relocs): New class.
3528 (Target_arm::relocate_special_relocatable): New method.
3529 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
3530 (Arm_relocate_functions::thumb_branch_common): Same.
3531 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
3532 instead of Default_scan_relocatable_relocs.
3533 * target-reloc.h (relocate_for_relocatable): Let target handle
3534 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
3535 * target.h (Sized_target::relocate_special_relocatable): New method.
3536
bca1c3ae
ILT
35372010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3538
3539 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
3540
0439c796
DK
35412010-05-23 Doug Kwan <dougkwan@google.com>
3542
3543 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
3544 instead of a cast.
3545 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
3546 with a direct branch, not a conditional branch, to a stub.
3547 * merge.cc (Output_merge_base::record_input_section): New method
3548 defintion.
3549 (Output_merge_data::do_add_input_section): Record input section if
3550 keeps-input-sections flag is set.
3551 (Output_merge_string::do_add_input_section): Ditto.
3552 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
3553 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
3554 INPUT_SECTIONS_.
3555 (Output_merge_base::keeps_input_sections,
3556 Output_merge_base::set_keeps_input_sections,
3557 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
3558 method definitions.
3559 (Output_merge_base::Input_sections): New type declaration.
3560 (Output_merge_base::input_sections_begin,
3561 Output_merge_base::input_sections_end,
3562 Output_merge_base::do_set_keeps_input_sections): New method definitions.
3563 (Output_merge_base::bool keeps_input_sections_,
3564 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
3565 Output_merge_base::input_sections_): New data members.
3566 (Output_merge_data::do_set_keeps_input_sections): New method
3567 defintion.
3568 (Output_merge_string::do_set_keeps_input_sections): Ditto.
3569 * output.cc (Output_section::Input_section::relobj): Move method
3570 defintion from class declaration to here and handle merge sections.
3571 (Output_section::Input_section::shndx): Ditto.
3572 (Output_section::Output_section): Remove initializations of removed
3573 data members and initialize new data member LOOKUP_MAPS_.
3574 (Output_section::add_input_section): Set keeps-input-sections flag
3575 for a newly created merge output section as appropriate. Adjust code
3576 to use Output_section_lookup_maps class.
3577 (Output_section::add_relaxed_input_section): Adjst code for lookup
3578 maps code refactoring.
3579 (Output_section::add_merge_input_section): Add a new parameter
3580 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
3581 class. If adding input section to a newly created merge output
3582 section fails, remove the new merge section.
3583 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3584 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3585 (Output_section::find_merge_section): Ditto.
3586 (Output_section::build_lookup_maps): New method defintion.
3587 (Output_section::find_relaxed_input_section): Adjust code to use
3588 Output_section_lookup_maps class.
3589 (Output_section::get_input_sections): Export merge sections. Adjust
3590 code to use Output_section_lookup_maps class.
3591 (Output_section:::add_script_input_section): Adjust code to use
3592 Output_section_lookup_maps class. Update lookup maps for merge
3593 sections also.
3594 (Output_section::discard_states): Use Output_section_lookup_maps.
3595 (Output_section::restore_states): Same.
3596 * output.h (Merge_section_properties): Move class defintion out of
3597 Output_section.
3598 (Output_section_lookup_maps): New class.
3599 (Output_section::Input_section::is_merge_section): New method
3600 defintion.
3601 (Output_section::Input_section::relobj): Move defintion out of class
3602 defintion. Declare method only.
3603 (Output_section::Input_section::shndx): Ditto.
3604 (Output_section::Input_section::output_merge_base): New method defintion.
3605 (Output_section::Input_section::u2_.pomb): New union field.
3606 (Output_section::Merge_section_by_properties_map,
3607 Output_section::Output_section_data_by_input_section_map,
3608 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3609 Remove types.
3610 (Output_section::add_merge_input_section): Add new parameter
3611 KEEPS_INPUT_SECTIONS.
3612 (Output_section::build_lookup_maps): New method declaration.
3613 (Output_section::merge_section_map_,
3614 Output_section::merge_section_by_properties_map_,
3615 Output_section::relaxed_input_section_map_,
3616 Output_section::is_relaxed_input_section_map_valid_): Remove data
3617 members.
3618 (Output_section::lookup_maps_): New data member.
3619
76295588
L
36202010-05-21 Doug Kwan <dougkwan@google.com>
3621
3622 PR gold/11619
3623 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3624 avoid a compilation error.
3625
d103a984
RÁE
36262010-05-19 Rafael Espindola <espindola@google.com>
3627
3628 * script-sections.cc (Output_section_definition::allocate_to_segment):
3629 Update the phdrs_list even when the output section is NULL.
3630 * testsuite/Makefile.am: Add test.
3631 * testsuite/Makefile.in: Regenerate.
3632 * testsuite/script_test_9.cc: New.
3633 * testsuite/script_test_9.sh: New.
3634 * testsuite/script_test_9.t: New.
3635
6625d24e
DK
36362010-05-19 Doug Kwan <dougkwan@google.com>
3637
3638 * arm.cc (Arm_input_section::original_size): New method.
3639 (Arm_input_section::do_addralign): Add a cast.
3640 (Arm_input_section::do_output_offset): Remove static cast.
3641 (Arm_input_section::original_addralign,
3642 Arm_input_section::original_size_): Change type to uint32_t.
3643 (Arm_input_section::init): Add safe casts for section alignment
3644 and size.
3645 (Arm_input_section::set_final_data_size): Do not set address and
3646 offset of stub table.
3647 (Arm_output_section::fix_exidx_coverage): Change use of of
3648 Output_section::Simple_input_section to that of
3649 Output_section::Input_section.
3650 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3651 except for the first pass.
3652 * output.cc (Output_section::get_input_sections): Change type of
3653 input_sections to std::list<Input_section>.
3654 (Output_section::add_script_input_section): Rename from
3655 Output_section::add_simple_input_section. Change type of SIS
3656 parameter from Simple_input_section to Input_section.
3657 * output.h (Output_section::Simple_input_section): Remove class.
3658 (Output_section::Input_section): Change class visibility to public.
3659 (Output_section::Input_section::addralign): Use stored alignments
3660 for special input sections if set.
3661 (Output_section::Input_section::set_addralign): New method.
3662 (Output_section::get_input_sections): Change parameter type from
3663 list of Simple_input_section to list of Input_section.
3664 (Output_section::add_script_input_section): Rename from
3665 Output_section::add_simple_input_section. Change first parameter's
3666 type from Simple_input_section to Input_section and remove the
3667 second and third parameters.
3668 * script-sections.cc (Input_section::Input_section_list): Change
3669 type to list of Output_section::Input_section/
3670 (Input_section_info::Input_section_info): Change parameter type of
3671 INPUT_SECTION to Output_section::Input_section.
3672 (Input_section_info::input_section): Change return type.
3673 (Input_section_info::input_section_): Change type to
3674 Output_section::Input_section.
3675 (Output_section_element_input::set_section_addresses): Adjust code
3676 to use Output_section::Input_section instead of
3677 Output_section::Simple_input_section. Adjust code for renaming
3678 of Output_section::add_simple_input_section.
3679 (Orphan_output_section::set_section_addresses): Ditto.
3680
e1e82ea4
RW
36812010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3682
3683 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
3684 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
3685
91e75c8a
RÁE
36862010-05-18 Rafael Espindola <espindola@google.com>
3687
3688 * options.cc (General_options::finalize): Handle -nostdlib.
3689 * options.h (nostdlib): New option.
3690 * script.cc (script_add_search_dir): Handle -nostdlib.
3691
da59ad79
DK
36922010-05-12 Doug Kwan <dougkwan@google.com>
3693
3694 * arm.cc (Target_arm::do_finalize_sections): Create an empty
3695 attributes section only if there no attributes section after merging.
3696 (Target_arm::merge_object_attributes): Move value of
e1df38aa 3697 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
3698 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
3699 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
3700 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
3701 and arm_attr_merge_7.stdout.
3702 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
3703 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
3704 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
3705 arm_attr_merge_7b.o): New rules.
3706 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
3707 arm_attr_merge_7
3708 * testsuite/Makefile.in: Regenerate.
3709 * testsuite/arm_attr_merge.sh: New file.
3710 * testsuite/arm_attr_merge_[67][ab].s: Same.
3711
3e01a7fd
NC
37122010-05-05 Nick Clifton <nickc@redhat.com>
3713
3714 * po/es.po: Updated Spanish translation.
3715
7ad2014a
L
37162010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3717
3718 * Makefile.am (install-exec-local): Properly install gold as
3719 default cross linker.
3720 * Makefile.in: Regenerated.
3721
4fda8867
NC
37222010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3723 Nick Clifton <nickc@redhat.com>
3724
3725 * configure.ac (install_as_default): Define and set to false
3726 unless --enable-gold or --enable-gold=both/gold has been
3727 specified.
3728 * configure: Regenerate.
3729
3730 * Makefile.am (install-exec-local): Install the executable as
3731 'ld.gold'. If install_as_default is true then also install it as
3732 'ld'.
3733 * Makefile.in: Regenerated.
3734
bd288ea2
ILT
37352010-04-24 Ian Lance Taylor <iant@google.com>
3736
3737 * layout.cc (Layout::layout_reloc): In relocatable link don't
3738 combine reloc sections for grouped sections.
3739
ef38fd8a
ST
37402010-04-23 Sriraman Tallam <tmsriram@google.com>
3741
3742 * gc.h (gc_process_relocs): Pass information on relocs pointing to
3743 sections that are not ordinary to icf.
3744 * icf.cc (get_section_contents): Handle relocation pointing to section
3745 with no object or shndx information.
3746 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
3747 * testsuite/Makefile.in: Regenerate.
3748 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
3749 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
3750
f6973bdc
ILT
37512010-04-22 Ian Lance Taylor <iant@google.com>
3752
3753 * expression.cc (Expression::Expression_eval_info): Add
3754 result_alignment_pointer field.
3755 (Expression::eval_with_dot): Add result_alignment_pointer
3756 parameter. Change all callers.
3757 (Expression::eval_maybe_dot): Likewise.
3758 (class Binary_expression): Add alignment_pointer parameter to
3759 left_value and right_value. Change all callers.
3760 (BINARY_EXPRESSION): Set result alignment.
3761 (class Trinary_expression): Add alignment_pointer parameter to
3762 arg2_value and arg3_value. Change all callers.
3763 (Trinary_cond::value): Set result alignment.
3764 (Max_expression::value, Min_expression::value): Likewise.
3765 (Align_expression::value): Likewise.
3766 * script-sections.cc (class Sections_element): Add dot_alignment
3767 parameter to set_section_addresses virtual function. Update
3768 instantiations.
3769 (class Output_section_element): Likewise.
3770 (Script_sections::create_segments): Add dot_alignment parameter.
3771 Change all callers.
3772 (Script_sections::create_segments_from_phdrs_clause): Likewise.
3773 (Script_sections::set_phdrs_clause_addresses): Likewise.
3774 * script-sections.h: Update declarations.
3775 * script.h: Update declarations.
3776 * output.h (Output_segment::set_minimum_p_align): Don't decrease
3777 min_p_align.
3778 * testsuite/script_test_3.t: Set large alignment.
3779 * testsuite/script_test_3.sh: Make sure that at least one LOAD
3780 segment has expected alignment.
3781
9c9c98a5
NC
37822010-04-22 Nick Clifton <nickc@redhat.com>
3783
3784 * po/gold.pot: Updated by the Translation project.
3785 * po/vi.po: Updated Vietnamese translation.
3786
2253bfba
L
37872010-04-22 H.J. Lu <hongjiu.lu@intel.com>
3788
3789 * testsuite/Makefile.am (check_PROGRAMS): Add
3790 icf_virtual_function_folding_test.
3791 * testsuite/Makefile.in: Regenerated.
3792
85fdf906
AH
37932010-04-15 Andrew Haley <aph@redhat.com>
3794
3795 * options.h (merge_exidx_entries): New option.
3796 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
3797 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
3798 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
3799 (Target_arm::merge_exidx_entries): New function.
3800 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
3801 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
3802 to Arm_exidx_fixup constructor.
3803 Add new arg, merge_exidx_entries.
3804 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
3805 Arm_output_section::fix_exidx_coverage.
3806
ce97fa81
ST
38072010-04-18 Sriraman Tallam <tmsriram@google.com>
3808
3809 * icf.cc (get_section_contents): Check for preemptible functions.
3810 Ignore addend when appropriate.
3811 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
3812 section folded.
3813 (add_from_relobj): Check for section folded.
3814 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
3815 * symtab.h (should_add_dynsym_entry): Add new parameter.
3816 * target-reloc.h (scan_relocs): Check for section folded.
3817 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
3818 Check reloc types for function pointers in shared objects.
3819 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
3820 case.
3821 (icf_preemptible_functions_test): New test case.
3822 (icf_string_merge_test): New test case.
3823 * testsuite.Makefile.in: Regenerate.
3824 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
3825 bar_glob. Refactor code.
3826 * testsuite/icf_preemptible_functions_test.cc: New file.
3827 * testsuite/icf_preemptible_functions_test.sh: New file.
3828 * testsuite/icf_string_merge_test.cc: New file.
3829 * testsuite/icf_string_merge_test.sh: New file.
3830 * testsuite/icf_virtual_function_folding_test.cc: New file.
3831 * testsuite/icf_virtual_function_folding_test.sh: New file.
3832
04ceb17c
DK
38332010-04-14 Doug Kwan <dougkwan@google.com>
3834
3835 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
3836 for local symbol recounting if we remove a section due to ICF.
3837 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
3838 there are no regular objects in input.
3839
153e7da4
DK
38402010-04-13 Doug Kwan <dougkwan@google.com>
3841
3842 * arm.cc (Arm_input_section::set_final_data_size): Compute
3843 accurate final data size instead of using current data size.
3844
4dbd9faf
DK
38452010-04-09 Doug Kwan <dougkwan@google.com>
3846
3847 * layout.cc (Layout::choose_output_section): Handle script section
3848 types.
3849 (Layout::make_output_section_for_script): Add section type parameter.
3850 Handle script section types.
3851 * layout.h (Layout::make_output_section_for_script): Add section
3852 type parameter.
3853 * output.cc (Output_section::Output_section): Initialize data member
3854 is_noload_.
3855 (Output_section::do_reset_address_and_file_offset): Do not set address
3856 to 0 if section is a NOLOAD section.
3857 * output.h (Output_section::is_noload): New method.
3858 (Output_section::set_is_noload): Ditto.
3859 (Output_section::is_noload_): New data member.
3860 * script-c.h (Script_section_type): New enum type.
3861 (struct Parser_output_section_header): Add new file section_type.
3862 * script-sections.cc (Sections_element::output_section_name): Add
3863 parameter for returning script section type.
3864 (Output_section_definition::output_section_name): Ditto.
3865 (Output_section_definition::section_type)P; New method.
3866 (Output_section_definiton::script_section_type_name): Ditto.
3867 (Output_section_definition::script_section_type_): New data member.
3868 (Output_section_definition::Output_section_definition): Initialize
3869 data member Output_section_definition::script_section_type_.
3870 (Output_section_definition::create_sections): Pass script section type
3871 to Layout::make_output_section_for_script.
3872 (Output_section_definition::output_section_name): Return script
3873 section type to caller.
3874 (Output_section_definition::set_section_address): Do not advance
3875 dot value and load address if section type is NOLOAD. Set address
3876 of NOLOAD sections regardless of section flags.
3877 (Output_section_definition::print): Print section type if it is
3878 not SCRIPT_SECTION_TYPE_NONE.
3879 (Output_section_definition::section_type): New method.
3880 (Output_section_definition::script_section_type_name): Ditto.
3881 (Script_sections::output_section_name): Add new parameter
3882 PSECTION_TYPE for returning script section type. Pass it to
3883 section elements. Handle discard sections.
3884 (Sort_output_sections::operator()): Handle NOLOAD sections.
3885 * script-sections.h (Script_sections::Section_type): New enum type.
3886 (Script_sections::output_section_name): Add a new parameter for
3887 returning script section type.
3888 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
3889 INFO and NOLOAD.
3890 * yyscript.y (union): Add new field SECTION_TYPE.
3891 (COPY, DSECT, INFO, NOLOAD): New tokens.
3892 (opt_address_and_section_type): Change type to output_section_header.
3893 (section_type): New non-terminal
3894 (section_header): Handle section type.
2253bfba 3895 (opt_address_and_section_type): Return section type value.
4dbd9faf 3896
721ea635
L
38972010-04-09 H.J. Lu <hongjiu.lu@intel.com>
3898
3899 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3900 * testsuite/plugin_common_test_2.c (foo): Likewise.
3901
6bf924b0
DK
39022010-04-08 Doug Kwan <dougkwan@google.com>
3903
3904 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3905 Output_merge_data.
3906 * output.cc (Output_section::add_merge_input_section): Simplify
3907 code and return status of Output_merge_base::add_input_section.
e1df38aa 3908 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3909 returns true.
3910
24af6f92
DK
39112010-04-07 Doug Kwan <dougkwan@google.com>
3912
3913 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3914 if section is marked as containing instructions but has no mapping
3915 symbols.
3916 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3917 correct section index.
3918 (Arm_relobj::find_linked_text_section): Ditto.
3919
00698fc5
CC
39202010-04-07 Cary Coutant <ccoutant@google.com>
3921
3922 * archive.cc (include_member): Destroy Read_symbols_data object before
3923 releasing file.
3924 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3925 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3926 (Read_symbols_data::~Read_symbols_data) New destructor.
3927 (Section_relocs::Section_relocs) New constructor.
3928 (Section_relocs::~Section_relocs) New destructor.
3929 (Read_relocs_data::Read_relocs_data) New constructor.
3930 (Read_relocs_data::~Read_relocs_data) New destructor.
3931 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3932 pointers to NULL after deleting.
3933
7296d933
DK
39342010-04-07 Doug Kwan <dougkwan@google.com>
3935
3936 * arm.cc: Replace "endianity" with "endianness" in comments.
3937 (Arm_exidx_cantunwind): Ditto.
3938 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3939 (Arm_relobj::merge_flags_and_attributes): New method.
3940 (Arm_relobj::merge_flags_and_attributes_): New data member.
3941 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3942 (Arm_relobj::scan_sections_for_stubs): Ditto.
3943 (Arm_relobj::do_read_symbols): Check to see if we really want to
3944 merge processor-specific flags and attributes. Exit early if
3945 an object is empty except for section names and the undefined symbol.
3946 (Target_arm::do_finalize_sections): Move check for ELF format to
3947 Arm_relobj::do_read_symbols. Merge processor specific flags and
3948 attributes from a regular object only when we have determined that
3949 it is aapropriate. Do not create an .ARM.attributes section in
3950 output if there is no regular input object.
3951 (Target_arm::merge_processor_specific_flags): Check
3952 --warn-mismatch before printing any error.
3953 (Target_arm::merge_object_attributes): Ditto.
3954 * gold.cc (queue_middle_tasks): Handle the case in which there is
3955 no regular object in input.
3956 * options.cc (General_options::parse_EB): New method.
3957 (General_options::parse_EL): Same.
3958 (General_options::General_options): Initialize endianness_.
3959 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3960 New options.
3961 (General_options::Endianness): New enum.
3962 (General_options::endianness): New method.
3963 (General_options::endianness_): New data member.
3964 * parameters.cc (Parameters::set_options): Check target endianness.
3965 (Parameters::set_target_once): Ditto.
3966 (Parameters::check_target_endianness): New method.
3967 (parameters_force_valid_target): If either -EL or -EB is specified,
3968 use it to define endianness of default target.
3969 * parameters.h (Parameters::check_target_endianness): New method
3970 declaration.
3971 * target.h (class Target): Change "endianity" to "endianness"
3972 in comments.
3973
efc8d4f2
RW
39742010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3975
3976 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3977 * configure: Regenerate.
3978 * Makefile.in: Regenerate.
3979 * testsuite/Makefile.in: Regenerate.
3980
be234d88
CC
39812010-04-06 Cary Coutant <ccoutant@google.com>
3982
3983 gcc PR lto/42757
3984 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3985 prevailing definitions of common symbols.
3986 * testsuite/plugin_test_6.sh: New test case.
3987 * testsuite/plugin_common_test_1.c: New test case.
3988 * testsuite/plugin_common_test_2.c: New test case.
3989 * testsuite/Makefile.am (plugin_test_6): New test case.
3990 * testsuite/Makefile.in: Regenerate.
3991
bd32c6bd
NC
39922010-04-06 Nick Clifton <nickc@redhat.com>
3993
3994 * po/vi.po: New Vietnamese translation.
3995
323c532f
DK
39962010-03-30 Doug Kwan <dougkwan@google.com>
3997
3998 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3999
4fcd97eb
DK
40002010-03-25 Doug Kwan <dougkwan@google.com>
4001
4002 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
4003 to avoid a conversion warning on a 32-bit host.
4004
4ebf39db
ILT
40052010-03-24 Ian Lance Taylor <iant@google.com>
4006
4007 * testsuite/script_test_3.t: Add a TLS segment.
4008 * testsuite/Makefile.am (check_PROGRAMS): Add
4009 tls_phdrs_script_test.
4010 (tls_phdrs_script_test_SOURCES): Define.
4011 (tls_phdrs_script_test_DEPENDENCIES): Define.
4012 (tls_phdrs_script_test_LDFLAGS): Define.
4013 (tls_phdrs_script_test_LDADD): Define.
4014 * testsuite/Makefile.in: Rebuild.
4015
4a599bdd
CC
40162010-03-23 Cary Coutant <ccoutant@google.com>
4017
4018 * fileread.cc (find_or_make_view): Fix comment.
4019
6c93b22c
ILT
40202010-03-23 Ian Lance Taylor <iant@google.com>
4021
4022 * script-sections.cc (class Orphan_section_placement): Define
4023 PLACE_TLS and PLACE_TLS_BSS.
4024 (Orphan_section_placement::Orphan_section_placement): Initialize
4025 new places.
4026 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
4027 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
4028 (tls_script_test_SOURCES): Define.
4029 (tls_script_test_DEPENDENCIES): Define.
4030 (tls_script_test_LDFLAGS): Define.
4031 (tls_script_test_LDADD): Define.
4032 * testsuite/Makefile.in: Rebuild.
4033
a2c7281b
DK
40342010-03-22 Doug Kwan <dougkwan@google.com>
4035
4036 * arm.cc (Arm_relocate_functions::abs8,
4037 Arm_relocate_functions::abs16): Use correct check for overflow
4038 specified in the ARM ELF specs.
4039 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
4040 target of a BLX instruction specially.
4041 (Reloc_stub::stub_type_for_reloc): Ditto.
4042 (Relocate::relocate): Use symbolic names instead of numeric relocation
4043 codes to report error.
4044 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
4045 workaround.
4046 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
4047 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
4048 thumb2_blx_out_of_range.stdout
4049 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
4050 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
4051 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
4052 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
4053 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
4054 thumb2_blx_in_range, thumb2_blx_in_range.o,
4055 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
4056 thumb2_blx_out_of_range.o): New rules.
4057 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
4058 thumb2_blx_in_range and thumb2_blx_out_of_range.
4059 * testsuite/Makefile.in: Regenerate.
4060 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4061 * testsuite/thumb_blx_in_range.s: New file.
4062 * testsuite/thumb_blx_out_of_range.s: New file.
4063
b0193076
RÁE
40642010-03-22 Rafael Espindola <espindola@google.com>
4065
4066 * archive.cc (Should_include): Move to archive.h.
4067 (should_include_member): Make it a member of Archive.
4068 (Lib_group): New.
4069 (Add_lib_group_symbols): New.
4070 * archive.h: Include options.h.
4071 (Archive_member): Moved from Archive.
4072 (Should_include): Moved from archive.cc.
4073 (Lib_group): New.
4074 (Add_lib_group_symbols): New.
4075 * dynobj.cc (do_should_include_member): New.
4076 * dynobj.h (do_should_include_member): New.
4077 * gold.cc (queue_initial_tasks): Update call to queue.
4078 * main.cc (main): Print lib group stats.
4079 * object.cc (do_should_include_member): New.
4080 * object.h: Include archive.h.
4081 (Object::should_include_member): New.
4082 (Object::do_should_include_member): New.
4083 (Sized_relobj::do_should_include_member): New.
4084 * options.cc (General_options::parse_start_lib): New.
4085 (General_options::parse_end_lib): New.
4086 (Input_arguments::add_file): Handle lib groups.
4087 (Input_arguments::start_group): Check we are not in a lib.
4088 (Input_arguments::start_lib): New.
4089 (Input_arguments::end_lib): New.
4090 * options.h (General_options): Add start_lib and end_lib.
4091 (Input_argument::lib_): New.
4092 (Input_argument::lib): New.
4093 (Input_argument::is_lib): New.
4094 (Input_file_lib): New.
4095 (Input_arguments::in_lib_): New.
4096 (Input_arguments::in_lib): New.
4097 (Input_arguments::start_lib): New.
4098 (Input_arguments::end_lib_): New.
4099 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4100 in unused members as preempted.
4101 (Sized_pluginobj::do_should_include_member): New.
4102 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4103 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4104 return the blocker.
4105 (Read_symbols::do_whole_lib_group): New.
4106 (Read_symbols::do_lib_group): New.
4107 (Read_symbols::do_read_symbols): Handle lib groups.
4108 (Read_symbols::get_name): Handle lib groups.
4109 * readsyms.h (Read_symbols): Add an archive member pointer.
4110 (Read_symbols::do_whole_lib_group): New.
4111 (Read_symbols::do_lib_group): New.
4112 (Read_symbols::member_): New.
4113 * script.cc (read_input_script): Update call to queue_soon.
4114
d099120c
DK
41152010-03-19 Doug Kwan <dougkwan@google.com>
4116
4117 * arm.cc (Stub_table::Stub_table): Initialize new data members
4118 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4119 (Stub_table::add_reloc_stub): Assign stub offset and update
4120 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4121 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4122 New data members.
4123 (Stub_table::update_data_size_and_addralign): Use
4124 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4125 instead of going over all reloc stubs.
4126 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4127 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4128 Stringpool_template::offset_ to size of Stringpool_char.
4129 (Stringpool_template::new_key_offset): Remove code to initialize
4130 Stringpool_template::offset_.
4131 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4132 Stringpool_template::offset_ to zero.
4133
1aa37384
DK
41342010-03-15 Doug Kwan <dougkwan@google.com>
4135
4136 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4137 offset_.
4138 (Stringpool_template::new_key_offset): New method.
4139 (Stringpool_template::add_string): Assign offsets when adding new
4140 strings.
4141 (Stringpool_template::set_string_offsets): Do not set string offsets
4142 when not optimizing.
4143 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4144 member size_.
4145 (Chunked_vector::clear): Clear size_.
4146 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4147 (Chunked_vector::size): Return size_.
4148 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 4149 (Chunked_vector::size_): New data member.
1aa37384
DK
4150 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4151 (Stringpool_template::new_key_offset): New method declaration.
4152 (Stringpool_template::offset_): New data member.
4153
b672b057
RÁE
41542010-03-15 Rafael Espindola <espindola@google.com>
4155
4156 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4157 Add_symbols' constructor.
4158 * readsyms.h (Add_symbols): Remove the input_group member.
4159
b6848d3c
ILT
41602010-03-10 Ian Lance Taylor <iant@google.com>
4161
4162 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4163 target to ask whether a reference to a symbol requires a stack
4164 split.
4165 * target.h (Target::is_call_to_non_split): New function.
4166 (Target::do_is_call_to_non_split): Declare virtual function.
4167 * target.cc: Include "symtab.h".
4168 (Target::do_is_call_to_non_split): New function.
4169 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4170
a2a5469e
CC
41712010-03-10 Cary Coutant <ccoutant@google.com>
4172
4173 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4174 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4175 (File_read::open[2]): Add whole_file_view_ to list of views.
4176 (File_read::make_view): Remove test of whole_file_view_.
4177 (File_read::find_or_make_view): Create whole_file_view_ if
4178 necessary.
4179 (File_read::clear_views): Replace bool parameter with enum;
4180 adjust all callers. Don't delete views with permanent data;
4181 do delete cached views and views from archives if
4182 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4183 if clearing the corresponding view.
4184 * fileread.h (File_read::Clear_views_mode): New enum.
4185 (File_read::View::is_permanent_view): New method.
4186 (File_read::clear_views): Replace bool parameter
4187 with enum; adjust all callers.
4188 * options.h (General_options): Change keep_files_mapped option;
4189 add map_whole_files.
4190 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4191 releasing the file.
4192 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4193 the file.
4194
8861f32b
DM
41952010-03-10 David S. Miller <davem@davemloft.net>
4196
4197 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4198
d62d0f5f
ST
41992010-03-09 Sriraman Tallam <tmsriram@google.com>
4200
4201 * icf.cc (get_section_contents): Add '@' marker after processing the
4202 merge reloc.
4203
9177756d
DK
42042010-03-08 Doug Kwan <dougkwan@google.com>
4205
4206 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4207 due to a conversion warning.
4208 (Arm_relobj::update_output_local_symbol_count): Check for local
4209 symbol with unset output index.
4210
9e9e071b
ILT
42112010-03-05 Ian Lance Taylor <iant@google.com>
4212
4213 * options.h (class General_options): Add --spare-dynamic-tags.
4214 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4215 --spare-dynamic-tags.
4216
a81ee015
ILT
42172010-03-05 Ian Lance Taylor <iant@google.com>
4218
4219 * incremental.cc: Include "libiberty.h".
4220
44ec90b9
RO
42212010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4222
4223 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4224 function, is_info_ member.
4225 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4226 (Versions::Versions): Update caller.
4227 (Versions::define_base_version): Likewise.
4228 (Versions::add_def): Likewise.
4229
0897ed3b
ST
42302010-03-03 Sriraman Tallam <tmsriram@google.com>
4231
4232 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4233 (Scan::possible_function_pointer_reloc): New function.
4234 (Scan::local_reloc_may_be_function_pointer): Change to call
4235 possible_function_pointer_reloc.
4236 (Scan::global_reloc_may_be_function_pointer): Ditto.
4237 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4238 relocations in ".data.rel.ro._ZTV" section.
4239 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4240 * testsuite/icf_safe_so_test.cc: Ditto.
4241 * testsuite/icf_safe_test.cc: Ditto.
4242 * testsuite/icf_safe_test.sh: Ditto.
4243
d3bbad62
ILT
42442010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4245 Ian Lance Taylor <iant@google.com>
4246
4247 * target-reloc.h (relocate_section): Check the symbol table index
4248 for -1U before setting the local symbol index.
4249 (scan_relocatable_relocs): If copying the relocation, record that
4250 the local symbol is required.
4251 * object.h (Symbol_value::is_output_symtab_index_set): New
4252 function.
4253 (Symbol_value::may_be_discarded_from_output_symtab): New
4254 function.
4255 (Symbol_value::has_output_symtab_entry): New function.
4256 (Symbol_value::needs_output_symtab_entry): Remove.
4257 (Symbol_value::output_symtab_index): Make sure the symbol index is
4258 set.
4259 (Symbol_value::set_output_symtab_index): Make sure the symbol
4260 index is not set. Make sure the new index is valid.
4261 (Symbol_value::set_must_have_output_symtab_entry): New function.
4262 (Symbol_value::has_output_dynsym_entry): New function.
4263 (Symbol_value::set_output_dynsym_index): Make sure the new index
4264 is valid.
4265 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4266 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4267 local symbol if permitted.
4268 (Sized_relobj::do_finalize_local_symbols): Call
4269 is_output_symtab_index_set rather than needs_output_symtab_entry.
4270 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4271 rather than needs_output_symtab_entry. Call
4272 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4273 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4274 is_output_symtab_index_set rather than needs_output_symtab_entry.
4275 * testsuite/discard_locals_relocatable_test.c: New file.
4276 * testsuite/discard_locals_test.sh: Test -r.
4277 * testsuite/Makefile.am (check_DATA): Add
4278 discard_locals_relocatable_test1.syms,
4279 discard_local_relocatable_test2.syms.
4280 (MOSTLYCLEANFILES): Likewise. Also add
4281 discard_locals_relocatable_test1.lout and
4282 discard_locals_relocatable_test2.out.
4283 (discard_locals_relocatable_test1.syms): New target.
4284 (discard_locals_relocatable_test.o): New target.
4285 (discard_locals_relocatable_test1.out): New target.
4286 (discard_locals_relocatable_test2.syms): New target.
4287 (discard_locals_relocatable_test2.out): New target.
4288 (various): Add missing ../ld-new dependencies.
4289 * testsuite/Makefile.in: Rebuild.
4290
7e8ccf26
NC
42912010-03-03 Nick Clifton <nickc@redhat.com>
4292
4293 * po/fi.po: New Finnish translation.
4294
2a0ff005
DK
42952010-03-01 Doug Kwan <dougkwan@google.com>
4296
4297 * layout.cc (Layout::Layout): Force section types of .init_array*,
4298 .preinit_array* and .fini_array* sections.
4299 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4300 Fix check of return value of std::string::find.().
4301 (Output_section::Input_section_sort_compare::operator()): Remove
4302 comment about .init_array.
4303 (Output_section::Input_section_sort_init_fini_compare::operator()):
4304 New method.
4305 (Output_section::sort_attached_input_sections): Handle .init_array
4306 and .fini_array specially.
4307 * output.h (Output_section::Inut_section_sort_compare): Update
4308 comment.
4309 (Output_section::Input_section_sort_init_fini_compare): New struct.
4310
c3e4ae29
DK
43112010-02-26 Doug Kwan <dougkwan@google.com>
4312
4313 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4314 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4315 * testsuite/debug_msg.sh: Avoid matching source line number for
4316 use of global variable undef_int.
4317
2fd9ae7a
DK
43182010-02-26 Doug Kwan <dougkwan@google.com>
4319
4320 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4321 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4322 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4323 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4324 * options.cc (General_options::General_options): Initialize member
4325 fix_v4bx_.
4326 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
4327 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
4328 and rm_no_fix_v4bx.stdout
4329 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
4330 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
4331 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
4332 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
4333 and arm_no_fix_v4bx.
4334 * Makefile.in: Regenerate.
4335 * testsuite/arm_fix_v4bx.s: New file.
4336 * testsuite/arm_fix_v4bx.sh: Ditto.
4337
67ec7d0b
DK
43382010-02-24 Doug Kwan <dougkwan@google.com>
4339
4340 * arm.cc (Target_arm::got_section): Make the .got section the first
4341 non RELRO section in the data segment.
4342 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4343 suffixes of section names.
4344
10165461
DK
43452010-02-24 Doug Kwan <dougkwan@google.com>
4346
4347 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4348 flags and attributes merging if an input file is a binary file.
4349 * fileread.cc (Input_file::open): Record format of original file.
4350 * fileread.h (Input_file::Format): New enum type.
4351 (Input_file::Input_file): Initialize data member format_.
4352 (Input_file::format): New method definition.
4353 (Input_file::format_):: New data member.
4354
4a54abbb
DK
43552010-02-24 Doug Kwan <dougkwan@google.com>
4356
4357 * arm.cc (Arm_output_data_got): New class.
4358 (ARM_TCB_SIZE): New constant
4359 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4360 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4361 If user uses a script with a SECTIONS clause, issue only a warning
4362 for a misplaced EXIDX input section. Otherwise, issue an error.
4363 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4364 garbage collection.
4365 (Target_arm::got_mode_index_entry): Handle static linking.
4366 (Target_arm::Scan::local): Ditto.
4367 (Target_arm::Scan::global): Ditto.
4368 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
4369 all incorrectly implemented relocations.
e1df38aa 4370 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
4371 Arm_output_section::fix_exidx_coverage.
4372 * layout.cc (Layout::section_name_mapping): Remove trailing dots
4373 from ".ARM.exidx." and ".ARM.extab.".
4374
ca419a6f
ILT
43752010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4376
4377 * arm.cc (Target_arm::do_finalize_sections): Create attribute
4378 section if it does not already exist.
4379 * attributes.cc (Attributes_section_data::Attributes_section_data):
4380 Don't crash if size is zero.
4381
135b9c78
ILT
43822010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4383 Ian Lance Taylor <iant@google.com>
4384
4385 * gold.cc (queue_middle_tasks): If no input files were opened,
4386 exit.
4387 * workqueue.h (Task_function::Task_function): Assert that there is
4388 a blocker.
4389
bb0bfe4f
DK
43902010-02-22 Doug Kwan <dougkwan@google.com>
4391
4392 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
4393 * icf.cc (get_section_contents): Cast snprintf arguments to long long
4394 types to avoid warnings due to different uint64_t implementations
4395 on different hosts.
4396
2a2b6d42
DK
43972010-02-21 Doug Kwan <dougkwan@google.com>
4398
4399 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
4400 handling of the maximum backward branch offset.
4401 (Arm_relocate_functions::thumb_branch_common): Ditto.
4402 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
4403 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 4404 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
4405 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
4406 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
4407 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
4408 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
4409 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
4410 thumb_bl_out_of_range thumb_bl_out_of_range.o,
4411 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
4412 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
4413 thumb2_bl_out_of_range.o): New rules.
4414 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
4415 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
4416 thumb2_bl_out_of_range
4417 * testsuite/Makefile.in: Regenerate.
4418 * testsuite/arm_bl_in_range.s: New file.
4419 * testsuite/arm_bl_out_of_range.s: Ditto.
4420 * testsuite/arm_branch_in_range.sh: Ditto.
4421 * testsuite/arm_branch_range.t: Ditto.
4422 * testsuite/thumb2_branch_range.t: Ditto.
4423 * testsuite/thumb_bl_in_range.s: Ditto.
4424 * testsuite/thumb_bl_out_of_range.s: Ditto.
4425 * testsuite/thumb_branch_range.t: Ditto.
4426
b487ad64
ST
44272010-02-20 Sriraman Tallam <tmsriram@google.com>
4428
4429 * gc.h (gc_process_relocs): Change vectors to point to the new list.
4430 Add reloc offset information.
4431 * icf.cc (get_section_contents): Change iterators to point to the new
4432 vectors. Add reloc offset information to the contents.
4433 * icf.h (Icf::Sections_reachable_info): New typedef.
4434 (Icf::Sections_reachable_list): New typedef.
4435 (Icf::Offset_info): New typedef.
4436 (Icf::Reloc_info): New struct typedef.
4437 (Icf::Reloc_info_list): New typedef.
4438 (Icf::symbol_reloc_list): Delete method.
4439 (Icf::addend_reloc_list): Delete method.
4440 (Icf::section_reloc_list): Delete method.
4441 (Icf::reloc_info_list): New method.
4442 (Icf::reloc_info_list_): New member.
4443
f96accdf
DK
44442010-02-19 Doug Kwan <dougkwan@google.com>
4445
4446 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
4447 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
4448 * arm.cc (Arm_relocation_functions): New forward declaration.
4449 (Target_arm::Target_arm): Initialize new data members
4450 got_mod_index_offset_ and tls_base_symbol_defined_.
4451 (Target_arm::Relocate::relocate_tls): New method.
4452 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
4453 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
4454 New methods.
4455 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
4456 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
4457 (Target_arm::got_mod_index_offset_,
4458 Target_arm::tls_base_symbol_defined_): New data members.
4459 (Target_arm::Scan::local, Target::Scan::global,
4460 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
4461 relocations.
4462
c8761b9a
DK
44632010-02-18 Doug Kwan <dougkwan@google.com>
4464
4465 * arm.cc (Arm_relobj::find_linked_text_section): New method.
4466 (Arm_relobj::make_exidx_input_section): Pass section index of linked
4467 text section as a parameter becuase some broken tools may not set
4468 the link in section header.
4469 (Target_arm::has_got_section): New method.
4470 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
4471 without any mapping symbol as data only. Remove warning.
4472 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
4473 link in its section header, try to discover the link by inspecting the
4474 REL31 relocation at the beginning of the section.
4475 (Target_arm::Scan::check_non_pic): Report name of offending relocation
4476 in error message.
4477 (Target_arm::Scan::global): Treat any reference to the symbol
4478 _GLOBAL_OFFSET_TABLE_ as a GOT access.
4479
21bb3914
ST
44802010-02-12 Sriraman Tallam <tmsriram@google.com>
4481
4482 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
4483 (Scan::global_reloc_may_be_function_pointer): New function.
4484 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4485 (Scan::global_reloc_may_be_function_pointer): New function.
4486 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4487 (Scan::global_reloc_may_be_function_pointer): New function.
4488 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
4489 (Scan::global_reloc_may_be_function_pointer): New function.
4490 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
4491 (Scan::global_reloc_may_be_function_pointer): New function.
4492 (Scan::possible_function_pointer_reloc): New function.
4493 (Target_x86_64::can_check_for_function_pointers): New function.
4494 * gc.h (gc_process_relocs): Scan relocation types to determine if
4495 function pointers were taken for targets that support it.
4496 * icf.cc (Icf::find_identical_sections): Include functions for
4497 folding in safe ICF whose pointer is not taken.
4498 * icf.h (Secn_fptr_taken_set): New typedef.
4499 (fptr_section_id_): New member.
4500 (section_has_function_pointers): New function.
4501 (set_section_has_function_pointers): New function.
4502 (check_section_for_function_pointers): New function.
4503 * options.h: Fix comment for safe ICF option.
4504 * target.h (can_check_for_function_pointers): New function.
4505 * testsuite/Makefile.am: Add icf_safe_so_test test case.
4506 Modify icf_safe_test for X86-64.
4507 * testsuite/Makefile.in: Regenerate.
4508 * testsuite/icf_safe_so_test.cc: New file.
4509 * testsuite/icf_safe_so_test.sh: New file.
4510 * testsuite/icf_safe_test.cc (kept_func_3): New function.
4511 (main): Change to take pointer to function kept_func_3.
4512 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
4513 folding is done correctly for X86-64.
4514
0da6fa6c
DM
45152010-02-12 David S. Miller <davem@davemloft.net>
4516
4517 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
4518 is_symbolless parameter.
4519 (Output_reloc<SHT_REL>::is_symbolless): New.
4520 (Output_reloc<SHT_REL>::is_symbolless_): New.
4521 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
4522 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
4523 (Output_reloc<SHT_RELA>::is_symbolless): New.
4524 (Output_data_reloc::add_global): Handle is_symbolless.
4525 (Output_data_reloc::add_global_relative): Likewise.
4526 (Output_data_reloc::add_local): Likewise.
4527 (Output_data_reloc::add_local_relative): Likewise.
4528 (Output_data_reloc::add_symbolless_global_addend): New.
4529 (Output_data_reloc::add_symbolless_local_addend): New.
4530 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
4531 is_symbolless.
4532 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
4533 instead of ->is_relative_
4534 (Output_reloc::write): Likewise.
4535 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
4536 (Output_reloc::write_rel): Simplify.
4537
4538 * sparc.cc (Target_sparc::Scan::local): Use
4539 ->add_symbolless_local_addend as needed.
4540 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
4541 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
4542 based upon relocation offset.
4543
e4782e83
DK
45442010-02-11 Doug Kwan <dougkwan@google.com>
4545
4546 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
4547 (Target_arm::Scan::global): Ditto. Also remove a comment before the
4548 beginning of function.
4549 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
4550 and MOVT_ABS relocations. Those are non issued in scanning. Fix
4551 parameter is_32bit in calls to should_apply_static_reloc.
4552 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
4553 (check_DATA): Add arm_abs_global.stdout.
4554 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
4555 arm_abs_global.stdout): New rules.
4556 (MOSTLLYCLEANFILES): Add arm_abs_global
4557 * Makefile.in: Regenerate.
4558 * testsuite/arm_abs_global.s: New file.
4559 * testsuite/arm_abs_global.sh: Ditto.
4560 * testsuite/arm_abs_lib.s: Ditto.
4561
93ceb764
ILT
45622010-02-11 Ian Lance Taylor <iant@google.com>
4563
4564 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
4565 Read_relocs task.
4566 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
4567 Allocate_commons_task first.
4568 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
4569 task, rather than symtab_lock_.
4570 (Gc_process_relocs::~Gc_process_relocs): New function.
4571 (Gc_process_relocs::is_runnable): Check this_blocker_.
4572 (Gc_process_relocs::locks): Use next_blocker_ rather than
4573 blocker_.
4574 (Scan_relocs::~Scan_relocs): New function.
4575 (Scan_relocs::is_runnable): Check this_blocker_ rather than
4576 symtab_lock_.
4577 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
4578 next_blocker_.
4579 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
4580 fields. Add this_blocker_ and next_blocker_ fields. Adjust
4581 constructor accordingly.
4582 (class Gc_process_relocs): Likewise.
4583 (class Scan_relocs): Likewise.
4584 * common.h (class Allocate_commons_task): Remove symtab_lock_
4585 field, and corresponding constructor parameter.
4586 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4587 symtab_lock_.
4588 (Allocate_commons_task::locks): Likewise.
4589
114dfbe1
ILT
45902010-02-11 Ian Lance Taylor <iant@google.com>
4591
4592 * gold-threads.h (class Once): Define.
4593 (class Initialize_lock): Rewrite as child of Once.
4594 * gold-threads.cc (class Once_initialize): Define.
4595 (once_pointer_control): New static variable.
4596 (once_pointer, once_arg): New static variables.
4597 (c_run_once): New static function.
4598 (Once::Once, Once::run_once, Once::internal_run): New functions.
4599 (class Initialize_lock_once): Remove.
4600 (initialize_lock_control): Remove.
4601 (initialize_lock_pointer): Remove.
4602 (initialize_lock_once): Remove.
4603 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4604 (Initialize_lock::initialize): Rewrite.
4605 (Initialize_lock::do_run_once): New function.
4606 * archive.cc (Archive::interpret_header): Only clear name if it is
4607 not already empty.
4608 * fileread.cc: Include "gold-threads.h"
4609 (file_counts_lock): New static variable.
4610 (file_counts_initialize_lock): Likewise.
4611 (File_read::release): Only increment counts when using --stats.
4612 Use a lock around the increment.
4613 * parameters.cc (class Set_parameters_target_once): Define.
4614 (set_parameters_target_once): New static variable.
4615 (Parameters::Parameters): Move here from parameters.h.
4616 (Parameters::set_target): Rewrite.
4617 (Parameters::set_target_once): New function.
4618 (Parameters::clear_target): Move here and rewrite.
4619 * parameters.h (class Parameters): Update declarations. Add
4620 set_parameters_target_once_ field.
4621 (Parameters::Parameters): Move to parameters.cc.
4622 (Parameters::clear_target): Likewise.
4623 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4624 task.
4625 (Start_group::~Start_group): New function.
4626 (Start_group::is_runnable): New function.
4627 (Start_group::locks, Start_group::run): New functions.
4628 (Finish_group::run): Change saw_undefined to size_t.
4629 * readsyms.h (class Start_group): Define.
4630 (class Finish_group): Change saw_undefined_ field to size_t.
4631 (Finish_group::Finish_group): Remove saw_undefined and
4632 this_blocker parameters. Change all callers.
4633 (Finish_group::set_saw_undefined): New function.
4634 (Finish_group::set_blocker): New function.
4635 * symtab.h (class Symbol_table): Change saw_undefined to return
4636 size_t. Change saw_undefined_ field to size_t.
4637 * target-select.cc (Set_target_once::do_run_once): New function.
4638 (Target_selector::Target_selector): Initialize set_target_once_
4639 field. Don't initialize lock_ and initialize_lock_ fields.
4640 (Target_selector::instantiate_target): Rewrite.
4641 (Target_selector::set_target): New function.
4642 * target-select.h (class Set_target_once): Define.
4643 (class Target_selector): Update declarations. Make
4644 Set_target_once a friend. Remove lock_ and initialize_lock_
4645 fields. Add set_target_once_ field.
4646
fa17a3f4
ILT
46472010-02-10 Ian Lance Taylor <iant@google.com>
4648
4649 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4650 queueing any tasks.
4651 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4652 (queue_middle_tasks): Add all blockers before queueing any tasks.
4653 (queue_final_tasks): Likewise.
4654 * token.h (Task_token::add_blockers): New function.
4655 * object.h (Input_objects::number_of_relobjs): New function.
4656
c7177d31
ILT
46572010-02-10 Ian Lance Taylor <iant@google.com>
4658
5de0e392
ILT
4659 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
4660 shared, not if not position independent.
4661 * x86_64.cc (Relocate::relocate_tls): Likewise.
4662 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
4663 (tls_pie_pic_test): New target.
4664 * testsuite/Makefile.in: Rebuild.
4665
c7177d31
ILT
4666 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
4667 (tls_test_main_pie.o, tls_test_pie.o): New targets.
4668 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
4669 * testsuite/Makefile.in: Rebuild.
4670
684b268a
DM
46712010-02-09 David S. Miller <davem@davemloft.net>
4672
4673 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4674 R_SPARC_RELATIVE using ->add_local_relative().
4675 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
4676
612a8d3d
DM
4677 * output.h (Output_data_dynamic::add_section_size): New method
4678 that takes two Output_data objects.
4679 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
4680 entry param. Handle it in initializers.
4681 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
4682 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
4683 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
4684 arg.
4685 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
4686 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
4687 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
4688 for dynrel_includes_plt.
4689 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4690 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4691 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
4692 before .rela.plt
4693 (Target_sparc::do_finalize_sections): Update to pass true for
4694 dynrel_includes_plt.
4695 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
4696 output before .rela.plt
4697 (Target_powerpc::do_finalize_sections): Update to pass true for
4698 dynrel_includes_plt when 32-bit.
4699
cb1be87e
DK
47002010-02-08 Doug Kwan <dougkwan@google.com>
4701
4702 * arm.cc (Arm_relobj::simple_input_section_output_address): New
4703 method.
4704 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
4705 Arm_relobj::scan_section_for_cortex_a8_stubs,
4706 Arm_relobj::do_relocation_section): Instead of calling
4707 Output_section::output_address, use faster
4708 Arm_relobj::simple_input_section_output_address.
4709
705b5121
DM
47102010-02-08 David S. Miller <davem@davemloft.net>
4711
4712 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
4713 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
4714 relocation helper function.
4715
024c4466
DM
4716 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
4717 just like R_SPARC_GOT{10,13,22}.
4718 (Target_sparc::Scan::local): Likewise.
4719 (Target_sparc::Relocate:relocate): Likewise.
4720
9109c078
ILT
47212010-02-06 Ian Lance Taylor <iant@google.com>
4722
4723 * configure.ac: Rewrite targetobjs duplicate removal code to use
4724 only shell constructs.
4725 * configure: Rebuild.
4726
cf846138
DK
47272010-02-05 Doug Kwan <dougkwan@google.com>
4728
4729 PR 11247
4730 * arm.cc (Arm_relobj::section_is_scannable): New method.
4731 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
4732 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
4733
6cfaf60b
DK
47342010-02-04 Doug Kwan <dougkwan@google.com>
4735
4736 PR 11247
4737 * arm-reloc-property.cc (cstdio): Include.
4738 * configure.ac (targetobjs): Remove duplicates.
4739 * configure: Regenerate.
4740 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
4741 big and little endian version for a given address size.
4742
5c57f1be
DK
47432010-02-03 Doug Kwan <dougkwan@google.com>
4744
4745 * arm-reloc-property.cc
4746 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4747 definition.
4748 * arm-reloc-property.h
4749 (Arm_reloc_property_table::get_implemented_static_reloc_property):
4750 New method definition.
4751 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4752 declaration.
4753 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
4754 overflow to N.
4755 (GOT_PREL): Change implemented to Y.
4756 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
4757 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
4758 (Arm_relocate_functions::movw_abs_nc): Remove method.
4759 (Arm_relocate_functions::movt_abs): Ditto.
4760 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
4761 (Arm_relocate_functions::thm_movt_abs): Ditto.
4762 (Arm_relocate_functions::movw_rel_nc): Ditto.
4763 (Arm_relocate_functions::movw_rel): Ditto.
4764 (Arm_relocate_functions::movt_rel): Ditto.
4765 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
4766 (Arm_relocate_functions:thm_movw_rel): Ditto.
4767 (Arm_relocate_functions:thm_movt_rel): Ditto.
4768 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
4769 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
4770 New method definitions.
4771 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
4772 (Arm_relocation_functions::arm_grp_ldr): Ditto.
4773 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
4774 (Arm_relocation_functions::arm_grp_ldc): Ditto.
4775 (Target_arm::Relocate::relocate): Check for non-static or
4776 unimplemented relocation code and exit early. Change calls to
4777 Target_arm::reloc_uses_thumb_bit and
4778 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
4779 instead. Refactor code to handle similar relocations to increase
4780 code sharing. Remove check for unsupported relocation code in switch
4781 statement.
4782 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
4783 relocation property table to find out size. Change error message to
4784 print out the name of a relocation code instead of the numeric value.
4785 (Target_arm::scan_reloc_for_stub): Use relocation property table
4786 instead of calling Target_arm::reloc_uses_thumb_bit().
4787
218c5831
DK
47882010-02-02 Doug Kwan <dougkwan@google.com>
4789
4790 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
4791 types of relaxed input section.
4792
0d31c79d
DK
47932010-02-02 Doug Kwan <dougkwan@google.com>
4794
4795 * Makefile.am (HFILES): Add arm-reloc-property.h.
4796 (DEFFILES): New.
4797 (TARGETSOURCES): Add arm-reloc-property.cc
4798 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
4799 (libgold_a_SOURCES): $(DEFFILES)
4800 * Makefile.in: Regenerate.
4801 * arm-reloc-property.cc: New file.
4802 * arm-reloc-property.h: New file.
4803 * arm-reloc.def: New file.
4804 * arm.cc: Update comments.
4805 (arm-reloc-property.h): New included header.
4806 (arm_reloc_property_table): New global variable.
4807 (Target_arm::do_select_as_default_target): New method definition.
4808 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
4809 arm-reloc-property to targ_extra_obj.
4810 * parameters.cc (set_parameters_target): Call
4811 Target::select_as_default_target().
4812 * target.h (Target::select_as_default_target): New method definition.
4813 (Target::do_select_as_default_target): Same.
4814
546c7457
DK
48152010-02-01 Doug Kwan <dougkwan@google.com>
4816
4817 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
4818 first_output_text_section_.
4819 (Arm_exidx_fixup::first_output_text_section): New method definition.
4820 (Arm_exidx_fixup::first_output_text_section_): New data member.
4821 (Arm_exidx_fixup::process_exidx_section): Record the first text
4822 output section seen.
4823 (Arm_output_section::fix_exidx_coverage): Set correct linked section
4824 and entsize in output section header.
4825
11b861d5
DK
48262010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4827
4828 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
4829 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
4830 (Arm_relocate_functions::thm_alu11): New Method.
4831 (Arm_relocate_functions::thm_pc8): New Method.
4832 (Arm_relocate_functions::thm_pc12): New Method.
4833 (Target_arm::Scan::local): Handle the relocations.
4834 (Target_arm::Scan::global): Likewise.
4835 (Target_arm::Relocate::relocate): Likewise.
4836 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4837
c9a2c125
DK
48382010-01-29 Doug Kwan <dougkwan@google.com>
4839
4840 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
4841 of relocation types as ld.
4842
1521477a
DK
48432010-01-29 Doug Kwan <dougkwan@google.com>
4844
4845 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
4846 to public.
4847 (Arm_relocate_functions::thumb_branch_common): Ditto.
4848 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
4849 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
4850 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
4851 Arm_relocate_functions::jump24): Remove.
4852 (Target_arm::Relocate::relocate): Adjust code to call
4853 Arm_relocation_functions::arm_branch_common and
4854 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 4855 wrappers. Merge switch-cases together to reduce source code size.
1521477a 4856
e7eca48c
DK
48572010-01-29 Doug Kwan <dougkwan@google.com>
4858
4859 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
4860 output_local_symbol_count_needs_update_.
4861 (Arm_relobj::output_local_symbol_count_needs_update,
4862 Arm_relobj::set_output_local_symbol_count_needs_update,
4863 Arm_relobj::update_output_local_symbol_count): New methods.
4864 (Arm_relobj::output_local_symbol_count_needs_update_): New data
4865 member.
4866 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
4867 of pointed function as in a R_ARM_PREL31 relocation.
4868 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
4869 for output local symbol count updating.
4870 (Target_arm::do_relax): Update output local symbol counts in objects
4871 if necessary.
4872 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
4873
02961d7e
ILT
48742010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4875
4876 * arm.cc: Added support for the ARM relocations:
4877 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
4878 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
4879 (Arm_relocate_functions::movw_rel_nc): Renamed (was
4880 movw_prel_nc).
4881 (Arm_relocate_functions::movw_rel): New method.
4882 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
4883 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
4884 thm_movw_prel_nc).
4885 (Arm_relocate_functions::thm_movw_rel): New method.
4886 (Arm_relocate_functions::thm_movt_rel): Renamed (was
4887 thm_movt_prel).
4888 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
4889 relocations.
4890 (Target_arm::Scan::global): Likewise.
4891 (Target_arm::Relocate::relocate): Likewise.
4892 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4893 Likewise.
4894
b10d2873
ILT
48952010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4896
4897 * arm.cc: Added support for ARM group relocations.
4898 (Target_arm::reloc_needs_sym_origin): New method.
4899 (Arm_relocate_functions::calc_grp_kn): New method.
4900 (Arm_relocate_functions::calc_grp_residual): New method.
4901 (Arm_relocate_functions::calc_grp_gn): New method.
4902 (Arm_relocate_functions::arm_grp_alu): New Method.
4903 (Arm_relocate_functions::arm_grp_ldr): New Method.
4904 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4905 (Arm_relocate_functions::arm_grp_ldc): New Method.
4906 (Target_arm::Scan::local): Handle the ARM group relocations.
4907 (Target_arm::Scan::global): Likewise.
4908 (Target_arm::Relocate::relocate): Likewise.
4909 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4910 Likewise.
4911
2b328d4e
DK
49122010-01-26 Doug Kwan <dougkwan@google.com>
4913
4914 * arm.cc (set): Include.
4915 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4916 pointer type.
4917 (Arm_output_section::Text_section_list): New type.
4918 (Arm_output_section::append_text_sections_to_list): New method.
4919 (Arm_output_section::fix_exidx_coverage): Ditto.
4920 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4921 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4922 Relobj::set_section_offset() instead of
4923 Sized_relobj::invalidate_section_offset().
4924 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4925 parameter for section headers. Ignore relocation sections for
4926 unallocated sections and EXIDX sections.
4927 (Target_arm::fix_exidx_coverage): New method.
4928 (Target_arm::output_section_address_less_than): New type.
4929 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4930 linked text section instead of the EXIDX section.
4931 (Arm_output_section::create_stub_group): Add an assertion to check
4932 that this is not an EXIDX output section.
4933 (Arm_output_section::append_text_sections_to_list): New method.
4934 (Arm_output_section::fix_exidx_coverage): Ditto.
4935 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4936 Arm_relobj::section_needs_reloc_stub_scanning.
4937 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4938 first pass.
4939 (Target_arm::fix_exidx_coverage): New method.
4940 * object.h (Relobj::set_output_section): New method.
4941 (Sized_relobj::invalidate_section_offset): Remove method.
4942 (Sized_relobj::do_invalidate_section_offset): Remove method.
4943 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4944
c7f3c371
DK
49452010-01-25 Doug Kwan <dougkwan@google.com>
4946
4947 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4948 Fix warning due to signed and unsigned comparison on a 32-bit host.
4949
8923b24c
DK
49502010-01-22 Doug Kwan <dougkwan@google.com>
4951
4952 * arm.cc (Target_arm::do_relax): Record an output section for section
4953 offset adjustment it contains any stub table that has changed.
4954 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4955 offsets in an output section if necessary.
4956 * output.cc (Output_section::Output_section): Initialize
4957 section_offsets_need_adjustments_.
4958 (Output_section::add_input_section_for_script): Renamed to
4959 Output_section::add_simple_input_section.
4960 (Output_section::save_states): Add a comment.
4961 (Output_section::discard_states): New method defintion.
4962 (Output_section::adjust_section_offsets): Same.
4963 * output.h (Output_section::add_input_section_for_script): Renamed to
4964 Output_section::add_simple_input_section.
4965 (Output_section::discard_states): New method declaration.
4966 (Output_section::adjust_section_offsets): Same.
4967 (Output_section::section_offsets_need_adjustment,
4968 Output_section::set_section_offsets_need_adjustment): New method
4969 definitions.
4970 (Output_section::section_offsets_need_adjustment_): New data member.
4971 * script-sections.cc
4972 (Output_section_element_input::set_section_address): Adjust code for
4973 renaming of Output_section::add_input_section_for_script.
4974 (Orphan_output_section::set_section_address): Same.
4975
9b2fd367
DK
49762010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4977
4978 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4979 Fix_v4bx enum values .
4980 * gold/options.h (General_options): New option definitions.
4981 (General_options::fix_v4bx): New method.
4982 (General_options::Fix_v4bx): New enum.
4983 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4984 (General_options::parse_fix_v4bx_interworking): New method.
4985
80d0d023
DK
49862010-01-22 Doug Kwan <dougkwan@google.com>
4987
4988 * arm.cc (Arm_exidx_fixup): New class.
4989
af2cdeae
DK
49902010-01-21 Doug Kwan <dougkwan@google.com>
4991
4992 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4993 classes.
4994 (Arm_exidx_section_offset_map): New type.
4995
993d07c1
DK
49962010-01-21 Doug Kwan <dougkwan@google.com>
4997
4998 * arm.cc (Arm_exidx_input_section): New class.
4999 (Arm_relobj::exidx_input_section_by_link,
5000 Arm_relobj::exidx_input_section_by_shndx,
5001 Arm_relobj::make_exidx_input_section): New methods.
5002 (read_arm_attributes_section): Remove.
5003 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
5004 information about them.
5005 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
5006 to here.
5007
5ac169d4
DK
50082010-01-20 Doug Kwan <dougkwan@google.com>
5009
5010 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
5011 Input_section_specifier to Section_id.
5012 (Target_arm::new_arm_input_section: Adjust code for change of key
5013 type.
5014 (Target_arm::find_arm_input_section): Ditto.
5015 * gc.h (object.h): Include for Section_id nand Section_id_hash.
5016 (Section_id): Remove.
5017 (Garbage_collection::Section_id_hash): Remove.
5018 * icf.h (object.h): Include for Section_id nand Section_id_hash.
5019 (Section_id): Remove.
5020 (Icf::Section_id_hash): Remove.
5021 * object.h (Section_id, Const_section_id, Section_id_hash,
5022 Const_section_id_hash): New type definitions.
5023 * output.cc (Output_section::add_relaxed_input_section): Change to
5024 use Const_section_id instead of Input_section_specifier as key type.
5025 (Output_section::add_merge_input_section): Ditto.
5026 (Output_section::build_relaxation_map): Change to use Section_id
5027 instead of Input_section_specifier as key type.
5028 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5029 Ditto.
5030 (Output_section::convert_input_sections_to_relaxed_sections): Change
5031 to use Const_section_id instead of Input_section_specifier as key type.
5032 (Output_section::find_merge_section): Ditto.
5033 (Output_section::find_relaxed_input_section): Ditto.
5034 * output.h (Input_section_specifier): Remove class.
5035 (Output_section::Output_section_data_by_input_section_map): Change
5036 key type to Const_section_id.
5037 (Output_section::Output_relaxed_input_section_by_input_section_map):
5038 Ditto.
5039 (Output_section::Relaxation_map): Change key type to Section_id.
5040
a2162063
ILT
50412010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5042
5043 * gold/arm.cc: Added support for R_ARM_V4BX relocation
5044 (class Arm_v4bx_stub): New class.
5045 (DEF_STUBS): Updated definition to support v4_veneer_bx.
5046 (Stub_factory::make_arm_v4bx_stub): New method.
5047 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
5048 (Stub_table::empty): Handle v4bx stubs.
5049 (Stub_table::add_arm_v4bx_stub): New method.
5050 (Stub_table::find_arm_v4bx_stub): New method.
5051 (Arm_relocate_functions::v4bx): New method.
5052 (Target_arm::fix_v4bx): New method.
5053 (Target_arm::Target_arm): Handle R_ARM_V4BX.
5054 (Stub_table::relocate_stubs): Likewise.
5055 (Stub_table::do_write): Likewise.
5056 (Stub_table::update_data_size_and_addralign): Likewise.
5057 (Stub_table::finalize_stubs): Likewise.
5058 (Target_arm::Scan::local): Likewise.
5059 (Target_arm::Scan::global): Likewise.
5060 (Target_arm::do_finalize_sections): Likewise.
5061 (Target_arm::Relocate::relocate): Likewise.
5062 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5063 Likewise.
5064 (Target_arm::scan_reloc_for_stub): Likewise.
5065 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5066
5696ab0b
ILT
50672010-01-19 Ian Lance Taylor <iant@google.com>
5068
5069 * output.cc (Output_section_headers::do_sized_write): Write large
5070 segment count to sh_info field.
5071 (Output_file_header::do_sized_write): For large segment count,
5072 write PN_XNUM to e_phnum field.
5073
800d0f56
ILT
50742010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5075
5076 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5077 (Arm_relocate_functions::thm_jump8): New function.
5078 (Arm_relocate_functions::thm_jump11): New function.
5079 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5080 R_ARM_THM_JUMP11.
5081 (Target_arm::Scan::global): Likewise.
5082 (Target_arm::Relocate::relocate): Likewise.
5083 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5084 Likewise.
5085
41263c05
DK
50862010-01-14 Doug Kwan <dougkwan@google.com>
5087
5088 * arm.cc (map, utility): Include headers.
5089 (Target_arm::apply_cortex_a8_workaround): New method.
5090 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5091 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5092 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5093 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5094 the --[no-]fix-cortex-a8 command line options.
5095 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5096 (Target_arm::relocate_stub): Use addend in instruction template.
5097 * options.h (DEFINE_bool): Set the user-set flag.
5098 (General_options): Add --[no-]-fix-cortex options.
5099 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 5100 : Update fast look-up map after conversion.
41263c05 5101
459e9b03
ST
51022010-01-14 Sriraman Tallam <tmsriram@google.com>
5103
5104 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5105 in the first pass of do_layout.
5106
b521dfe4
DK
51072010-01-13 Doug Kwan <dougkwan@google.com>
5108
5109 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5110 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5111 apparent compiler problem of not folding static constant integral
5112 data members of elfcpp::Elf_sizes<32>.
5113
44272192
DK
51142010-01-13 Doug Kwan <dougkwan@google.com>
5115
5116 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5117 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5118 Arm_relobj::scan_section_for_cortex_a8_erratum,
5119 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5120 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5121 sections to scan for relocation stubs into a new method
5122 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5123 relocation and Cortex-A8 stub scanning.
5124 (Target_arm::do_relax): Force stubs to be after stubbed sections
5125 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 5126 the beginning of a new relaxation pass. Update a comment.
44272192
DK
5127 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5128
44b71ece
ILT
51292010-01-12 Ian Lance Taylor <iant@google.com>
5130
5131 * target-reloc.h (visibility_error): New inline function.
5132 (relocate_section): Call visibility_error.
5133 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5134 (MOSTLYCLEANFILES): Likewise.
5135 (protected_4_pic.o, protected_3.err): New targets.
5136 * testsuite/protected_4.cc: New file.
5137
a120bc7f
DK
51382010-01-12 Doug Kwan <dougkwan@google.com>
5139
5140 * arm.cc (Cortex_a8_reloc): New class.
5141 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5142 and cortex_a8_relocs_info_.
5143 (Target_arm::fix_cortex_a8): New method definition.
5144 (Target_arm::Cortex_a8_relocs_info): New type.
5145 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5146 New data member declarations.
5147 (Target_arm::scan_reloc_for_stub): Record information about
5148 relocations for THUMB branches that might be exempted from the
5149 Cortex-A8 workaround.
5150 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5151 at the beginning of a relaxation pass.
5152
20138696
DK
51532010-01-12 Doug Kwan <dougkwan@google.com>
5154
5155 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5156 (Arm_relobj::Mapping_symbol_position,
5157 Arm_reloj::Mapping_symbol_position_less,
5158 Arm_relobj::Mapping_symbols_info): New types.
5159 (Target_arm::is_mapping_symbol_name): New method definition.
5160 (Arm_relobj::do_count_local_symbols): Save information about mapping
5161 symbols.
5162
089d69dc
DK
51632010-01-11 Doug Kwan <dougkwan@google.com>
5164
5165 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5166 Arm_relocate_functions::thumb32_branch_upper,
5167 Arm_relocate_functions::thumb32_branch_lower,
5168 Arm_relocate_functions::thumb32_cond_branch_offset,
5169 Arm_relocate_functions::thumb32_cond_branch_upper,
5170 Arm_relocate_functions::thumb32_cond_branch_lower,
5171 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5172 branch offset encoding.
5173 (Arm_relocate_functions::thumb_branch_common): Use new branch
5174 offset encoding methods to avoid code duplication.
5175 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5176 (Stub_addend_reader::operator()): Use new branch encoding method
5177 to avoid code duplication.
5178
99e5bff2
DK
51792010-01-11 Doug Kwan <dougkwan@google.com>
5180
5181 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5182 (Target_arm::do_finalize_sections): Define special EXIDX section
5183 symbols only if referenced.
5184 * gc.h (Garbage_collection::add_reference): New method.
5185 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5186 code duplication.
5187
98e090bd
ILT
51882010-01-11 Ian Lance Taylor <iant@google.com>
5189
d0a91bd8
ILT
5190 * script.cc (Version_script_info::build_expression_list_lookup):
5191 Change complaing about duplicate wildcard match from error to
5192 warning.
5193
98e090bd
ILT
5194 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5195 of 2009-12-30.
5196 (Version_script_info::Version_script_info): Initialize globs_,
5197 default_version_, default_is_global_, and exact_. Don't
5198 initialize globals_ or locals_.
5199 (Version_script_info::build_lookup_tables): Build local symbols
5200 first.
5201 (Version_script_info::unquote): New function.
5202 (Version_script_info::add_exact_match): New function.
5203 (Version_script_info::build_expression_list_lookup): Remove lookup
5204 parameter. Add is_global parameter. Change all callers. Handle
5205 wildcard pattern specially. Unquote pattern. Call
5206 add_exact_match.
5207 (Version_script_info::get_name_to_match): New function.
5208 (Version_script_info::get_symbol_version): New function.
5209 (Version_script_info::get_symbol_version_helper): Remove.
5210 (Version_script_info::check_unmatched_names): Call unquote.
5211 * script.h (class Version_script_info): Change get_symbol_version
5212 to be non-inline and add is_global parameter; change all callers.
5213 Rewrite symbol_is_local. Update declarations. Define struct
5214 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5215 Remove globals_ and locals_ members. Add exact_, globs_,
5216 default_version_, is_global_.
5217 (Version_script_info::Glob): Remove pattern, add expression and
5218 is_global. Update constructor. Change all callers.
5219 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5220 default version.
5221 (Versions::symbol_section_contents): If a symbol is undefined, or
5222 defined in a dynamic object, set the version index to
5223 VER_NDX_LOCAL.
5224 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5225 symbol_is_local.
5226 (Symbol_table::add_from_pluginobj): Likewise.
5227 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5228
d56962d3
DK
52292010-01-11 Doug Kwan <dougkwan@google.com>
5230
5231 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5232 (incremental_dump_LDADD): Add linking option for libintl.
5233 * Makefile.in: Regenerate.
5234
94e6ee91
L
52352010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5236
5237 PR gold/11144
5238 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5239 instead of -Ds.
5240 * testsuite/Makefile.in: Regenerated.
5241
e96c574b
DK
52422010-01-10 Doug Kwan <dougkwan@google.com>
5243
5244 * options.h (DEFINE_var): Use parentheses around argument varname__
5245 in macro body to avoid any unintended subsequent substitutions.
5246
7198066b
ILT
52472010-01-10 Ian Lance Taylor <iant@google.com>
5248
ba4d53bf
ILT
5249 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5250 candidates before doing symbol resolution.
5251
7198066b
ILT
5252 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5253 ODR candidates if only one is weak.
5254
a2beed37
ILT
52552010-01-08 Ian Lance Taylor <iant@google.com>
5256
5257 * script.cc (Version_script_info::build_expression_list_lookup):
5258 Don't warn about ambiguous version, just record the ambiguity.
5259 (Version_script_info::get_symbol_version_helper): Give error if
5260 version is ambiguous.
5261
2fb7225c
DK
52622010-01-08 Doug Kwan <dougkwan@google.com>
5263
5264 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5265 prev_data_size_ and prev_addralign_. Remove initializer for
5266 deleted data member has_been_changed_.
5267 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5268 to determine if the table is empty.
5269 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5270 Remove.
5271 (Stub_table::add_reloc_stub): Define method in class definition
5272 instead of just declaring it there.
5273 (Stub_table::add_cortex_a8_stub): New method definition.
5274 (Stub_table::update_data_size_and_addralign): Ditto.
5275 (Stub_table::finalize_stubs): Ditto.
5276 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5277 (Stub_table::do_addralign_): Return address alignment in the
5278 (Stub_table::do_reset_address_and_file_offset): Define method in
5279 class definition instead of declaring it there. Set current data
5280 size to be the data size of the previous pass.
5281 (Stub_table::set_final_data_size): Use current data size as the
5282 final data size.
5283 (Stub_table::relocate_stub): Change parameter type of stub from
5284 Reloc_stub pointer to Stub pointer.
5285 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5286 (Stub_table::Cortex_a8_stub_list): New typedef.
5287 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5288 Stub_table::prev_addralign_): New data member.
5289 (Arm_relobj::Arm_relobj): Initialize data member
5290 section_has_cortex_a8_workaround_.
5291 (Arm_relobj::section_has_cortex_a8_workaround,
5292 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5293 definitions.
5294 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5295 declarations.
5296 (Target_arm::relocate_stub): Change parameter type of stub from
5297 Reloc_stub pointer to Stub pointer.
5298 (Insn_template::size, Insn_template::alignment): Handle
5299 THUMB16_SPECIAL_TYPE.
5300 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5301 Stub_table::update_data_size_and_addralign,
5302 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5303 definitions.
5304 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5305 (Stub_table::do_write): Ditto.
5306 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5307
880cd20d
ILT
53082010-01-08 Ian Lance Taylor <iant@google.com>
5309
5310 PR 11108
5311 * symtab.h (class Symbol): Remove fields is_target_special_ and
5312 has_plt_offset_. Add field is_defined_in_discarded_section_.
5313 (Symbol::is_defined_in_discarded_section): New function.
5314 (Symbol::set_is_defined_in_discarded_section): New function.
5315 (Symbol::has_plt_offset): Rewrite.
5316 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5317 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5318 Don't initialize is_target_special_ or has_plt_offset_.
5319 Initialize is_defined_in_discarded_section_.
5320 (Symbol_table::add_from_relobj): If appropriate, set
5321 is_defined_in_discarded_section.
5322 * resolve.cc (Symbol::override_base_with_special): Don't test
5323 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5324 * target-reloc.h (relocate_section): Do special handling for
5325 symbols defined in discarded sections for global symbols as well
5326 as local symbols.
5327
2703e3eb
ILT
53282010-01-08 Ian Lance Taylor <iant@google.com>
5329
5330 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
5331 the SHT_SYMTAB case.
5332
339d40a3
ILT
53332010-01-08 Ian Lance Taylor <iant@google.com>
5334
5335 * object.cc (Sized_relobj::do_layout): Don't get confused if
5336 layout_eh_frame returns NULL.
5337
abecea76
ILT
53382010-01-08 Ian Lance Taylor <iant@google.com>
5339
5340 PR 11084
5341 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
5342 dynamic symbol table, use the normal symbol table.
5343 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5344 symbol table.
5345
6b7dd3f3
ILT
53462010-01-08 Ian Lance Taylor <iant@google.com>
5347
5348 PR 11072
5349 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5350 sections.
5351
36c50e63
L
53522010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5353
5354 * version.cc (print_version): Change to "Copyright 2010".
5355
e291e7b9
ILT
53562010-01-08 Ian Lance Taylor <iant@google.com>
5357
5358 PR 10287
5359 PR 11063
5360 * i386.cc (class Target_i386): Change return type of plt_section
5361 to be non-const.
5362 (class Output_data_plt_i386): Add tls_desc_rel_ field.
5363 (Output_data_plt_i386::Output_data_plt_i386): Initialize
5364 tls_desc_rel_ field.
5365 (Output_data_plt_i386::rel_tls_desc): New function.
5366 (Target_i386::rel_tls_desc_section): New function.
5367 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
5368 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
5369 R_386_TLS_DESC reloc in rel_tls_desc_section.
5370 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
5371 Define struct Tlsdesc_info.
5372 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
5373 (Target_x86_64::do_reloc_symbol_index): New function.
5374 (Target_x86_64::add_tlsdesc_info): New function.
5375 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
5376 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
5377 tlsdesc_rel_ field.
5378 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
5379 all callers.
5380 (Output_data_plt_x86_64::rela_tlsdesc): New function.
5381 (Target_x86_64::rela_tlsdesc_section): New function.
5382 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
5383 handling.
5384 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
5385 (Target_x86_64::do_reloc_addend): New function.
5386 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
5387 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
5388 declarations. Define TARGET_CODE. Add arg field to u1_ union.
5389 (Output_reloc::type): New function.
5390 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
5391 (Output_reloc::is_target_specific): New function.
5392 (Output_reloc::target_arg): New function.
5393 (class Output_reloc) [SHT_RELA]: Add four new constructors for
5394 absolute relocs and target specific relocs.
5395 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
5396 add_target_specific.
5397 (class Output_data_reloc) [SHT_RELA]: Likewise.
5398 * output.cc (Output_reloc::Output_reloc): Add four new versions
5399 for absolute relocs and target specific relocs.
5400 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
5401 (Output_reloc::get_symbol_index): Likewise.
5402 (Output_reloc::local_section_offset): Check that local_sym_index_
5403 is not TARGET_CODE or 0.
5404 (Output_reloc::symbol_value): Likewise.
5405 (Output_reloc::write) [SHT_RELA]: Call target for target specific
5406 reloc.
5407 * target.h (class Target): Add reloc_symbol_index and reloc_addend
5408 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
5409 functions.
5410 * layout.cc (add_target_dynamic_tags): Use output section for
5411 DT_PLTRELSZ and DT_JMPREL.
5412
3a44184e
ILT
54132010-01-07 Ian Lance Taylor <iant@google.com>
5414
5415 PR 11061
5416 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
5417 function.
5418 (class Output_data_reloc_generic): Define.
5419 (class Output_data_reloc_base): Change base class to
5420 Output_data_reloc_generic. Change add() method to call
5421 bump_relative_reloc_count for a relative reloc. Remove
5422 sort_relocs_ field.
5423 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
5424 to sort_relocs().
5425 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
5426 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
5427 appropriate.
5428 * layout.h (class Layout): Update declaration.
5429
ea715a34
ILT
54302010-01-07 Ian Lance Taylor <iant@google.com>
5431
5432 * output.h (class Output_data): Add const version of
5433 output_section and do_output_section.
5434 (class Output_section_data): Add const version of
5435 do_output_section.
5436 (class Output_section): Likewise.
5437 * layout.cc (Layout::add_target_dynamic_tags): New function.
5438 * layout.h (class Layout): Update declarations.
5439 * arm.cc (Target_arm::do_finalize_sections): Use
5440 add_target_dynamic_tags.
5441 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5442 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5443 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5444 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5445
659948a4
ILT
54462010-01-07 Ian Lance Taylor <iant@google.com>
5447
5448 PR 11042
5449 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
5450 object as needed.
5451
9d3b86f6
ILT
54522010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
5453 Ian Lance Taylor <iant@google.com>
5454
5455 PR 11019
5456 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
5457 Xindex::read_symtab_xindex.
5458
bb0d3eb0
DK
54592010-01-07 Doug Kwan <dougkwan@google.com>
5460
5461 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
5462 (Insn_template::thumb16_bcond_insn): New method declaration.
5463 (Insn_template): Fix spelling.
5464 (Stub::thumb16_special): New method declaration.
5465 (Stub::do_write): Define virtual method which was previously pure
5466 virtual.
5467 (Stub::do_thumb16_special): New method declaration.
5468 (Stub::do_fixed_endian_write): New template member.
5469 (Reloc_stub::do_write): Remove.
5470 (Reloc_stub::do_fixed_endian_write): Remove.
5471 (Cortex_a8_stub): New class definition.
5472 (Stub_factory::make_cortex_a8_stub): New method definition.
5473 (Stub_factory::Stub_factory): Add missing static storage class
5474 qualifier for elf32_arm_stub_a8_veneer_blx.
5475
ffeef7df
ILT
54762010-01-07 Ian Lance Taylor <iant@google.com>
5477
dc3f80fe
ILT
5478 PR 10980
5479 * options.h (class General_options): Add --warn-unresolved-symbols
5480 and --error-unresolved-symbols.
5481 * errors.cc (Errors::undefined_symbol): Implement
5482 --warn-unresolved-symbols.
5483
ffeef7df
ILT
5484 * options.h (class General_options): Add -z text and -z textoff.
5485 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
5486
f1ec9ded
ST
54872010-01-06 Sriraman Tallam <tmsriram@google.com>
5488
5489 * gc.h (Garbage_collection::Cident_section_map): New typedef.
5490 (Garbage_collection::cident_sections): New function.
5491 (Garbage_collection::add_cident_section): New function.
5492 (Garbage_collection::cident_sections_): New member.
5493 (gc_process_relocs): Add references to sections whose names are C
5494 identifiers.
5495 * gold.h (cident_section_start_prefix): New constant.
5496 (cident_section_stop_prefix): New constant.
5497 (is_cident): New function.
5498 * layout.cc (Layout::define_section_symbols): Replace string constants
5499 with the newly defined constants.
5500 * object.cc (Sized_relobj::do_layout): Track sections whose names are
5501 C identifiers.
5502 * testsuite/Makefile.am: Add gc_orphan_section_test.
5503 * testsuite/Makefile.in: Regenerate.
5504 * testsuite/gc_orphan_section_test.cc: New file.
5505 * testsuite/gc_orphan_section_test.sh: New file.
5506
6eda8c29
ILT
55072010-01-06 Ian Lance Taylor <iant@google.com>
5508
b9674e17
ILT
5509 PR 10980
5510 * options.h (class General_options): Add --warn-shared-textrel.
5511 * layout.cc (Layout::finish_dynamic_section): Implement
5512 --warn-shared-textrel.
5513
6eda8c29
ILT
5514 PR 10980
5515 * options.h (class General_options): Add --warn-multiple-gp.
5516
32dcd44e
ILT
55172010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5518
5519 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
5520 $(THREADSLIB) and $(LIBDL).
5521 * Makefile.in: Rebuild.
5522
a192ba05
ILT
55232010-01-06 Ian Lance Taylor <iant@google.com>
5524
5525 PR 10980
5526 * options.cc (General_options::parse_section_start): New function.
5527 (General_options::section_start): New function.
5528 (General_options::General_options): Initialize all members.
5529 * options.h: Include <map>
5530 (class General_options): Add --section-start. Add section_starts_
5531 member.
5532 * layout.cc (Layout::attach_allocated_section_to_segment): If
5533 --section-start was used, set the address of the segment. Remove
5534 local sort_sections.
5535 (Layout::relaxation_loop_body): If the address of the load segment
5536 has been set by --section-start, don't use it.
5537 * output.h (Output_segment::update_flags_for_output_section): New
5538 function.
5539 * output.cc (Output_segment::add_output_section): Call
5540 update_flags_for_output_section.
5541
dde3f402
ILT
55422010-01-05 Ian Lance Taylor <iant@google.com>
5543
62dfdd4d
ILT
5544 PR 10980
5545 * options.h (class General_options): Add --undefined-version.
5546 * script.cc (struct Version_expression): Add was_matched_by_symbol
5547 field.
5548 (Version_script_info::matched_symbol): New function.
5549 (Version_script_info::get_symbol_version_helper): Call
5550 matched_symbol.
5551 (Version_script_info::check_unmatched_names): New function.
5552 * script.h (class Version_script_info): Update declarations.
5553 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
5554
9c4ae156
ILT
5555 * options.h (class General_options): Use DEFINE_bool_alias for
5556 allow_multiple_definition.
5557 * resolve.cc (Symbol_table::should_override): Don't test
5558 allow_multiple_definition.
5559
dde3f402
ILT
5560 PR 10980
5561 * options.h (class General_options): Add --cref.
5562 * main.cc (main): Print cref table if --cref. Don't close mapfile
5563 until after printing cref table.
5564 * cref.cc: Include "symtab.h".
5565 (class Cref_inputs): Define Cref_table_compare and Cref_table.
5566 (Cref_table_compare::operator()): New function.
5567 (Cref_inputs::gather_cref): New function.
5568 (filecol): New static const.
5569 (Cref_inputs::print_cref): New function.
5570 (Cref::print_cref): New function.
5571 * cref.h: Include <cstdio>.
5572 (class Cref): Update declarations.
5573 * mapfile.h (Mapfile::file): New function.
5574 * object.h (class Object): Define Symbols. Declare virtual
5575 do_get_global_symbols.
5576 (Object::get_global_symbols): New function.
5577 * object.cc (Input_objects::add_object): Pass object to cref_ if
5578 --cref.
5579 (Input_objects::archive_start): Likewise.
5580 (Input_objects::archive_stop): Likewise.
5581 (Input_objects::print_cref): New function.
5582 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5583 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5584 --cref.
5585 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5586 function.
5587 * plugin.h (class Sized_pluginobj): Update declarations.
5588
8781f709
ILT
55892010-01-05 Ian Lance Taylor <iant@google.com>
5590
5591 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5592 to is_default_version. Rename insdef to insdefault.
5593 (Symbol_table::add_from_relobj): Rename def to is_default_version
5594 and local to is_forced_local.
5595 (Symbol_table::add_from_pluginobj): Likewise.
5596 (Symbol_table::add_from_dynobj): Likewise.
5597 (Symbol_table::define_special_symbol): Rename insdef to
5598 insdefault.
5599
fe35d28d
ILT
56002010-01-04 Ian Lance Taylor <iant@google.com>
5601
30bc8c46
ILT
5602 PR 10980
5603 * options.h (class General_options): Add
5604 --allow-multiple-definition and -z muldefs.
5605 * resolve.cc (Symbol_table::should_override): Don't warn about a
5606 multiple symbol definition if --allow-multiple-definition or -z
5607 muldefs.
5608
7eaea549
ILT
5609 PR 10980
5610 * options.h (class General_options): Add --add-needed and
5611 --copy-dt-needed-entries. Tweak --as-needed help entry.
5612 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5613 error if --copy-dt-needed-entries aka --add-needed is used and
5614 would cause a change in behaviour.
5615
fe35d28d
ILT
5616 PR 10980
5617 * options.h (class General_options): Add -G as a short version of
5618 --shared. Add no-op options -assert, -g, and -i.
5619
55a2bb35
ST
56202010-01-04 Sriraman Tallam <tmsriram@google.com>
5621
5622 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5623 check for .text or .gnu.linkonce.t sections.
5624 * icf.cc (Icf::find_identical_sections): Ditto.
5625 Change the detection for mangled function name within the section
5626 name.
5627 * icf.h (is_section_foldable_candidate): New function.
5628
719328e1
ILT
56292009-12-30 Ian Lance Taylor <iant@google.com>
5630
5631 PR 10980
5632 * options.h (class General_options): Permit two dashes with
5633 --retain-symbols-file.
5634
d7bb5745
ILT
56352009-12-30 Ian Lance Taylor <iant@google.com>
5636
403a15dd
ILT
5637 PR 10979
5638 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5639 don't put the file header and segment headers in the text
5640 segment.
5641
eda294df
ILT
5642 PR 10979
5643 * common.cc (Sort_commons::operator()): Stabilize sort when both
5644 entries are NULL.
5645 (Symbol_table::do_allocate_commons_list): When allocating common
5646 symbols, skip a symbol which is no longer common.
5647 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5648 an object before checking its type.
5649 * testsuite/common_test_2.c: New file.
5650 * testsuite/common_test_3.c: New file.
5651 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5652 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5653 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5654 (common_test_2_pic.o, common_test_2.so): New targets.
5655 (common_test_3_pic.o, common_test_3.so): New targets.
5656 * testsuite/Makefile.in: Rebuild.
5657
d7bb5745
ILT
5658 PR 10979
5659 * script.cc (read_input_script): If we see a new SECTIONS clause,
5660 and we have added an input section, give an error.
5661 * layout.h (class Layout): Add have_added_input_section function.
5662 Add have_added_input_section_ field.
5663 * layout.cc (Layout::Layout): Initialize
5664 have_added_input_section_.
5665 (Layout::layout): Set have_added_input_section_.
5666 (Layout::layout_eh_frame): Likewise.
5667
fc59c572
ILT
56682009-12-30 Ian Lance Taylor <iant@google.com>
5669
5670 PR 10931
5671 * options.h (class General_options): Add --sort-common option.
5672 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
5673 * common.cc (Sort_common): Add sort_order parameter to
5674 constructor. Add sort_order_ field.
5675 (Sort_commons::operator): Check sort_order_.
5676 (Symbol_table::allocate_commons): Determine the sort order.
5677 (Symbol_table::do_allocate_commons): Add sort_order parameter.
5678 Change all callers.
5679 (Symbol_table::do_allocate_commons_list): Likewise.
5680
1c74fab0
ILT
56812009-12-30 Ian Lance Taylor <iant@google.com>
5682
5683 PR 10916
5684 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
5685 symbols from this object, don't change the visibility of an
5686 undefined symbol.
5687 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
5688
6affe781
ILT
56892009-12-30 Ian Lance Taylor <iant@google.com>
5690
5691 PR 10861
5692 * script.h (class Version_script_info): Define Language enum.
5693 Update declarations. Define Glob, Exact, and Lookup types. Add
5694 new fields globals_, locals_, and is_finalized_.
5695 * script.cc: Various formatting fixes.
5696 (class Parser_closure): Change language_stack_ from a vector of
5697 std::string to one of Version_script_info::Language. Adjust all
5698 uses accordingly.
5699 (class Lazy_demangler): Remove.
5700 (struct Version_expression): Change language from std::string to
5701 Version_script_info::Language.
5702 (Version_script_info::Version_script_info): New function.
5703 (Version_script_info::~Version_script_info): Don't call clear.
5704 (Version_script_info::finalize): New function.
5705 (Version_script_info::build_lookup_tables): New function.
5706 (Version_script_info::build_expression_list_lookup): New
5707 function.
5708 (Version_script_info::get_symbol_version_helper): Rewrite to use
5709 lookup tables.
5710 (Version_script_info::print_expression_list): Adjust to use
5711 Version_script_info::Language.
5712 (script_push_lex_into_version_mode): Check that the version script
5713 has not been finalized.
5714 (version_script_push_lang): Change language string to
5715 Version_script_info::Language.
5716 * options.cc (Command_line::version_script): New function.
5717 * options.h (class General_options): Add finalize_dynamic_list
5718 function. Change version_script from declaration to definition.
5719 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
5720 * testsuite/version_script.map: Remove duplicate def of foo.
5721 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
5722 version_script.map.
5723 * testsuite/Makefile.in: Rebuild.
5724
818bf354
ILT
57252009-12-30 Ian Lance Taylor <iant@google.com>
5726
5727 PR 10843
5728 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
5729 if the input symbol index is 0, make the output symbol index 0.
5730
ebcc8304
ILT
57312009-12-30 Ian Lance Taylor <iant@google.com>
5732
5733 PR 10670
5734 * options.h (class General_options): Add -x/--discard-all.
5735 * object.cc (Sized_relobj::do_count_local_symbols): Handle
5736 --discard-all. If the local symbol needs a dynamic entry, check
5737 that before handling --discard-locals.
5738
176fe33f
ILT
57392009-12-30 Ian Lance Taylor <iant@google.com>
5740
bb321bb1
ILT
5741 PR 10450
5742 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
5743 flags to PF_R.
5744 (Output_segment::add_output_section): Don't change the flags if
5745 the type is PT_TLS.
5746
176fe33f
ILT
5747 PR 10450
5748 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
5749 GNU hash table if they need a dynamic value. Otherwise, don't add
5750 them if they are defined in a dynamic object or are forced local.
5751
e8cd95c7
ILT
57522009-12-29 Ian Lance Taylor <iant@google.com>
5753
1b81fb71
ILT
5754 PR 10450
5755 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
5756 .gnu.hash table for a 32-bit target.
5757
8d6d383d
ILT
5758 PR 10450
5759 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
5760 regular and a dynamic object only needs a dynamic symbol table
5761 entry if it is externally visible.
5762
e785ec03
ILT
5763 PR 10450
5764 * i386.cc (class Target_i386): Initialize global_offset_table_ in
5765 constructor. Add global_offset_table_ field.
5766 (Target_i386::got_section): Set global_offset_table_.
5767 (Target_i386::do_finalize_sections): Set global_offset_table_
5768 size.
5769 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
5770 in constructor. Add global_offset_table_ field.
5771 (Target_x86_64::got_section): Set global_offset_table_.
5772 (Target_x86_64::do_finalize_sections): Set global_offset_table_
5773 size.
5774
1a2dff53
ILT
5775 * layout.cc (Layout::Layout): Initialize increase_relro_.
5776 (Layout::get_output_section): Add is_relro, is_last_relro, and
5777 is_first_non_relro parameters. Change all callers.
5778 (Layout::choose_output_section): Likewise.
5779 (Layout::add_output_section_data): Likewise.
5780 (Layout::make_output_section): Likewise.
5781 (Layout::set_segment_offsets): Clear increase_relro when using a
5782 linker script.
5783 * layout.h (class Layout): Add increase_relro method. Add
5784 increase_relro_ field. Update declarations.
5785 * output.cc (Output_section::Output_section): Initialize
5786 is_last_relro_ and is_first_non_relro_.
5787 (Output_segment::add_output_section): Group relro sections is
5788 do_sort is true. Handle is_last_relro and is_first_non_relro.
5789 (Output_segment::maximum_alignment): Remove relro handling.
5790 (Output_segment::set_section_addresses): Add increase_relro
5791 parameter. Change all callers. Add initial alignment to align
5792 relro sections on separate page. Remove old relro handling.
5793 (Output_segment::set_section_list_addresses): Remove in_relro
5794 parameter. Change all callers.
5795 (Output_segment::set_offset): Add increase parameter. Change all
5796 callers. Remove old relro handling.
5797 * output.h (class Output_section): Add new methods: is_last_relro,
5798 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
5799 Add is_last_relro_ and is_first_non_relro_ fields.
5800 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
5801 Create separate .got.plt section. Call increase_relro.
5802 * x86_64.cc (Target_x86_64::got_section): Likewise.
5803 * testsuite/relro_script_test.t: Add .got.plt.
5804
f0ba79e2
ILT
5805 PR 10450
5806 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
5807 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
5808 (Layout::finalize): Call set_dynamic_symbol_size.
5809 (Layout::set_dynamic_symbol_size): New function.
5810 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
5811 set_dynamic_symbol_size.
5812
e8cd95c7
ILT
5813 PR 10450
5814 * output.h (class Output_section): Add is_entsize_zero_ field.
5815 * output.cc (Output_section::Output_section): Initialize
5816 is_entsize_zero_.
5817 (Output_section::set_entsize): If two different entsizes are
5818 requested, force it to zero.
5819 (Output_section::add_input_section): Set flags for .debug_str
5820 before updating section flags. Set entsize.
5821 (Output_section::update_flags_for_input_section): Set SHF_MERGE
5822 and SHF_STRING if all input sections have those flags.
5823
3e1b9a8a
RÁE
58242009-12-29 Rafael Espindola <espindola@google.com>
5825
5826 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
5827 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
5828 reporting.
3e1b9a8a 5829
3dcad376
ST
58302009-12-29 Sriraman Tallam <tmsriram@google.com>
5831
5832 * options.cc (General_options::parse_version): Allow -v to exit
5833 without an error if there is nothing to link.
5834
084e2665
ILT
58352009-12-29 Ian Lance Taylor <iant@google.com>
5836
5837 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
5838 using a version of gcc before 4.1.
5839 * configure: Rebuild.
5840
250acde3
CD
58412009-12-28 Chris Demetriou <cgd@google.com>
5842
5843 * attributes.cc (Output_attributes_section_data::do_write): Use
5844 std::vector::front rather than std::vector::data.
5845
99fff23b
ILT
58462009-12-28 Ian Lance Taylor <iant@google.com>
5847
5848 * symtab.h (class Symbol_table): Add enum Defined.
5849 * resolve.cc (Symbol_table::should_override): Add defined
5850 parameter. Change all callers. Test whether object is NULL
5851 before calling a method on it.
5852 (Symbol_table::report_resolve_problem): Add defined parameter.
5853 Change all callers.
5854 (Symbol_table::should_override_with_special): Likewise.
5855 * symtab.cc (Symbol_table::define_in_output_data): Add defined
5856 parameter. Change all callers.
5857 (Symbol_table::do_define_in_output_data): Likewise.
5858 (Symbol_table::define_in_output_segment): Likewise.
5859 (Symbol_table::do_define_in_output_segment): Likewise.
5860 (Symbol_table::define_as_constant): Likewise.
5861 (Symbol_table::do_define_as_constant): Likewise.
5862 * script.h (class Symbol_assignment): Add is_defsym parameter to
5863 constructor; change all callers.
5864 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
5865 parameter. Change all callers. Add is_defsym_ field.
5866 (class Parser_closure): Add parsing_defsym parameter to
5867 constructor; change all callers. Add parsing_defsym accessor
5868 function. Add parsing_defsym_ field.
5869
556bd683
ILT
58702009-12-28 Ian Lance Taylor <iant@google.com>
5871
5872 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 5873 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 5874
1782c879
ILT
58752009-12-23 Ian Lance Taylor <iant@google.com>
5876
5877 * i386.cc (Target_i386::do_calls_non_split): Recognize
5878 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
5879 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
5880 -fsplit-stack prologue when using %r11.
1782c879 5881
329ca2b1
ST
58822009-12-21 Sriraman Tallam <tmsriram@google.com>
5883
5884 * options.cc (General_options::parse_version): Make -v continue and do
5885 the link like GNU ld does.
5886
d675ff46
RÁE
58872009-12-17 Rafael Avila de Espindola <espindola@google.com>
5888
5889 * Makefile.am (CCFILES): Add timer.cc.
5890 (HFILES): Add timer.h.
5891 * configure.ac: Check for sysconf and times.
5892 * main.cc: include timer.h.
5893 (main): Use Timer instead of get_run_time.
5894 * timer.cc: New.
5895 * timer.h: New.
5896 * workqueue.cc: include timer.h.
5897 (Workqueue::find_and_run_task):
5898 Report user, sys and wall time.
5899 * Makefile.in: Regenerate.
5900 * config.in: Regenerate.
5901 * configure: Regenerate.
5902
d6344fb5
DK
59032009-12-16 Doug Kwan <dougkwan@google.com>
5904
5905 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5906 sections.
5907 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5908 relaxed input sections.
5909 * output.cc (Output_section::find_relaxed_input_section): Change
5910 return type to Output_relaxed_input_section pointer. Adjust code
5911 for new type of relaxed_input_section_map_.
5912 * output.h (Output_section::find_relaxed_input_section): Change
5913 return type to Output_relaxed_input_section pointer.
5914 (Output_section::Output_relaxed_input_section_by_input_section_map):
5915 New type.
5916 (Output_section::relaxed_input_section_map_): Change type to
5917 Output_section::Output_relaxed_input_section_by_input_section_map.
5918 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5919 input section.
5920
0e0d5469
ILT
59212009-12-15 Ian Lance Taylor <iant@google.com>
5922
5923 * layout.cc (Layout::create_shstrtab): Only write out after input
5924 sections if we are compressing debug sections.
5925
0649a889
ILT
59262009-12-15 Ian Lance Taylor <iant@google.com>
5927
5928 * archive.cc (Archive::add_symbols): Only look up a symbol without
5929 a version if there is, in fact, a version.
5930
2ea97941
ILT
59312009-12-14 Ian Lance Taylor <iant@google.com>
5932
5933 Revert -Wshadow changes, all changes from:
5934 2009-12-11 Doug Kwan <dougkwan@google.com>
5935 2009-12-11 Nick Clifton <nickc@redhat.com>
5936 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5937
b0eec2cc
DK
59382009-12-11 Doug Kwan <dougkwan@google.com>
5939
5940 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5941 due to -Wshadow.
5942 * attributes.cc (Object_attribute::size): Ditto.
5943 (Attributes_section_data::size): Ditto.
5944 (Attributes_section_data::Attributes_section_data): Ditto.
5945 (Output_attributes_section_data::do_write): Ditto.
5946 * attributes.h (Object_attribute::set_type): Ditto.
5947 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5948
91d6fa6a
NC
59492009-12-11 Nick Clifton <nickc@redhat.com>
5950
5951 * archive.cc: Fix shadowed variable warnings.
5952 * arm.cc: Likewise.
5953 * compressed_output.cc: Likewise.
5954 * compressed_output.h: Likewise.
5955 * configure: Likewise.
5956 * dwarf_reader.cc: Likewise.
5957 * dynobj.cc: Likewise.
5958 * dynobj.h: Likewise.
5959 * ehframe.cc: Likewise.
5960 * ehframe.h: Likewise.
5961 * errors.cc: Likewise.
5962 * expression.cc: Likewise.
5963 * fileread.cc: Likewise.
5964 * fileread.h: Likewise.
5965 * freebsd.h: Likewise.
5966 * i386.cc: Likewise.
5967 * icf.cc: Likewise.
5968 * incremental.h: Likewise.
5969 * layout.cc: Likewise.
5970 * layout.h: Likewise.
5971 * mapfile.cc: Likewise.
5972 * merge.cc: Likewise.
5973 * merge.h: Likewise.
5974 * object.cc: Likewise.
5975 * object.h: Likewise.
5976 * options.h: Likewise.
5977 * output.cc: Likewise.
5978 * output.h: Likewise.
5979 * parameters.cc: Likewise.
5980 * plugin.cc: Likewise.
5981 * powerpc.cc: Likewise.
5982 * reduced_debug_output.cc: Likewise.
5983 * reduced_debug_output.h: Likewise.
5984 * reloc.cc: Likewise.
5985 * reloc.h: Likewise.
5986 * resolve.cc: Likewise.
5987 * script-sections.cc: Likewise.
5988 * script.cc: Likewise.
5989 * script.h: Likewise.
5990 * sparc.cc: Likewise.
5991 * symtab.cc: Likewise.
5992 * symtab.h: Likewise.
5993 * target-select.cc: Likewise.
5994 * target-select.h: Likewise.
5995 * token.h: Likewise.
5996 * workqueue.cc: Likewise.
5997 * workqueue.h: Likewise.
5998 * x86_64.cc: Likewise.
5999
a0351a69
DK
60002009-12-10 Doug Kwan <dougkwan@google.com>
6001
6002 * arm.cc (attributes.h): New include.
6003 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
6004 (Arm_relobj::~Arm_relobj): Delete object pointed by
6005 attributes_section_data_.
6006 (Arm_relobj::attributes_section_data): New method definition.
6007 (Arm_relobj::attributes_section_data_): New data member declaration.
6008 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
6009 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
6010 attributes_section_data_.
6011 (Arm_dynobj::attributes_section_data): New method definition.
6012 (Arm_dynobj::attributes_section_data_): New data member declaration.
6013 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
6014 initialization value of may_use_blx_ to false.
6015 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
6016 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
6017 object attributes to compute results instead of hard-coding.
6018 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
6019 Target_arm::get_secondary_compatible_arch,
6020 Target_arm::set_secondary_compatible_arch
6021 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6022 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
6023 New method declarations.
6024 (Target_arm::get_aeabi_object_attribute): New method definition.
6025 (Target_arm::attributes_section_data_): New data member declaration.
6026 (read_arm_attributes_section): New template definition.
6027 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
6028 (Arm_dynobj::do_read_symbols): Ditto.
6029 (Target_arm::do_finalize_sections): Merge attributes sections from
6030 input. Check for BLX use after attributes section merging.
6031 Fix __exidx_start and __exidx_end visibility. Create an
6032 .ARM.attributes section if necessary.
6033 (Target_arm::get_secondary_compatible_arch,
6034 Target_arm::set_secondary_compatible_arch,
6035 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6036 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 6037 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
6038 New method definitions.
6039
b59befec
ILT
60402009-12-09 Ian Lance Taylor <iant@google.com>
6041
6042 * plugin.cc (Plugin::load): Don't cast from void* to a function
6043 pointer.
6044
1276bc89
ILT
60452009-12-09 Ian Lance Taylor <iant@google.com>
6046
6047 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
6048 information fields.
6049
2f2de248
L
60502009-12-09 H.J. Lu <hongjiu.lu@intel.com>
6051
6052 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
6053 Replace two_file_shared_1.so with two_file_shared_2.so.
6054 * testsuite/Makefile.in: Regenerated.
6055
4f787271
DK
60562009-12-08 Doug Kwan <dougkwan@google.com>
6057
6058 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6059 (HFILES): Add attributes.h and int_encoding.h.
6060 * Makefile.in: Regenerate.
6061 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6062 function definitions to int_encoding.cc
6063 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6064 prototypes to int_encoding.h
6065 * reduced_debug_output.cc (int_encoding.h): New include.
6066 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6067 function definitions to int_encoding.cc
6068 (insert_into_vector, read_from_pointer): Move template definitions to
6069 int_encoding.h
6070 * attributes.cc: New file.
6071 * attributes.h: New file.
6072 * int_encoding.cc: New file.
6073 * int_encoding.h: New file.
6074
20b52f1a
RÁE
60752009-12-07 Rafael Avila de Espindola <espindola@google.com>
6076
6077 PR gold/11055
6078 * incremental-dump.cc (dump_incremental_inputs): New.
6079 (main): Use dump_incremental_inputs.
6080
53d7974c
L
60812009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6082
6083 PR gold/10893
6084 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6085 checking elfcpp::STT_FUNC.
6086 (Target_i386::Relocate::relocate): Likewise.
6087 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6088
6089 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6090 symbols from shared libraries into normal FUNC symbols.
6091
6092 * symtab.h (Symbol): Add is_func and use it.
6093
05a352e6
DK
60942009-12-05 Doug Kwan <dougkwan@google.com>
6095
6096 * arm.cc (Target_arm::arm_info): Initialize new fields
6097 attributes_section and attributes_vendor.
6098 * i386.cc (Target_i386::i386_info): Same.
6099 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6100 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6101 fields attributes_section and attributes_vendor.
53d7974c 6102 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
6103 * target.h (Target::attributes_section, Target::attributes_vendor,
6104 Target::is_attributes_section, Target::attribute_arg_type,
6105 Target::attributes_order): New method definitions.
6106 (Target::Target_info::attributes_section,
6107 Target::Target_info::attributes_vendor): New fields.
6108 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6109 virtual method definitions.
6110 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6111 attributes_section and attributes_vendor.
6112 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6113
f4e5969c
DK
61142009-12-05 Doug Kwan <dougkwan@google.com>
6115
6116 * arm.cc: Update comments about interworking and stub generation.
6117 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6118 considered as non-PIC.
6119 (Arm_relocate_functions::base_abs): Fix formatting.
6120 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6121 of function to use GOT entry address instead of offset.
6122 (Target_arm::Scan::global): Issue an error if a symbol would need a
6123 PLT does not get one because it is untyped. Remove code to create
6124 dynamic symbols for relative branches.
6125 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6126 takes unsigned integer instead of boolean.
6127
1abce4a6
L
61282009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6129
6130 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6131 (two_file_test_LDADD): Likewise.
6132 (common_test_1_LDADD): Likewise.
6133 (exception_test_LDADD) Likewise.
6134 (weak_test_LDADD): Likewise.
6135 (many_sections_test_LDADD): Likewise.
6136 (initpri1_LDADD): Likewise.
6137 (script_test_1_LDADD): Likewise.
6138 (script_test_2_LDADD): Likewise.
6139 (justsyms_LDADD): Likewise.
6140 (binary_test_LDADD): Likewise.
6141 (large_LDADD): Likewise.
6142 * testsuite/Makefile.in: Regenerated.
6143
adcf2816 61442009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 6145
adcf2816
L
6146 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6147 (Symbol_table::override_with_special): Likewise.
6148 (Symbol_table::add_from_object): Likewise.
6149
28e67f5d
RÁE
61502009-12-04 Rafael Avila de Espindola <espindola@google.com>
6151
6152 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6153 Don't set the data_offset twice.
6154
ae10a101
RÁE
61552009-12-04 Rafael Avila de Espindola <espindola@google.com>
6156
6157 * testsuite/Makefile.in: Regenerate.
6158
f59f41f3
DK
61592009-12-03 Doug Kwan <dougkwan@google.com>
6160
6161 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6162 (Target_arm::do_finalize_sections): Add parameter for symbol table
6163 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6164 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6165 parameter for symbol table pointer.
6166 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6167 an additional parameter for a pointer to symbol table.
6168 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6169 parameter for a symbol table pointer.
6170 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6171 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6172 Ditto.
6173 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6174 parameter for a symbol table pointer.
6175
ca55d848
RÁE
61762009-12-03 Rafael Avila de Espindola <espindola@google.com>
6177
6178 * incremental.cc (Incremental_inputs_header)
6179 (Incremental_inputs_header_write, Incremental_inputs_entry)
6180 (Incremental_inputs_entry_write): Move ...
6181 * incremental.h (Incremental_inputs_header)
6182 (Incremental_inputs_header_write, Incremental_inputs_entry)
6183 (Incremental_inputs_entry_write): here.
6184
3aec4f9c
RÁE
61852009-12-02 Rafael Avila de Espindola <espindola@google.com>
6186
6187 * incremental.cc (make_sized_incremental_binary): Set the target.
6188 Error if it is incompatible.
6189 * output.h (Output_file): Add filename method.
6190
9c0ae74d
RÁE
61912009-12-02 Rafael Avila de Espindola <espindola@google.com>
6192
6193 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6194 from the get_* methods.
6195
a45500ae
RÁE
61962009-12-02 Rafael Avila de Espindola <espindola@google.com>
6197
6198 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6199 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6200 Write 0 for the data_offset of scripts.
6201
325e6408
RÁE
62022009-12-02 Rafael Avila de Espindola <espindola@google.com>
6203
6204 * testsuite/Makefile.am: Add the incremental_test.sh test.
6205 * testsuite/incremental_test.sh: New.
6206 * testsuite/incremental_test_1.c: New.
6207 * testsuite/incremental_test_2.c: New.
6208
954c3e2e
RÁE
62092009-12-01 Rafael Avila de Espindola <espindola@google.com>
6210
6211 * incremental-dump.cc (main): Fix typos.
6212
f8086623
RÁE
62132009-11-27 Rafael Avila de Espindola <espindola@google.com>
6214
6215 PR gold/11025
6216 * incremental-dump.cc (main): Use llu to print 64 bit values.
6217
3b0dd6ac
L
62182009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6219 H.J. Lu <hongjiu.lu@intel.com>
6220
6221 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6222 $(LIBDL).
6223 (incremental_dump_LDADD): Likewise.
6224 * Makefile.in: Regenerated.
6225
a6d1ef57 62262009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 6227
a6d1ef57
DK
6228 Revert:
6229
6230 2009-11-25 Doug Kwan <dougkwan@google.com>
6231
6232 * arm.cc (Target_arm::Target_arm): Move method definition
6233 outside of class definition. Add code to handle
6234 --target1-rel, --target1-abs and --target2= options.
6235 (Target_arm::get_reloc_reloc_type): Change method to be
6236 non-static and const.
6237 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6238 New data member declaration.
6239 (Target_arm::Scan::local, Target_arm::Scan::global,
6240 Target_arm::Relocate::relocate,
6241 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6242 Adjust call to Target_arm::get_real_reloc_type.
6243 (Target_arm::get_real_reloc_type): Use command line options
6244 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6245 * options.h (--target1-rel, --target1-abs, --target2): New
6246 ARM-only options.
6247
50aeb7d4
DK
62482009-11-25 Doug Kwan <dougkwan@google.com>
6249
6250 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6251 class definition. Add code to handle --target1-rel, --target1-abs
6252 and --target2= options.
6253 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6254 and const.
6255 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6256 member declaration.
6257 (Target_arm::Scan::local, Target_arm::Scan::global,
6258 Target_arm::Relocate::relocate,
6259 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6260 call to Target_arm::get_real_reloc_type.
6261 (Target_arm::get_real_reloc_type): Use command line options to
6262 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6263 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6264 options.
6265
51938283
DK
62662009-11-25 Doug Kwan <dougkwan@google.com>
6267
6268 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6269 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6270 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6271 formatting.
6272 (Arm_relocate_functions::thm_call): Replace body with a call to
6273 Arm_relocate_functions::thumb_branch_common.
6274 (Arm_relocate_functions::thm_jump24,
6275 Arm_relocate_functions::thm_xpc22): New method definitions.
6276 (Arm_relocate_functions::thumb_branch_common): New method definition.
6277 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6278 operator.
6279 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6280 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6281
e2b8f3c4
RÁE
62822009-11-24 Rafael Avila de Espindola <espindola@google.com>
6283
6284 * Makefile.am: Build incremental-dump
6285 * Makefile.in: Regenerate.
6286 * incremental-dump.cc: New.
6287 * incremental.cc (Incremental_inputs_header_data,
6288 Incremental_inputs_entry_data): Move to incremental.h
6289 * incremental.h: (Incremental_inputs_header_data,
6290 Incremental_inputs_entry_data): Move from incremental.cc
6291
bcba9aec
RÁE
62922009-11-24 Rafael Avila de Espindola <espindola@google.com>
6293
6294 * incremental.cc (Incremental_inputs_header,
6295 Incremental_inputs_header_write, Incremental_inputs_entry,
6296 Incremental_inputs_entry_write): Add a typedef with the data type.
6297
7c3afe08
RÁE
62982009-11-24 Rafael Avila de Espindola <espindola@google.com>
6299
6300 * incremental.cc (Incremental_inputs_header,
6301 Incremental_inputs_header_write, Incremental_inputs_entry,
6302 Incremental_inputs_entry_write): Update comment about which
6303 type has the filed descriptions.
6304
d204b6e9
DK
63052009-11-15 Doug Kwan <dougkwan@google.com>
6306
6307 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6308 (Arm_relocate_functions::arm_branch_common): Change method defintion
6309 in class definition to a method declaration and update list of formal
6310 parameters.
6311 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6312 Arm_relocation_functions::jump24): Adjust call to
6313 Arm_relocate_functions::arm_branch_common. Update list of formal
6314 parameters.
6315 (Arm_relocate_functions::xpc25): New method definition.
6316 (Arm_relocate_functions::arm_branch_common): Move method defintion
6317 out from class definition. Use stubs for mode-switching and extending
6318 branch ranges.
6319 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6320 specially. Change code to enable use of stubs in ARM branches.
6321
43d12afe
DK
63222009-11-10 Doug Kwan <dougkwan@google.com>
6323
6324 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6325 in method declaration.
6326 (Target_arm::relocate_stub): New method declaration.
6327 (Target_arm::default_target): Change to return a pointer instead of
6328 a const reference.
6329 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
6330 Target_arm::default_target.
6331 (Arm_Relobj::do_relocate_sections): Remove options paramater in
6332 method definition.
6333 (Target_arm::relocate_section): Adjust view.
6334 (Target_arm::relocate_stub): New method definition.
6335
ac33a407
DK
63362009-11-10 Doug Kwan <dougkwan@google.com>
6337
6338 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
6339 a format warning.
6340 * incremental.cc (open_incremental_binary): Initialized local
6341 variables to avoid warnings.
6342 * object.cc (make_elf_object): Ditto.
6343 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6344 a format warning.
e1df38aa 6345
88ee28e9
L
6346009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6347
6348 PR gold/10930
6349 * testsuite/plugin_test.c: Include "config.h".
6350
2daedcd6
DK
63512009-11-09 Doug Kwan <dougkwan@google.com>
6352
6353 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6354 (arm_symbol_value): Remove.
6355 (Arm_relocate_functions::arm_branch_common,
6356 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6357 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6358 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6359 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6360 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6361 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
6362 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
6363 Arm_relocate_functions::thm_mobw_abs_nc,
6364 Arm_relocate_functions::thm_mov_abs,
6365 Arm_relocate_functions::movw_prel_nc,
6366 Arm_relocate_functions::thm_movt_abs,
6367 Arm_relocate_functions::movt_prel,
6368 Arm_relocate_functions::thm_movw_prel_nc,
6369 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
6370 (Target_arm::Relocate::relocate): Only decompose address into two
6371 parts if relocation type uses the thumb-bit and pass the actual
6372 bit instead of a flag indicating that the thumb-bit is used. Adjust
6373 calls to methods in Arm_relocate_functions for this change.
6374
1276bc89 63752009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
6376
6377 PR 10925
6378 * reloc.cc: Instantiate
6379 Sized_relobj::initialize_input_to_output_maps and
6380 Sized_relobj:free_input_to_output_maps.
6381
e53ad1b5
ILT
63822009-11-06 Ian Lance Taylor <iant@google.com>
6383
6384 PR 10876
6385 * defstd.cc (in_segment): Set only_if_ref true for "end".
6386
eb44217c
DK
63872009-11-06 Doug Kwan <dougkwan@google.com>
6388
6389 * arm.cc (class Reloc_stub): Correct a comment.
6390 (Target_arm::Target_arm): Initialize arm_input_section_map_.
6391 (Target_arm::scan_section_for_stubs): New method declaration.
6392 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
6393 Change methods from private to protected.
6394 (Target_arm::do_may_relax): New method definition.
6395 (Target_arm::do_relax, Target_arm::group_sections,
6396 Target_arm::scan_reloc_for_stub,
6397 Target_arm::scan_reloc_section_for_stubs): New method declarations.
6398 (Target_arm::arm_input_section_map_): New data member declaration.
6399 (Target_arm::scan_reloc_for_stub,
6400 Target_arm::scan_reloc_section_for_stubs,
6401 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
6402 Target_arm::do_relax): New method definitions.
6403
5d329b7d
ILT
64042009-11-06 Mikolaj Zalewski <mikolaj@google.com>
6405
6406 * configure.ac: Check for (struct stat)::st_mtim
6407 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
6408 * config.in: Regenerate.
6409 * configure: Regenerate.
6410
96a0d71b
ILT
64112009-11-05 Ian Lance Taylor <iant@google.com>
6412
6413 PR 10910
6414 * output.cc (Output_segment::add_output_section): Add missing
6415 return statement.
6416
594c8e5e
ILT
64172009-11-04 Ian Lance Taylor <iant@google.com>
6418
6419 PR 10880
6420 * object.h (class Object): Add is_needed and set_is_needed
6421 methods. Add is_needed_ field. Make bool fields into bitfields.
6422 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
6423 defined in a dynamic object and referenced by a regular object,
6424 set is_needed for the dynamic object.
6425 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
6426 if the file is marked with as_needed and it is not needed.
6427
22b127cc
ILT
64282009-11-04 Ian Lance Taylor <iant@google.com>
6429
6430 PR 10887
6431 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
6432 tags if data is discarded by linker script.
6433 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6434 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6435 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6436 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6437
f5c870d2
ILT
64382009-11-04 Ian Lance Taylor <iant@google.com>
6439
6440 * layout.cc (Layout::get_output_section): Add is_interp and
6441 is_dynamic_linker_section parameters. Change all callers.
6442 (Layout::choose_output_section): Likewise.
6443 (Layout::make_output_section): Likewise.
6444 (Layout::add_output_section_data): Add is_dynamic_linker_section
6445 parameter. Change all callers.
6446 * layout.h (class Layout): Update declarations.
6447 * output.h (class Output_section): Add is_interp, set_is_interp,
6448 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
6449 Add is_interp_, is_dynamic_linker_section_ fields. Change
6450 generate_code_fills_at_write_ to a bitfield.
6451 * output.cc (Output_section::Output_sections): Initialize new
6452 fields.
6453 (Output_segment::add_output_section): Add do_sort parameter.
6454 Change all callers.
6455
1ae4d23b
ILT
64562009-11-03 Ian Lance Taylor <iant@google.com>
6457
6458 PR 10860
6459 * options.h (class General_options): Add --warn-common.
6460 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
6461 merging two common symbols.
6462 (Symbol_table::should_override): Handle --warn-common when merging
6463 a common symbol with a defined symbol. Use report_resolve_problem
6464 for multiple definitions.
6465 (Symbol_table::report_resolve_problem): New function.
6466 * symtab.h (class Symbol_table): Declare report_resolve_problem.
6467
55da9579
DK
64682009-11-03 Doug Kwan <dougkwan@google.com>
6469
6470 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
6471 stub_factory_.
6472 (Target_arm::stub_factory): New method definition.
6473 (Target_arm::new_arm_input_section,
6474 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
6475 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 6476 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
6477 New type definitions.
6478 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
6479 member declarations.
6480 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
6481 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
6482 New method definitions.
6483
37a9ac43
ILT
64842009-11-03 Ian Lance Taylor <iant@google.com>
6485
6486 * options.h (class General_options): Add --warn_constructors.
6487
b3d6a3d4
ILT
64882009-11-03 Ian Lance Taylor <iant@google.com>
6489
6490 PR 10893
6491 * defstd.cc (in_section): Add entries for __rel_iplt_start,
6492 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
6493
934b01dd
ILT
64942009-11-03 Ian Lance Taylor <iant@google.com>
6495
6496 PR 10895
6497 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
6498 --msgid-bugs-address.
6499 (install-pdf): New target.
6500 (install-data_yes): Look up one directory to find mkinstalldirs.
6501
03c1939b
L
65022009-11-03 H.J. Lu <hongjiu.lu@intel.com>
6503
6504 * po/Make-in (.po.gmo): Don't generate .gmo files in source
6505 tree.
6506
ebd95253
DK
65072009-10-30 Doug Kwan <dougkwan@google.com>
6508
6509 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
6510
e9bbb538
DK
65112009-10-30 Doug Kwan <dougkwan@google.com>
6512
6513 * arm.cc (Stub_addend_reader): New struct template definition
6514 and partial specializations.
6515 (Stub_addend_reader::operator()): New method definition for a
6516 partially specialized template.
6517
d5b40221
DK
65182009-10-30 Doug Kwan <dougkwan@google.com>
6519
6520 * arm.cc (Arm_relobj::processor_specific_flags): New method
6521 definition.
6522 (Arm_relobj::do_read_symbols): New method declaration.
6523 (Arm_relobj::processor_specific_flags_): New data member declaration.
6524 (Arm_dynobj): New class definition.
6525 (Target_arm::do_finalize_sections): Add input_objects parameter.
6526 (Target_arm::do_adjust_elf_header): New method declaration.
6527 (Target_arm::are_eabi_versions_compatible,
6528 (Target_arm::merge_processor_specific_flags): New method declaration.
6529 (Target_arm::do_make_elf_object): New overloaded method definitions
6530 and declaration.
6531 (Arm_relobj::do_read_symbols): New method definition.
6532 (Arm_dynobj::do_read_symbols): Ditto.
6533 (Target_arm::do_finalize_sections): Add input_objects parameters.
6534 Merge processor-specific flags from all input objects.
6535 (Target_arm::are_eabi_versions_compatible,
6536 Target_arm::merge_processor_specific_flags,
6537 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
6538 New method definitions.
6539 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
6540 Input_objects pointer type parameter.
6541 * layout.cc (Layout::finalize): Pass input objects to target's.
6542 finalize_sections function.
6543 * output.cc (Output_file_header::do_sized_write): Set ELF file
6544 header's processor-specific flags.
6545 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
6546 Input_objects pointer type parameter.
6547 * sparc.cc (Target_sparc::do_finalize_sections): Same.
6548 * target.h (Input_objects): New forward class declaration.
6549 (Target::processor_specific_flags,
6550 Target::are_processor_specific_flags_sect): New method definitions.
6551 (Target::finalize_sections): Add input_objects parameter.
6552 (Target::Target): Initialize processor_specific_flags_ and
6553 are_processor_specific_flags_set_.
6554 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
6555 parameter.
6556 (Target::set_processor_specific_flags): New method definition.
6557 (Target::processor_specific_flags_,
6558 Target::are_processor_specific_flags_set_): New data member
6559 declarations.
6560 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
6561 Input_objects pointer type parameter.
6562
ebabffbd
DK
65632009-10-30 Doug Kwan <dougkwan@google.com>
6564
6565 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
6566
ad0f2072
ILT
65672009-10-28 Ian Lance Taylor <iant@google.com>
6568
6569 * object.h (class Relobj): Drop options parameter from
6570 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
6571 do_scan_relocs, do_relocate. Change all callers.
6572 (class Sized_relobj): Drop options parameters from
6573 do_gc_process_relocs, do_scan_relocs, do_relocate,
6574 do_relocate_sections, relocate_sections, emit_relocs_scan,
6575 emit_relocs_scan_reltype. Change all callers.
6576 (struct Relocate_info): Remove options field and all references to
6577 it.
6578 * reloc.h (class Read_relocs): Remove options constructor
6579 parameter and options_ field. Change all callers.
6580 (class Gc_process_relocs, class Scan_relocs): Likewise.
6581 (class Relocate_task): Likewise.
6582 * target-reloc.h (scan_relocs): Remove options parameter. Change
6583 all callers.
6584 (scan_relocatable_relocs): Likewise.
6585 * target.h (class Sized_target): Remove options parameter from
6586 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6587 all callers.
6588 * gc.h (gc_process_relocs): Remove options parameter. Change all
6589 callers.
6590 * arm.cc: Update functions to remove options parameters.
6591 * i386.cc: Likewise.
6592 * powerpc.cc: Likewise.
6593 * sparc.cc: Likewise.
6594 * x86_64.cc: Likewise.
6595 * testsuite/testfile.cc: Likewise.
6596
8ffa3667
DK
65972009-10-28 Doug Kwan <dougkwan@google.com>
6598
6599 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6600 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6601 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6602 New method definitions.
6603
40f36857
CC
66042009-10-28 Cary Coutant <ccoutant@google.com>
6605
6606 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6607 (Plugin::cleanup_done_): New member.
6608 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6609 (Plugin_manager::cleanup_done_): Remove.
6610 (Plugin_manager::add_input_file): Edit error message.
6611 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6612 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6613
2c849493
ILT
66142009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6615
6616 * fileread.cc: (File_read::View::~View): Use the new
6617 data_ownership_ filed.
6618 (File_read::~File_read): Dispose the new whole_file_view_.
6619 (File_read::open): Mmap the whole file if needed.
6620 (File_read::open): Use whole_file_view_ instead of contents_.
6621 (File_read::find_view): Use whole_file_view_ if applicable.
6622 (File_read::do_read): Use whole_file_view_ instead of contents_.
6623 (File_read::make_view): Use whole_file_view_ instead of contents_,
6624 update File_read::View::View call.
6625 (File_read::find_or_make_view): Update File_read::View::View
6626 call.
6627 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6628 remove contents_
6629 (File_read::View::Data_ownership): New enum.
6630 (File_read::View::View): Replace bool mapped_ with Data_ownership
6631 argument.
6632 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6633 (File_read::View::data_ownership_): New field.
6634 (File_read::contents_): Remove (replaced by whole_file_view_).
6635 (File_read::whole_file_view_): New field.
6636 * options.h (class General_options): Add --keep-files-mapped.
6637
24998053
CC
66382009-10-27 Cary Coutant <ccoutant@google.com>
6639
6640 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6641 * testsuite/Makefile.am (plugin_test_5): New test case.
6642 * testsuite/Makefile.in: Regenerate.
6643
72adc4fa
DK
66442009-10-25 Doug Kwan <dougkwan@google.com>
6645
6646 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6647 from private to protected to allow access by child class.
6648 (Sized_relobj::do_relocate_sections): New method declaration.
6649 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6650 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6651 Sized_relobj::relocate_sections. Instantiate template explicitly
6652 for different target sizes and endianity.
6653
07f508a2
DK
66542009-10-24 Doug Kwan <dougkwan@google.com>
6655
6656 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6657 (Arm_input_section::as_arm_input_section): New method.
6658 (Arm_output_section): New class definition.
6659 (Arm_output_section::create_stub_group,
6660 Arm_output_section::group_sections): New method definitions.
6661
10ad9fe5
DK
66622009-10-22 Doug Kwan <dougkwan@google.com>
6663
6664 * arm.cc (Arm_input_section): New class definition.
6665 (Arm_input_section::init, Arm_input_section:do_write,
6666 Arm_input_section::set_final_data_size,
6667 Arm_input_section::do_reset_address_and_file_offset): New method
6668 definitions.
6669
56ee5e00
DK
66702009-10-21 Doug Kwan <dougkwan@google.com>
6671
6672 * arm.cc (Stub_table, Arm_input_section): New forward class
6673 declarations.
6674 (Stub_table): New class defintion.
6675 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
6676 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
6677 New method definition.
6678
b569affa
DK
66792009-10-21 Doug Kwan <dougkwan@google.com>
6680
6681 * arm.cc: Update copyright comments.
6682 (Target_arm): New forward class template declaration.
6683 (Arm_address): New type.
6684 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
6685 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
6686 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
6687 constants.
6688 (Insn_template): Same.
6689 (DEF_STUBS): New macro.
6690 (Stub_type): New enum type.
6691 (Stub_template): New class definition.
6692 (Stub): Same.
6693 (Reloc_stub): Same.
6694 (Stub_factory): Same.
6695 (Target_arm::Target_arm): Initialize may_use_blx_ and
6696 should_force_pic_veneer_.
6697 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
6698 Target_arm::should_force_pic_veneer,
6699 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
6700 Target_arm::using_thumb_only, Target_arm:;default_target): New
6701 method defintions.
6702 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
6703 New data member declarations.
6704 (Insn_template::size, Insn_template::alignment): New method defintions.
6705 (Stub_template::Stub_template): New method definition.
6706 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
6707 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
6708 (Stub_factory::Stub_factory): New method definition.
6709 * gold.h (string_hash): New template.
6710 * output.h (Input_section_specifier::hash_value): Use
6711 gold::string_hash.
6712 (Input_section_specifier::string_hash): Remove.
6713 * stringpool.cc (Stringpool_template::string_hash): Use
6714 gold::string_hash.
6715
6c172549
DK
67162009-10-20 Doug Kwan <dougkwan@google.com>
6717
6718 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
6719 symbols of relaxed input sections.
6720 * output.h (Output_section::find_relaxed_input_section): Make
6721 method public.
6722
c5617f2f
DK
67232009-10-16 Doug Kwan <dougkwan@google.com>
6724
6725 * dynobj.cc (Versions::Versions): Initialize version_script_.
6726 Only insert base version symbol definition for a shared object
6727 if version script defines any version versions.
6728 (Versions::define_base_version): New method definition.
6729 (Versions::add_def): Check that base version is not needed.
6730 (Versions::add_need): Define base version lazily.
6731 * dynobj.h (Versions::define_base_version): New method declaration.
6732 (Versions::needs_base_version_): New data member declaration.
6733 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
6734 (check_DATA): Add no_version_test.stdout.
6735 (libno_version_test.so, no_version_test.o no_version_test.stdout):
6736 New make rules.
6737 * testsuite/Makefile.in: Regenerate.
6738 * testsuite/no_version_test.c: New file.
6739 * testsuite/no_version_test.sh: Ditto.
6740
3c12dcdb
DK
67412009-10-16 Doug Kwan <dougkwan@google.com>
6742
6743 * expression.cc (class Segment_start_expression): New class definition.
6744 (Segment_start_expression::value): New method definition.
6745 (script_exp_function_segment_start): Return a new
6746 Segment_start_expression.
6747 * gold/script-c.h (script_saw_segment_start_expression): New function
6748 prototype.
6749 * script-sections.cc (Script_sections::Script_sections): Initialize
6750 SAW_SEGMENT_START_EXPRESSION_ to false.
6751 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
6752 and -Tbbs options to specify section addresses if given in
6753 command line and no SEGMENT_START expression is seen in a script.
6754 * script-sections.h (Script_sections::saw_segment_start_expression,
6755 Script_sections::set_saw_segment_start_expression): New method
6756 definition.
6757 (Script_sections::saw_segment_start_expression_): New data member
6758 declaration.
6759 * script.cc (script_saw_segment_start_expression): New function.
6760 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
6761 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
6762 script_test_7.sh and script_test_8.sh.
6763 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
6764 script_test_8.stdout.
6765 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
6766 (script_test_6, script_test_6.stdout, script_test_7,
6767 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
6768 * Makefile.in: Regenerate.
6769 * testsuite/script_test_6.sh: New file.
6770 * testsuite/script_test_6.t: Same.
6771 * testsuite/script_test_7.sh: Same.
6772 * testsuite/script_test_7.t: Same.
6773 * testsuite/script_test_8.sh: Same.
6774
64b1ae37
DK
67752009-10-16 Doug Kwan <dougkwan@google.com>
6776
6777 * output.cc (Output_segment::set_section_list_address): Cast
6778 expressions to unsigned long long type to avoid format warnings.
6779
661be1e2
ILT
67802009-10-15 Ian Lance Taylor <iant@google.com>
6781
12edd763 6782 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 6783 dot assignment to script_sections_.
12edd763
ILT
6784 * script-sections.cc (Script_sections::add_dot_assignment):
6785 Initialize if necessary.
6786
68b6574b
ILT
6787 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
6788 program headers with no load segment if there is a linker script.
6789
661be1e2
ILT
6790 * layout.cc (Layout::set_segment_offsets): Align the file offset
6791 to the segment aligment for -N or -n with no load segment.
6792 * output.cc (Output_segment::add_output_section): Don't crash if
6793 the first section is a TLS section.
6794 (Output_segment::set_section_list_addresses): Print an error
6795 message if the address moves backward in a linker script.
6796 * script-sections.cc
6797 (Output_section_element_input::set_section_addresses): Don't
6798 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
6799 (Orphan_output_section::set_section_addresses): Likewise.
6800
f15f61a7
DK
68012009-10-15 Doug Kwan <dougkwan@google.com>
6802
6803 * layout.cc (Layout::finish_dynamic_section): Generate tags
6804 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
6805 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
6806 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
6807
82bb573a
ILT
68082009-10-14 Ian Lance Taylor <iant@google.com>
6809
6810 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
6811 fields.
6812 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
6813 data_shdr fields of relinfo.
6814 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
6815 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
6816 R_386_TLS_LDO_32, adjust based on section flags.
6817 (Target_i386::Relocate::fix_up_ldo): Remove.
6818
374ad285
ILT
68192009-10-13 Ian Lance Taylor <iant@google.com>
6820
6821 Add support for -pie.
6822 * options.h (class General_options): Add -pie and
6823 --pic-executable.
6824 (General_options::output_is_position_independent): Test -pie.
6825 (General_options::output_is_executable): Return true if not shared
6826 and not relocatable.
6827 (General_options::output_is_pie): Remove.
6828 * options.cc (General_options::finalize): Reject incompatible uses
6829 of -pie.
6830 * gold.cc (queue_middle_tasks): A -pie link is not static.
6831 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
6832 * symtab.cc (Symbol::final_value_is_known): Return false if
6833 output_is_position_independent.
6834 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
6835 output_is_position_independent.
6836 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
6837 output_is_position_independent.
6838 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
6839 output_is_position_independent.
6840 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
6841 two_file_pie_test.
6842 (basic_pie_test.o, basic_pie_test): New targets.
6843 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
6844 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
6845 (two_file_pie_test): New target.
6846 * testsuite/Makefile.in: Rebuild.
6847 * README: Remove note saying that -pie is not supported.
6848
c6585162
ILT
68492009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
6850
6851 * options.h (class General_options): Add -init and -fini.
6852 * layout.cc (Layout::finish_dynamic_section): Emit
6853 given init and fini functions.
6854
032ce4e9
ST
68552009-10-13 Sriraman Tallam <tmsriram@google.com>
6856
6857 * gc.h (gc_process_relocs): Check if icf is enabled using new
6858 function.
6859 * gold.cc (queue_initial_tasks): Likewise.
6860 (queue_middle_tasks): Likewise.
6861 * object.cc (do_layout): Likewise.
6862 * symtab.cc (is_section_folded): Likewise.
6863 * main.cc (main): Likewise.
6864 * reloc.cc (Read_relocs::run): Likewise.
6865 (Sized_relobj::do_scan_relocs): Likewise.
6866 * icf.cc (is_function_ctor_or_dtor): New function.
6867 (Icf::find_identical_sections): Check if function is ctor or dtor when
6868 safe icf is chosen.
6869 * options.h (General_options::icf): Change option to be an enum.
6870 (Icf_status): New enum.
6871 (icf_enabled): New method.
6872 (icf_safe_folding): New method.
6873 (set_icf_status): New method.
6874 (icf_status_): New variable.
6875 * (options.cc) (General_options::finalize): Set icf_status_.
6876 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
6877 icf_test and icf_keep_unique_test to use the --icf enum flag.
6878 * testsuite/icf_safe_test.sh: New file.
e1df38aa 6879 * testsuite/icf_safe_test.cc: New file.
032ce4e9 6880
f345227a
ST
68812009-10-12 Sriraman Tallam <tmsriram@google.com>
6882
6883 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
6884 includes to gc.h and icf.h.
6885 * arm.cc: Include gc.h.
6886 * gold.cc: Likewise.
6887 * i386.cc: Likewise.
6888 * powerpc.cc: Likewise.
6889 * sparc.cc: Likewise.
6890 * x86_64.cc: Likewise.
6891 * gc.h: Include icf.h.
6892
1c7814ed
ILT
68932009-10-11 Ian Lance Taylor <iant@google.com>
6894
6895 * plugin.cc: Include "gold.h" before other header files.
6896
ae3b5189
CD
68972009-10-10 Chris Demetriou <cgd@google.com>
6898
6899 * options.h (Input_file_argument::Input_file_type): New enum.
6900 (Input_file_argument::is_lib_): Replace with...
6901 (Input_file_argument::type_): New member.
6902 (Input_file_argument::Input_file_argument): Take Input_file_type
6903 'type' rather than boolean 'is_lib' as second argument.
6904 (Input_file_argument::is_lib): Use type_.
6905 (Input_file_argument::is_searched_file): New function.
6906 (Input_file_argument::may_need_search): Handle is_searched_file.
6907 * options.cc (General_options::parse_library): Support -l:filename.
6908 (General_options::parse_just_symbols): Update for Input_file_argument
6909 changes.
6910 (Command_line::process): Likewise.
6911 * archive.cc (Archive::get_file_and_offset): Likewise.
6912 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6913 * script.cc (read_script_file, script_add_file): Likewise.
6914 * fileread.cc (Input_file::Input_file): Likewise.
6915 (Input_file::will_search_for): Handle is_searched_file.
6916 (Input_file::open): Likewise.
6917 * readsyms.cc (Read_symbols::get_name): Likewise.
6918 * testsuite/Makefile.am (searched_file_test): New test.
6919 * testsuite/Makefile.in: Regenerate.
6920 * testsuite/searched_file_test.cc: New file.
6921 * testsuite/searched_file_test_lib.cc: New file.
6922
f3048a1d
ILT
69232009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6924 Ian Lance Taylor <iant@google.com>
6925
6926 * descriptor.cc: Include <cstdio> and "binary-io.h".
6927 (Descriptors::open): Open the files in binary mode always.
6928 * script.cc (Lex::get_token): Treat \r as whitespace.
6929
d4780e57
ILT
69302009-10-09 Ian Lance Taylor <iant@google.com>
6931
6932 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6933
d9a893b8
ILT
69342009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6935 Ian Lance Taylor <iant@google.com>
6936
6937 * configure.ac: Check for readv function also.
6938 * fileread.cc (readv): Define if not HAVE_READV.
6939 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6940 does not exist.
6941 * config.in: Regenerate.
6942 * configure: Regenerate.
6943
c0a62865
DK
69442009-10-09 Doug Kwan <dougkwan@google.com>
6945
6946 * layout.cc (Layout::make_output_section): Call target hook to make
6947 ordinary output section.
6948 (Layout::finalize): Adjust parameter list of call the
6949 Target::may_relax().
6950 * layout.h (class Layout::section_list): New method.
6951 * merge.h (Output_merge_base::entsize): Change visibility to public.
6952 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6953 New methods.
6954 (Output_merge_string::do_is_string): New method.
6955 * object.cc (Sized_relobj::do_setup): renamed from
6956 Sized_relobj::set_up.
6957 * object.h (Sized_relobj::adjust_shndx,
6958 Sized_relobj::initializ_input_to_output_maps,
6959 Sized_relobj::free_input_to_output_maps): Change visibilities to
6960 protected.
6961 (Sized_relobj::setup): Virtualize.
6962 (Sized_relobj::do_setup): New method declaration.
6963 (Sized_relobj::invalidate_section_offset,
6964 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6965 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6966 * options.cc (parse_int): New function.
6967 * options.h (parse_int): New declaration.
6968 (DEFINE_int): New macro.
6969 (stub_group_size): New option.
6970 * output.cc (Output_section::Output_section): Initialize memebers
6971 merge_section_map_, merge_section_by_properties_map_,
6972 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6973 (Output_section::add_input_section): Handled deferred code-fill
6974 generation and remove an old comment.
6975 (Output_section::add_relaxed_input_section): New method definition.
6976 (Output_section::add_merge_input_section): Use merge section by
6977 properties map to speed to search. Update merge section maps
6978 as appropriate.
6979 (Output_section::build_relaxation_map): New method definition.
6980 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6981 Same.
6982 (Output_section::relax_input_section): Renamed to
6983 Output_section::convert_input_sections_to_relaxed_sections and change
6984 interface to take a vector of pointers to relaxed sections.
6985 (Output_section::find_merge_section,
6986 Output_section::find_relaxed_input_section): New method definitions.
6987 (Output_section::is_input_address_mapped,
6988 Output_section::output_offset, Output_section::output_address):
6989 Use output section data maps to speed up searching.
6990 (Output_section::find_starting_output_address): Add comments.
6991 (Output_section::do_write,
6992 Output_section::write_to_postprocessing_buffer): Do code-fill
6993 generation as appropriate.
6994 (Output_section::get_input_sections): Invalidate relaxed input section
6995 map.
6996 (Output_section::restore_states): Adjust type of checkpoint .
6997 Invalidate relaxed input section map.
6998 * output.h (Output_merge_base): New class declaration.
6999 (Input_section_specifier): New class defintion.
7000 (class Output_relaxed_input_section) Change base class to
7001 Output_section_data_build.
7002 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
7003 base class initializer.
7004 (Output_section::add_relaxed_input_section): New method declaration.
7005 (Output_section::Input_section): Change visibility to protected.
7006 (Output_section::Input_section::relobj,
7007 Output_section::Input_section::shndx): Handle relaxed input sections.
7008 Output_section::input_sections) Change visibility to protected. Also
7009 define overload to return a non-const pointer.
7010 (Output_section::Merge_section_properties): New class defintion.
7011 (Output_section::Merge_section_by_properties_map,
7012 Output_section::Output_section_data_by_input_section_map,
7013 Output_section::Relaxation_map): New types.
7014 (Output_section::relax_input_section): Rename method to
7015 Output_section::convert_input_sections_to_relaxed_sections and change
7016 interface to take a vector of relaxed section pointers.
7017 (Output_section::find_merge_section,
7018 Output_section::find_relaxed_input_section,
7019 Output_section::build_relaxation_map,
7020 Output_section::convert_input_sections_in_list_to_relaxed_sections):
7021 New method declarations.
7022 (Output_section::merge_section_map_
7023 Output_section::merge_section_by_properties_map_,
7024 Output_section::relaxed_input_section_map_,
7025 Output_section::is_relaxed_input_section_map_valid_,
7026 Output_section::generate_code_fills_at_write_): New data members.
7027 * script-sections.cc
7028 (Output_section_element_input::set_section_addresses): Call
7029 current_data_size and addralign methods of relaxed input sections.
7030 (Orphan_output_section::set_section_addresses): Call current_data_size
7031 and addralign methods of relaxed input sections.
7032 * symtab.cc (Symbol_table::compute_final_value): Extract template
7033 from the body of Symbol_table::sized_finalize_symbol.
7034 (Symbol_table::sized_finalized_symbol): Call
7035 Symbol_table::compute_final_value.
7036 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
7037 (Symbol_table::compute_final_value): New templated method declaration.
7038 * target.cc (Target::do_make_output_section): New method defintion.
7039 * target.h (Target::make_output_section): New method declaration.
7040 (Target::relax): Add more parameters for input objects, symbol table
7041 and layout. Adjust call to do_relax.
7042 (Target::do_make_output_section): New method declaration.
7043 (Target::do_relax): Add parameters for input objects, symbol table
7044 and layout.
7045
d446d6c4
ILT
70462009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7047
7048 * pread.c: Include stdio.h.
7049
bc06c745
ILT
70502009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7051
7052 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
7053 defined.
7054
75aea3d0
ILT
70552009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7056
7057 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7058 Change read_shndx type to unsigned int.
7059 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7060 int.
7061 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7062 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7063 Change read_shndx type to unsigned int.
7064 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7065 int.
7066 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7067 * layout.cc (Layout::create_symtab_sections): Cast the result of
7068 local_symcount * symsize to off_t in the gold_assert.
7069
be8fcb75
ILT
70702009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7071
7072 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7073 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7074 R_ARM_BASE_ABS.
7075 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7076 (Arm_relocate_functions::thm_abs5): New function.
7077 (Arm_relocate_functions::abs12): New function.
7078 (Arm_relocate_functions::abs16): New function.
7079 (Arm_relocate_functions::base_abs): New function.
7080 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7081 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7082 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7083 R_ARM_BASE_ABS.
7084 (Scan::global): Likewise.
7085 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7086 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7087 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7088 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7089 R_ARM_BASE_ABS.
7090
c2a122b6
ILT
70912009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7092
7093 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7094 (Arm_relocate_functions::movt_prel): New function.
7095 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7096 (Arm_relocate_functions::thm_movt_prel): New function.
7097 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7098 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7099 (Scan::global, Relocate::relocate): Likewise.
7100 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7101
c4aa1e2d
ILT
71022009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7103
7104 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7105 Incremental_checker.
7106 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7107 unsigned int.
7108 (class Incremental_inputs_header): New class.
7109 (Incremental_inputs_header_writer): Edit comment.
7110 (Incremental_inputs_entry): New class.
7111 (Incremental_inputs_entry_writer): Edit comment.
7112 (Sized_incremental_binary::do_find_incremental_inputs_section):
7113 Add *strtab_shndx parameter, fill it.
7114 (Sized_incremental_binary::do_check_inputs): New method.
7115 (Incremental_checker::can_incrementally_link_output_file): Use
7116 Sized_incremental_binary::check_inputs.
7117 (Incremental_inputs::report_command_line): Save command line in
7118 command_line_.
7119 * incremental.h:
7120 (Incremental_binary::find_incremental_inputs_section): New
7121 method.
7122 (Incremental_binary::do_find_incremental_inputs_section): Add
7123 strtab_shndx parameter.
7124 (Incremental_binary::do_check_inputs): New pure virtual method.
7125 (Sized_incremental_binary::do_check_inputs): Declare.
7126 (Incremental_checker::Incremental_checker): Add incremental_inputs
7127 parameter, use it to initialize incremental_inputs_.
7128 (Incremental_checker::incremental_inputs_): New field.
7129 (Incremental_checker::command_line): New method.
7130 (Incremental_checker::inputs): New method.
7131 (Incremental_checker::command_line_): New field.
7132
c549a694
ILT
71332009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7134
7135 * incremental.cc: Include <cstdarg> and "target-select.h".
7136 (vexplain_no_incremental): New function.
7137 (explain_no_incremental): New function.
7138 (Incremental_binary::error): New method.
7139 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7140 method.
7141 (make_sized_incremental_binary): New function.
7142 (open_incremental_binary): New function.
7143 (can_incrementally_link_file): Add checks if output is ELF and has
7144 inputs section.
7145 * incremental.h: Include "elfcpp_file.h" and "output.h".
7146 (Incremental_binary): New class.
7147 (Sized_incremental_binary): New class.
7148 (open_incremental_binary): Declare.
7149 * object.cc (is_elf_object): Use
7150 elfcpp::Elf_recognizer::is_elf_file.
7151 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7152 * output.h (Output_file::filesize): New method.
7153
fd3c5f0b
ILT
71542009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7155
7156 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7157 New function.
7158 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7159 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7160 function.
7161 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7162 function.
7163 (Arm_relocate_functions::movw_abs_nc): New function.
7164 (Arm_relocate_functions::movt_abs): New function.
7165 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7166 (Arm_relocate_functions::thm_movt_abs): New function.
7167 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7168 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7169 (Scan::global): Likewise.
7170 (Relocate::relocate): Likewise.
7171 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7172
7f5309a5
ILT
71732009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7174
7175 * arm.cc (Arm_relocate_functions::got_prel) New function.
7176 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7177 (Relocate::relocate): Likewise.
7178 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7179
364c7fa5
ILT
71802009-10-06 Ian Lance Taylor <iant@google.com>
7181
7182 * options.h (class General_options): Define
7183 split_stack_adjust_size parameter.
7184 * object.h (class Object): Add uses_split_stack_ and
7185 has_no_split_stack_ fields. Add uses_split_stack and
7186 has_no_split_stack accessor functions. Declare
7187 handle_split_stack_section.
7188 (class Reloc_symbol_changes): Define.
7189 (class Sized_relobj): Define Function_offsets. Declare
7190 split_stack_adjust, split_stack_adjust_reltype, and
7191 find_functions.
7192 * object.cc (Object::handle_split_stack_section): New function.
7193 (Sized_relobj::do_layout): Call handle_split_stack_section.
7194 * dynobj.cc (Sized_dynobj::do_layout): Call
7195 handle_split_stack_section.
7196 * reloc.cc (Sized_relobj::relocate_sections): Call
7197 split_stack_adjust for executable sections in split_stack
7198 objects. Pass reloc_map to relocate_section.
7199 (Sized_relobj::split_stack_adjust): New function.
7200 (Sized_relobj::split_stack_adjust_reltype): New function.
7201 (Sized_relobj::find_functions): New function.
7202 * target-reloc.h: Include "object.h".
7203 (relocate_section): Add reloc_symbol_changes parameter. Change
7204 all callers.
7205 * target.h (class Target): Add calls_non_split method. Declare
7206 do_calls_non_split virtual method. Declare match_view and
7207 set_view_to_nop.
7208 * target.cc: Include "elfcpp.h".
7209 (Target::do_calls_non_split): New function.
7210 (Target::match_view): New function.
7211 (Target::set_view_to_nop): New function.
7212 * gold.cc (queue_middle_tasks): Give an error if mixing
7213 split-stack and non-split-stack objects with -r.
7214 * i386.cc (Target_i386::relocate_section): Add
7215 reloc_symbol_changes parameter.
7216 (Target_i386::do_calls_non_split): New function.
7217 * x86_64.cc (Target_x86_64::relocate_section): Add
7218 reloc_symbol_changes parameter.
7219 (Target_x86_64::do_calls_non_split): New function.
7220 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7221 parameter.
7222 * powerpc.cc (Target_powerpc::relocate_section): Add
7223 reloc_symbol_changes parameter.
7224 * sparc.cc (Target_sparc::relocate_section): Add
7225 reloc_symbol_changes parameter.
7226 * configure.ac: Call AM_CONDITIONAL for the default target.
7227 * configure: Rebuild.
7228 * testsuite/Makefile.am (TEST_AS): New variable.
7229 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7230 (check_DATA): Add split_i386 and split_x86_64 files.
7231 (SPLIT_DEFSYMS): Define.
7232 (split_i386_[1234n].o): New targets.
7233 (split_i386_[124]): New targets.
7234 (split_i386_[1234r].stdout): New targets.
7235 (split_x86_64_[1234n].o): New targets.
7236 (split_x86_64_[124]): New targets.
7237 (split_x86_64_[1234r].stdout): New targets.
7238 (MOSTLYCLEANFILES): Add new executables.
7239 * testsuite/split_i386.sh: New file.
7240 * testsuite/split_x86_64.sh: New file.
7241 * testsuite/split_i386_1.s: New file.
7242 * testsuite/split_i386_2.s: New file.
7243 * testsuite/split_i386_3.s: New file.
7244 * testsuite/split_i386_4.s: New file.
7245 * testsuite/split_i386_n.s: New file.
7246 * testsuite/split_x86_64_1.s: New file.
7247 * testsuite/split_x86_64_2.s: New file.
7248 * testsuite/split_x86_64_3.s: New file.
7249 * testsuite/split_x86_64_4.s: New file.
7250 * testsuite/split_x86_64_n.s: New file.
7251 * testsuite/testfile.cc (Target_test): Update relocation_section
7252 function.
7253 * testsuite/Makefile.in: Rebuild.
7254
e8a9fcda
ILT
72552009-10-06 Ian Lance Taylor <iant@google.com>
7256
7257 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7258 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7259 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7260 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7261 the address on ldo_addrs_.
7262 (Target_i386::Relocate::fix_up_ldo): New function.
7263
e99daf92
ILT
72642009-10-06 Rafael Espindola <espindola@google.com>
7265
7266 * plugin.cc (add_input_library): New.
7267 (Plugin::load): Add add_input_library to tv.
7268 (Plugin_manager::add_input_file): Add the is_lib argument.
7269 (add_input_file): Update call to Plugin_manager::add_input_file.
7270 (add_input_library): New.
7271 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7272
966d4097
DK
72732009-09-30 Doug Kwan <dougkwan@google.com>
7274
7275 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7276 symbol and call Symbol::may_need_copy_reloc to determine if
7277 a copy reloc is needed.
7278 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7279 nocopyreloc is given in command line.
7280 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7281 given in command line.
7282 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7283 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7284 of the removed Target_i386::may_need_copy_reloc.
7285 * options.h (copyreloc): New option with default value false.
7286 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7287 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7288 instead of the removed Target_powerpc::may_need_copy_reloc.
7289 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7290 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7291 instead of the removed Target_sparc::may_need_copy_reloc.
7292 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7293 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7294 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7295 instead of the removed Target_x86_64::may_need_copy_reloc.
7296
029ba973
ILT
72972009-09-30 Ian Lance Taylor <iant@google.com>
7298
7299 * object.h (class Object): Remove target_ field, and target,
7300 sized_target, and set_target methods.
7301 (Object::sized_target): Remove.
7302 (class Sized_relobj): Update declarations. Remove sized_target.
7303 * object.cc (Sized_relobj::setup): Remove target parameter.
7304 Change all callers.
7305 (Input_objects::add_object): Don't do anything with the target.
7306 (make_elf_sized_object): Add punconfigured parameter. Change all
7307 callers. Set or test parameter target.
7308 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7309 Change all callers.
7310 * parameters.cc (Parameters::set_target): Change parameter type to
7311 be non-const.
7312 (Parameters::default_target): Remove.
7313 (set_parameters_target): Change parameter type to be non-const.
7314 (parameters_force_valid_target): New function.
7315 (parameters_clear_target): New function.
7316 * parameters.h (class Parameters): Update declarations. Remove
7317 default_target method. Add sized_target and clear_target
7318 methods. Change target_ to be non-const.
7319 (set_parameters_target): Update declaration.
7320 (parameters_force_valid_target): Declare.
7321 (parameters_clear_target): Declare.
7322 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7323 as NULL if we aren't searching.
7324 (Add_symbols::run): Don't check for compatible target.
7325 * fileread.cc (Input_file::open_binary): Call
7326 parameters_force_valid_target.
7327 * gold.cc (queue_middle_tasks): Likewise.
7328 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
7329 set_target on object.
7330 * dynobj.h (class Sized_dynobj): Update declarations.
7331 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
7332 make_elf_object returns NULL.
7333 (Archive::include_member): Don't check whether object target is
7334 compatible.
7335 * output.cc (Output_section::add_input_section): Get target from
7336 parameters.
7337 (Output_section::relax_input_section): Likewise.
7338 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
7339 parameters.
7340 (Sized_relobj::do_scan_relocs): Likewise.
7341 (Sized_relobj::relocate_sections): Likewise.
7342 * resolve.cc (Symbol_table::resolve): Likewise.
7343 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7344 parameter. Change all callers.
7345 (Symbol_table::add_from_object): Get target from parameters.
7346 (Symbol_table::add_from_relobj): Don't check object target.
7347 (Symbol_table::add_from_dynobj): Likewise.
7348 (Symbol_table::define_special_symbol): Get target from
7349 parameters.
7350 * symtab.h (class Symbol_table): Update declaration.
7351 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7352 parameter. Change all callers. Clear parameter target.
7353 (Binary_test): Test target here.
7354 * testsuite/object_unittest.cc (gold_testsuite): Remove
7355 target_test_pointer parameter. Change all callers.
7356 (Object_test): Test target here.
7357
a6a22b83
ILT
73582009-09-26 Ian Lance Taylor <iant@google.com>
7359
7360 * testsuite/initpri1.c: Don't try to use constructor priorities if
7361 compiling with gcc before 4.3.
7362
6a8f49fe
ILT
73632009-09-22 Mikolaj Zalewski <mikolajz@google.com>
7364
7365 * testsuite/retain_symbols_file_test.sh (check_present): Change
7366 output file name to retain_symbols_file_test.stdout.
7367 (check_absent): Likewise.
7368
8c604651
CS
73692009-09-18 Craig Silverstein <csilvers@google.com>
7370
7371 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
7372 * options.cc: Include <cerrno> and <fstream>.
7373 (General_options::finalize): Parse -retain-symbols-file tag.
7374 * options.h: New flag.
7375 (General_options): New method should_retain_symbol, new
7376 variable symbols_to_retain.
7377 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
7378 should_retain_symbol map.
7379 * testsuite/Makefile.am (retain_symbols_file_test): New test.
7380 * testsuite/Makefile.in: Regenerate.
7381 * testsuite/retain_symbols_file_test.sh: New file.
7382
ca58b19f
NC
73832009-09-18 Nick Clifton <nickc@redhat.com>
7384
7385 * po/es.po: Updated Spanish translation.
7386
20e6d0d6
DK
73872009-09-17 Doug Kwan <dougkwan@google.com>
7388
7389 * debug.h (DEBUG_RELAXATION): New constant.
7390 (DEBUG_ALL): Add DEBUG_RELAXATION.
7391 (debug_string_to_enum): Add relaxation debug option.
7392 * layout.cc
7393 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
7394 Layout::Relaxation_debug_check::read_sections,
7395 Layout::Relaxation_debug_check::read_sections): New method definitions.
7396 (Layout::Layout): Initialize data members
7397 record_output_section_data_from_scrips_,
7398 script_output_section_data_list_ and relaxation_debug_check_.
7399 (Layout::save_segments, Layout::restore_segments,
7400 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7401 Layout::relaxation_loop_body): New method definitions.
7402 (Layout::finalize): Support relaxation. Move section layout code to
7403 Layout::relaxation_loop_body.
7404 (Layout::set_asection_address_from_script): Move code for orphan
7405 section placement out.
7406 (Layout::place_orphan_sections_in_script): New method definition.
7407 * layout.h (Output_segment_headers, Output_file_header):
7408 New forward class declarations.
7409 (Layout::~Layout): Define.
7410 (Layout::new_output_section_data_from_script): New method definition.
7411 (Layout::place_orphan_sections_in_script): New method declaration.
7412 (Layout::Segment_states): New type declaration.
7413 (Layout::save_segments, Layout::restore_segments,
7414 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7415 Layout::relaxation_loop_body): New method declarations.
7416 (Layout::Output_section_data_list): New type declaration.
7417 (Layout::Relaxation_debug_check): New class definition.
7418 (Layout::record_output_section_data_from_script_,
7419 Layout::script_output_section_data_list_, Layout::segment_states_,
7420 Layout::relaxation_debug_check_): New data members.
7421 * output.cc: (Output_section_headers::do_size): New method definition.
7422 (Output_section_headers::Output_section_headers): Move size
7423 computation to Output_section_headers::do_size.
7424 (Output_segment_headers::do_size): New method definition.
e1df38aa 7425 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
7426 Output_file_header::do_size and call it.
7427 (Output_file_header::do_size): New method definition.
7428 (Output_data_group::Output_data_group): Adjust call to
7429 Output_section_data.
7430 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
7431 (Output_symtab_xindex::do_write): Add array bound check.
7432 (Output_section::Input_section::print_to_mapfile): Handle
7433 RELAXED_INPUT_SECTION_CODE.
7434 (Output_section::Output_section): Initialize data member checkpoint_.
7435 (Output_section::~Output_section): Delete checkpoint object pointed
7436 by checkpoint_.
7437 (Output_section::add_input_section): Always add an Input_section if
7438 relaxing.
7439 (Output_section::add_merge_input_section): Add assert.
7440 (Output_section::relax_input_section): New method definition.
7441 (Output_section::set_final_data_size): Set load address to zero for
7442 an unallocated section.
7443 (Output_section::do_address_and_file_offset_have_reset_values):
7444 New method definition.
7445 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
7446 Handle relaxed input section.
7447 (Output_section::sort_attached_input_sections): Checkpoint input
7448 section list lazily.
7449 (Output_section::get_input_sections): Change type of input_sections to
7450 list of Simple_input_section pointers. Checkpoint input section list
7451 lazily. Also handle relaxed input sections.
7452 (Output_section::add_input_section_for_script): Take a reference to
7453 a Simple_input_section object instead of Relobj pointer and section
7454 index as parameter. Handle relaxed input sections.
7455 (Output_section::save_states, Output_section::restore_states): New
7456 method definitions.
7457 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
7458 (Output_data::is_data_size_fixed): New method definition.
7459 (Output_data::reset_addresss_and_file_offset): Do not reset data size
7460 if it is fixed.
7461 (Output_data::address_and_file_offset_have_reset_values): New method
7462 definition.
7463 (Output_data::do_address_and_file_offset_have_reset_values): New method
7464 definition.
7465 (Output_data::set_data_size): Check that data size is not fixed.
7466 (Output_data::fix_data_size): New method definition.
7467 (Output_data::is_data_size_fixed_): New data member.
7468 (Output_section_headers::set_final_data_size): New method definition.
7469 (Output_section_headers::do_size): New method declaration.
7470 (Output_segment_headers::set_final_data_size): New method definition.
7471 (Output_segment_headers::do_size): New method declaration.
7472 (Output_file_header::set_final_data_size)::New method definition.
7473 (Output_file_header::do_size)::New method declaration.
7474 (Output_section_data::Output_section_data): Add new parameter
7475 is_data_size_fixed and use it to fix data size.
7476 (Output_data_const::Output_data_const): Adjust call to base class
7477 constructor and fix data size.
7478 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
7479 base class constructor and fix data size.
7480 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
7481 base class constructor and fix data size.
7482 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
7483 class constructor and fix data size.
7484 (Output_data_group::set_final_data_size): New method definition.
7485 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
7486 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
7487 class constructor and fix data size.
7488 (Output_relaxed_input_section): New class definition.
7489 (Output_section::Simple_input_section): New class definition.
7490 (Output_section::get_input_sections): Adjust parameter list.
7491 (Output_section::add_input_section_for_script): Same.
7492 (Output_section::save_states, Output_section::restore_states,
7493 Output_section::do_address_and_file_offset_have_reset_values,
7494 (Output_section::Input_section::Input_section): Handle
7495 RELAXED_INPUT_SECTION_CODE. Add new overload for
7496 Output_relaxed_input_section.
7497 (Output_section::Input_section::is_input_section,
7498 Output_section::Input_section::set_output_section): Handle relaxed
7499 input section.
7500 (Output_section::Input_section::is_relaxed_input_section,
7501 Output_section::Input_section::output_section_data,
7502 Output_section::Input_section::relaxed_input_section): New method
7503 definitions.
7504 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
7505 value.
7506 (Output_section::Input_section::u1_): Update comments.
7507 (Output_section::Input_section::u2_): Add new union member poris.
7508 (Output_section::Checkpoint_output_section): New classs definition.
7509 (Output_section::relax_input_section): New method declaration.
7510 (Output_section::checkpoint_): New data member.
7511 (Output_segment): Update comments.
7512 (Output_segment::Output_segment): Un-privatize copy constructor.
7513 (Output_segment::operator=): Un-privatize.
7514 * script-sections.cc (Output_section_element::Input_section_list):
7515 Change element type to Output_section::Simple_input_section.
7516 (Output_section_element_dot_assignment::set_section_addresses):
7517 Register output section data for relaxation clean up.
7518 (Output_data_exression::Output_data_expression): Adjust call to base
7519 constructor to fix data size.
7520 (Output_section_element_data::set_section_addresses): Register
7521 Output_data_expression object for relaxation clean up.
7522 (struct Input_section_info): Replace Relobj pointer and section index
7523 pair with Output_section::Simple_input_section and Convert struct to a
7524 class.
7525 (Input_section_sorter::operator()): Adjust access to
e1df38aa 7526 Input_section_info data member to use accessors.
20e6d0d6
DK
7527 (Output_section_element_input::set_section_addresses): Use layout
7528 parameter. Adjust code to use Output_section::Simple_input_section
7529 and Input_secction_info classes. Register filler for relaxation
7530 clean up.
7531 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
7532 and section index pair with Output_section::Simple_input_section
7533 class. Adjust code accordingly.
7534 (Phdrs_element::release_segment): New method definition.
7535 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
7536 segment list.
7537 (Script_sections::release_segments): New method definition.
7538 * gold/script-sections.h (Script_sections::release_segments): New
7539 method declaration.
7540 * gold/target.h (Target::may_relax, Target::relax,
7541 Target::do_may_relax, Target::do_relax): New method definitions.
7542
5e445df6
ILT
75432009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7544
7545 * arm.cc (has_signed_unsigned_overflow): New function.
7546 (Arm_relocate_functions::abs8): New function.
7547 (Target_arm::Scan::local): Handle R_ARM_ABS8.
7548 (Target_arm::Scan::global): Likewise.
7549 (Target_arm::relocate::relocate): Likewise.
7550 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7551 Likewise.
7552
8c604651 75532009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
7554
7555 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
7556 * testsuite/Makefile.in: Regenerate.
7557
1e9cc1c2
NC
75582009-09-11 Nick Clifton <nickc@redhat.com>
7559
7560 * po/gold.pot: Updated by the Translation project.
7561
6a89f575
CC
75622009-09-08 Cary Coutant <ccoutant@google.com>
7563
7564 * output.cc (Output_file::open): Add execute permission to empty file.
7565 * testsuite/Makefile.am (permission_test): New test.
7566 * testsuite/Makefile.in: Regenerate.
7567
fdcac5af
ILT
75682009-09-02 Ian Lance Taylor <iant@google.com>
7569
7570 * output.cc (Output_file::resize): Call map_no_anonymous rather
7571 than map.
7572
44453f85
ILT
75732009-09-01 Mikolaj Zalewski <mikolajz@google.com>
7574
7575 * gold.cc: Include "incremental.h".
7576 (queue_initial_tasks): Call Incremental_checker methods.
7577 * incremental.cc: Include "output.h".
7578 (Incremental_checker::can_incrementally_link_output_file): New
7579 method.
7580 * incremental.h (Incremental_checker): New class.
7581
7582 * output.cc (Output_file::open_for_modification): New method.
7583 (Output_file::map_anonymous): Changed return type to bool. Record
7584 map in base_ field.
7585 (Output_file::map_no_anonymous): New method, broken out of map.
7586 (Output_file::map): Use map_no_anonymous and map_anonymous.
7587 * output.h (class Output_file): Update declarations.
7588
293c1386
CC
75892009-08-24 Cary Coutant <ccoutant@google.com>
7590
7591 * options.h (Command_line::Pre_options): New class.
7592 (Command_line::pre_options): New member.
7593 * options.cc (gold::options::ready_to_register): New variable.
7594 (One_option::register_option): Do nothing if not registering options.
7595 Assert if same short option registered twice.
7596 (General_options::General_options): Turn off option registration when
7597 done constructing.
7598 (Command_line::Pre_options::Pre_options): New constructor.
7599
f773f3d2
CC
76002009-08-24 Cary Coutant <ccoutant@google.com>
7601
06a73cfe
CC
7602 * options.h (General_options::no_keep_memory): Remove incorrect
7603 short option.
f773f3d2 7604
a15af8e2
RW
76052009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7606
7607 * Makefile.am (am__skiplex, am__skipyacc): New.
7608 * Makefile.in: Regenerate.
7609
c462b41b
RW
76102009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7611
14ec8efd
RW
7612 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7613 (INCLUDES): ... this.
7614 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7615 (AM_CPPFLAGS): Renamed from ...
7616 (INCLUDE): ... this.
7617 * Makefile.in, testsuite/Makefile.in: Regenerate.
7618
81ecdfbb
RW
7619 * Makefile.in: Regenerate.
7620 * aclocal.m4: Likewise.
7621 * config.in: Likewise.
7622 * configure: Likewise.
7623 * testsuite/Makefile.in: Likewise.
7624
c462b41b
RW
7625 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7626 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7627 * Makefile.in: Regenerate.
7628 * testsuite/Makefile.in: Regenerate.
7629
2da73f13
CC
76302009-08-19 Cary Coutant <ccoutant@google.com>
7631
7632 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7633 symbols in shared libraries overridden by hidden or internal symbols
7634 in the main program.
7635
2db70501
CD
76362009-08-19 Chris Demetriou <cgd@google.com>
7637
7638 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7639 checking source file names in error messages.
7640
f733487b
DK
76412009-08-18 Doug Kwan <dougkwan@google.com>
7642
7643 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7644 an elcpp::Ehdr as parameter. Adjust call to set_target.
7645 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7646 an elfcpp::Ehdr as parameter.
7647 * object.cc (Object::set_target): Remove the version that looks up
7648 a target and sets it.
7649 (Sized_relobj::setup): Take a Target object instead of
7650 an elfcpp::Ehdr as parameter. Adjust call to set_target.
7651 (make_elf_sized_object): Find target and ask target to
7652 make an ELF object.
7653 * object.h: (Object::set_target): Remove the version that looks up
7654 a target and sets it.
7655 (Sized_relobj::setup): Take a Target object instead of
7656 an elfcpp:Ehdr as parameter.
7657 * target.cc: Include dynobj.h.
7658 (Target::do_make_elf_object_implementation): New.
7659 (Target::do_make_elf_object): New.
7660 * target.h (Target::make_elf_object): New template declaration.
7661 (Target::do_make_elf_object): New method declarations.
7662 (Target::do_make_elf_object_implementation): New template declaration.
7663
cc70f101
ILT
76642009-08-14 Ian Lance Taylor <iant@google.com>
7665
7666 * gold.h (FUNCTION_NAME): Define.
7667 (gold_unreachable): Use FUNCTION_NAME.
7668
ef5e0cb1
ST
76692009-08-12 Sriraman Tallam <tmsriram@google.com>
7670
7671 * icf.cc (Icf::find_identical_sections): Issue a warning when a
7672 symbol in the --keep-unique list is not found.
7673
48c187ce
ST
76742009-08-12 Sriraman Tallam <tmsriram@google.com>
7675
7676 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
7677 been maked as --keep-unique.
7678 (Icf::unfold_section): New function.
7679 * icf.h (Icf::unfold_section): New function.
7680 * options.h (General_options::keep_unique): New option.
7681 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
7682 * testsuite/Makefile.in: Regenerate.
7683 * testsuite/icf_keep_unique_test.sh: New file.
7684 * testsuite/icf_keep_unique_test.cc: New file.
7685
645afe0c
CC
76862009-08-12 Cary Coutant <ccoutant@google.com>
7687
7688 PR 10471
7689 * resolve.cc (Symbol_table::resolve): Check for references from
7690 dynamic objects to hidden and internal symbols.
7691 * testsuite/Makefile.am (hidden_test.sh): New test.
7692 * testsuite/Makefile.in: Regenerate.
7693 * testsuite/hidden_test.sh: New script.
7694 * testsuite/hidden_test_1.c: New test source.
7695 * testsuite/hidden_test_main.c: New test source.
7696
11af873f
DK
76972009-08-11 Doug Kwan <dougkwan@google.com>
7698
7699 * arm.cc: Update comments.
7700 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
7701 segment to locate the .ARM.exidx section if present.
7702
b9f7d72d
DK
77032009-08-09 Doug Kwan <dougkwan@google.com>
7704
7705 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
7706 patch.
7707
ddd3c53c
ST
77082009-08-07 Sriraman Tallam <tmsriram@google.com>
7709 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
7710 compiler warnings.
7711
27721062
ST
77122009-08-06 Sriraman Tallam <tmsriram@google.com>
7713
7714 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
7715 valid tls_segment only for non-debug-section relocations.
7716 * testsuite/Makefile.am: Add gc_tls_test.
7717 * testsuite/Makefile.in: Regenerate.
7718 * testsuite/gc_tls_test.cc: New file.
7719 * testsuite/gc_tls_test.sh: New file.
7720
ef15dade 77212009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 7722
ef15dade
ST
7723 * icf.cc: New file.
7724 * icf.h: New file.
7725 * Makefile.am (CCFILES): Add icf.cc.
7726 (HFILES): Add icf.h
7727 * Makefile.in: Regenerate.
7728 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
7729 * gc.h (gc_process_relocs): Populate lists used by icf to contain
7730 section, symbol and addend information for the relocs.
7731 * gold.cc (queue_middle_tasks): Call identical code folding.
7732 * gold.h: Add defines for multimap.
7733 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
7734 to the call of finalize_local_symbols.
7735 * main.cc (main): Create object of class Icf.
7736 * object.cc (Sized_relobj::do_layout): Allow this function to be
7737 called twice during icf.
7738 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
7739 to sections marked as identical by icf.
7740 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
7741 when available.
7742 (Sized_relobj::do_section_entsize): New function.
7743 * object.h (Object::section_entsize): New function.
7744 (Object::do_section_entsize): New pure virtual function.
7745 (Relobj::finalize_local_symbols): Add new parameter.
7746 (Relobj::do_section_entsize): New function.
7747 * options.h (General_options::icf): New option.
7748 (General_options::icf_iterations): New option.
7749 (General_options::print_icf_sections): New option.
7750 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
7751 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
7752 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
7753 icf.
7754 * symtab.cc (Symbol_table::is_section_folded): New function.
7755 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
7756 to sections marked as identical by icf.
7757 * symtab.h (Symbol_table::set_icf): New function.
7758 (Symbol_table::icf): New function.
7759 (Symbol_table::is_section_folded): New function.
7760 (Symbol_table::icf_): New data member.
7761 * target-reloc.h (relocate_section): Ignore sections folded by icf.
7762 * testsuite/Makefile.am: Add commands to build icf_test.
7763 * testsuite/Makefile.in: Regenerate.
7764 * testsuite/icf_test.sh: New file.
7765 * testsuite/icf_test.cc: New file.
7766
c3b65ac4
CD
77672009-07-24 Chris Demetriou <cgd@google.com>
7768
7769 * layout.cc (is_compressible_debug_section): Fix incorrect
7770 comment about compressed section names.
7771
1caf2c51
ILT
77722009-07-20 Ian Lance Taylor <ian@airs.com>
7773
7774 PR 10419
7775 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
7776
1ef4d87f
ILT
77772009-07-16 Ian Lance Taylor <iant@google.com>
7778
7779 PR 10400
7780 * layout.h: #include <map>.
7781 (class Kept_section): Change from struct to class. Add accessors
7782 and setters. Add section size to Comdat_group mapping. Change
7783 Comdat_group to std::map. Add is_comdat_ field. Add
7784 linkonce_size field in union.
7785 (class Layout): Update declaration of find_or_add_kept_section.
7786 Don't declare find_kept_object.
7787 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
7788 parameter. Add object, shndx, is_comdat, and is_group_name
7789 parameters. Change all callers. Adjust for new Kept_section.
7790 (Layout::find_kept_object): Remove.
7791 * object.cc (Sized_relobj::include_section_group): Update use of
7792 Kept_section. Rename secnum to shndx. Only record
7793 Kept_comdat_section if sections are the same size.
7794 (Sized_relobj::include_linkonce_section): Update use of
7795 Kept_section. Only record Kept_comdat_section if sections are the
7796 same size. Set size of linkonce section.
7797 (Sized_relobj::map_to_kept_section): Update call to
7798 get_kept_comdat_section.
7799 * object.h (class Sized_relobj): Rename fields in
7800 Kept_comdat_section to drop trailing underscores; change object
7801 field to Relobj*. Change Kept_comdat_section_table to store
7802 struct rather than pointer.
7803 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
7804 Add kept_object and kept_shndx parameters. Change all callers.
7805 (Sized_relobj::get_kept_comdat_section): Change return type to
7806 bool. Add kept_object and kept_shndx parameters. Change all
7807 callers.
7808 * plugin.cc (Pluginobj::include_comdat_group): Update call to
7809 Layout::find_or_add_kept_section.
7810
37c3b7b0
ILT
78112009-07-09 Ian Lance Taylor <iant@google.com>
7812
7813 * merge.cc (Object_merge_map::initialize_input_to_output_map):
7814 Reserve space in the hash table.
7815
98fa85cb
ILT
78162009-07-06 Mikolaj Zalewski <mikolajz@google.com>
7817
7818 * fileread.cc (File_read::get_mtime): New method.
7819 * fileread.h (Timespec): New structure.
7820 (File_read::get_mtime): New method.
7821 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
7822 Renamed from timestamp_nsec.
7823 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
7824 Elf_Xword.
e1df38aa 7825 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 7826 timestamp_nsec.
e1df38aa 7827 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
7828 (Incremental_inputs::report_obejct): Save mtime; style fix.
7829 (Incremental_inputs::report_script): Save mtime; style fix.
7830 (Incremental_inputs::finalize_inputs): Style fix.
7831 (Incremental_inputs::finalize): Style fix.
7832 (Incremental_inputs::create_input_section_data): Store inputs
7833 mtime.
7834 * incremental.h (Incremental_inputs::report_script): Add mtime
7835 argument.
7836 (Incremental_inputs::Input_info::Input_info): Intialize only one
7837 union member.
7838 (Incremental_inputs::Input_info::archive): Move to nameless
7839 union.
7840 (Incremental_inputs::Input_info::obejct): Move to nameless union.
7841 (Incremental_inputs::Input_info::script): Move to nameless union.
7842 (Incremental_inputs::mtime): New field.
7843 * script.cc (read_input_script): Pass file mtime to
7844 Incremental_input.
7845 * script.h (Script_info::inputs): Style fix.
7846
c9d70757
ILT
78472009-07-01 Ian Lance Taylor <ian@airs.com>
7848
7849 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
7850 instead of 32.
7851
9c547ec3
ILT
78522009-06-24 Ian Lance Taylor <iant@google.com>
7853
7854 PR 10156
7855 * layout.cc (Layout::choose_output_section): If we find an
7856 existing section, update the flags.
7857 (Layout::create_notes): New function, broken out of
7858 Layout::finalize.
7859 (Layout::finalize): Don't create note sections.
7860 (Layout::create_note): Don't crash if linker script discards
7861 section.
7862 (Layout::create_gold_note): Likewise.
7863 (Layout::create_build_id): Likewise. Don't set
7864 after_input_sections on the section.
7865 (Layout::create_executable_stack_info): Remove target parameter.
7866 Change caller.
7867 * layout.h (class Layout): Declare create_notes. Update
7868 declaration of create_executable_stack_info.
7869 * gold.cc (queue_middle_tasks): Call create_notes.
7870 * output.cc (Output_section::update_flags_for_input_section): Move
7871 here from output.h. If SHF_ALLOC flag is newly set, mark address
7872 invalid.
7873 * output.h (Output_data::mark_address_invalid): New function.
7874 (class Output_section): Only declare, not define,
7875 update_flags_for_input_section. Remove set_flags.
7876
55458500
ILT
78772009-06-24 Ian Lance Taylor <iant@google.com>
7878
7879 * script-sections.cc (Output_section_definition::
7880 set_section_addresses): Rename shadowing local load_address to
7881 laddr.
7882
1307d6cd
ILT
78832009-06-24 Ian Lance Taylor <iant@google.com>
7884
7885 PR 10244
7886 * reloc.cc (relocate_sections): Skip empty relocation sections.
7887
ec3f783e
ILT
78882009-06-23 Ian Lance Taylor <iant@google.com>
7889
7890 PR 10156
7891 * layout.cc (Layout::create_note): Use choose_output_section
7892 rather than make_output_section.
7893
459c9f1c
ILT
78942009-06-23 Ian Lance Taylor <iant@google.com>
7895
7896 PR 10237
7897 * options.cc (General_options::parse_V): Set printed_version_.
7898 (General_options::General_options): Initialize printed_version_.
7899 * options.h (class General_options): Add printed_version_ field.
7900 * gold.cc (queue_initial_tasks): If there are no input files,
7901 don't give a fatal error if we printed the version information.
7902 (queue_middle_tasks): If using -r with a shared object, give a
7903 fatal error rather than an ordinary error.
7904
1518dc8f
ILT
79052009-06-23 Ian Lance Taylor <iant@google.com>
7906
7907 PR 10219
7908 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7909 (Layout::make_output_section): Set have_stabstr_section_ if we see
7910 a .stab*str section.
7911 (Layout::finalize): Call link_stabs_sections.
7912 (Layout::link_stabs_sections): New file.
7913 * layout.h (class Layout): Add have_stabstr_section_ field.
7914 Declare link_stabs_sections.
7915
3d857b98
DK
79162009-06-23 Doug Kwan <dougkwan@google.com>
7917
7918 * Makefile.am (libgold_a_LIBADD): New.
7919 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7920 * Makefile.in: Regenerate.
7921 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7922 * configure: Regenerate.
7923 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7924 * fileread.cc: Include sys/state.h
7925 * gold.h: Declare memmem and strndup if found missing.
7926 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7927
0639a6f6
ILT
79282009-06-23 Ian Lance Taylor <iant@google.com>
7929
7930 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7931 * configure: Rebuild.
7932
8d63875c
ILT
79332009-06-23 Ian Lance Taylor <iant@google.com>
7934
7935 PR 10147
7936 * object.cc (Object::section_contents): Don't try to get a view if
7937 the section has length zero.
7938 (Object::handle_gnu_warning_section): If the section is empty, use
7939 the name of the section as the warning.
7940
f7c8a183
ILT
79412009-06-23 Ian Lance Taylor <iant@google.com>
7942
7943 PR 10133
7944 * stringpool.h (class Stringpool_template): Add optimize_ field.
7945 (Stringpool_template::set_optimize): New function.
7946 * stringpool.cc (Stringpool_template::Stringpool_template):
7947 Initialize optimize_ field.
7948 (Stringpool_template::set_string_offsets): Test local optimize
7949 fild rather than parameter.
7950 * layout.cc (Layout::Layout): Call set_optimize on the section
7951 name stringpool.
7952
e6a307ba
ILT
79532009-06-22 Ian Lance Taylor <iant@google.com>
7954
7955 PR 10030
7956 * yyscript.y: Parse TARGET.
7957 * script.cc (script_set_target): New function.
7958 * script-c.h (script_set_target): Declare.
7959 * options.cc (General_options::string_to_object_format): Rename
7960 from string_to_object_format in anonymous namespace. Change
7961 callers.
7962 * options.h (class General_options): Declare
7963 string_to_object_format.
7964
3ee173de
ILT
79652009-06-22 Ian Lance Taylor <iant@google.com>
7966
7967 * script-sections.cc (Script_sections::create_segments): Don't put
7968 program headers in a PT_LOAD segment if -n or -N.
7969
79702009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7971
7972 PR 10141
7973 * options.h (class General_options): Add -z lazy and -z now. Sort
7974 -z options into alphabetical order.
7975 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7976
cd6739a1 79772009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7978
7979 * layout.cc (Layout::make_output_section): Call
7980 Target::new_output_section.
7981 (Layout::attach_allocated_section_to_segment): Put large section
7982 sections in a separate load segment with the large segment flag
7983 set.
7984 (Layout::segment_precedes): Sort large data segments after other
7985 load segments.
7986 (align_file_offset): New static function.
7987 (Layout::set_segment_offsets): Use align_file_offset.
7988 * output.h (class Output_section): Add is_small_section_ and
7989 is_large_section_ fields.
7990 (Output_section::is_small_section): New function.
7991 (Output_section::set_is_small_section): New function.
7992 (Output_section::is_large_section): New function.
7993 (Output_section::set_is_large_section): New function.
7994 (Output_section::is_large_data_section): New function.
7995 (class Output_segment): Add is_large_data_segment_ field.
7996 (Output_segment::is_large_data_segment): New function.
7997 (Output_segment::set_is_large_data_segment): New function.
7998 * output.cc (Output_section::Output_section): Initialize new
7999 fields.
8000 (Output_segment::Output_segment): Likewise.
8001 (Output_segment::add_output_section): Add assertion that large
8002 data sections always go in large data segments. Force small data
8003 sections to the end of the list of data sections. Force small BSS
8004 sections to the start of the list of BSS sections. For large BSS
8005 sections to the end of the list of BSS sections.
8006 * symtab.h (class Symbol): Declare is_common_shndx.
8007 (Symbol::is_defined): Check Symbol::is_common_shndx.
8008 (Symbol::is_common): Likewise.
8009 (class Symbol_table): Define enum Commons_section_type. Update
8010 declarations. Add small_commons_ and large_commons_ fields.
8011 * symtab.cc (Symbol::is_common_shndx): New function.
8012 (Symbol_table::Symbol_table): Initialize new fields.
8013 (Symbol_table::add_from_object): Put small and large common
8014 symbols in the right list.
8015 (Symbol_table::sized_finalized_symbol): Check
8016 Symbol::is_common_shndx.
8017 (Symbol_table::sized_write_globals): Likewise.
8018 * common.cc (Symbol_table::do_allocate_commons): Allocate new
8019 common symbol lists. Don't call do_allocate_commons_list if the
8020 list is empty.
8021 (Symbol_table::do_allocate_commons_list): Remove is_tls
8022 parameter. Add comons_section_type parameter. Change all
8023 callers. Handle small and large common symbols.
8024 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
8025 Symbol::is_common_shndx.
8026 * resolve.cc (symbol_to_bits): Likewise.
8027 * target.h (Target::small_common_shndx): New function.
8028 (Target::small_common_section_flags): New function.
8029 (Target::large_common_shndx): New function.
8030 (Target::large_common_section_flags): New function.
8031 (Target::new_output_section): New function.
8032 (Target::Target_info): Add small_common_shndx, large_common_shndx,
8033 small_common_section_flags, and large_common_section_flags
8034 fields.
8035 (Target::do_new_output_section): New virtual function.
8036 * arm.cc (Target_arm::arm_info): Initialize new fields.
8037 * i386.cc (Target_i386::i386_info): Likewise.
8038 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
8039 Likewise.
8040 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
8041 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8042 (Target_x86_64::do_new_output_section): New function.
8043 * configure.ac: Define conditional MCMODEL_MEDIUM.
8044 * testsuite/Makefile.am (check_PROGRAMS): Add large.
8045 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
8046 (large_LDFLAGS): Define.
8047 * testsuite/large.c: New file.
8048 * testsuite/testfile.cc (Target_test::test_target_info):
8049 Initialize new fields.
8050 * configure, testsuite/Makefile.in: Rebuild.
8051
bb04269c
DK
80522009-06-05 Doug Kwan <dougkwan@google.com>
8053
8054 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 8055 * Makefile.in: Regenerate.
bb04269c
DK
8056 * i386.cc (class Target_i386): Define new virtual method to
8057 override do_is_local_label_name in parent.
8058 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8059 local symbols if --discard-locals or -X is given.
8060 * options.h (class General_options): Declare new options
8061 '--discard-locals' and '-X' for discarding locals.
8062 * target.h (class Target): Define new methods is_local_label_name.
8063 Declare new virtual method do_is_local_label_name.
8064 * target.cc: New file.
8065 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8066 (check_SCRIPTS): Add discard_locals_test.sh.
8067 (check_DATA): Add discard_local_tests.syms.
8068 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8069 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8070 * testsuite/Makefile.in: Regenerate.
8071 * testsuite/discard_locals_test.c: New file.
8072 * testsuite/discard_locals_test.sh: Same.
8073
805bb01c
DK
80742009-06-05 Doug Kwan <dougkwan@google.com>
8075
8076 * object.cc (Sized_relobj::Sized_relobj): Initialize
8077 discarded_eh_frame_shndx_ to -1U.
8078 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8079 section.
8080 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8081 a discarded .eh_frame section.
8082 (Sized_relobj::do_finalize_local_symbols): Ditto.
8083 * object.h (class Sized_relobj): Declare new member
8084 discarded_eh_frame_shndx_.
8085 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8086 (local_labels_test.o, local_labels_test): New rules.
8087 * testsuite/Makefile.in: Regenerate.
8088
1dcd334d
DK
80892009-06-04 Doug Kwan <dougkwan@google.com>
8090
8091 * layout.cc (Layout::section_name_mapping): Add mapping for
8092 special ARM sections.
8093
96d49306
DK
80942009-06-03 Doug Kwan <dougkwan@google.com>
8095
8096 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8097 (utils::has_overflow): Same.
8098
dff16297
ILT
80992009-06-03 Ian Lance Taylor <iant@google.com>
8100
8101 * layout.cc (Layout::section_name_mapping): New array, replacing
8102 Layout::linkonce_mapping.
8103 (Layout::section_name_mapping_count): New variable, replacing
8104 Layout::linkonce_mapping_count.
8105 (Layout::linkonce_output_name): Remove.
8106 (Layout::output_section_name): Rewrite.
8107 * layout.h (class Layout): Rename Linkonce_mapping to
8108 Section_name_mapping, linkonce_mapping to section_name_mapping,
8109 linkonce_mapping_count to section_name_mapping_count. Don't
8110 declare linkonce_output_name.
8111
c121c671
DK
81122009-06-03 Doug Kwan <dougkwan@google.com>
8113
8114 * gold/arm.cc (namespace utils): New.
8115 (Target_arm::reloc_is_non_pic): Define new method.
8116 (class Arm_relocate_functions): New.
8117 (Target_arm::Relocate::relocate): Handle relocation types used by
8118 Android.
8119
07800fab
ILT
81202009-06-03 Ian Lance Taylor <iant@google.com>
8121
8122 * arm.cc (Target_arm::scan::global): Use || instead of |.
8123
c121c671
DK
81242009-06-02 Doug Kwan <dougkwan@google.com>
8125
8126 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8127 issued_non_pic_error_.
8128 (class Target_arm::Scan): Declare new method check_non_pic.
8129 Define new method symbol_needs_plt_entry.
8130 Declare new data member issued_non_pic_error_.
8131 (class Target_arm::Relocate): Declare new method
8132 should_apply_static_reloc.
8133 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8134 (Target_arm::Scan::check_non_pic): Define new method.
8135 (Target_arm::Scan::local): Handle a small subset of reloc types used
8136 by Android.
8137 (Target_arm::Scan::local): Same.
8138 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8139
b19b0c6d
ILT
81402009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8141
8142 * incremental.cc (Incremental_inputs::report_command_line): Filter
8143 out --incremental-* options.
8144
94cdfcff
DK
81452009-05-29 Doug Kwan <dougkwan@google.com>
8146
8147 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8148 template class.
8149 (class Target_arm): Update comment.
8150 (Target_arm::Target_arm): Initialize new data members GOT_,
8151 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8152 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8153 and Target_arm::rel_dyn_section.
8154 Declare new_enum Target_arm::Got_type.
8155 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8156 and DYNBSS_.
8157 Update commments for member do_dynsym_value.
8158 (Target_arm::got_size, Target_arm::plt_section,
8159 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8160 new methods inside class defintion.
8161 (Target_arm::got_section): Define new method.
8162 (Target_arm::rel_dyn_section): Same.
8163 (Output_data_plt_arm): New template class.
8164 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8165 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8166 (Output_data_plt_arm::add_entry): Same.
8167 (Output_data_plt_arm::first_plt_entry): Define new
8168 static data member for PLT instruction template.
8169 (Output_data_plt_arm::plt_entry): Same.
8170 (Output_data_plt_arm::do_write): Define new method.
8171 (Target_arm::make_plt_entry): Same.
8172 (Target_arm::do_finalize_sections): Same.
8173 (Target_arm::do_dynsym_value): Same.
8174
4a657b0d
DK
81752009-05-28 Doug Kwan <dougkwan@google.com>
8176
8177 * Makefile.am (TARGETSOURCES): Add arm.cc.
8178 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8179 * Makefile.in: Regenerate.
8180 * arm.cc: New file.
8181 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8182
e7ae8c36
DK
81832009-05-26 Doug Kwan <dougkwan@google.com>
8184
8185 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8186 (General_options::check_excluded_libs): Strip off directories in
8187 archive name before matching like GNU ld does.
8188 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8189 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8190 (exclude_libs_test_LDFLAGS): Add linker option
8191 -Wl,--exclude-libs,libexclude_libs_test_3
8192 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8193 an explicit archive without using -l.
8194 (alt/libexclude_libs_test_3.a): New make rule.
8195 * testsuite/Makefile.in: Regenerate.
8196 * testsuite/exclude_libs_test.c : Declare lib3_default().
8197 (main): Call it.
8198 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8199 * exclude_libs_test_3.c: New file.
8200
f12e7348
NC
82012009-05-26 Nick Clifton <nickc@redhat.com>
8202
8203 * po/id.po: New Indonesian translation.
8204 * po/gold.pot: Updated template file.
8205
4daadc0d
ST
82062009-05-22 Sriraman Tallam <tmsriram@google.com>
8207
e1df38aa 8208 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
8209 gc_comdat_test files. Add -Wl,--gc-sections to build
8210 gc_comdat_test.
8211 * testsuite/Makefile.in: Regenerate.
8212 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8213
531813ad
ST
82142009-05-21 Sriraman Tallam <tmsriram@google.com>
8215
8216 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8217 kept comdat section was garbage collected.
8218 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8219 * testsuite/Makefile.in: Regenerate.
8220 * testsuite/gc_comdat_test.sh: New file.
8221 * testsuite/gc_comdat_test_1.cc: New file.
8222 * testsuite/gc_comdat_test_2.cc: New file.
8223
65514900
CC
82242009-05-19 Doug Kwan <dougkwan@google.com>
8225
8226 * archive.cc (Archive::Archive): Move constructor from archive.h
8227 to here. Initialize no_export_.
8228 (Archive::get_elf_object_for_member): Set no_export flag of object.
8229 * archive.h (Archive::Archive): Move constructor body to
8230 archive.cc.
8231 (Archive::no_export): New method.
8232 (Archive::no_export_): New field.
8233 * object.h (Object::Object): Initialize no_export_ to false.
8234 (Object::no_export, Object::set_no_export): New methods.
8235 (Object::no_export_): New field.
8236 * options.cc (General_options::parse_exclude_libs): New method.
8237 (General_options::check_excluded_libs) Same.
8238 * options.h (exclude_libs): New option.
8239 (General_options::check_excluded_libs): New method declaration.
8240 (General_options::excluded_libs_): New field.
8241 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8242 default or protected visibility if an object has no-export flag set.
8243 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8244 (check_SCRIPTS): Add exclude_libs_test.sh.
8245 (check_DATA): Add exclude_libs_test.syms.
8246 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8247 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8248 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8249 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8250 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8251 libexclude_libs_test_2.a): New rules.
8252 * testsuite/Makefile.in: Regenerate.
8253 * testsuite/exclude_libs_test.c: New file.
8254 * testsuite/exclude_libs_test.sh: Ditto.
8255 * testsuite/exclude_libs_test_1.c: Ditto.
8256 * testsuite/exclude_libs_test_2.c: Ditto.
8257
1b77ea50
ILT
82582009-05-15 Ian Lance Taylor <iant@google.com>
8259
8260 * configure.ac: Check for declarations for cases where libiberty.h
8261 checks HAVE_DECL_xxx.
8262 * configure, config.in: Rebuild.
8263
072fe7ce
ILT
82642009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8265
8266 * gold.h (Incremental_argument_list): Remove (invalid) forward
8267 declaration.
8268 * incremental.cc (Incremental_inputs::report_achive): New method.
8269 (Incremental_inputs::report_object): New method.
8270 (Incremental_inputs::report_script): New method.
8271 (Incremental_inputs::finalize_inputs): New method.
8272 (Incremental_inputs::finalize): Call finalize_inputs().
8273 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8274 Create inputs entries.
8275 * incremental.h (Incremental_input_type): New enum.
8276 (Incremental_inputs::Incremental_input): Initialize new fields.
8277 (Incremental_inputs::report_inputs): New method.
8278 (Incremental_inputs::report_achive): New method.
8279 (Incremental_inputs::report_object): New method.
8280 (Incremental_inputs::report_script): New method.
8281 (Incremental_inputs::finalize_inputs): New method.
8282 (Incremental_inputs::Input_info): New struct.
8283 (Incremental_inputs::Input_info_map): New typedef.
8284 (Incremental_inputs::lock_): New field.
8285 (Incremental_inputs::Inputs_): New field.
8286 (Incremental_inputs::Inputs_map): New field.
8287 * main.cc (main): Call Incremental_input::report_inputs.
8288 * options.h (Input_argument_list): Typedef moved from
8289 Input_arguments.
8290 (Input_file_group::Files): Remove, use ::Input_argument_list.
8291 (Input_file_group::Input_argument_list): Remove, use
8292 ::Input_argument_list.
8293 * plugin.cc (Plugin_manager::add_input_file): Add error in
8294 incremental build.
8295 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8296 functions.
8297 * script.cc (read_input_script): Call
8298 Incremental_input::report_script.
8299 * script.h (Script_info): New class.
8300
b0481b0b
ILT
83012009-04-27 Ian Lance Taylor <iant@google.com>
8302
8303 * x86_64.cc (do_adjust_output_section): Set entsize to
8304 plt_entry_size.
8305
b22a5a41 83062009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
8307
8308 * output.cc (Output_file::close): After short writes, continue
8309 writing from the correct offset in the buffer being written.
8310
40fde488
CD
83112009-04-23 Chris Demetriou <cgd@google.com>
8312
8313 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8314 * configure: Regenerate.
8315 * config.in: Regenerate.
8316 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8317 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8318
3ce2c28e
ILT
83192009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8320
8321 * incremental.cc (Incremental_inputs_header_data): Renamed from
8322 Incremental_input_header_data.
8323 (Incremental_inputs_header_data::data_size): New field.
8324 (Incremental_inputs_header_data::put_input_file_count): Renamed
8325 from input_file_count.
8326 (Incremental_inputs_header_data::put_command_line_offset): Renamed
8327 from command_line_offset.
8328 (Incremental_inputs_header_data::put_reserved): Renamed from
8329 put_reserved.
8330 (Incremental_inputs_entry_data): Renamed from
8331 Incremental_input_entry_data.
8332 (Incremental_inputs_entry_data::data_size): New field.
8333 (Incremental_inputs::report_command_line): New method.
8334 (Incremental_inputs::finalize): New method.
8335 (Incremental_inputs::create_incremental_inputs_data): New method.
8336 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
8337 * incremental.h: New file.
8338 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
8339 (Layout::finalize): Create incremental inputs section in
8340 incremental builds.
8341 (Layout::create_incremental_info_sections): New method.
8342 * layout.h (Layout::incremental_inputs): New method.
8343 (Layout::create_incremental_info_sections): New method.
8344 (Layout::incremental_inputs_): New field.
8345 * main.cc (main): Notify Incremental_input of the command line.
8346
e55bde5e
ILT
83472009-04-01 Ian Lance Taylor <iant@google.com>
8348 Mikolaj Zalewski <mikolajz@google.com>
8349
8350 * gold.h (reserve_unordered_map): Define, three versions, one for
8351 each version of Unordered_map.
8352 * layout.cc (Layout::Layout): Remove options parameter. Add
8353 number_of_input_files parameter. Don't initialize options_.
8354 Initialize number_of_input_files_ and resized_signatures_. Move
8355 sections_are_attached_.
8356 (Layout::layout_group): Reserve space for group_signatures_.
8357 (Layout::find_or_add_kept_section): Change name parameter to be a
8358 reference. Resize signatures_ map when it gets large enough.
8359 (Layout::layout_eh_frame): Use parameters->options() instead of
8360 this->options_.
8361 (Layout::make_output_section): Likewise.
8362 (Layout::attach_allocated_section_to_segment): Likewise.
8363 (Layout::finalize, Layout::create_executable_stack): Likewise.
8364 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
8365 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
8366 * layout.h (class Layout): Update declarations. Remove options_
8367 field. Add number_of_input_files_ and resized_signatures_
8368 fields. Move sections_are_attached_ field.
8369 * main.cc (main): Pass number of input files to Layout
8370 constructor. Don't pass options.
8371
154b857c
ILT
83722009-03-30 Ian Lance Taylor <iant@google.com>
8373
8374 * ffsll.c (ffsll): Correct implementation.
8375
2f35ab9b
ILT
83762009-03-27 Ian Lance Taylor <iant@google.com>
8377
fd03461a
ILT
8378 * ffsll.c: New file.
8379 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
8380 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
8381 * ftruncate.c (ftruncate): Declare before definition.
8382 * mremap.c (mremap): Likewise.
8383 * pread.c (pread): Likewise.
8384 * configure, Makefile.in, config.in: Rebuild.
8385
2f35ab9b
ILT
8386 * mremap.c: New file.
8387 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
8388 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
8389 (mremap): Declare if HAVE_MREMAP is not defined.
8390 * configure, Makefile.in, config.in: Rebuild.
8391
33aea2fd
CC
83922009-03-27 Cary Coutant <ccoutant@google.com>
8393
8394 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
8395 position independent.
8396 * sparc.cc (Target_sparc::check_non_pic): Likewise.
8397 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
8398
6d479619
CC
83992009-03-24 Cary Coutant <ccoutant@google.com>
8400
8401 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
8402 an executable.
8403 (needs_dynamic_reloc): Likewise.
8404
afc06bb8
ILT
84052009-03-24 Ian Lance Taylor <iant@google.com>
8406
8407 * yyscript.y (file_cmd): Recognize EXTERN.
8408 (extern_name_list, extern_name_list_body): New nonterminals.
8409 * script.cc (script_add_extern): Define.
8410 * script-c.h (script_add_extern): Declare.
8411
f6060a4d
ILT
84122009-03-24 Rafael Avila de Espindola <espindola@google.com>
8413
8414 * object.cc (is_elf_object): Define.
8415 * object.h (is_elf_object): Declare.
8416 * archive.cc (Archive::get_elf_object_for_member): Call
8417 is_elf_object.
33aea2fd 8418 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 8419
26736d8e
ILT
84202009-03-24 Elliott Hughes <enh@google.com>
8421
8422 * output.cc (Output_file::map_anonymous): Define.
8423 (Output_file::map): Use map_anonymous. If the regular mmap fails,
8424 try an anonymous one. Report the size if the mmap fails.
8425 * output.h (class Output_file): Declare map_anonymous.
8426
22fd9730
ILT
84272009-03-24 Ian Lance Taylor <iant@google.com>
8428
8429 * target-select.cc (instantiate_target): Don't acquire the lock if
8430 the instantiated_target_ field has already been set.
8431
cb010894
ILT
84322009-03-23 Ian Lance Taylor <iant@google.com>
8433
7f055c20
ILT
8434 * gold-threads.h (class Initialize_lock): Define.
8435 * gold-threads.cc (class Initialize_lock_once): Define.
8436 (initialize_lock_control): New static variable.
8437 (initialize_lock_pointer): New static variable.
8438 (initialize_lock_once): New static function.
8439 (Initialize_lock::Initialize_lock): Define.
8440 (Initialize_lock::initialize): Define.
8441 * target-select.h: Include "gold-threads.h".
8442 (class Target_selector): Add lock_ and initialize_lock_ fields.
8443 Don't define instantiate_target, just declare it.
8444 * target-select.cc (Target_selector::Target_selector): Initialize
8445 new fields.
8446 (Target_selector::instantiate_target): Define.
8447 * descriptors.h: Include "gold-threads.h".
8448 (class Descriptors): Add initialize_lock_ field.
8449 * descriptors.cc (Descriptors::Descriptors): Initialize new
8450 field.
8451 (Descriptors::open): Use initialize_lock_ field
8452 * errors.h (class Errors): Add initialize_lock_ field.
8453 * errors.cc (Errors::Errors): Initialize new field.
8454 (Errors::initialize_lock): Use initialize_lock_ field.
8455 * powerpc.cc (class Target_selector_powerpc): Remove
8456 instantiated_target_ field. In do_recognize call
8457 instantiate_target rather than do_instantiate_target. In
8458 do_instantiate_target just allocate a new target.
8459 * sparc.cc (class Target_selector_sparc): Likewise.
8460
36959681
ILT
8461 * freebsd.h: New file.
8462 * i386.cc: Include "freebsd.h".
8463 (Target_i386): Derive from Target_freebsd rather than
8464 Sized_target.
8465 (Target_selector_i386): Derive from Target_selector_freebsd rather
8466 than Target_selector.
8467 * x86_64.cc: Include "freebsd.h".
8468 (Target_x86_64): Derive from Target_freebsd rather than
8469 Sized_target.
8470 (Target_selector_x86_64): Derive from Target_selector_freebsd
8471 rather than Target_selector.
8472 * target.h (class Target): Add adjust_elf_header and
8473 do_adjust_elf_header.
8474 * output.cc (Output_file_header:: do_sized_write): Call target
8475 adjust_elf_header routine.
8476 * configure.tgt: Set targ_osabi.
8477 * configure.ac: Define GOLD_DEFAULT_OSABI.
8478 * parameters.cc (Parameters::default_target): Pass
8479 GOLD_DEFAULT_OSABI to select_target.
8480 * target-select.h (class Target_selector): Make instantiate_target
8481 protected rather than private.
8482 * Makefile.am (HFILES): Add freebsd.h.
8483 * configure, Makefile.in, config.in: Rebuild.
8484
cb010894
ILT
8485 * merge.cc (do_add_input_section): Correct pend value. Change
8486 message about last entry not being null terminated from error to
8487 warning.
8488
0e879927
ILT
84892009-03-20 Mikolaj Zalewski <mikolajz@google.com>
8490
8491 * incremental.cc: New file.
8492 * Makefile.am (CCFILES): Add incremental.cc.
8493 * Makefile.in: Rebuild.
8494
41105937
PP
84952009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
8496
8497 * layout.cc (Layout::output_section_name): Preserve names
8498 of '.note.' sections.
e1df38aa 8499
60439920
ILT
85002009-03-19 Ian Lance Taylor <iant@google.com>
8501
8502 * descriptors.cc (Descriptors::open): Check that the options are
8503 valid before using them.
8504
0d371ad3
ILT
85052009-03-18 Ian Lance Taylor <iant@google.com>
8506
8507 * script-sections.h: Include <list>.
8508 (class Script_sections): Change Sections_elements from std::vector
8509 to std::list. Typedef public Elements_iterator. Add
8510 orphan_section_placement_, data_segment_align_start_, and
8511 saw_data_segment_align_ fields. Remove data_segment_align_index_
8512 field.
8513 * script-sections.cc (class Orphan_section_placement): New class.
8514 (class Sections_element): Add virtual functions is_relro and
8515 orphan_section_init. Remove virtual function place_orphan_here.
8516 (class Output_section_definition): Add is_relro and
8517 orphan_section_init. Remove place_orphan_here.
8518 (class Orphan_output_section): Likewise.
8519 (Script_sections::Script_sections): Update for field changes.
8520 (Script_sections::data_segment_align): Set saw_data_segment_align_
8521 and data_segment_align_start_, not data_segment_align_index.
8522 (Script_sections::data_segment_relro_end): Check
8523 saw_data_segment_align_. Use data_segment_align_start_ rather
8524 than data_segment_align_index_.
8525 (Script_sections::place_orphan): Rewrite to use
8526 Orphan_section_placement.
8527
9201d894
ILT
85282009-03-17 Ian Lance Taylor <iant@google.com>
8529
9c5b8369
ILT
8530 * archive.cc (Archive::add_symbols): Check for a version attached
8531 to the symbol name in the archive map.
8532 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
8533 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
8534 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
8535 (ver_test_11.a): New target.
8536 * testsuite/Makefile.in: Rebuild.
8537
9201d894
ILT
8538 * configure.ac: Check for chsize and posix_fallocate. Replace
8539 ftruncate.
8540 * ftruncate.c: New file, from gnulib.
8541 * output.cc (posix_fallocate): Define dummy version if not
8542 HAVE_POSIX_FALLOCATE.
8543 (Output_file::map): Call posix_fallocate rather than lseek and
8544 write.
8545 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
8546 * configure, Makefile.in, config.in: Rebuild.
8547
ef4ab7a8 85482009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 8549
ef4ab7a8
PP
8550 * layout.h (Layout::create_note): Add section_name parameter.
8551 * layout.cc (Layout::create_note): Likewise.
8552 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 8553
8c500701
ILT
85542009-03-17 Ian Lance Taylor <iant@google.com>
8555
e85b18e1
ILT
8556 * descriptors.cc: Include "options.h".
8557 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
8558 (Descriptors::open): Always use O_CLOEXEC when opening a new
8559 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
8560 then set FD_CLOEXEC.
8561
9efe6174
ILT
8562 * sparc.cc (class Target_sparc): Add has_got_section.
8563 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
8564 make sure we have a GOT section.
8565
8566 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
8567 (Target_sparc::Scan::local): Likewise.
8568 (Target_sparc::Scan::global): Likewise.
8569 (Target_sparc::Relocate::relocate): Likewise.
8570 (Target_sparc::Relocate::relocate_tls): Likewise.
8571
8c500701
ILT
8572 * symtab.cc (Symbol_table::define_default_version): New function,
8573 broken out of add_from_object.
8574 (Symbol_table::add_from_object): Call define_default_version.
8575 (Symbol_table::define_special_symbol): Add resolve_oldsym
8576 parameter. Change all callers. If the version for a symbol comes
8577 from a version script, resolve it with the symbol with the same
8578 name with no version. Also add the symbol without a version if
8579 appropriate.
8580 (do_define_in_output_data): If resolving with oldsym, don't delete
8581 sym.
8582 (do_define_in_output_segment): Likewise.
8583 (do_define_as_constant): Likewise.
8584 * symtab.h (class Symbol_table): Update declarations.
8585
f1ed28fb
ILT
85862009-03-13 Ian Lance Taylor <iant@google.com>
8587
15f8229b
ILT
8588 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8589 (Read_symbols::requeue): New function.
8590 (Read_symbols::do_read_symbols): If make_elf_object fails because
8591 the target type is not configured, and the file was searched for,
8592 issue a warning and retry with the next directory.
8593 (Add_symbols::run): If the file has an incompatible format, and
8594 it was searched for, requeue the Read_symbols task. On error,
8595 release the object.
8596 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8597 dirindex parameter to constructor. Change all callers. Declare
8598 incompatible_warning and requeue.
8599 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8600 input_argument_ and input_group_ fields. Add them to
8601 constructor. Change all callers.
8602 (class Read_script): Add dirindex_ field. Add it to constructor.
8603 Change all callers.
8604 * archive.cc (Archive::setup): Remove input_objects parameter.
8605 Change all callers.
8606 (Archive::get_file_and_offset): Likewise.
8607 (Archive::read_all_symbols): Likewise.
8608 (Archive::read_symbols): Likewise.
8609 (Archive::get_elf_object_for_member): Remove input_objects
8610 parameter. Add punconfigured parameter. Change all callers.
8611 (Archive::add_symbols): Change return type to bool. Check return
8612 value of include_member.
8613 (Archive::include_all_members): Likewise.
8614 (Archive::include_member): Change return type to bool. Return
8615 false if first included object has incompatible target. Set
8616 included_member_ field.
8617 (Add_archive_symbols::run): If add_symbols returns false, requeue
8618 Read_symbols task.
8619 * archive.h (class Archive): Add included_member_ field.
8620 Initialize it in constructor. Add input_file and searched_for
8621 methods. Update declarations.
8622 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8623 input_argument_ fields. Add them to constructor. Change all
8624 callers.
8625 * script.cc: Include "target-select.h".
8626 (class Parser_closure): Add skip_on_incompatible_target_ and
8627 found_incompatible_target_ fields. Add
8628 skip_on_incompatible_target parameter to constructor. Change all
8629 callers. Add methods skip_on_incompatible_target,
8630 clear_skip_on_incompatible_target, found_incompatible_target, and
8631 set_found_incompatible_target.
8632 (read_input_script): Add dirindex parameter. Change all callers.
8633 If parser finds an incompatible target, requeue Read_symbols
8634 task.
8635 (script_set_symbol): Clear skip_on_incompatible_target in
8636 closure.
8637 (script_add_assertion, script_parse_option): Likewise.
8638 (script_start_sections, script_add_phdr): Likewise.
8639 (script_check_output_format): New function.
8640 * script.h (read_input_script): Update declaration.
8641 * script-c.h (script_check_output_format): Declare.
8642 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8643 (ignore_cmd): Remove OUTPUT_FORMAT.
8644 * fileread.cc (Input_file::Input_file): Add explicit this.
8645 (Input_file::will_search_for): New function.
8646 (Input_file::open): Add pindex parameter. Change all callers.
8647 * fileread.h (class Input_file): Add input_file_argument method.
8648 Declare will_search_for. Update declarations.
8649 * object.cc (make_elf_object): Add punconfigured parameter.
8650 Change all callers.
8651 * object.h (class Object): Make input_file public. Add
8652 searched_for method.
8653 (make_elf_object): Update declaration.
8654 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8655 restart search.
8656 * dirsearch.h (class Dirsearch): Update declaration.
8657 * options.h (class General_options): Add --warn-search-mismatch.
8658 * parameters.cc (Parameters::is_compatible_target): New function.
8659 * parameters.h (class Parameters): Declare is_compatible_target.
8660 * workqueue.cc (Workqueue::add_blocker): New function.
8661 * workqueue.h (class Workqueue): Declare add_blocker.
8662
f1ed28fb
ILT
8663 * fileread.cc (Input_file::open): Remove options parameter.
8664 Change all callers.
8665 (Input_file::open_binary): Likewise.
8666 * script.cc (read_input_script): Likewise.
8667 * readsyms.h (class Read_symbols): Remove options_ field. Remove
8668 options parameter from constructor. Change all callers.
8669 (class Read_script): Likewise.
8670 * fileread.h (class Input_file): Update declarations.
8671 * script.h (read_input_script): Update declaration.
8672
34dd024a
NC
86732009-03-10 Nick Clifton <nickc@redhat.com>
8674
8675 * po/es.po: New Spanish translation.
8676
6d71b17c
CC
86772009-03-06 Cary Coutant <ccoutant@google.com>
8678
8679 * options.cc (parse_short_option): Keep dash_z from registering itself.
8680
031cdbed
ILT
86812009-03-03 Ian Lance Taylor <iant@google.com>
8682
8683 PR 9918
8684 * target-reloc.h (relocate_section): Pass output_section to
8685 relocate.
8686 * i386.cc (Target_i386::should_apply_static_reloc): Add
8687 output_section parameter. Change all callers.
8688 (Target_i386::Relocate::relocate): Add output_section parameter.
8689 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8690 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
8691 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
8692 * testsuite/two_file_shared.sh: New script.
8693 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
8694 (check_DATA): Add two_file_shared.dbg.
8695 (two_file_shared.dbg): New target.
8696 * testsuite/Makefile.in: Rebuild.
8697
15d5fa16
ILT
86982009-03-01 Ian Lance Taylor <iant@google.com>
8699
8700 * configure.ac: Check for byteswap.h.
8701 * configure: Rebuild.
8702 * config.in: Rebuild.
8703
8a4c0b0d
ILT
87042009-03-01 Mikolaj Zalewski <mikolajz@google.com>
8705
8706 * layout.cc (Layout::find_or_add_kept_section): New function.
8707 (Layout::add_comdat): Removed.
8708 * layout.h (struct Kept_section): Move out of class Layout.
8709 Remove trailing underscores from field names. Add group_sections
8710 field. Rename group_ field to is_group. Change all uses.
8711 (class Layout): Declare find_or_add_kept_section, not add_comdat.
8712 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
8713 comdat_groups_ field.
8714 (Sized_relobj::include_section_group): Use
8715 find_or_add_kept_section and Kept_section::group_sections.
8716 (Sized_relobj::include_linkonce_section): Likewise.
8717 * object.cc (class Sized_relobj): Don't define Comdat_group or
8718 Comdat_group_table. Remove find_comdat_group and
8719 add_comdat_group. Remove comdat_groups_ field.
8720 * plugin.cc (include_comdat_group): Use
8721 Layout::find_or_add_kept_section.
8722
b4ecf66b
ILT
87232009-02-28 Ian Lance Taylor <iant@google.com>
8724
14359ca0
ILT
8725 * README: --gc-sections and map files are now supported. Document
8726 some build requirements.
8727
b4ecf66b
ILT
8728 PR 6992
8729 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
8730 relocatable link set the value of the section symbol to zero.
8731 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
8732 relocatable link don't include the section address in the local
8733 symbol value.
8734
0602e05a
ILT
87352009-02-27 Ian Lance Taylor <iant@google.com>
8736
fd9d194f
ILT
8737 PR 6811
8738 * options.h (class Search_directory): Add is_system_directory.
8739 (class General_options): Declare is_in_system_directory.
8740 * options.cc (get_relative_sysroot): Make static.
8741 (get_default_sysroot): Make static.
8742 (General_optoins::is_in_system_directory): New function.
8743 * fileread.cc (Input_file::is_in_system_directory): New function.
8744 * fileread.h (class Input_file): Declare is_in_system_directory.
8745 * object.h (class Object): Add is_in_system_directory.
8746 (class Input_objects): Remove system_library_directory_ field.
8747 * object.cc (Input_objects::add_object): Don't set
8748 system_library_directory_.
8749 (input_objects::found_in_system_library_directory): Remove.
8750 * symtab.cc (Symbol_table::write_globals): Remove input_objects
8751 parameter. Change all callers.
8752 (Symbol_table::sized_write_globals): Likewise.
8753 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
8754 Call Object::is_in_system_directory.
8755 * symtab.h (class Symbol_table): Update declarations.
8756
61edd21f
ILT
8757 PR 5990
8758 * descriptors.h (Open_descriptor): Add is_on_stack field.
8759 * descriptors.cc (Descriptors::open): If the descriptor is on the
8760 top of the stack, remove it. Initialize is_on_stack field.
8761 (Descriptors::release): Only add pod to stack if it is not on the
8762 stack already.
8763 (Descriptors::close_some_descriptor): Clear stack_next and
8764 is_on_stack fields.
8765
e29e076a
ILT
8766 PR 7091
8767 * output.cc (Output_section::find_starting_output_address): Rename
8768 from starting_output_address; add PADDR parameter; change return
8769 type.
8770 * output.h (class Output_section): Declare
8771 find_starting_output_address instead of starting_output_address.
8772 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
8773 section symbol for which we can't find a merge section.
8774
0602e05a
ILT
8775 PR 9836
8776 * symtab.cc (Symbol_table::add_from_object): If the visibility is
8777 hidden or internal, force the symbol to be local.
8778 * resolve.cc (Symbol::override_visibility): Define.
8779 (Symbol::override_base): Use override_visibility.
8780 (Symbol_table::resolve): Likewise.
8781 (Symbol::override_base_with_special): Likewise.
8782 (Symbol_table::override_with_special): If the visibility is hidden
8783 or internal, force the symbol to be local.
8784 * symtab.h (class Symbol): Add set_visibility and
8785 override_visibility.
8786 * testsuite/ver_test_1.sh: New file.
8787 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
8788 (check_DATA): Add ver_test_1.syms.
8789 (ver_test_1.syms): New target.
8790 * testsuite/Makefile.in: Rebuild.
8791
401a9a73
CC
87922009-02-25 Cary Coutant <ccoutant@google.com>
8793
8794 * layout.cc (Layout::choose_output_section): Don't rename sections
8795 when using a linker script that has a SECTIONS clause.
8796 * Makefile.in: Regenerate.
8797
8798 * testsuite/Makefile.am (script_test_5.sh): New test case.
8799 * testsuite/Makefile.in: Regenerate.
8800 * testsuite/script_test_5.cc: New file.
8801 * testsuite/script_test_5.sh: New file.
8802 * testsuite/script_test_5.t: New file.
8803
f488e4b0
CC
88042009-02-13 Rafael Avila de Espindola <espindola@google.com>
8805
8806 * archive.cc (Archive::include_member): Update calls to add_symbols.
8807 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
8808 the Layout argument.
8809 * dynobj.h (do_add_symbols): Add the Layout argument.
8810 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
8811 Layout argument.
8812 * object.h (Object::add_symbols): Add the Layout argument.
8813 (Object::do_add_symbols): Add the Layout argument.
8814 (Sized_relobj::do_add_symbols): Add the Layout argument.
8815 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
8816 Unify the two versions.
8817 (Add_plugin_symbols): Remove.
8818 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
8819 (Sized_pluginobj::do_add_symbols): Unify the two versions.
8820 (Add_plugin_symbols): Remove.
8821 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
8822 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
8823 (Add_symbols::run): Make it work with Pulginobj.
8824
89dd1680
ILT
88252009-02-06 Ian Lance Taylor <iant@google.com>
8826
8827 * object.cc (Sized_relobj::do_layout): Make info message start
8828 with lower case letter.
8829
266d0a74
ILT
88302009-02-06 Mikolaj Zalewski <mikolajz@google.com>
8831
602b464e
ILT
8832 * binary.cc: Fix file comment.
8833
266d0a74
ILT
8834 * options.h (enum Incremental_disposition): Define.
8835 (class General_options): Add new options: --incremental,
8836 --incremental_changed, --incremental_unchanged,
8837 --incremental_unknown. Add incremental_disposition_ and
8838 implicit_incremental_ fields.
8839 (General_options::incremental_disposition): New function.
8840 (class Position_dependent_options): Add incremental_disposition
8841 option.
8842 (Position_dependent_options::copy_from_options): Set incremental
8843 dispositions.
8844 * options.cc (General_options::parse_incremental_changed): New
8845 function.
8846 (General_options::parse_incremental_unchanged): New function.
8847 (General_options::parse_incremental_unknown): New function.
8848 (General_options::General_options): Initialize new fields
8849 incremental_disposition_ and implicit_incremental_.
8850 (General_options::finalize): Check for uasge of --incremental-*
8851 without --incremental.
8852
f073bbf7
CD
88532009-02-06 Chris Demetriou <cgd@google.com>
8854
8855 * gold.h (gold_undefined_symbol): Change to take only a Symbol
8856 pointer and to report location as the file name associated with
8857 the symbol.
8858 (gold_undefined_symbol_at_location): New function to replace the
8859 old gold_undefined_symbol functionality.
8860 * target-reloc.h (relocate_section): Update to use
8861 gold_undefined_symbol_at_location.
8862 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8863 Call gold_undefined_symbol function rather than gold_error.
8864 * errors.h (Errors::undefined_symbol): Take location as a
8865 string, rather than calculating it from a relocation.
8866 * errors.cc (Errors::fatal): Print "fatal error:" before the
8867 formatted message.
8868 (Errors::error, Errors::error_at_location): Print "error: "
8869 before the formatted message.
8870 (Errors::undefined_symbol): Take location as a string, rather
8871 than calculating it from a relocation.
8872 (gold_undefined_symbol_at_location): New function akin to
8873 old gold_undefined_symbol, calculates location from relocation.
8874 (gold_undefined_symbol): Change to take only a Symbol pointer
8875 and to report location as the file name associated with the symbol.
8876 * testsuite/debug_msg.sh: Update for changed error messages.
8877 * testsuite/undef_symbol.sh: Likewise.
8878
8e94a90c
ILT
88792009-02-04 Duncan Sands <baldrick@free.fr>
8880
8881 PR 9812
8882 * reduced_debug_output.h
8883 (Output_reduced_debug_abbrev_section::failed): Use format for
8884 gold_warning.
8885 (Output_reduced_debug_info_section::faild): Likewise.
8886
88a0e15b
ILT
88872009-01-31 Mikolaj Zalewski <mikolajz@google.com>
8888
8889 * script.cc (Lazy_demangler): New class.
8890 (Version_script_info::get_symbol_version_helper): Demangle a
8891 symbol only once.
8892
5efc7cd2
CC
88932009-01-29 Cary Coutant <ccoutant@google.com>
8894
8895 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
8896 to __tls_get_addr.
8897 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8898
e0ebcf42
ILT
88992009-01-28 Ian Lance Taylor <iant@google.com>
8900
5efc7cd2 8901 * version.cc (version_string): Bump to 1.9.
75fe7426 8902
e0ebcf42
ILT
8903 * gold.h: Include <cstring> and <stdint.h>.
8904 * version.cc: Include <cstdio>.
8905 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8906 warning.
8907 * reduced_debug_output.cc (insert_into_vector): Rename from
8908 Insert_into_vector; change all callers. Use Swap_unaligned to
8909 avoid aliasing issue; remove union since it is unnecessary.
8910
8e2813be 89112009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8912
8913 * Makefile.am (CCFILES): Add gc.cc.
8914 (HFILES): Add gc.h.
8915 * Makefile.in: Regenerate.
8916 * gold.cc (Gc_runner): New class.
8917 (queue_initial_tasks): Call garbage collection related tasks
8918 when corresponding options are invoked.
8919 (queue_middle_gc_tasks): New function.
8920 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8921 processed early before laying out sections during garbage collection.
8922 * gold.h (queue_middle_gc_tasks): New function.
8923 (is_prefix_of): Move from "layout.cc".
8924 * i386.cc (Target_i386::gc_process_relocs): New function.
8925 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8926 * main.cc (main): Create object of class "Garbage_collection".
8927 * object.cc (Relobj::copy_symbols_data): New function.
8928 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8929 (Sized_relobj::do_layout): Allow this function to be called twice
8930 during garbage collection and defer layout of section during the
6d03d481
ST
8931 first call.
8932 * object.h (Relobj::get_symbols_data): New function.
8933 (Relobj::is_section_name_included): New function.
8934 (Relobj::copy_symbols_data): New function.
8935 (Relobj::set_symbols_data): New function.
8936 (Relobj::get_relocs_data): New function.
8937 (Relobj::set_relocs_data): New function.
8938 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8939 (Relobj::gc_process_relocs): New function.
8940 (Relobj::do_gc_process_relocs): New pure virtual function.
8941 (Relobj::sd_): New data member.
8942 (Sized_relobj::is_output_section_offset_invalid): New function.
8943 (Sized_relobj::do_gc_process_relocs): New function.
8944 * options.h (General_options::gc_sections): Modify to not be a no-op.
8945 (General_options::print_gc_sections): New option.
8946 * plugin.cc (Plugin_finish::run): Remove function call to
8947 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8948 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8949 * reloc.cc (Read_relocs::run): Add task to process relocs and
8950 determine unreferenced sections when doing garbage collection.
8951 (Gc_process_relocs): New class.
8952 (Sized_relobj::do_gc_process_relocs): New function.
8953 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8954 sections that are garbage collected.
8955 * reloc.h (Gc_process_relocs): New class.
8956 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8957 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8958 symbols whose corresponding sections are garbage collected.
8959 (Symbol_table::Symbol_table): Add new parameter for the garbage
8960 collection object.
8961 (Symbol_table::gc_mark_undef_symbols): New function.
8962 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8963 (Symbol_table::gc_mark_dyn_syms): New function.
8964 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8965 as garbage.
8966 (Symbol_table::add_from_object): Likewise.
8967 (Symbol_table::add_from_relobj): When building shared objects, do not
8968 treat externally visible symbols as garbage.
8969 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8970 table information for static and relocatable links.
8971 * symtab.h (Symbol_table::set_gc): New function.
8972 (Symbol_table::gc): New function.
8973 (Symbol_table::gc_mark_undef_symbols): New function.
8974 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8975 (Symbol_table::gc_mark_dyn_syms): New function.
8976 (Symbol_table::gc_): New data member.
e1df38aa 8977 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8978 function.
8979 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8980 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8981
3b293544
CF
89822009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8983
8984 * options.h (General_options::gc_sections): Define as a no-op for now.
8985 (General_options::no_keep_memory): Ditto.
8986 (General_options::Bshareable): Define.
8987 * options.cc (General_options::finalize): Honor -Bshareable.
8988
83d22aa8
AS
89892009-01-20 Andreas Schwab <schwab@suse.de>
8990
8991 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8992 read the value in the contents, since we don't use it. Use the
8993 template endianness when writing.
8994 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8995
cd536b21
AS
89962009-01-19 Andreas Schwab <schwab@suse.de>
8997
8998 * configure.tgt (powerpc64-*): Fix targ_obj.
8999
99e9a495
ILT
90002009-01-15 Ian Lance Taylor <iant@google.com>
9001
9002 * object.cc (Sized_relobj::write_local_symbols): Don't write out
9003 local symbols when stripping all symbols.
9004
bbbfea06
CC
90052009-01-14 Cary Coutant <ccoutant@google.com>
9006
99e9a495 9007 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 9008
0f7c0701
CC
90092009-01-14 Cary Coutant <ccoutant@google.com>
9010
9011 * archive.cc (Archive::get_elf_object_for_member): Remove call
9012 to File_read::claim_for_plugin.
9013 * descriptors.cc (Descriptors::open): Remove reference to
9014 is_claimed.
9015 (Descriptors::claim_for_plugin): Remove.
9016 * descriptors.h (Descriptors::claim_for_plugin): Remove.
9017 (Descriptors::is_claimed): Remove.
9018 (claim_descriptor_for_plugin): Remove.
9019 * fileread.cc (File_read::claim_for_plugin): Remove.
9020 * fileread.h (File_read::claim_for_plugin): Remove.
9021 (File_read::descriptor): Reopen descriptor if necessary.
9022 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
9023 (Plugin_manager::all_symbols_read): Add task parameter. Change
9024 all callers.
9025 (Plugin_manager::get_input_file): New function.
9026 (Plugin_manager::release_input_file): New function.
9027 (Pluginobj::Pluginobj): Add filesize parameter and initialize
9028 corresponding data member.
9029 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
9030 and pass to base constructor. Change all callers.
9031 (get_input_file, release_input_file): New functions.
9032 (make_sized_plugin_object): Add filesize parameter. Change all callers.
9033 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
9034 (Plugin_manager::all_symbols_read): Add task parameter.
9035 (Plugin_manager::get_input_file): New function.
9036 (Plugin_manager::release_input_file): New function.
9037 (Plugin_manager::task_): New data member.
9038 (Pluginobj::Pluginobj): Add filesize parameter.
9039 (Pluginobj::filename): New function.
9040 (Pluginobj::descriptor): New function.
9041 (Pluginobj::filesize): New function.
9042 (Pluginobj::filesize_): New data member.
9043 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
9044 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
9045 File_read::claim_for_plugin; use Object::unlock to unlock the file.
9046
9047 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
9048 with archive libraries.
9049 * testsuite/Makefile.in: Regenerate.
9050 * testsuite/plugin_test.c (struct sym_info): New type.
9051 (get_input_file, release_input_file): New static variables.
9052 (onload): Capture new transfer vector entries.
9053 (claim_file_hook): Stop reading at end of file according to filesize.
9054 Factor out parsing of readelf output into separate function.
9055 (all_symbols_read_hook): Exercise get_input_file and release_input_file
9056 APIs and get the source file name from the symbol table. Convert
9057 source file name to corresponding object file name. Print info
9058 message when adding new input files.
9059 (parse_readelf_line): New function.
9060 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9061 * testsuite/plugin_test_2.sh: Likewise.
9062 * testsuite/plugin_test_3.sh: Likewise.
9063 * testsuite/plugin_test_4.sh: New test case.
9064
62a6d109
ILT
90652009-01-07 Ian Lance Taylor <iant@google.com>
9066
9067 * version.cc (version_string): Bump to 1.8.
9068
483620e8
CC
90692008-12-23 Cary Coutant <ccoutant@google.com>
9070
9071 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9072 * plugin.cc (Plugin_manager::finish): Rename as
9073 layout_deferred_objects. Move cleanup to separate function.
9074 (Plugin_manager::cleanup): New function.
9075 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9076 separately.
9077 * plugin.h (Plugin_manager::finish): Rename as
9078 layout_deferred_objects.
9079 (Plugin_manager::cleanup): New function.
9080 (Plugin_manager::cleanup_done): New field.
9081
d66a9eb3
CC
90822008-12-23 Cary Coutant <ccoutant@google.com>
9083
9084 * plugin.cc (is_visible_from_outside): New function.
9085 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9086 so we don't return "IR only" status for exported symbols or -r links.
9087
9088 * testsuite/Makefile.am (plugin_test_3): New test case.
9089 * testsuite/Makefile.in: Regenerate.
9090 * testsuite/plugin_test_3.sh: New file.
9091
5995b570
CC
90922008-12-22 Cary Coutant <ccoutant@google.com>
9093
9094 * object.cc (Sized_relobj::layout_section): New function.
9095 (Sized_relobj::do_layout): Defer layout of input sections until after
9096 plugin has provided replacement files.
9097 (Sized_relobj::do_layout_deferred_sections): New function.
9098 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9099 (Relobj::layout_deferred_sections): New function.
9100 (Relobj::do_layout_deferred_sections): New function.
9101 (Sized_relobj::do_layout_deferred_sections): New function.
9102 (Sized_relobj::layout_section): New function.
9103 (Sized_relobj::Deferred_layout): New structure.
9104 (Sized_relobj::deferred_layout_): New field.
9105 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9106 Change all callers. Layout deferred sections.
9107 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9108 references.
9109 (Plugin_hook::run): Move code from do_plugin_hook inline.
9110 (Plugin_hook::do_plugin_hook): Remove.
9111 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9112 (Plugin_manager::finish): Renamed, was cleanup.
9113 (Plugin_manager::should_defer_layout): New function.
9114 (Plugin_manager::add_deferred_layout_object): New function.
9115 (Plugin_manager::Deferred_layout_list): New type.
9116 (Plugin_manager::deferred_layout_objects_): New field.
9117 (Plugin_hook::do_plugin_hook): Remove.
9118
ee769c88
ILT
91192008-12-17 Ian Lance Taylor <iant@google.com>
9120
9121 * options.h (class General_options): Add --no case for
9122 --export-dynamic.
9123
abc8dcba
CC
91242008-12-16 Cary Coutant <ccoutant@google.com>
9125
9126 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9127 vector.
9128 (Plugin_manager::claim_file): Create plugin object even if
9129 plugin did not call the add_symbols callback.
9130 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9131 asking for more symbols than were added.
9132 * testsuite/Makefile.am (plugin_test_1): Add test case with
9133 no global symbols.
9134 (empty.syms): New target.
9135 * testsuite/Makefile.in: Regenerate.
9136 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9137 message. Don't call add_symbols if no globals.
9138 (all_symbols_read_hook): Don't provide replacement for empty
9139 claimed file.
9140
b0074644
ILT
91412008-12-12 Ian Lance Taylor <iant@google.com>
9142
68943102
ILT
9143 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9144 r_type == 0 for a local symbol with r_sym == 0.
9145 (scan_relocatable_relocs): Pass r_sym to
9146 local_non_section_strategy.
9147 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9148 r_sym parameter.
9149
b0074644
ILT
9150 * configure.ac: Update test for TLS descriptors: they are
9151 supported as of glibc 2.9.
9152 * configure: Rebuild.
9153
c2508178
ILT
91542008-12-11 Ian Lance Taylor <iant@google.com>
9155
9156 PR 7091
9157 * target-reloc.h (Default_scan_relocatable_relocs): For each
9158 function, map r_type == 0 to RELOC_DISCARD.
9159
2756a258
CC
91602008-12-10 Cary Coutant <ccoutant@google.com>
9161
9162 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9163 object to override a kept COMDAT group from a plugin object.
9164
bb6f53d3
ILT
91652008-12-09 Ian Lance Taylor <iant@google.com>
9166
fbc558e1
ILT
9167 PR 7088
9168 * yyscript.y (file_cmd): Handle INPUT.
9169
bb6f53d3
ILT
9170 * testsuite/initpri1.c: Change all declarations to be full
9171 prototypes by adding void, to avoid compiler warnings.
9172
4674ecfc
CC
91732008-12-05 Rafael Avila de Espindola <espindola@google.com>
9174
9175 * options.cc (General_options::parse_plugin_opt): New.
9176 (General_options::add_plugin): The argument now is just the filename.
9177 (General_options::add_plugin_option): New.
9178 * options.h (plugin_opt): New.
9179 (add_plugin): Change argument name.
9180 (add_plugin_option): New.
9181 * plugin.cc (Plugin::load): Don't parse the plugin option.
9182 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9183 (Plugin::add_option): New.
9184 (Plugin::args_): Change type.
9185 (Plugin::filename_): New.
9186 (Plugin_manager::add_plugin_option): New.
9187 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9188 * testsuite/Makefile.in: Regenerate.
9189
fd06b4aa
CC
91902008-12-05 Cary Coutant <ccoutant@google.com>
9191
9192 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9193 Handle --strip-lto-sections option.
9194 * options.h (strip_lto_sections): New option.
9195
6c52134c
CC
91962008-12-01 Cary Coutant <ccoutant@google.com>
9197
9198 * plugin.cc (ld_plugin_message): Change format parameter to const.
9199 Fix mismatch between new[] and delete.
9200
a45248e0
CC
92012008-11-14 Cary Coutant <ccoutant@google.com>
9202
9203 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9204 instead of -1U.
9205
c82fbeee
CS
92062008-11-05 Craig Silverstein <csilvers@google.com>
9207
9208 * options.cc (General_options::parse_dynamic_list): New function.
9209 * options.h (General_options): New flags dynamic_list,
9210 dynamic_list_data, dynamic_list_cpp_new, and
9211 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9212 (General_options::in_dynamic_list): New function.
9213 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9214 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9215 (Lex::can_continue_name): Likewise.
9216 (yylex): Likewise.
9217 (read_script_file): New parameter script_options.
9218 (read_dynamic_list): New function.
9219 (Script_options::define_dynamic_list): New function.
9220 (dynamic_list_keyword_parsecodes): New variable.
9221 (dynamic_list_keywords): New variable.
9222 * script.h (Script_options::define_dynamic_list): New function
9223 prototype.
9224 (read_dynamic_list): New function prototype.
9225 * symtab.cc (strprefix): New macro.
9226 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9227 dynamic_list_data, dynamic_list_cpp_new, and
9228 dynamic_list_cpp_typeinfo.
9229 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9230 (dynamic_list_expr): New rule.
9231 (dynamic_list_nodes): Likewise.
9232 (dynamic_list_node): Likewise.
9233 * testsuite/Makefile.am (dynamic_list): New test.
9234 * testsuite/Makefile.in: Regenerated.
9235 * testsuite/dynamic_list.t: New file.
9236 * testsuite/dynamic_list.sh: New file.
9237
e0bb29a5
CS
92382008-11-05 Craig Silverstein <csilvers@google.com>
9239
9240 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9241 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9242 (t11_last): Likewise.
9243 * testsuite/ver_test_6.c (main): Likewise.
9244
4e1e25e0
CC
92452008-10-07 Cary Coutant <ccoutant@google.com>
9246
9247 * options.c (General_options::finalize): Add check for -static and
9248 -shared.
9249 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9250 is not empty.
9251
92f03fcb
CC
92522008-10-02 Cary Coutant <ccoutant@google.com>
9253
9254 * plugin.cc (make_sized_plugin_object): Fix conditional
9255 compilation to work when not all targets are enabled.
9256
fbd8a257
CC
92572008-09-29 Cary Coutant <ccoutant@google.com>
9258
9259 * archive.cc (Archive::get_file_and_offset): Use filename instead
9260 of name to get library path.
9261 (Archive::include_member): Unlock external member of a thin archive.
9262
9263 * testsuite/Makefile.am (TEST_AR): New variable.
9264 (thin_archive_test_1): New test.
9265 (thin_archive_test_2): New test.
81636b3f
CC
9266 * testsuite/Makefile.in: Regenerate.
9267 * testsuite/thin_archive_main.cc: New file.
9268 * testsuite/thin_archive_test_1.cc: New file.
9269 * testsuite/thin_archive_test_2.cc: New file.
9270 * testsuite/thin_archive_test_3.cc: New file.
9271 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 9272
eff45813
CC
92732008-09-29 Cary Coutant <ccoutant@google.com>
9274
9275 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9276 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9277 instead of -1U.
9278 (Sized_relobj::do_finalize_local_symbols): Likewise.
9279 (Sized_relobj::map_to_kept_section): Likewise.
9280 * object.h (Sized_relobj::invalid_address): New constant.
9281 (Sized_relobj::do_output_section_offset): Check for invalid_address
9282 and return -1ULL.
9283 * output.cc (Output_reloc::local_section_offset): Use constant
9284 invalid_address instead of -1U.
9285 (Output_reloc::get_address): Likewise.
9286 (Output_section::output_address): Change -1U to -1ULL.
9287 * output.h (Output_reloc::invalid_address): New constant.
9288 * reloc.cc (Sized_relobj::write_sections): Use constant
9289 invalid_address instead of -1U.
9290 (Sized_relobj::relocate_sections): Likewise.
9291 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9292 values for merge sections.
9293 * target-reloc.h (relocate_for_relocatable): Use constant
9294 invalid_address instead of -1U.
9295
89fc3421
CC
92962008-09-19 Cary Coutant <ccoutant@google.com>
9297
9298 Add plugin functionality for link-time optimization (LTO).
9299 * configure.ac (plugins): Add --enable-plugins option.
9300 * configure: Regenerate.
9301 * config.in: Regenerate.
9302 * Makefile.am (LIBDL): New variable.
9303 (CCFILES): Add plugin.cc.
9304 (HFILES): Add plugin.h.
9305 (ldadd_var): Add LIBDL.
9306 * Makefile.in: Regenerate.
9307
9308 * archive.cc: Include "plugin.h".
9309 (Archive::setup): Don't preread archive symbols when using a plugin.
9310 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9311 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9312 files.
9313 (Archive::include_member): Add symbols from plugin objects.
9314 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9315 * descriptors.cc (Descriptors::open): Check for file descriptors
9316 abandoned by plugins.
9317 (Descriptors::claim_for_plugin): New function.
9318 * descriptors.h (Descriptors::claim_for_plugin): New function.
9319 (Open_descriptor::is_claimed): New field.
9320 (claim_descriptor_for_plugin): New function.
9321 * fileread.cc (File_read::claim_for_plugin): New function.
9322 * fileread.h (File_read::claim_for_plugin): New function.
9323 (File_read::descriptor): New function.
9324 * gold.cc: Include "plugin.h".
9325 (queue_initial_tasks): Add task to call plugin hooks for generating
9326 new object files.
9327 * main.cc: Include "plugin.h".
9328 (main): Load plugin libraries.
9329 * object.h (Pluginobj): Declare.
9330 (Object::pluginobj): New function.
9331 (Object::do_pluginobj): New function.
9332 (Object::set_target): New function.
9333 * options.cc: Include "plugin.h".
9334 (General_options::parse_plugin): New function.
9335 (General_options::General_options): Initialize plugins_ field.
9336 (General_options::add_plugin): New function.
9337 * options.h (Plugin_manager): Declare.
9338 (General_options): Add --plugin option.
9339 (General_options::has_plugins): New function.
9340 (General_options::plugins): New function.
9341 (General_options::add_plugin): New function.
9342 (General_options::plugins_): New field.
9343 * plugin.cc: New file.
9344 * plugin.h: New file.
9345 * readsyms.cc: Include "plugin.h".
9346 (Read_symbols::do_read_symbols): Check for archive before checking
9347 for ELF file. Call plugin hooks to claim files.
9348 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9349 from a real object file; force override when processing replacement
9350 files.
9351 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9352 (Symbol::init_base_object): Likewise.
9353 (Symbol::init_base_output_data): Likewise.
9354 (Symbol::init_base_output_segment): Likewise.
9355 (Symbol::init_base_constant): Likewise.
9356 (Symbol::init_base_undefined): Likewise.
9357 (Symbol::output_section): Assert that object is not a plugin.
9358 (Symbol_table::add_from_pluginobj): New function.
9359 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9360 undefined.
9361 (Symbol_table::sized_write_globals): Likewise.
9362 (Symbol_table::add_from_pluginobj): Instantiate template.
9363 * symtab.h (Sized_pluginobj): Declare.
9364 (Symbol::in_real_elf): New function.
9365 (Symbol::set_in_real_elf): New function.
9366 (Symbol::in_real_elf_): New field.
9367 (Symbol_table::add_from_pluginobj): New function.
9368
9369 * testsuite/Makefile.am (AM_CFLAGS): New variable.
9370 (LIBDL): New variable.
9371 (LDADD): Add LIBDL.
9372 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
9373 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
9374 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
9375 (MOSTLYCLEANFILES): Likewise.
9376 * testsuite/Makefile.in: Regenerate.
9377 * testsuite/plugin_test.c: New file.
9378 * testsuite/plugin_test_1.sh: New file.
9379 * testsuite/plugin_test_2.sh: New file.
9380
de31bda5
ILT
93812008-09-16 Ian Lance Taylor <iant@google.com>
9382
9c2d0ef9
ILT
9383 * target-reloc.h (relocate_section): Check whether a symbol is
9384 defined by the ABI before reporting an undefined symbol error.
9385 * target.h (Target::is_defined_by_abi): Make parameter const.
9386 (Target::do_is_defined_by_abi): Likewise.
9387 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
9388 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
9389 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
9390 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
9391 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
9392 * testsuite/Makefile.in: Rebuild.
9393
de31bda5
ILT
9394 * fileread.cc (make_view): Add casts to avoid warning.
9395
9fa33bee
AO
93962008-09-16 Alexandre Oliva <aoliva@redhat.com>
9397
9398 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
9399 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9400
183fd0e3
AO
94012008-09-16 Alexandre Oliva <aoliva@redhat.com>
9402
9403 * options.h (General_options::output_is_executable): New.
9404 (General_options::output_is_pie): New.
9405 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
9406 for shared libraries.
9407 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9408
7be8330a
CD
94092008-09-11 Chris Demetriou <cgd@google.com>
9410
9411 * options.h (origin): New -z option.
9412 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
9413 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
9414 in DT_FLAGS_1.
9415
a9caad02
CC
94162008-09-05 Cary Coutant <ccoutant@google.com>
9417
9418 * fileread.cc (File_read::make_view): Add check for attempt to map
9419 beyond end of file.
9420
ae6dce4d
CC
94212008-09-05 Cary Coutant <ccoutant@google.com>
9422
9423 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
9424 explicit instantiations.
9425
d7ab2a47
KVH
94262008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
9427
9428 PR gold/6858
9429 * options.cc (General_options::finalize): Allow undefined symbols
9430 in shlibs if linking -shared.
9431
9432 PR gold/6859
9433 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
9434 symbols as not needing a dynsym entry.
9435
1e52a9c1
CS
94362008-08-20 Craig Silverstein <csilvers@google.com>
9437
9438 * fileread.cc (File_read::open): Do not lock the file unless it
9439 was successfully opened.
9440
d85c80a3
CC
94412008-08-14 Cary Coutant <ccoutant@google.com>
9442
9443 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
9444 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
9445 * testsuite/tls_test.cc (struct int128): 128-bit struct
9446 for testing TLS relocs with non-zero addend.
9447 (v12): New TLS variable.
9448 (t12): New test.
9449 (t_last): Add check for v12.
9450 * testsuite/tls_test.h (t12): New function.
9451 * testsuite/tls_test_main.cc (thread_routine): Call new test.
9452
2d924fd9
ILT
94532008-08-13 Ian Lance Taylor <iant@google.com>
9454
9455 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
9456 set tls_segment_ or relro_segment_.
9457 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
9458 when appropriate.
9459 * output.h (Output_section::clear_is_relro): New function.
9460 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
9461 sections specially even when output_data_ is empty.
9462 (Output_segment::maximum_alignment): When first section is relro,
9463 only force alignment for PT_LOAD segments.
9464 * script.cc (script_data_segment_align): New function.
9465 (script_data_segment_relro_end): New function.
9466 * script-c.h (script_data_segment_align): Declare.
9467 (script_data_segment_relro_end): Declare.
9468 * script-sections.h (class Script_sections): Declare
9469 data_segment_align and data_segment_relro_end. Add fields
9470 segment_align_index_ and saw_relro_end_.
9471 * script-sections.cc (class Sections_element): Add set_is_relro
9472 virtual function. Add new bool* parameter to place_orphan_here.
9473 Add get_output_section virtual function.
9474 (class Output_section_definition): Add set_is_relro. Add new
9475 bool* parameter to place_orphan_here. Add get_output_section.
9476 Add is_relro_ field.
9477 (Output_section_definition::Output_section_definition): Initialize
9478 evaluated_address_, evaluated_load_address, evaluated_addralign_,
9479 and is_relro_ fields.
9480 (Output_section_definition::place_orphan_here): Add is_relro
9481 parameter.
9482 (Output_section_definition::set_section_addresses): Set relro for
9483 output section.
9484 (Output_section_definition::alternate_constraint): Likewise.
9485 (class Orphan_output_section): Add new bool* parameter to
9486 place_orphan_here. Add get_output_section.
9487 (Orphan_output_section::place_orphan_here): Add is_relro
9488 parameter.
9489 (Script_sections::Script_sections): Initialize
9490 data_segment_align_index_ and saw_relro_end_.
9491 (Script_sections::data_segment_align): New function.
9492 (Script_sections::data_segment_relro_end): New function.
9493 (Script_sections::place_orphan): Set or clear is_relro.
9494 (Script_sections::set_section_addresses): Force alignment of first
9495 TLS section.
9496 * yyscript.y (exp): Call script_data_segment_align and
9497 script_data_segment_relro_end.
9498 * testsuite/relro_script_test.t: New file.
9499 * testsuite/relro_test.cc (using_script): Declare.
9500 (t1, t2): Test using_script.
9501 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
9502 (relro_script_test_SOURCES): Define.
9503 (relro_script_test_DEPENDENCIES): Define.
9504 (relro_script_test_LDFLAGS): Define.
9505 (relro_script_test_LDADD): Define.
9506 (relro_script_test.so): New target.
9507 * testsuite/Makefile.in: Rebuild.
9508
f827c9a9
CC
95092008-08-06 Cary Coutant <ccoutant@google.com>
9510
9511 * archive.cc (Archive::total_archives, Archive::total_members)
9512 (Archive::total_members_loaded): New variables.
9513 (Archive::setup): Add parameter. Add option to preread
9514 archive symbols.
9515 (Archive::read_armap): Add counter.
9516 (Archive::get_file_and_offset): New function.
9517 (Archive::get_elf_object_for_member): New function.
9518 (Archive::read_all_symbols): New function.
9519 (Archive::read_symbols): New function.
9520 (Archive::add_symbols): Add counters.
9521 (Archive::include_all_members): Use armap to find members if it's
9522 already built.
9523 (Archive::include_member): Skip reading symbols if already read.
9524 Factored code into Archive::get_file_and_offset and
9525 Archive::get_elf_object_for_member. Changed call to
9526 Mapfile::report_include_archive_member.
9527 (Archive::print_stats): New function.
9528 * archive.h: Declare Object and Read_symbols_data classes.
9529 (Archive::Archive): Add initializers for new members.
9530 (Archive::setup): Add parameter.
9531 (Archive::print_stats): New function.
9532 (Archive::total_archives, Archive::total_members)
9533 (Archive::total_members_loaded): New variables.
9534 (Archive::get_file_and_offset): New function.
9535 (Archive::get_elf_object_for_member): New function.
9536 (Archive::read_all_symbols): New function.
9537 (Archive::read_symbols): New function.
9538 (Archive::Archive_member): New class.
9539 (Archive::members_): New member.
9540 (Archive::num_members_): New member.
9541 * main.cc: Include archive.h.
9542 (main): Call Archive::print_stats.
9543 * mapfile.cc (Mapfile::report_include_archive_member): Delete
9544 archive parameter; member_name is now the fully-decorated name.
9545 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
9546 * options.h: (General_options): Add --preread-archive-symbols option.
9547 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
9548 Archive::setup.
9549
de4c45bd
ILT
95502008-08-04 Ian Lance Taylor <iant@google.com>
9551
9552 * symtab.h (Symbol::use_plt_offset): New function.
9553 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
9554 * powerpc.cc (Relocate::relocate): Likewise.
9555 * sparc.cc (Relocate::relocate): Likewise.
9556 * x86_64.cc (Relocate::relocate): Likewise.
9557 * testsuite/weak_plt.sh: New test.
9558 * testsuite/weak_plt_main.cc: New test.
9559 * testsuite/weak_plt_shared.cc: New test.
9560 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
9561 (check_PROGRAMS): Add weak_plt.
9562 (check_DATA): Add weak_plt_shared.so.
9563 (weak_plt_main_pic.o, weak_plt): New targets.
9564 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
9565 * testsuite/Makefile.in: Rebuild.
9566
9567 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
9568 gcctestdir/ld.
9569 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
9570 * testsuite/Makefile.in: Rebuild.
9571
323ee3f4
AM
95722008-08-04 Alan Modra <amodra@bigpond.net.au>
9573
9574 * Makefile.am (POTFILES.in): Set LC_ALL=C.
9575 * Makefile.in: Regenerate.
9576 * po/POTFILES.in: Regenerate.
9577
7c07ecec
ILT
95782008-07-29 Ian Lance Taylor <iant@google.com>
9579
9580 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
9581 symbols before other symbols.
9582 * testsuite/script_test_2.cc (test_addr): Declare.
9583 (test_addr_alias): Declare.
9584 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9585 values.
7c07ecec
ILT
9586 * testsuite/script_test_2.t: Define test_addr_alias and
9587 test_addr.
9588
5778530e
ILT
95892008-07-24 Ian Lance Taylor <iant@google.com>
9590
2a00e4fb
ILT
9591 PR 5990
9592 * descriptors.cc: New file.
9593 * descriptors.h: New file.
9594 * gold-threads.h (class Hold_optional_lock): New class.
9595 * fileread.cc: Include "descriptors.h".
9596 (File_read::~File_read): Release descriptor rather than closing
9597 it.
9598 (File_read::open) [file]: Call open_descriptor rather than open.
9599 Set is_descriptor_opened_.
9600 (File_read::open) [memory]: Assert that descriptor is not open.
9601 (File_read::reopen_descriptor): New function.
9602 (File_read::release): Release descriptor.
9603 (File_read::do_read): Make non-const. Reopen descriptor.
9604 (File_read::read): Make non-const.
9605 (File_read::make_view): Reopen descriptor.
9606 (File_read::do_readv): Likewise.
9607 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9608 Update declarations.
9609 * layout.cc: Include "descriptors.h".
9610 (Layout::create_build_id): Use open_descriptor rather than open.
9611 * output.cc: Include "descriptors.h".
9612 (Output_file::open): Use open_descriptor rather than open.
9613 * archive.cc (Archive::const_iterator): Change Archive to be
9614 non-const.
9615 (Archive::begin, Archive::end): Make non-const.
9616 (Archive::count_members): Likewise.
9617 * archive.h (class Archive): Update declarations.
9618 * object.h (Object::read): Make non-const.
9619 * Makefile.am (CCFILES): Add descriptors.cc.
9620 (HFILES): Add descriptors.h.
9621 * Makefile.in: Rebuild.
9622
801647d1
ILT
9623 PR 6716
9624 * gold.h: Always include <clocale>. Add Solaris workarounds
9625 following code in binutils/sysdep.h.
9626
5edd166e
ILT
9627 PR 6048
9628 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9629 this->eh_frame_hdr_ is NULL before using it.
9630
c89ad728
ILT
9631 * dynobj.cc (Versions::Versions): Update comment.
9632
aa86f06b
ILT
9633 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9634 the base version name.
9635
5778530e
ILT
9636 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9637 array size plus one.
9638 (Stringpool_template::set_string_offsets): Subtract one from key
9639 before using it as an array index.
9640 (Stringpool_template::get_offset_with_length): Likewise.
9641 (Stringpool_template::write_to_buffer): Likewise.
9642 * stringpool.h (Stringpool_template::get_offset_from_key):
9643 Likewise.
9644
057ead22
ILT
96452008-07-23 Ian Lance Taylor <iant@google.com>
9646
7f649c59
ILT
9647 PR 6658
9648 * object.h (Merged_symbol_value::value): Do our best to handle a
9649 negative addend.
9650
057ead22
ILT
9651 PR 6647
9652 * script.cc (Version_script_info::get_versions): Don't add empty
9653 version tag to return value.
9654 (Version_script_info::get_symbol_version_helper): Change return
9655 type to bool. Add pversion parameter. Change all callers.
9656 (script_register_vers_node): Don't require a non-NULL tag.
9657 * script.h (class Version_script_info): Update declarations.
9658 (Version_script_info::get_symbol_version): Change return type to
9659 bool. Add version parameter. Change all callers.
9660 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
9661 handling. Handle an empty version from a version script.
9662 (Symbol_table::define_special_symbol): Likewise.
9663 * testsuite/ver_test_10.script: New file.
9664 * testsuite/ver_test_10.sh: New file.
9665 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
9666 (check_DATA): Add ver_test_10.syms.
9667 (ver_test_10.syms, ver_test_10.so): New target.
9668 * testsuite/Makefile.in: Rebuild.
9669
58e54ac2
CD
96702008-07-23 Simon Baldwin <simonb@google.com>
9671
9672 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
9673 to zero for undefined symbols from dynamic libraries.
9674
95d14cd3
ILT
96752008-07-23 Ian Lance Taylor <iant@google.com>
9676
9677 * symtab.cc (Symbol_table::resolve): Remove version parameter.
9678 Change all callers.
9679 * symtab.h (class Symbol_table): Update declaration.
9680 * testsuite/ver_test_9.cc: New file.
9681 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
9682 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9683 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
9684 (ver_test_9.so, ver_test_9.o): New targets.
9685 * testsuite/Makefile.in: Rebuild.
9686
92de84a6
ILT
96872008-07-22 Ian Lance Taylor <iant@google.com>
9688
34810851
ILT
9689 * options.h (class General_options): Define --check-sections.
9690 * layout.cc (Layout::set_segment_offsets): Handle
9691 --check-sections.
9692
af6156ef
ILT
9693 * options.h (class General_options): Define -n/--nmagic and
9694 -N/--omagic.
9695 * options.cc (General_options::finalize): For -n/--nmagic or
9696 -N/--omagic, set -static.
9697 * layout.cc (Layout::attach_allocated_section_to_segment): If
9698 -N/--omagic, don't put read-only and read-write sections in
9699 different segments.
9700 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
9701 finding a read-only segment.
9702 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
9703 don't set the minimum segment alignment to the common page size,
9704 and don't set the file offset to the address modulo the page size.
9705 * script-sections.cc (Script_sections::create_segments): If
9706 -n/--omagic, don't put read-only and read-write sections in
9707 different segments.
9708
92de84a6
ILT
9709 * cref.cc: New file.
9710 * cref.h: New file.
9711 * options.h (class General_options): Add --print-symbol-counts.
9712 * main.cc (main): Issue defined symbol report if requested.
9713 * archive.cc (Archive::interpret_header): Make into a const member
9714 function.
9715 (Archive::add_symbols): Call Input_objects::archive_start and
9716 archive_stop.
9717 (Archive::const_iterator): Define new class.
9718 (Archive::begin, Archive::end): New functions.
9719 (Archive::include_all_members): Rewrite to use iterator.
9720 (Archive::count_members): New function.
9721 * archive.h (class Archive): Update declarations.
9722 (Archive::filename): New function.
9723 * object.cc: Include "cref.h".
9724 (Sized_relobj::Sized_relobj): Initialize defined_count_.
9725 (Sized_relobj::do_get_global_symbol_counts): New function.
9726 (Input_objects::add_object): Add object to cross-referencer.
9727 (Input_objects::archive_start): New function.
9728 (Input_objects::archive_stop): New function.
9729 (Input_objects::print_symbol_counts): New function.
9730 * object.h: Declare Cref and Archive.
9731 (Object::get_global_symbol_counts): New function.
9732 (Object::do_get_global_symbol_counts): New pure virtual function.
9733 (class Sized_relobj): Add defined_count_ field. Update
9734 declarations.
9735 (class Input_objects): Add cref_ field. Update constructor.
9736 Update declarations.
9737 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
9738 defined_count_.
9739 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
9740 symbol counts.
9741 (Sized_dynobj::do_get_global_symbol_counts): New function.
9742 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
9743 defined_count_. Update declarations. Define Symbols typedef.
9744 * symtab.cc (Symbol_table::add_from_relobj): Add defined
9745 parameter. Change all callers.
9746 (Symbol_table::add_from_dynobj): Add sympointers and defined
9747 parameters. Change all callers.
9748 * symtab.h (class Symbol_table): Update declarations.
9749 * Makefile.am (CCFILES): Add cref.cc.
9750 (HFILES): Add cref.h.
9751 * Makefile.in: Rebuild.
9752
3f7c5e1d
CD
97532008-07-22 Simon Baldwin <simonb@google.com>
9754
9755 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
9756 to zero when writing undefined symbols.
9757
e0b64032
ILT
97582008-07-22 Ian Lance Taylor <iant@google.com>
9759
9760 * output.cc (Output_section::add_input_section): Don't try to
9761 merge empty merge sections.
9762
096b02cf
CS
97632008-07-21 Craig Silverstein <csilvers@google.com>
9764
9765 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9766 Include symbol version in error message.
cd536b21 9767
1d1f116d
CD
97682008-07-20 Chris Demetriou <cgd@google.com>
9769
cd536b21 9770 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
9771 (RANDOM_SEED_CFLAGS): New substituted variable.
9772 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
9773 * configure: Rebuild.
9774 * Makefile.in: Likewise.
9775 * testsuite/Makefile.in: Likewise.
9776
a18f591e
ILT
97772008-07-18 Ian Lance Taylor <iant@google.com>
9778
9779 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
9780 where we see NAME/NULL and NAME/VERSION as separate symbols.
9781 * testsuite/ver_test_main.cc (main): Call t4.
9782 (t4, t4_2a): Define.
9783 * testsuite/ver_test_2.cc (t4_2): Define.
9784 * testsuite/ver_test_2.script: Put t4_2a in VER2.
9785 * testsuite/ver_test_4.cc (t4_2a): Define.
9786 * testsuite/ver_test_4.script: Put t4_2a in VER2.
9787 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
9788
c6e3f6ed
ILT
97892008-07-17 Ian Lance Taylor <iant@google.com>
9790
9791 * dynobj.cc (Versions::add_def): If we give an error about a
9792 missing version, go ahead and create the version anyhow.
9793
ef9beddf
ILT
97942008-07-10 Ian Lance Taylor <iant@google.com>
9795
9796 Handle output sections with more than 0x7fffffff bytes.
9797 * object.h (class Relobj): Change map_to_output_ to
9798 output_sections_, and just keep a section pointer. Change all
9799 uses. Move comdat group support to Sized_relobj.
9800 (Relobj::is_section_specially_mapped): Remove.
9801 (Relobj::output_section): Remove poff parameter. Change all
9802 callers.
9803 (Relobj::output_section_offset): New function.
9804 (Relobj::set_section_offset): Rewrite.
9805 (Relobj::map_to_output): Remove.
9806 (Relobj::output_sections): New function.
9807 (Relobj::do_output_section_offset): New pure virtual function.
9808 (Relobj::do_set_section_offset): Likewise.
9809 (class Sized_relobj): Add section_offsets_ field. Add comdat
9810 group support from Relobj. Update declarations.
9811 (Sized_relobj::get_output_section_offset): New function.
9812 (Sized_relobj::do_output_section_offset): New function.
9813 (Sized_relobj::do_set_section_offset): New function.
9814 * object.cc (Relobj::output_section_address): Remove.
9815 (Sized_relobj::Sized_relobj): Initialize new fields.
9816 (Sized_relobj::include_section_group): Cast find_kept_object to
9817 Sized_relobj.
9818 (Sized_relobj::include_linkonce_section): Likewise.
9819 (Sized_relobj::do_layout): Use separate arrays for output section
9820 and output offset.
9821 (Sized_relobj::do_count_local_symbols): Change map_to_output to
9822 output_sections.
9823 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
9824 output_sections and section_offsets.
9825 (Sized_relobj::write_local_symbols): Likewise.
9826 (map_to_kept_section): Compute output address directly.
9827 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
9828 output_sections and section_offsets.
9829 (Sized_relobj::write_sections): Likewise.
9830 (Sized_relobj::relocate_sections): Likewise.
9831 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
9832 * output.h (class Output_reloc): Update declarations. Change
9833 u2_.relobj to Sized_relobj*.
9834 (class Output_data_reloc): Change add functions to use
9835 Sized_relobj*.
9836 * output.cc (Output_reloc::Output_reloc): Change relobj to
9837 Sized_relobj*.
9838 (Output_reloc::local_section_offset): Change return type to
9839 Elf_Addr. Use get_output_section_offset.
9840 (Output_reloc::get_address): Likewise.
9841 (Output_section::is_input_address_mapped): Don't call
9842 is_section_specially_mapped.
9843 (Output_section::output_offset): Likewise.
9844 (Output_section::output_address): Likewise.
9845 (Output_section::starting_output_address): Likewise.
9846 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
9847 parameter to Sized_relobj*.
9848 (Copy_relocs::need_copy_reloc): Likewise.
9849 (Copy_relocs::save): Likewise.
9850 * copy-relocs.h (class Copy_relocs): Update declarations.
9851 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
9852 Sized_relobj*. Change relobj_ field to Sized_relobj*.
9853 * target-reloc.h (relocate_for_relocatable): Change
9854 offset_in_output_section type to Elf_Addr. Change code that uses
9855 it as well.
9856 * layout.cc (Layout::layout): Always set *off.
9857 * mapfile.cc (Mapfile::print_input_section): Use
9858 output_section_offset.
9859 * i386.cc (Target_i386::copy_reloc): Change object parameter to
9860 Sized_relobj*.
9861 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
9862 * sparc.cc (Target_sparc::copy_reloc): Likewise.
9863 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
9864
5cb66f97
ILT
98652008-07-03 Ian Lance Taylor <iant@google.com>
9866
9867 * layout.cc (Layout::include_section): Do not discard unrecognized
9868 SHT_STRTAB sections.
9869
afe47622
CS
98702008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
9871
9872 * script.cc (Lex::can_continue_name): Make '?' allowable in
9873 version-script names.
9874 * testsuite/version_script.map: Change glob pattern to use '?'
9875
5adf9721
ILT
98762008-06-30 Manish Singh <yosh@gimp.org>
9877
9878 PR 6585
9879 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
9880 Correct typo.
9881
e6fde208
ILT
98822008-06-30 Ian Lance Taylor <iant@google.com>
9883
9884 PR 6660
9885 PR 6682
9886 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
9887 versions]: Don't try to read the value in the contents, since we
9888 don't use it. Use the template endianness when writing.
9889
3f2e6a2d
CC
98902008-06-25 Cary Coutant <ccoutant@google.com>
9891
9892 * fileread.cc (File_read::make_view): Assert on zero-length view.
9893 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
9894 symbol table when there are no symbols to read.
9895
c43d3a48
CS
98962008-06-23 Craig Silverstein <csilvers@google.com>
9897
9898 * version.cc (version_string): Bump to 1.7
9899
5f494ea0
CS
99002008-06-18 Craig Silverstein <csilvers@google.com>
9901
9902 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9903 constant 0xFFFF to type Valtype.
9904 (Powerpc_relocate_functions::rel16_ha): Likewise.
9905
c42e122e
ILT
99062008-06-17 Ian Lance Taylor <iant@google.com>
9907
f34787f8
ILT
9908 * output.h (Output_section::Input_section): Initialize p2align_ to
9909 zero for Output_section_data constructors.
9910 (Output_section::Input_section::addralign): If not an input
9911 section, return the alignment of the Output_section_data.
9912 * testsuite/copy_test.cc: New file.
9913 * testsuite/copy_test_1.cc: New file.
9914 * testsuite/copy_test_2.cc: New file.
9915 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9916 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9917 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9918 (copy_test_1_pic.o, copy_test_1.so): New targets.
9919 (copy_test_2_pic.o, copy_test_2.so): New targets.
9920 * testsuite/Makefile.in: Rebuild.
9921
c42e122e
ILT
9922 * script-sections.cc (Script_sections::place_orphan): Initialize
9923 local variable exact.
9924
ce3ac18a
DE
99252008-06-13 David Edelsohn <edelsohn@gnu.org>
9926
9927 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9928
42cacb20
DE
99292008-06-12 David Edelsohn <edelsohn@gnu.org>
9930 David S. Miller <davem@davemloft.net>
9931
9932 * powerpc.cc: New file.
9933 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9934 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9935 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9936 * Makefile.in: Rebuild.
9937
7b308235
ILT
99382008-06-09 Ian Lance Taylor <iant@google.com>
9939
9940 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9941 <exception>.
9942 (throwing, orig_terminate): New static variables.
9943 (terminate_handler): New static function.
9944 (t2): Set terminate handler.
9945
f0b886e3
ILT
99462008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9947
9948 PR 6584
cd536b21 9949 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9950 alignment.
9951
3e90f135
CC
99522008-05-30 Cary Coutant <ccoutant@google.com>
9953
9954 * archive.cc (Archive::include_all_members) Correct to step
9955 over symbol table and extended name table in thin archives.
9956
e09ad04a
ILT
99572008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9958
9959 PR 6407
9960 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9961 calculation.
9962
62b01cb5
ILT
99632008-05-28 Caleb Howe <cshowe@google.com>
9964
9965 * reduced_debug_output.cc: New file.
9966 * reduced_debug_output.h: New file.
92de84a6 9967 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9968 * options.cc (General_options::finalize): Add strip_debug_non_line
9969 to the strip heirarchy.
9970 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9971 fields.
9972 * layout.cc: Include "reduced_debug_output.h".
9973 (Layout::Layout): Initialize new fields.
9974 (line_only_debug_sections): New static array.
9975 (is_lines_only_debug_sections): New static inline function.
9976 (Layout::include_section): Handle --strip-debug-non-line.
9977 (Layout::make_output_section): If --strip-debug-non-line, build
9978 new output sections for .debug_abbrev and .debug_info.
9979 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9980 gold. Warn about possible overflow.
9981 (read_signed_LEB_128): Likewise.
9982 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9983 (read_signed_LEB_128): Declare.
9984 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9985 (HFILES): Add reduced_debug_output.h.
9986 * Makefile.in: Rebuild.
9987
7d9e3d98
ILT
99882008-05-21 Ian Lance Taylor <iant@google.com>
9989
9990 * mapfile.cc: New file.
9991 * mapfile.h: New file.
9992 * options.h (class General_options): Add -M/--print-map and -Map.
9993 * options.cc (General_options::finalize): Make -M equivalent to
9994 -Map -.
9995 * main.cc: Include <cstdio> and "mapfile.h".
9996 (main): Open mapfile if requested.
9997 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9998 constructor. Change caller.
9999 (queue_initial_tasks): Add mapfile parameter. Change caller.
10000 (queue_middle_tasks): Likewise.
10001 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
10002 declarations.
10003 * archive.cc: Include "mapfile.h".
10004 (Archive::add_symbols): Add mapfile parameter. Change all
10005 callers. Pass mapfile, symbol, and reason to include_member.
10006 (Archive::include_all_members): Add mapfile parameter. Change all
10007 callers.
10008 (Archive::include_member): Add mapfile, sym, and why parameters.
10009 Change all callers. Report inclusion to map file.
10010 * archive.h: Include "fileread.h".
10011 (class Archive): Update declarations.
10012 (Archive::file): New const method.
10013 (class Add_archive_symbols): Add mapfile_ field. Update
10014 constructor. Change all callers.
10015 * readsyms.h (class Read_symbols): Likewise.
10016 (class Finish_group): Likewise.
10017 (class Read_script): Likewise.
10018 * common.cc: Include "mapfile.h".
10019 (Symbol_table::allocate_commons): Add mapfile parameter. Change
10020 all callers.
10021 (Symbol_table::do_allocate_commons): Likewise.
10022 (Symbol_table::do_allocate_commons_list): Likewise. Report common
10023 symbol allocation to mapfile.
10024 * common.h (class Allocate_commons_task): Add mapfile_ field.
10025 Update constructor. Change all callers.
10026 * symtab.h (class Symbol_table): Update declarations.
10027 * layout.cc: Include "mapfile.h".
10028 (Layout_task_runner::run): Print information to mapfile.
10029 (Layout::create_gold_note): Change Output_data_fixed_space to
10030 Output_data_zero_fill.
10031 (Layout::create_build_id): Likewise.
10032 (Layout::print_to_mapfile): New function.
10033 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
10034 constructor. Change caller.
10035 (class Layout): Declare print_to_mapfile.
10036 * output.cc (Output_section::Input_section::print_to_mapfile): New
10037 function.
10038 (Output_section::add_input_section): If producing a map, always
10039 add to input_sections_ list.
10040 (Output_section::do_print_to_mapfile): New function.
10041 (Output_segment::print_sections_to_mapfile): New function.
10042 (Output_segment::print_section_list_to_mapfile): New function.
10043 * output.h: Include "mapfile.h".
10044 (Output_data::print_to_mapfile): New function.
10045 (Output_data::do_print_to_mapfile): New virtual function.
10046 (Output_segment_headers::do_print_to_mapfile): New function.
10047 (Output_file_header::do_print_to_mapfile): New function.
10048 (Output_data_const::do_print_to_mapfile): New function.
10049 (class Output_data_const_buffer): Add map_name_ field. Update
10050 constructor. Change all callers. Add do_print_to_mapfile
10051 function.
10052 (class Output_data_fixed_space): Likewise.
10053 (class Output_data_space): Likewise.
10054 (class Output_data_zero_fill): New class.
10055 (Output_data_strtab::do_print_to_mapfile): New function.
10056 (Output_data_reloc_base::do_print_to_mapfile): New function.
10057 (Output_relocatable_relocs::do_print_to_mapfile): New function.
10058 (Output_data_group::do_print_to_mapfile): New function.
10059 (Output_data_got::do_print_to_mapfile): New function.
10060 (Output_data_dynamic::do_print_to_mapfile): New function.
10061 (Output_symtab_xindex::do_print_to_mapfile): New function.
10062 (class Output_section): Declare do_print_to_mapflie. Declare
10063 print_to_mapfile in Input_section.
10064 (class Output_segment): Declare new functions.
10065 * object.h (Sized_relobj::symbol_count): New function.
10066 * script-sections.cc
10067 (Output_section_element_dot_assignment::set_section_addresses):
10068 Change Output_data_fixed_space to Output_data_zero_fill.
10069 (Output_data_expression::do_print_to_mapfile): New function.
10070 * script.cc (read_input_script): Add mapfile parameter. Change
10071 all callers.
10072 * script.h (read_input_script): Update declaration.
10073 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10074 (Eh_frame::do_print_to_mapfile): New function.
10075 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10076 (Output_merge_string::do_print_to_mapfile): New function.
10077 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10078 function.
10079 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10080 function.
10081 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10082 function.
10083 * Makefile.am (CCFILES): Add mapfile.cc.
10084 (HFILES): Add mapfile.h.
10085 * Makefile.in: Rebuild.
10086
9f1d377b
ILT
100872008-05-19 Ian Lance Taylor <iant@google.com>
10088
10089 * options.h (class General_options): Add -z relro.
10090 * layout.cc (Layout::Layout): Initialize relro_segment_.
10091 (Layout::add_output_section_data): Return the output section.
10092 (Layout::make_output_section): Rcognize relro sections and mark
10093 them appropriately.
10094 (Layout::attach_allocated_section_to_segment): Put relro sections
10095 in a PT_GNU_RELRO segment.
10096 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10097 section as relro.
10098 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10099 PT_TLS segments.
10100 (Layout::linkonce_mapping): Map d.rel.ro.local to
10101 .data.rel.ro.local.
10102 (Layout::output_section_name): Us .data.rel.ro.local for any
10103 section which begins with that.
10104 * layout.h (class Layout): Update add_output_section_data
10105 declaration. Add relro_segment_ field.
10106 * output.cc (Output_section::Output_section): Initialize is_relro_
10107 and is_relro_local_ fields.
10108 (Output_segment::add_output_section): Group relro sections.
10109 (Output_segment::is_first_section_relro): New function.
10110 (Output_segment::maximum_alignment): If there is a relro section,
10111 align the segment to the common page size.
10112 (Output_segment::set_section_addresses): Track whether we are
10113 looking at relro sections. If the last section is a relro
10114 section, align to the common page size.
10115 (Output_segment::set_section_list_addresses): Add in_relro
10116 parameter. Change all callers. Align to the page size when
10117 moving from relro to non-relro section.
10118 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10119 segment.
10120 * output.h (class Output_section): Add is_relro_ and
10121 is_relro_local_ fields.
10122 (Output_section::is_relro): New function.
10123 (Output_section::set_is_relro): New function.
10124 (Output_section::is_relro_local): New function.
10125 (Output_section::set_is_relro_local): New function.
10126 (class Output_segment): Update declarations.
10127 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10128 * sparc.cc (Target_sparc::got_section): Likewise.
10129 * x86_64.cc (Target_x86_64::got_section): Likewise.
10130 * testsuite/relro_test_main.cc: New file.
10131 * testsuite/relro_test.cc: New file.
10132 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10133 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10134 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10135 (relro_test.so, relro_test_pic.o): New targets.
10136 * testsuite/Makefile.in: Rebuild.
10137
a984ee1d
ILT
101382008-05-16 Ian Lance Taylor <iant@google.com>
10139
01676dcd
ILT
10140 * output.cc (Output_segment::add_output_section): Remove front
10141 parameter.
10142 * output.h (class Output_segment): Remove
10143 add_initial_output_section and overloaded add_output_section.
10144 Update declaration of remaining add_output_section.
10145 * layout.cc (Layout::create_interp): Call add_output_section
10146 rather than add_initial_output_section.
10147 (Layout::finish_dynamic_section): Likewise.
10148
497897f9
ILT
10149 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10150 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10151 know the dynamic type.
10152 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10153 field. Initialize it in constructor.
10154 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10155 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10156 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10157 reloc.
10158
a984ee1d
ILT
10159 * output.cc (Output_reloc::get_address): Change return type to
10160 Elf_Addr.
10161 * output.h (class Output_reloc): Update get_address declaration.
10162 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10163 for section addresses.
10164
55ba0940
ILT
101652008-05-09 Ian Lance Taylor <iant@google.com>
10166
10167 PR 6493
10168 * gold.cc (gold_nomem): Use return value of write.
10169
75517b77
ILT
101702008-05-08 Ian Lance Taylor <iant@google.com>
10171
10172 * symtab.c (Symbol::init_base_output_data): Add version
10173 parameter. Change all callers.
10174 (Symbol::init_base_output_segment): Likewise.
10175 (Symbol::init_base_constant): Likewise.
10176 (Symbol::init_base_undefined): Likewise.
10177 (Sized_symbol::init_output_data): Likewise.
10178 (Sized_symbol::init_output_segment): Likewise.
10179 (Sized_symbol::init_constant): Likewise.
10180 (Sized_symbol::init_undefined): Likewise.
10181 (Symbol_table::do_define_in_output_data): If the new symbol has a
10182 version, mark it as the default.
10183 (Symbol_table::do_define_in_output_segment): Likewise.
10184 (Symbol_table::do_define_as_constant): Likewise.
10185 * symtab.h (class Symbol): Update declarations.
10186 (class Sized_symbol): Likewise.
10187 * resolve.cc (Symbol::override_version): New function.
c42e122e 10188 (Symbol::override_base): Call override_version.
75517b77
ILT
10189 (Symbol::override_base_with_special): Likewise.
10190 * testsuite/ver_script_8.script: New file.
10191 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10192 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10193 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10194 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10195
f1f70eae
ILT
101962008-05-06 Ian Lance Taylor <iant@google.com>
10197
f3e9c5c5
ILT
10198 PR 6049
10199 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10200 functions.
10201 (class General_options): Remove existing --undefined, and add
10202 --no-undefined instead. Add new --undefined as synonym for -u.
10203 * archive.cc (Archive::add_symbols): Check whether symbol was
10204 named with -u.
10205 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10206 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10207 all uses. Add IS_UNDEFINED. Update declarations to split
10208 different versions of init_base. Declare init_base_undefined.
10209 (Symbol::is_defined): Handle IS_UNDEFINED.
10210 (Symbol::is_undefined): Likewise.
10211 (Symbol::is_weak_undefined): Call is_undefined.
10212 (Symbol::is_absolute): Handle IS_CONSTANT.
10213 (class Sized_symbol): Update declarations to split different
10214 versions of init. Declare init_undefined.
10215 (class Symbol_table): Declare new functions.
10216 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10217 Change all callers.
10218 (Symbol::init_base_output_data): Likewise.
10219 (Symbol::init_base_output_segment): Likewise.
10220 (Symbol::init_base_constant): Likewise.
10221 (Symbol::init_base_undefined): New function.
10222 (Sized_symbol::init_object): Rename from init. Change all
10223 callers.
10224 (Sized_symbol::init_output_data): Likewise.
10225 (Sized_symbol::init_output_segment): Likewise.
10226 (Sized_symbol::init_constant): Likewise.
10227 (Sized_symbol::init_undefined): New function.
10228 (Symbol_table::add_undefined_symbols_from_command_line): New
10229 function.
10230 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10231 function.
10232 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10233 (Symbol::output_section): Likewise.
10234 (Symbol::set_output_section): Likewise.
10235 (Symbol_table::sized_finalize_symbol): Likewise.
10236 (Symbol_table::sized_write_globals): Likewise.
10237 * resolve.cc (Symbol_table::should_override): Likewise.
10238 (Symbol::override_base_with_special): Likewise.
10239
8bdcdf2c
ILT
10240 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10241 symbol, change it to have default visibility.
10242 * testsuite/protected_1.cc: New file.
10243 * testsuite/protected_2.cc: New file.
10244 * testsuite/protected_3.cc: New file.
10245 * testsuite/protected_main_1.cc: New file.
10246 * testsuite/protected_main_2.cc: New file.
10247 * testsuite/protected_main_3.cc: New file.
10248 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10249 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10250 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10251 (protected_1.so): New target.
10252 (protected_1_pic.o, protected_2_pic.o): New targets.
10253 (protected_3_pic.o): New target.
10254 (check_PROGRAMS): Add protected_2.
10255 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10256 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10257 * testsuite/Makefile.in: Rebuild.
10258
2b706932
ILT
10259 * options.h (DEFINE_var): Add set_user_set_##varname__.
10260 (DEFINE_bool_alias): New macro.
10261 (class General_options): Define -Bstatic using DEFINE_bool_alias
10262 rather than DEFINE_special. Add --undefined as an alias for -z
10263 defs.
10264 * options.cc (General_options::parse_Bstatic): Remove.
10265
d82a5bcc
ILT
10266 * options.h (class General_options): Add --fatal-warnings.
10267 * main.cc (main): Implement --fatal-warnings.
10268 * errors.h (Errors::warning_count): New function.
10269
f1f70eae
ILT
10270 * options.h (class General_options): Add -Bsymbolic-functions.
10271 * symtab.h (Symbol::is_preemptible): Check for
10272 -Bsymbolic-functions.
10273
8825ac63
ILT
102742008-05-05 Ian Lance Taylor <iant@google.com>
10275
d98bc257
ILT
10276 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10277 as noVARNAME rather than no-VARNAME.
10278 (class General_options): Add option -z combreloc.
10279 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10280 get_address.
10281 (Output_reloc::sort_before) [SHT_REL]: New function.
10282 (Output_reloc::sort_before) [SHT_RELA]: New function.
10283 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10284 Sort_relocs_comparison.
10285 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10286 parameter. Change all callers.
10287 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10288 sort_relocs parameter. Change all callers.
10289 * output.cc (Output_reloc::get_address): New function, broken out
10290 of write_rel.
10291 (Output_reloc::write_rel): Call it.
10292 (Output_reloc::compare): New function.
10293 (Output_data_reloc_base::do_write): Optionally sort relocs.
10294
60b2b4e7
ILT
10295 * configure.ac: If targ_extra_obj is set, link it in.
10296 * configure.tgt: Initialize all variables.
10297 (x86_64*): Set targ_extra_obj and targ_extra_size.
10298 * configure: Rebuild.
10299
8825ac63
ILT
10300 * object.cc (Sized_relobj::include_section_group): Adjust section
10301 indexes read from group data. Build vector to pass to
10302 layout_group.
10303 * layout.cc (Layout::layout_group): Add flags and shndxes
10304 parameters. Remove contents parameter. Change caller. Update
10305 explicit instantiations.
10306 * layout.h (class Layout): Update layout_group declaration.
10307 * output.cc (Output_data_group::Output_data_group): Add flags and
10308 input_shndxes parameters. Remove contents parameter. Change
10309 caller.
10310 (Output_data_group::do_write): Change input_sections_ to
10311 input_shndxes_.
10312 * output.h (class Output_data_group): Update constructor
10313 declaration. Rename input_sections_ to input_shndxes_.
10314 * testsuite/many_sections_test.cc: Add template.
10315
e94cf127
CC
103162008-04-30 Cary Coutant <ccoutant@google.com>
10317
4418b2d5
CC
10318 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10319
e94cf127
CC
10320 * layout.cc (Layout::include_section): Refactored check for debug
10321 info section.
10322 (Layout::add_comdat): Add new parameters. Change type
10323 of signature parameter. Add object and shndx to signatures table.
10324 (Layout::find_kept_object): New function.
10325 * layout.h: Include <cstring>.
10326 (Layout::is_debug_info_section): New function.
10327 (Layout::add_comdat): Add new parameters.
10328 (Layout::find_kept_object): New function.
10329 (Layout::Kept_section): New struct.
10330 (Layout::Signatures): Change type of map range.
10331 * object.cc (Relobj::output_section_address): New function.
10332 (Sized_relobj::include_section_group): Add new parameters. Change
10333 calls to Layout::add_comdat. Change to build table of kept comdat
10334 groups and table mapping discarded sections to kept sections.
10335 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
10336 (Sized_relobj::do_layout): Change calls to include_section_group and
10337 include_linkonce_section.
10338 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
10339 value to zero when section is discarded.
10340 (Sized_relobj::map_to_kept_section): New function.
10341 * object.h (Relobj::output_section_address): New function.
10342 (Relobj::Comdat_group): New type.
10343 (Relobj::find_comdat_group): New function.
10344 (Relobj::Comdat_group_table): New type.
10345 (Relobj::Kept_comdat_section): New type.
10346 (Relobj::Kept_comdat_section_table): New type.
10347 (Relobj::add_comdat_group): New function.
10348 (Relobj::set_kept_comdat_section): New function.
10349 (Relobj::get_kept_comdat_section): New function.
10350 (Relobj::comdat_groups_): New field.
10351 (Relobj::kept_comdat_sections_): New field.
10352 (Symbol_value::input_value): Update comment.
10353 (Sized_relobj::map_to_kept_section) New function.
10354 (Sized_relobj::include_linkonce_section): Add new parameter.
10355 * target-reloc.h (Comdat_behavior): New type.
10356 (get_comdat_behavior): New function.
10357 (relocate_section): Add code to map a discarded section to the
10358 corresponding kept section when applying a relocation.
10359
e4e5049b
CS
103602008-04-30 Craig Silverstein <csilvers@google.com>
10361
10362 * dwarf_reader.cc (next_generation_count): New static var.
10363 (Addr2line_cache_entry): New struct.
10364 (addr2line_cache): New static var.
10365 (Dwarf_line_info::one_addr2line): Added caching.
10366 (Dwarf_line_info::clear_addr2line_cache): New function.
10367 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
10368 cache-size parameter.
10369 (Dwarf_line_info::one_addr2line_cache): New function.
10370 * symtab.cc (Symbol_table::detect_odr_violations): Pass
10371 new cache-size argument to one_addr2line(), and clear cache.
10372
d09e9154
CC
103732008-04-28 Cary Coutant <ccoutant@google.com>
10374
10375 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
10376 R_386_PC8 relocations.
10377
7ef73768
ILT
103782008-04-23 Ian Lance Taylor <iant@google.com>
10379
55438702
ILT
10380 * object.cc (Sized_relobj::include_section_group): Check for
10381 invalid section group.
10382
c165fb93
ILT
10383 * object.cc (make_elf_object): Correct test for 64-bit ELF file
10384 header size.
10385
7ef73768
ILT
10386 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
10387 than read for file header.
10388 * archive.cc (Archive::include_member): Likewise.
10389
6194aaab
L
103902008-04-23 Paolo Bonzini <bonzini@gnu.org>
10391
10392 * aclocal.m4: Regenerate.
10393 * configure: Regenerate.
10394
d491d34e
ILT
103952008-04-19 Ian Lance Taylor <iant@google.com>
10396
5ea2bac6
ILT
10397 * version.cc (version_string): Bump to 1.6.
10398
7bc3e21a
ILT
10399 * testsuite/Makefile.am (many_sections_r_test): New target.
10400 (many_sections_r_test_SOURCES): Remove.
10401 (many_sections_r_test_DEPENDENCIES): Remove.
10402 (many_sections_r_test_LDFLAGS): Remove.
10403 (many_sections_r_test_LDADD): Remove.
10404
7fcd3aa9
ILT
10405 * object.cc (Sized_relobj::do_add_symbols): Always pass
10406 local_symbol_count_ to add_from_relobj.
10407
4c94d6ae
ILT
10408 * testsuite/Makefile.am (many_sections_check.h): Only check one in
10409 every thousand variables.
10410 * testsuite/Makefile.in: Rebuild.
10411
d491d34e
ILT
10412 * object.cc (Xindex::initialize_symtab_xindex): New function.
10413 (Xindex::read_symtab_xindex): New function.
10414 (Xindex::sym_xindex_to_shndx): New function.
10415 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
10416 available.
10417 (Sized_relobj::do_initialize_xindex): New function.
10418 (Sized_relobj::do_read_symbols): Adjust section links.
10419 (Sized_relobj::symbol_section_and_value): Add is_ordinary
10420 parameter. Change all callers.
10421 (Sized_relobj::include_section_group): Adjust section links and
10422 symbol section indexes.
10423 (Sized_relobj::do_layout): Adjust section links.
10424 (Sized_relobj::do_count_local_symbols): Adjust section links and
10425 symbol section indexes.
10426 (Sized_relobj::do_finalize_local_symbols): Distinguish between
10427 ordinary and special symbols.
10428 (Sized_relobj::write_local_symbols): Add symtab_xindex and
10429 dynsym_xindex parameters. Change all callers. Adjust section
10430 links. Use SHN_XINDEX when needed.
10431 (Sized_relobj::get_symbol_location_info): Adjust section links.
10432 Don't get fooled by special symbols.
10433 * object.h (class Xindex): Define.
10434 (class Object): Add xindex_ parameter. Declare virtual functoin
10435 do_initialize_xindex.
10436 (Object::adjust_sym_shndx): New function.
10437 (Object::set_xindex): New protected function.
10438 (class Symbol_value): Add is_ordinary_shndx_ field.
10439 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
10440 (Symbol_value::value): Assert ordinary section.
10441 (Symbol_value::initialize_input_to_output_map): Likewise.
10442 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
10443 Change all callers.
10444 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
10445 all callers.
10446 (class Sized_relobj): Update declarations.
10447 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
10448 parameter. Change all callers.
10449 (Sized_relobj::adjust_shndx): New function.
10450 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
10451 field.
10452 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
10453 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
10454 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
10455 (Sized_dynobj::read_dynsym_section): Adjust section links.
10456 (Sized_dynobj::read_dynamic): Likewise.
10457 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
10458 section links.
10459 (Sized_dynobj::do_initialize_xindex): New function.
10460 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
10461 do_initialize_xindex.
10462 (Sized_dynobj::adjust_shndx): New function.
10463 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
10464 dynsym_xindex_ fields.
10465 (Layout::finalize): Add a call to set_section_indexes before
10466 creating the symtab sections.
10467 (Layout::set_section_indexes): Don't do anything if the section
10468 already has a section index.
10469 (Layout::create_symtab_sections): Add shnum parameter. Change
10470 caller. Create .symtab_shndx section if needed.
10471 (Layout::create_shdrs): Add shstrtab_section parameter. Change
10472 caller.
10473 (Layout::allocated_output_section_count): New function.
10474 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
10475 needed.
10476 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
10477 fields. Update declarations.
10478 (Layout::symtab_xindex): New function.
10479 (Layout::dynsym_xindex): New function.
10480 (class Write_symbols_task): Add layout_ field.
10481 (Write_symbols_task::Write_symbols_task): Add layout parameter.
10482 Change caller.
10483 * output.cc (Output_section_headers::Output_section_headers): Add
10484 shstrtab_section parameter. Change all callers.
10485 (Output_section_headers::do_sized_write): Store overflow values
10486 for section count and section string table section index in
10487 section header zero.
10488 (Output_file_header::do_sized_write): Check for overflow of
10489 section count and section string table section index.
10490 (Output_symtab_xindex::do_write): New function.
10491 (Output_symtab_xindex::endian_do_write): New function.
10492 * output.h (class Output_section_headers): Add shstrtab_section_.
10493 Update declarations.
10494 (class Output_symtab_xindex): Define.
10495 (Output_section::has_out_shndx): New function.
10496 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
10497 field.
10498 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
10499 Change all callers.
10500 (Sized_symbol::init): Likewise.
10501 (Symbol::output_section): Check for ordinary symbol.
10502 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
10503 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
10504 callers.
10505 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
10506 Change all callers. Simplify handling of symbols from sections
10507 not included in the link.
10508 (Symbol_table::add_from_dynobj): Handle ordinary symbol
10509 distinction.
10510 (Weak_alias_sorter::operator()): Assert that symbols are
10511 ordinary.
10512 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
10513 distinction.
10514 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
10515 parameters. Change all callers.
10516 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
10517 symbol distinction. Use SHN_XINDEX when needed.
10518 (Symbol_table::write_section_symbol): Add symtab_xindex
10519 parameter. Change all callers.
10520 (Symbol_table::sized_write_section_symbol): Likewise. Use
10521 SHN_XINDEX when needed.
10522 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
10523 declarations.
10524 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
10525 (Symbol::is_defined): Check is_ordinary.
10526 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
10527 (Symbol::is_absolute, Symbol::is_common): Likewise.
10528 (class Sized_symbol): Update declarations.
10529 (class Symbol_table): Update declarations.
10530 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
10531 parameters. Change all callers.
10532 (Sized_symbol::override): Likewise.
10533 (Symbol_table::override): Likewise.
10534 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
10535 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
10536 is_ordinary, and orig_st_shndx parameters. Change all callers.
10537 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
10538 to be in an ordinary section.
10539 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
10540 object and is_ordinary parameters. Change all callers.
10541 (Sized_dwarf_line_info::read_relocs): Add object parameter.
10542 Change all callers. Don't add undefined or non-ordinary symbols
10543 to reloc_map_.
10544 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
10545 Change all callers.
10546 * dwarf_reader.h (class Sized_dwarf_line_info): Update
10547 declarations.
10548 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
10549 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
10550 (Sized_relobj::relocate_sections): Likewise.
10551 * target-reloc.h (scan_relocs): Adjust section symbol index.
10552 (scan_relocatable_relocs): Likewise.
10553 * i386.cc (Scan::local): Check for ordinary symbols.
10554 * sparc.cc (Scan::local): Likewise.
10555 * x86_64.cc (Scan::local): Likewise.
10556 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
10557 to symbol_section_and_value.
10558 * testsuite/many_sections_test.cc: New file.
10559 * testsuite/Makefile.am (BUILT_SOURCES): Define.
10560 (check_PROGRAMS): Add many_sections_test.
10561 (many_sections_test_SOURCES): Define.
10562 (many_sections_test_DEPENDENCIES): Define.
10563 (many_sections_test_LDFLAGS): Define.
10564 (BUILT_SOURCES): Add many_sections_define.h.
10565 (many_sections_define.h): New target.
10566 (BUILT_SOURCES): Add many_sections_check.h.
10567 (many_sections_check.h): New target.
10568 (check_PROGRAMS): Add many_sections_r_test.
10569 (many_sections_r_test_SOURCES): Define.
10570 (many_sections_r_test_DEPENDENCIES): Define.
10571 (many_sections_r_test_LDFLAGS): Define.
10572 (many_sections_r_test_LDADD): Define.
10573 (many_sections_r_test.o): New target.
10574 * testsuite/Makefile.in: Rebuild.
10575
c5818ff1
CC
105762008-04-17 Cary Coutant <ccoutant@google.com>
10577
10578 * errors.cc (Errors::info): New function.
10579 (gold_info): New function.
10580 * errors.h (Errors::info): New function.
10581 * gold.h (gold_info): New function.
10582 * object.cc (Input_objects::add_object): Print trace output.
10583 * options.cc (options::parse_set): New function.
10584 (General_options::parse_wrap): Deleted.
10585 (General_options::General_options): Deleted initializer.
10586 * options.h (options::String_set): New typedef.
10587 (options::parse_set): New function.
10588 (DEFINE_set): New macro.
10589 (General_options::wrap): Changed to use DEFINE_set. Changed
10590 callers of any_wrap_symbols and is_wrap_symbol.
10591 (General_options::trace, General_options::trace_symbol):
10592 New options.
10593 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10594 (General_options::wrap_symbols_): Deleted.
10595 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10596
b5be4a7c
DM
105972008-04-17 David S. Miller <davem@davemloft.net>
10598
10599 * options.cc (General_options::parse_V): New function.
10600 * options.h: Add entries for -V and -Qy.
10601
155a0dd7
ILT
106022008-04-17 Ian Lance Taylor <iant@google.com>
10603
10604 * common.cc (Symbol_table::allocate_commons): Remove options
10605 parameter. Change caller.
10606 (Symbol_table::do_allocate_commons): Remove options parameter.
10607 Change caller. Just call do_allocate_commons_list twice.
10608 (Symbol_table::do_allocate_commons_list): New function, broken out
10609 of do_allocate_commons.
10610 * common.h (class Allocate_commons_task): Remove options_ field.
10611 Update constructor.
10612 * symtab.cc (Symbol_table::Symbol_table): Initialize
10613 tls_commons_.
10614 (Symbol_table::add_from_object): Put TLS common symbols on
10615 tls_commons_ list.
10616 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10617 which are IN_OUTPUT_DATA.
10618 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10619 allocate_commons and do_allocate_commons declarations. Declare
10620 do_allocate_commons_list.
10621 * gold.cc (queue_middle_tasks): Update creation of
10622 Allocate_commons_task to not pass options.
10623 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10624 (TLS_TEST_C_FLAGS): New variable.
10625 (tls_test_c_pic.o): New target.
10626 (tls_test_shared.so): Link in tls_test_c_pic.o.
10627 (tls_test_c_pic_ie.o): New target.
10628 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10629 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10630 (tls_test_c.o): New target.
10631 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10632 (tls_pic_test_LDADD): Likewise.
10633 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10634 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10635 (tls_test_c_gnu2.o): New target.
10636 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10637 tls_test_c_gnu2.o.
10638 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10639 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10640 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10641 * testsuite/tls_test.cc: Include "config.h".
10642 (t_last): Call t11_last.
10643 * testsuite/tls_test.h (t11, t11_last): Declare.
10644 * testsuite/tls_test_c.c: New file.
10645 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10646 * configure.ac: Check for OpenMP support.
10647 * configure, config.in, Makefile.in: Rebuild.
10648 * testsuite/Makefile.in: Rebuild.
10649
edfbb029
CC
106502008-04-16 Cary Coutant <ccoutant@google.com>
10651
10652 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10653 (Target_i386::tls_base_symbol_defined_): New field.
10654 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10655 (Target_i386::Scan::global): Likewise.
10656 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10657 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10658 (Target_x86_64::tls_base_symbol_defined_): New field.
10659 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10660 (Target_x86_64::Scan::global): Likewise.
10661
f3c69fca
CC
106622008-04-16 Cary Coutant <ccoutant@google.com>
10663
10664 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
10665 (Symbol::needs_plt_entry): Allow weak undefined symbols.
10666 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
10667 building shared libraries.
10668 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
10669 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
10670 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
10671 * testsuite/Makefile.in: Rebuild.
10672 * testsuite/weak_undef.h: New file.
10673 * testsuite/weak_undef_file1.cc: Add extra test cases.
10674 * testsuite/weak_undef_file2.cc: Likewise.
10675 * testsuite/weak_undef_test.cc: Likewise.
10676
7c414435
DM
106772008-04-16 David S. Miller <davem@davemloft.net>
10678
32b769e1
DM
10679 * sparc.cc (Target_sparc::Scan): Change from struct to class.
10680 Add issued_non_pic_error_ field. Declare check_non_pic.
10681 (Target_sparc::Scan::check_non_pic): New function.
10682 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
10683 (Target_sparc::Scan::global): Likewise.
10684
11936fb1
DM
10685 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
10686 * configure: Rebuild.
10687
7c414435
DM
10688 * options.h (DEFINE_enable): New macro.
10689 (new_dtags): New enable option.
10690 (initfirst, interpose, loadfltr, nodefaultlib,
10691 nodelete, nodlopen, nodump): New -z options.
10692 * layout.cc (Layout:finish_dynamic_section): If new
10693 dtags enabled, emit DT_RUNPATH. Also, emit a
10694 DT_FLAGS_1 containing any specified -z flags.
10695
85c7bf8b
ILT
106962008-04-16 Ian Lance Taylor <iant@google.com>
10697
12c0daef
ILT
10698 * copy-relocs.cc: New file.
10699 * copy-relocs.h: New file.
10700 * reloc.cc: Remove Copy_relocs code.
10701 * reloc.h: Likewise.
10702 * reloc-types.h (struct Reloc_types) [both versions]: Add
10703 get_reloc_addend_noerror.
10704 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
10705 variants of add_global which take an addend which must be zero.
10706 * i386.cc: Include "copy-relocs.h".
10707 (class Target_i386): Change type of copy_relocs_ to variable,
10708 update initializer.
10709 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
10710 Change all callers.
10711 (Target_i386::do_finalize_sections): Change handling of
10712 copy_relocs_.
10713 * sparc.cc: Include "copy-relocs.h".
10714 (class Target_sparc): Change type of copy_relocs_ to variable,
10715 update initializer.
10716 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
10717 Change all callers.
10718 (Target_sparc::do_finalize_sections): Change handling of
10719 copy_relocs_.
10720 * x86_64.cc: Include "copy-relocs.h".
10721 (class Target_x86_64): Change type of copy_relocs_ to variable,
10722 update initializer.
10723 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
10724 class. Change all callers.
10725 (Target_x86_64::do_finalize_sections): Change handling of
10726 copy_relocs_.
10727 * Makefile.am (CCFILES): Add copy-relocs.cc.
10728 (HFILES): Add copy-relocs.h.
10729
4f4995b6
ILT
10730 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
10731
85c7bf8b
ILT
10732 * testsuite/script_test_4.sh: Permit leading zeroes.
10733
4f2a9edd
ILT
107342008-04-15 Ian Lance Taylor <iant@google.com>
10735
e6188289
ILT
10736 * script-sections.cc (Script_sections::create_segments): Use
10737 header_size_adjustment even when there is enough room for the
10738 headers.
10739 * testsuite/script_test_4.sh: New file.
10740 * testsuite/script_test_4.t: New file.
10741 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
10742 (check_DATA): Add script_test_4.stdout.
10743 (MOSTLYCLEANFILES): Likewise.
10744 (script_test_4): New target.
10745 (script_test_4.stdout): New target.
10746 * testsuite/Makefile.in: Rebuild.
10747
4f2a9edd
ILT
10748 * sparc.cc: Add definitions for Output_data_plt_sparc class
10749 constants.
10750
f5314dd5
DM
107512008-04-14 David S. Miller <davem@davemloft.net>
10752
10753 * sparc.cc: New file.
10754 * Makefile.am (TARGETSOURCES): Add sparc.cc
10755 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
10756 * configure.tgt: Document targ_extra_size and
10757 targ_extra_big_endian. Add entries for sparc-* and
10758 sparc64-*.
10759 * configure.ac: Handle targ_extra_size and
10760 targ_extra_big_endian.
10761 * Makefile.in: Rebuild.
10762 * configure: Likewise.
10763 * po/POTFILES.in: Likewise.
10764 * po/gold.pot: Likewise.
10765
154e0e9a
ILT
107662008-04-14 Ian Lance Taylor <iant@google.com>
10767
10768 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
10769 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
10770 in the name/type/flags to section mapping. Don't call
10771 allocate_output_section.
10772 (Layout::choose_output_section): Change parameter from adjust_name
10773 to is_input_section. Don't permit input sections after sections
10774 are attached to segments. Don't call allocate_output_section.
10775 (Layout::layout_eh_frame): Call update_flags_for_input_section,
10776 not write_enable_output_section.
10777 (Layout::make_output_section): Don't push to
10778 unattached_section_list_ nor call attach_to_segment. Call
10779 attach_section_to_segment if sections are attached.
10780 (Layout::attach_sections_to_segments): New function.
10781 (Layout::attach_section_to_segment): New function.
10782 (Layout::attach_allocated_section_to_segment): Rename from
10783 attach_to_segment. Remove flags parameter.
10784 (Layout::allocate_output_section): Remove function.
10785 (Layout::write_enable_output_section): Remove function.
10786 * layout.h (class Layout): Update for above changes. Add new
10787 field sections_are_attached_.
10788 * output.h (Output_section::update_flags_for_input_section): New
10789 function.
10790 * output.cc (Output_section::add_input_section): Call
10791 update_flags_for_input_section.
10792 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
10793
009a67a2
CC
107942008-04-11 Cary Coutant <ccoutant@google.com>
10795
10796 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
10797 thought unnecessary.
10798 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
10799
759b1a24
ILT
108002008-04-11 Ian Lance Taylor <iant@google.com>
10801
10802 * output.h (class Output_section_data): Remove inline definition
10803 of set_addralign.
10804 * output.cc (Output_section_data::set_addralign): New function.
10805
c2b45e22
CC
108062008-04-11 Cary Coutant <ccoutant@google.com>
10807
10808 Add support for TLS descriptors for i386 and x86_64.
10809 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
10810 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
10811 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
10812 GOT_TYPE_TLS_DESC.
10813 (Target_i386::got_mod_index_entry): Remove unnecessary code.
10814 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
10815 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
10816 relocations.
10817 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
10818 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
10819 Fix problem with initial-exec relocations.
10820 (Target_i386::Relocate::relocate_tls): Likewise.
10821 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
10822 relaxation.
10823 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
10824 support for section-plus-offset dynamic table entries.
10825 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
10826 (Output_data_dynamic::Dynamic_entry): Add support for
10827 section-plus-offset dynamic table entries.
10828 (Output_data_dynamic::Classification): Likewise.
10829 (Output_data_dynamic::classification_): Renamed offset_.
10830 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
10831 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
10832 (Target_x86_64::make_plt_section): New function.
10833 (Target_x86_64::reserve_tlsdesc_entries): New function.
10834 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
10835 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
10836 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
10837 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
10838 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
10839 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
10840 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
10841 add extra PLT entry for TLS descriptors.
10842 (Output_data_plt_x86_64::got_): New field.
10843 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
10844 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
10845 fields.
10846 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
10847 descriptors.
10848 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
10849 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
10850 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
10851 R_386_TLS_DESC_CALL relocations.
10852 (Target_x86_64::Scan::global): Likewise.
10853 (Target_x86_64::do_finalize_sections): Add dynamic table entries
10854 for TLS descriptors.
10855 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
10856 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
10857 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
10858 GD-to-IE relaxation.
10859 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
10860 and TLS_DESCRIPTORS.
10861 * Makefile.in: Rebuild.
10862 * configure: Rebuild.
10863 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
10864 (tls_test_shared2.so): New target.
10865 (tls_shared_gd_to_ie_test_SOURCES): New variable.
10866 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
10867 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
10868 (tls_shared_gd_to_ie_test_LDADD): New variable.
10869 (tls_shared_gnu2_gd_to_ie_test): New target.
10870 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
10871 New targets.
10872 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
10873 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
10874 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
10875 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
10876 (tls_shared_gnu2_test): New target.
10877 (tls_test_gnu2_shared.so): New target.
10878 (tls_shared_gnu2_test_SOURCES): New variable.
10879 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
10880 (tls_shared_gnu2_test_LDFLAGS): New variable.
10881 (tls_shared_gnu2_test_LDADD): New variable.
10882 * testsuite/Makefile.in: Rebuild.
10883 * testsuite/Makefile.
10884
83bfb6b7
ILT
108852008-04-11 Ian Lance Taylor <iant@google.com>
10886
10887 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
10888 justsyms.t.
10889 * testsuite/Makefile.in: Rebuild.
10890
10891 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
10892 long.
10893 * testsuite/script_test_2.cc (main): Adjust test.
10894
706e1f5e
ILT
108952008-04-11 David S. Miller <davem@davemloft.net>
10896 Ian Lance Taylor <iant@google.com>
10897
10898 * options.h (General_options): Add entries for '-Y' and
10899 '-relax'.
10900 * options.cc (General_options:finalize): If -Y was used, add those
10901 entries to the library path instead of the default "/lib" and
10902 "/usr/lib".
10903
7c98e6bb
DM
109042008-04-11 David S. Miller <davem@davemloft.net>
10905
10906 * testsuite/justsyms.t: Start at 0x100.
10907 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10908 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10909 long.
10910 * testsuite/script_test_2.cc: Adjust string and section length
10911 checks.
7c98e6bb 10912
99a37bfd
ILT
109132008-04-09 Ian Lance Taylor <iant@google.com>
10914
2cefc357
ILT
10915 PR gold/5996
10916 * script-sections.cc (Sections_element::allocate_to_segment): Add
10917 orphan parameter.
10918 (Output_section_definition::allocate_to_segment): Likewise.
10919 (Orphan_output_section::allocate_to_segment): Likewise.
10920 (Script_sections::attach_sections_using_phdrs_clause): Don't
10921 propagate non-PT_LOAD segments to orphan sections.
10922 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10923 readelf rather than objdump.
10924 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10925 .interp section and PT_INTERP segment are the same size.
10926 * testsuite/Makefile.in: Rebuild.
10927
99a37bfd
ILT
10928 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10929 aliases for symbols defined in the same object.
10930 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10931 (weak_alias_test_SOURCES): New variable.
10932 (weak_alias_test_DEPENDENCIES): New variable.
10933 (weak_alias_test_LDFLAGS): New variable.
10934 (weak_alias_test_LDADD): New variable.
10935 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10936 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10937 (weak_alias_test_3.o): New target.
10938 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10939 * testsuite/weak_alias_test_main.cc: New file.
10940 * testsuite/weak_alias_test_1.cc: New file.
10941 * testsuite/weak_alias_test_2.cc: New file.
10942 * testsuite/weak_alias_test_3.cc: New file.
10943
780e49c5
ILT
109442008-04-08 Ian Lance Taylor <iant@google.com>
10945
cdb0b8f5
ILT
10946 * options.h (class General_options): Add --noinhibit-exec option.
10947 * main.cc (main): Check --noinhibit-exec.
10948
0864d551
ILT
10949 * options.h (class General_options): Define --wrap as a special
10950 option. Add wrap_symbols_ field.
10951 (General_options::any_wrap_symbols): New function.
10952 (General_options::is_wrap_symbol): New function.
10953 * options.cc (General_options::parse_wrap): New function.
10954 (General_options::General_options): Initialize wrap_symbols_.
10955 * symtab.cc (Symbol_table::wrap_symbol): New function.
10956 (Symbol_table::add_from_object): Handle --wrap.
10957 * symtab.h (class Symbol_table): Declare wrap_symbol.
10958 * target.h (Target::wrap_char): New function.
10959 (Target::Target_info): Add wrap_char field.
10960 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10961 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10962 * testsuite/testfile.cc (Target_test::test_target_info):
10963 Likewise.
10964
789aa6de
ILT
10965 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10966 there is one.
10967
2c38906f
ILT
10968 * layout.h (class Layout): Add added_eh_frame_data_ field.
10969 * layout.cc (Layout::Layout): Initialize new field.
10970 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10971 output section until we find a section we merged successfully.
10972 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10973 that the size be non-zero.
10974
780e49c5
ILT
10975 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10976 qualifier.
10977
7fcd0256
ILT
109782008-04-08 Craig Silverstein <csilvers@google.com>
10979
10980 * configure.ac: Export new conditional variable HAVE_ZLIB.
10981 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10982 on HAVE_ZLIB.
10983 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10984 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10985
6835af53
ILT
109862008-04-07 Ian Lance Taylor <iant@google.com>
10987
e24f324c
ILT
10988 * version.cc (version_string): Set to "1.5".
10989
a036edd8
ILT
10990 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10991 Add issued_non_pic_error_ field. Declare check_non_pic.
10992 (Target_x86_64::Scan::check_non_pic): New function.
10993 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10994 (Target_x86_64::Scan::global): Likewise.
10995
624f8810
ILT
10996 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10997 addend parameter. Change caller. Handle merge sections.
10998 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10999 Address to Addend. Don't add in the result of
11000 local_section_offset, pass down the addend and use the returned
11001 value.
11002 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
11003 Update declarations of local_section_offset and symbol_value.
11004 * testsuite/two_file_test_1.cc (t18): New function.
11005 * testsuite/two_file_test_2.cc (f18): New function.
11006 * testsuite/two_file_test_main.cc (main): Call t18.
11007 * testsuite/two_file_test.h (t18, f18): Declare.
11008
6835af53
ILT
11009 * configure.ac: Don't test for objdump, c++filt, or readelf.
11010 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
11011 conditionals.
11012 (TEST_READELF): New variable.
11013 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
11014 (check_PROGRAMS): Add two_file_strip_test.
11015 (two_file_strip_test): New target.
11016 (check_PROGRAMS): Add two_file_same_shared_strip_test.
11017 (two_file_same_shared_strip_test_SOURCES): New variable.
11018 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
11019 (two_file_same_shared_strip_test_LDFLAGS): New variable.
11020 (two_file_same_shared_strip_test_LDADD): New variable.
11021 (two_file_shared_strip.so): New target.
11022 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
11023 (ver_test_5.syms, ver_test_7.syms): Likewise.
11024 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
11025 (strip_test_3.stdout): Use TEST_OBJDUMP.
11026 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11027
86925eef
CC
110282008-04-04 Cary Coutant <ccoutant@google.com>
11029
11030 * symtab.h (Symbol::is_weak_undefined): New function.
11031 (Symbol::is_strong_undefined): New function.
11032 (Symbol::is_absolute): New function.
11033 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
11034 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
11035 absolute symbols.
11036 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
11037 (weak_undef_test): New target.
11038 * testsuite/Makefile.in: Rebuild.
11039 * testsuite/weak_undef_file1.cc: New file.
11040 * testsuite/weak_undef_file2.cc: New file.
11041 * testsuite/weak_undef_test.cc: New file.
11042
126f3ece
ILT
110432008-04-03 Craig Silverstein <csilvers@google.com>
11044
11045 * compressed_output.h (class Output_compressed_section): Use
11046 unsigned buffer.
11047 * compressed_output.cc (zlib_compress): Use unsigned buffers,
11048 add zlib header.
11049 (zlib_compressed_suffix): Removed.
11050 (Output_compressed_section::set_final_data_size): Use unsigned
11051 buffers.
11052 * testsuite/Makefile.am (flagstest_compress_debug_sections):
11053 Fix linker invocation.
11054 (flagstest_o_specialfile_and_compress_debug_sections):
11055 Likewise.
11056 * testsuite/Makefile.in: Regenerated.
11057
deae2a14
DM
110582008-04-02 David S. Miller <davem@davemloft.net>
11059
11060 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11061 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11062
70752818
ILT
110632008-04-02 Craig Silverstein <csilvers@google.com>
11064
11065 * TODO: New file.
11066
39d0cb0e
ILT
110672008-04-02 Ian Lance Taylor <iant@google.com>
11068
11069 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11070 parameters. Update for new key type to views_. Change all
11071 callers.
11072 (File_read::read): Adjust for byteshift in returned view.
11073 (File_read::add_view): New function, broken out of
11074 find_and_make_view.
11075 (File_read::make_view): New function, broken out of
11076 find_and_make_view.
11077 (File_read::find_or_make_view): Add offset and aligned
11078 parameters. Rewrite accordingly. Change all callers.
11079 (File_read::get_view): Add offset and aligned parameters. Adjust
11080 for byteshift in return value.
11081 (File_read::get_lasting_view): Likewise.
11082 * fileread.h (class File_read): Update declarations.
11083 (class File_read::View): Add byteshift_ field. Add byteshift to
11084 constructor. Add byteshift method.
11085 * archive.h (Archive::clear_uncached_views): New function.
11086 (Archive::get_view): Add aligned parameter. Change all callers.
11087 * object.h (Object::get_view): Add aligned parameter. Change all
11088 callers.
11089 (Object::get_lasting_view): Likewise.
11090
11091 * fileread.cc (File_read::release): Don't call clear_views if
11092 there are multiple objects.
11093 * fileread.h (File_read::clear_uncached_views): New function.
11094 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11095 on the archive.
11096
a1207466
CC
110972008-03-31 Cary Coutant <ccoutant@google.com>
11098
11099 Add thin archive support.
11100 * archive.cc (Archive::armagt): New const.
11101 (Archive::setup): Remove task parameter and calls to unlock.
11102 (Archive::unlock_nested_archives): New function.
11103 (Archive::read_header): Add nested_off parameter. Change
11104 all callers.
11105 (Archive::interpret_header): Likewise.
11106 (Archive::include_all_members): Change to handle thin
11107 archives.
11108 (Archive::include_member): Likewise.
11109 * archive.h (Archive::Archive): Add new parameters and
11110 initializers.
11111 (Archive::armagt): New const.
11112 (Archive::setup): Remove task parameter.
11113 (Archive::unlock_nested_archives): New function.
11114 (Archive::read_header): Add nested_off parameter.
11115 (Archive::interpret_header): Likewise.
11116 (Archive::Nested_archive_table): New typedef.
11117 (Archive::is_thin_archive_): New field.
11118 (Archive::nested_archives_): New field.
11119 (Archive::options_): New field.
11120 (Archive::dirpath_): New field.
11121 (Archive::task_): New field.
11122 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11123 for thin archives. Pass additional parameters to
11124 Archive::Archive. Unlock the archive file after calling
11125 Archive::setup.
cd536b21 11126
479f6503
ILT
111272008-03-29 Ian Lance Taylor <iant@google.com>
11128
686c8caf
ILT
11129 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11130 version symbol to be local.
11131 * testsuite/ver_test_4.sh: New file.
11132 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11133 (check_DATA): Add ver_test_4.syms.
11134 (ver_test_4.syms): New target.
11135 * testsuite/Makefile.in: Rebuild.
11136
ab794b6b
ILT
11137 * output.cc
11138 (Output_section::Input_section_sort_entry::has_priority): New
11139 function.
11140 (Output_section::Input_section_sort_entry::match_file_name): New
11141 function.
11142 (Output_section::Input_section_sort_entry::match_section_name):
11143 Remove.
11144 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11145 Remove.
11146 (Output_section::Input_section_sort_entry::match_section_file):
11147 Remove.
11148 (Output_section::Input_section_sort_compare::operator()): Rewrite
11149 using new Input_section_sort_entry functions. Sort crtbegin and
11150 crtend first. Sort sections with no priority before sections with
11151 a priority.
11152 * testsuite/initpri1.c (d3): Check j != 4.
11153 (cd5): New constructor/destructor function.
11154 (main): Check j != 2.
11155
479f6503
ILT
11156 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11157 new symbol when resolving, don't call set_is_default.
11158 * testsuite/ver_test_7.cc: New file.
11159 * testsuite/ver_test_7.sh: New file.
11160 * testsuite/Makefile.am (ver_test_7.so): New target.
11161 (ver_test_7.o): New target.
11162 (check_SCRIPTS): Add ver_test_7.sh.
11163 (check_DATA): Add ver_test_7.syms.
11164 (ver_test_7.syms): New target.
11165
2fd32231
ILT
111662008-03-28 Ian Lance Taylor <iant@google.com>
11167
11168 * layout.cc (Layout::layout): If we see an input section with a
11169 name that needs sorting, set the must_sort flag for the output
11170 section.
11171 (Layout::make_output_section): If the name of the output section
11172 indicates that it might require sorting, set the may_sort flag.
11173 * output.h (Output_section::may_sort_attached_input_sections): New
11174 function.
11175 (Output_section::set_may_sort_attached_input_sections): New
11176 function.
11177 (Output_section::must_sort_attached_input_sections): New
11178 function.
11179 (Output_section::set_must_sort_attached_input_sections): New
11180 function.
11181 (class Output_section): Declare Input_section_sort_entry. Define
11182 Input_section_sort_compare. Declare
11183 sort_attached_input_sections. Add new fields:
11184 may_sort_attached_input_sections_,
11185 must_sort_attached_input_sections_,
11186 attached_input_sections_are_sorted_.
11187 * output.cc (Output_section::Output_section): Initialize new
11188 fields.
11189 (Output_section::add_input_section): Add an entry to
11190 input_sections_ if may_sort or must_sort are true.
11191 (Output_section::set_final_data_size): Call
11192 sort_attached_input_sections if necessary.
11193 (Output_section::Input_section_sort_entry): Define new class.
11194 (Output_section::Input_section_sort_compare::operator()): New
11195 function.
11196 (Output_section::sort_attached_input_sections): New function.
11197 * configure.ac: Check whether the compiler supports constructor
11198 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11199 * testsuite/initpri1.c: New file.
11200 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11201 CONSTRUCTOR_PRIORITY.
11202 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11203 (initpri1_LDFLAGS): New variable.
11204 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11205
18e6b24e
ILT
112062008-03-27 Ian Lance Taylor <iant@google.com>
11207
49bdd526
ILT
11208 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11209 * testsuite/common_test_1.c: New file.
11210 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11211 (common_test_1_SOURCES): New variable.
11212 (common_test_1_DEPENDENCIES): New variable.
11213 (common_test_1_LDFLAGS): New variable.
11214
18e6b24e
ILT
11215 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11216 and commons_ correctly when NAME/VERSION does not override
11217 NAME/NULL.
11218 * testsuite/ver_test_6.c: New file.
11219 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11220 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11221 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11222
04bf7072
ILT
112232008-03-26 Ian Lance Taylor <iant@google.com>
11224
5871526f
ILT
11225 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11226 of an undefined symbol from a version script.
11227 * testsuite/Makefile.am (ver_test_5.so): New target.
11228 (ver_test_5.o): New target.
11229 (check_SCRIPTS): Add ver_test_5.sh.
11230 (check_DATA): Add ver_test_5.syms.
11231 (ver_test_5.syms): New target.
11232 * testsuite/ver_test_5.cc: New file.
11233 * testsuite/ver_test_5.script: New file.
11234 * testsuite/ver_test_5.sh: New file.
11235 * Makefile.in, testsuite/Makefile.in: Rebuild.
11236
04bf7072
ILT
11237 PR gold/5986
11238 Fix problems building gold with gcc 4.3.0.
11239 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11240 (gold_error_at_location, gold_warning_at_location): Use it.
11241 * configure.ac: Check whether we can compile and use a template
11242 function with a printf attribute.
11243 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11244 when jumping over bytes.
11245 * object.cc: Instantiate Object::read_section_data.
11246 * debug.h: Include <cstring>
11247 * dwarf_reader.cc: Include <algorithm>
11248 * main.cc: Include <cstring>.
11249 * options.cc: Include <cstring>.
11250 * output.cc: Include <cstring>.
11251 * script.cc: Include <cstring>.
11252 * script.h: Include <string>.
11253 * symtab.cc: Include <cstring> and <algorithm>.
11254 * target-select.cc: Include <cstring>.
11255 * version.cc: Include <string>.
11256 * testsuite/testmain.cc: Include <cstdlib>.
11257 * configure, config.in: Rebuild.
11258
874c5b28
ILT
112592008-03-25 Ian Lance Taylor <iant@google.com>
11260
819d6c3a
ILT
11261 * options.cc: Include "../bfd/bfdver.h".
11262 (options::help): Print bug reporting address.
11263
f4b2c6f5
ILT
11264 * version.cc (print_version): Adjust output for current value of
11265 BFD_VERSION_STRING.
11266
11267 * NEWS: New file.
11268
e96caa79
ILT
11269 * options.cc (options::help): Print list of supported targets.
11270 * target-select.h: Include <vector>.
11271 (class Target_selector): Make machine_, size_, and is_big_endian_
11272 fields const. Add bfd_name_ and instantiated_target_ fields.
11273 (Target_selector::Target_selector): Add bfd_name parameter.
11274 (Target_selector::recognize): Make non-virtual, call
11275 do_recognize.
11276 (Target_selector::recognize_by_name): Make non-virtual, call
11277 do_recognize_by_name.
11278 (Target_selector::supported_names): New function.
11279 (Target_selector::bfd_name): New function.
11280 (Target_selector::do_instantiate_target): New pure virtual
11281 function.
11282 (Target_selector::do_recognize): New virtual function.
11283 (Target_selector::do_recognize_by_name): New virtual function.
11284 (Target_selector::instantiate_target): New private function.
11285 (supported_target_names): Declare.
11286 * target-select.cc (Target_selector::Target_selector): Update for
11287 new parameter and fields.
11288 (select_target_by_name): Check that the name matches before
11289 calling recognize_by_name.
11290 (supported_target_names): New function.
11291 * i386.cc (class Target_selector_i386): Update Target_selector
11292 constructor call. Remove recognize and recognize_by_name. Add
11293 do_instantiate_target.
11294 * x86_64.cc (class Target_selector_x86_64): Likewise.
11295 * testsuite/testfile.cc (class Target_selector_test): Update for
11296 changes to Target_selector.
11297
874c5b28
ILT
11298 * README: Rewrite, with some notes on unsupported features.
11299
0a65a3a7
CC
113002008-03-24 Cary Coutant <ccoutant@google.com>
11301
11302 * i386.cc (Target_i386::Got_type): New enum declaration.
11303 (Target_i386::Scan::local): Updated callers of Output_data_got
11304 member functions.
11305 (Target_i386::Scan::global): Likewise.
11306 (Target_i386::Relocate::relocate): Likewise.
11307 (Target_i386::Relocate::relocate_tls): Likewise.
11308 * object.h (Got_offset_list): New class.
11309 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11310 (Sized_relobj::local_got_offset): Likewise.
11311 (Sized_relobj::set_local_got_offset): Likewise.
11312 (Sized_relobj::local_has_tls_got_offset): Removed.
11313 (Sized_relobj::local_tls_got_offset): Removed.
11314 (Sized_relobj::set_local_tls_got_offset): Removed.
11315 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11316 * output.cc (Output_data_got::add_global): Added got_type parameter.
11317 (Output_data_got::add_global_with_rel): Likewise.
11318 (Output_data_got::add_global_with_rela): Likewise.
11319 (Output_data_got::add_global_pair_with_rel): New function.
11320 (Output_data_got::add_global_pair_with_rela): New function.
11321 (Output_data_got::add_local): Added got_type parameter.
11322 (Output_data_got::add_local_with_rel): Likewise.
11323 (Output_data_got::add_local_with_rela): Likewise.
11324 (Output_data_got::add_local_pair_with_rel): New function.
11325 (Output_data_got::add_local_pair_with_rela): New function.
11326 (Output_data_got::add_global_tls): Removed.
11327 (Output_data_got::add_global_tls_with_rel): Removed.
11328 (Output_data_got::add_global_tls_with_rela): Removed.
11329 (Output_data_got::add_local_tls): Removed.
11330 (Output_data_got::add_local_tls_with_rel): Removed.
11331 (Output_data_got::add_local_tls_with_rela): Removed.
11332 * output.h (Output_data_got::add_global): Added got_type parameter.
11333 (Output_data_got::add_global_with_rel): Likewise.
11334 (Output_data_got::add_global_with_rela): Likewise.
11335 (Output_data_got::add_global_pair_with_rel): New function.
11336 (Output_data_got::add_global_pair_with_rela): New function.
11337 (Output_data_got::add_local): Added got_type parameter.
11338 (Output_data_got::add_local_with_rel): Likewise.
11339 (Output_data_got::add_local_with_rela): Likewise.
11340 (Output_data_got::add_local_pair_with_rel): New function.
11341 (Output_data_got::add_local_pair_with_rela): New function.
11342 (Output_data_got::add_global_tls): Removed.
11343 (Output_data_got::add_global_tls_with_rel): Removed.
11344 (Output_data_got::add_global_tls_with_rela): Removed.
11345 (Output_data_got::add_local_tls): Removed.
11346 (Output_data_got::add_local_tls_with_rel): Removed.
11347 (Output_data_got::add_local_tls_with_rela): Removed.
11348 * resolve.cc (Symbol::override_base_with_special): Removed
11349 reference to has_got_offset_ field.
11350 * symtab.cc (Symbol::init_fields): Replaced initialization
11351 of got_offset_ with got_offsets_. Removed initialization
11352 of has_got_offset_
53fcba31 11353 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
11354 (Symbol::got_offset): Likewise.
11355 (Symbol::set_got_offset): Likewise.
11356 (Symbol::has_tls_got_offset): Removed.
11357 (Symbol::tls_got_offset): Removed.
11358 (Symbol::set_tls_got_offset): Removed.
11359 (Symbol::got_offset_): Removed.
11360 (Symbol::tls_mod_got_offset_): Removed.
11361 (Symbol::tls_pair_got_offset_): Removed.
11362 (Symbol::got_offsets_): New field.
11363 (Symbol::has_got_offset): Removed.
11364 (Symbol::has_tls_mod_got_offset): Removed.
11365 (Symbol::has_tls_pair_got_offset): Removed.
11366 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
11367 (Target_x86_64::Scan::local): Updated callers of Output_data_got
11368 member functions.
11369 (Target_x86_64::Scan::global): Likewise.
11370 (Target_x86_64::Relocate::relocate): Likewise.
11371 (Target_x86_64::Relocate::relocate_tls): Likewise.
11372
bd52eafb
BE
113732008-03-25 Ben Elliston <bje@au.ibm.com>
11374
11375 * yyscript.y: Fix spelling error in comment.
11376
8b105e34
ILT
113772008-03-24 Ian Lance Taylor <iant@google.com>
11378
8ed814a9
ILT
11379 * options.h (class General_options): Define build_id option.
11380 * layout.h (class Layout): Declare write_build_id, create_note,
11381 create_build_id. Add build_id_note_ member.
11382 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
11383 "libiberty.h", "md5.h", "sha1.h".
11384 (Layout::Layout): Initialize eh_frame_data_,
11385 eh_frame_hdr_section_, and build_id_note_.
11386 (Layout::finalize): Call create_build_id.
11387 (Layout::create_note): New function, broken out of
11388 Layout::create_gold_note.
11389 (Layout::create_gold_note): Call create_note.
11390 (Layout::create_build_id): New function.
11391 (Layout::write_build_id): New function.
11392 (Close_task_runner::run): Call write_build_id.
11393
8b105e34
ILT
11394 * x86_64.cc: Correct license to GPLv3.
11395
086a1841
ILT
113962008-03-23 Ian Lance Taylor <iant@google.com>
11397
11398 * options.cc: Include "demangle.h".
11399 (parse_optional_string): New function.
11400 (parse_long_option): Handle takes_optional_argument.
11401 (parse_short_option): Update dash_z initializer. Handle
11402 takes_optional_argument.
11403 (General_options::General_options): Initialize do_demangle_.
11404 (General_options::finalize): Set do_demangle_. Handle demangling
11405 style.
11406 * options.h (parse_optional_string): Declare.
11407 (struct One_option): Add optional_arg field. Update constructor.
11408 Update call constructor calls. Add takes_optional_argument
11409 function.
11410 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
11411 (DEFINE_optional_string): Define.
11412 (General_options::demangle): Change from DEFINE_bool to
11413 DEFINE_optional_string.
11414 (General_options::no_demangle): New function.
11415 (General_options::do_demangle): New function.
11416 (General_options::set_do_demangle): New function.
11417 (General_options::execstack_status_): Move definition to end of
11418 class definition.
11419 (General_options::static_): Likewise.
11420 (General_options::do_demangle_): New field.
11421 * object.cc (big_endian>::get_symbol_location_info): Call
11422 Options::do_demangle, not Options::demangle.
11423 * symtab.cc (demangle): Likewise.
11424
cbb93e63
ILT
114252008-03-22 Ian Lance Taylor <iant@google.com>
11426
11427 * gold.h: Include <cstddef> and <sys/types.h>
11428 * options.h: Include <cstring>.
11429
ec531623
ILT
114302008-03-21 Ian Lance Taylor <iant@google.com>
11431
11432 * Added source code to GNU binutils.
This page took 0.661747 seconds and 4 git commands to generate.