Correct last commit.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
328c7c2f
ILT
12011-07-01 Ian Lance Taylor <iant@google.com>
2
3 PR gold/12525
4 * configure.ac: Test whether static linking works, setting
5 the automake conditional HAVE_STATIC.
6 * testsuite/Makefile.am: Disable tests using -static if
7 HAVE_STATIC is not true.
8 * configure, testsuite/Makefile.in: Rebuild.
9
02d7cd44
ILT
102011-07-01 Ian Lance Taylor <iant@google.com>
11
12 PR gold/12525
13 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
14 Assert if we see DW_EH_PE_indirect.
15 * target.h (Target::ehframe_datarel_base): New function.
16 (Target::do_ehframe_datarel_base): New target function.
17 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
18 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
19 function.
20
07a60597
ILT
212011-07-01 Ian Lance Taylor <iant@google.com>
22
23 PR gold/12571
24 * options.h (class General_options): Add
25 --ld-generated-unwind-info.
26 * ehframe.cc (Fde::write): Add address parameter. Change all
27 callers. If associated with PLT, fill in address and size.
28 (Cie::set_output_offset): Only add merge mapping if there is an
29 object.
30 (Cie::write): Add address parameter. Change all callers.
31 (Eh_frame::add_ehframe_for_plt): New function.
32 * ehframe.h (class Fde): Update declarations. Move shndx_ and
33 input_offset_ fields into union u_, with new plt field.
34 (Fde::Fde): Adjust for new union field.
35 (Fde::Fde) [Output_data version]: New constructor.
36 (Fde::add_mapping): Only add merge mapping if there is an object.
37 (class Cie): Update declarations.
38 (class Eh_frame): Declare add_ehframe_for_plt.
39 * layout.cc (Layout::layout_eh_frame): Break out code into
40 make_eh_frame_section, and call it.
41 (Layout::make_eh_frame_section): New function.
42 (Layout::add_eh_frame_for_plt): New function.
43 * layout.h (class Layout): Update declarations.
44 * merge.cc (Merge_map::add_mapping): Add assertion.
45 * i386.cc: Include "dwarf.h".
46 (class Output_data_plt_i386): Make first_plt_entry,
47 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
48 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
49 and plt_eh_frame_fde.
50 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
51 boundary. Call add_eh_frame_for_plt if appropriate.
52 * x86_64.cc: Include "dwarf.h".
53 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
54 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
55 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
56 and plt_eh_frame_fde.
57 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
58 appropriate.
59
14788a3f
ILT
602011-06-29 Ian Lance Taylor <iant@google.com>
61
62 PR gold/12629
63 * object.cc (Sized_relobj_file::layout_section): Change shdr
64 parameter to be const.
65 (Sized_relobj_file::layout_eh_frame_section): New function, broken
66 out of do_layout.
67 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
68 appropriate. Call layout_eh_frame_section.
69 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
70 sections.
71 * object.h (class Sized_relobj_file): Update declarations.
72
6c21fce1
ILT
732011-06-29 Ian Lance Taylor <iant@google.com>
74
37e41b03 75 PR gold/12652
6c21fce1
ILT
76 * script.cc (Token::integer_value): Accept trailing M/m/K/k
77 modifier.
78 (Lex::gather_token): Accept trailing M/m/K/k for integers.
79
4d5e4e62
ILT
802011-06-29 Ian Lance Taylor <iant@google.com>
81
82 PR gold/12675
83 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
84 SHT_X86_64_UNWIND.
85 * layout.cc (Layout::layout_eh_frame): Likewise.
86
886f533a
ILT
872011-06-29 Ian Lance Taylor <iant@google.com>
88
89 PR gold/12695
90 * layout.cc (Layout::symtab_section_shndx): New function.
91 * layout.h (class Layout): Declare symtab_section_shndx.
92 * output.cc (Output_section::write_header): Call it.
93
f3ae1b28
ILT
942011-06-29 Ian Lance Taylor <iant@google.com>
95
96 PR gold/12818
97 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
98 symbols which are not used in a relocation.
99
aecf301f
ILT
1002011-06-28 Ian Lance Taylor <iant@google.com>
101
102 PR gold/12898
103 * layout.cc (Layout::segment_precedes): Don't crash if a linker
104 script create indistinguishable segments.
105 (Layout::set_segment_offsets): Use stable_sort when sorting
106 segments. Pass this to Compare_segments constructor.
107 * layout.h (class Layout): Make segment_precedes non-static.
108 (class Compare_segments): Change from struct to class. Add
109 layout_ field. Add constructor.
110 * script-sections.cc
111 (Script_sections::attach_sections_using_phdrs_clause): Rename
112 local orphan to is_orphan. Don't report failure to put empty
113 section in segment. On attachment failure, report name of
114 section, and attach to first PT_LOAD segment.
115
03ef7571
ILT
1162011-06-28 Ian Lance Taylor <iant@google.com>
117
118 PR gold/12934
119 * target-select.cc (Target_selector::Target_selector): Add
120 emulation parameter. Change all callers.
121 (select_target_by_bfd_name): Rename from select_target_by_name.
122 Change all callers.
123 (select_target_by_emulation): New function.
124 (supported_emulation_names): New function.
125 * target-select.h (class Target_selector): Add emulation_ field.
126 Update declarations.
127 (Target_selector::recognize_by_bfd_name): Rename from
128 recognize_by_name. Change all callers.
129 (Target_selector::supported_bfd_names): Rename from
130 supported_names. Change all callers.
131 (Target_selector::recognize_by_emulation): New function.
132 (Target_selector::supported_emulations): New function.
133 (Target_selector::emulation): New function.
134 (Target_selector::do_recognize_by_bfd_name): Rename from
135 do_recognize_by_name. Change all callers.
136 (Target_selector::do_supported_bfd_names): Rename from
137 do_supported_names. Change all callers.
138 (Target_selector::do_recognize_by_emulation): New function.
139 (Target_selector::do_supported_emulations): New function.
140 (select_target_by_bfd_name): Change name in declaration.
141 (select_target_by_emulation): Declare.
142 (supported_emulation_names): Declare.
143 * parameters.cc (parameters_force_valid_target): Try to find
144 target based on emulation from -m option.
145 * options.h (class General_options): Change doc string for -m.
146 * options.cc (help): Print emulations.
147 (General_options::parse_V): Likewise.
148 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
149 Add emulation parameter. Change all callers.
150
200b2bb9
ILT
1512011-06-28 Ian Lance Taylor <iant@google.com>
152
153 * target.h (class Target): Add osabi_ field.
154 (Target::osabi): New function.
155 (Target::set_osabi): New function.
156 (Target::Target): Initialize osabi_.
157 (Target::do_adjust_elf_header): Make pure virtual.
158 (Sized_target::do_adjust_elf_header): Declare.
159 * target.cc (Sized_target::do_adjust_elf_header): New function.
160 (class Sized_target): Instantiate all versions.
161 * freebsd.h (class Target_freebsd): Remove.
162 (Target_selector_freebsd::do_recognize): Call set_osabi on
163 Target.
164 (Target_selector_freebsd::do_recognize_by_name): Likewise.
165 (Target_selector_freebsd::set_osabi): Remove.
166 * i386.cc (class Target_i386): Inherit from Sized_target rather
167 than Target_freebsd.
168 * x86_64.cc (class Target_x86_64): Likewise.
169
b3ce541e
ILT
1702011-06-28 Ian Lance Taylor <iant@google.com>
171
172 * target.h (Target::can_check_for_function_pointers): Rewrite.
173 Make non-virtual.
174 (Target::can_icf_inline_merge_sections): Likewise.
175 (Target::section_may_have_icf_unsafe_poineters): Likewise.
176 (Target::Target_info): Add can_icf_inline_merge_sections field.
177 (Target::do_can_check_for_function_pointers): New virtual
178 function.
179 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
180 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
181 from can_check_for_function_pointers, move in file.
182 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
183 section_may_have_icf_unsafe_poineters, move in file.
184 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
185 * i386.cc (Target_i386::do_can_check_for_function_pointers):
186 Rename from can_check_for_function_pointers, move in file.
187 (Target_i386::can_icf_inline_merge_sections): Remove.
188 (Target_i386::i386_info): Initialize
189 can_icf_inline_merge_sections.
190 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
191 Initialize can_icf_inline_merge_sections.
192 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
193 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
194 Rename from can_check_for_function_pointers, move in file.
195 (Target_x86_64::can_icf_inline_merge_sections): Remove.
196 (Target_x86_64::x86_64_info): Initialize
197 can_icf_inline_merge_sections.
198 * testsuite/testfile.cc (Target_test::test_target_info):
199 Likewise.
200 * icf.cc (get_section_contents): Correct formatting.
201
6d1c4efb
ILT
2022011-06-27 Ian Lance Taylor <iant@google.com>
203
204 * symtab.cc (Symbol::versioned_name): New function.
205 (Symbol_table::add_to_final_symtab): Use versioned_name when
206 appropriate.
207 (Symbol_table::sized_write_symbol): Likewise.
208 * symtab.h (class Symbol): Declare versioned_name.
209 * stringpool.h (class Stringpool_template): Add variant of add
210 which takes a std::basic_string.
211 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
212 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
213 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
214 (ver_test_12.o): New target.
215 * testsuite/Makefile.in: Rebuild.
216
57eb9b50
DK
2172011-06-27 Doug Kwan <dougkwan@google.com>
218
219 * arm.cc (Arm_relocate_functions::thm_jump8,
220 Arm_relocate_functions::thm_jump11): Use a wider signed
221 type to compute offset.
222 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
223 arm_thm_jump8.
224 * testsuite/Makefile.in: Regenerate.
225 * testsuite/arm_branch_in_range.sh: Check test results of
226 arm_thm_jump11 and arm_thm_jump8.
227 * testsuite/arm_thm_jump11.s: New test source file.
228 * testsuite/arm_thm_jump11.t: New linker script.
229 * testsuite/arm_thm_jump8.s: New test source file.
230 * testsuite/arm_thm_jump8.t: New linker script.
231
487b39df
ILT
2322011-06-24 Ian Lance Taylor <iant@google.com>
233
234 * layout.cc: Include "object.h".
235 (ctors_sections_in_init_array): New static variable.
236 (Layout::is_ctors_in_init_array): New function.
237 (Layout::layout): Add entry to ctors_sections_in_init_array if
238 appropriate.
239 * layout.h (class Layout): Declare is_ctors_in_init_array.
240 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
241 is_ctors_reverse_view is set.
242 (Sized_relobj_file::write_sections): Add layout parameter. Change
243 all callers. Set is_ctors_reverse_view field of View_size.
244 (Sized_relobj_file::reverse_words): New function.
245 * object.h (Sized_relobj_file::View_size): Add
246 is_ctors_reverse_view field.
247 (class Sized_relobj_file): Update declarations.
248 * testsuite/initpri3.c: New test.
249 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
250 initpri3b.
251 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
252 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
253 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
254 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
255 * testsuite/Makefile.in: Rebuild.
256
472076e4
CC
2572011-06-24 Cary Coutant <ccoutant@google.com>
258
259 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
260 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
261 (debug_msg_cdebug.err): New targets.
262 * testsuite/Makefile.in: Regenerate.
263 * testsuite/debug_msg.sh: Check output of link with compressed debug.
264 Fix checks for link with shared library.
265
a60af0db
DK
2662011-06-24 Doug Kwan <dougkwan@google.com>
267
268 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
269 skip empty text sections.
270 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
271
5393d741
ILT
2722011-06-22 Ian Lance Taylor <iant@google.com>
273
274 PR gold/12910
275 * options.h (class General_options): Add --ctors-in-init-array.
276 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
277 friends as SHT_PROGBITS for merging sections.
278 (Layout::layout): Remove special handling of .init_array and
279 friends. Don't sort if doing relocatable link. Sort for .ctors
280 and .dtors if ctors_in_init_array.
281 (Layout::make_output_section): Force correct section types for
282 .init_array and friends. Don't sort if doing relocatable link,
283 Don't sort .ctors and .dtors if ctors_in_init_array.
284 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
285 (Layout::output_section_name): Add relobj parameter. Change all
286 callers. Handle .ctors. and .dtors. in code rather than table.
287 Handle .ctors and .dtors if ctors_in_init_array.
288 (Layout::match_file_name): New function, moved from output.cc.
289 * layout.h (class Layout): Update declarations.
290 * output.cc: Include "layout.h".
291 (Input_section_sort_entry::get_priority): New function.
292 (Input_section_sort_entry::match_file_name): Just call
293 Layout::match_file_name.
294 (Output_section::Input_section_sort_init_fini_compare::operator()):
295 Handle .ctors and .dtors. Sort by explicit priority rather than
296 by name.
297 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
298 * testsuite/initpri2.c: New test.
299 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
300 (check_PROGRAMS): Add initpri2.
301 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
302 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
303 * configure, testsuite/Makefile.in: Rebuild.
304
e1f74f98
ILT
3052011-06-19 Ian Lance Taylor <iant@google.com>
306
307 PR gold/12880
308 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
309 .interp section to a PT_INTERP segment even if we have seen a
310 --dynamic-linker option. Don't do it if we have seen a PHDRS
311 clause in a linker script.
312 (Layout::finalize): Don't create a .interp section if we've
313 already create a PT_INTERP segment.
314 (Layout::create_interp): Always call choose_output_section (revert
315 patch of 2011-06-17). Don't create PT_INTERP segment.
316 * script-sections.cc
317 (Script_sections::create_note_and_tls_segments): Add a .interp
318 section to a PT_INTERP segment even if we have seen a
319 --dynamic-linker option.
320
766f91bb
ILT
3212011-06-18 Ian Lance Taylor <iant@google.com>
322
323 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
324 merely because a non-PT_LOAD segment has a dynamic reloc.
325
0d212c3a
ILT
3262011-06-18 Ian Lance Taylor <iant@google.com>
327
328 * layout.cc (Layout::finish_dynamic_section): Don't create
329 DT_FLAGS entry if not needed.
330
911a5072
ILT
3312011-06-18 Ian Lance Taylor <iant@google.com>
332
333 PR gold/12745
334 * layout.cc (Layout::layout_eh_frame): Correct handling of
335 writable .eh_frame section.
336
534b4e5f
ILT
3372011-06-17 Ian Lance Taylor <iant@google.com>
338
339 PR gold/12893
340 * resolve.cc (Symbol_table::resolve): Don't give an error if a
341 symbol is redefined with the exact same object and value.
342
10b4f102
ILT
3432011-06-17 Ian Lance Taylor <iant@google.com>
344
345 PR gold/12880
346 * layout.h (class Layout): Add interp_segment_ field.
347 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
348 (Layout::attach_allocated_section_to_segment): If making shared
349 library, put .interp section in PT_INTERP segment.
350 (Layout::finalize): Also call create_interp if -dynamic-linker
351 option was used.
352 (Layout::create_interp): Assert that there is no PT_INTERP
353 segment. If not using a SECTIONS clause, use make_output_section.
354 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
355 * script-sections.cc
356 (Script_sections::create_note_and_tls_segments): If making shared
357 library, put .interp section in PT_INTERP segment.
358
a29b0dad
ILT
3592011-06-17 Ian Lance Taylor <iant@google.com>
360
e588ea8d
ILT
361 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
362 when making a shared library.
363
3642011-06-17 Ian Lance Taylor <iant@google.com>
365
366 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
367 parameter. Change all callers. Don't issue warning about PC32
368 against locally defined symbol.
a29b0dad 369
9d3b0698
ILT
3702011-06-16 Ian Lance Taylor <iant@google.com>
371
372 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
373 occurs in same object.
374
85b0f90c
AM
3752011-06-14 Alan Modra <amodra@gmail.com>
376
377 * po/POTFILES.in: Regenerate.
378
a94907d9
ILT
3792011-06-09 Ian Lance Taylor <iant@google.com>
380
381 * script-sections.cc
382 (Orphan_output_section::set_section_addresses): For a relocatable
383 link set address to 0.
384
4fb3a1c3
CC
3852011-06-09 Cary Coutant <ccoutant@google.com>
386
387 PR gold/12804
388 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
389 used with --compress-debug-sections.
390 * gold/object.cc (Sized_relobj_file::do_layout): Report
391 uncompressed size of compressed input sections.
392
61220854
CC
3932011-06-08 Cary Coutant <ccoutant@google.com>
394
395 PR gold/12804
396 * testsuite/two_file_test_2_v1.cc: Change initialization of
397 v2 to keep it in .data.
398
e6455dfb
CC
3992011-06-07 Cary Coutant <ccoutant@google.com>
400
401 * common.cc (Symbol_table::do_allocate_commons_list): Call
402 gold_fallback.
403 * errors.cc (Errors::fatal): Adjust call to gold_exit.
404 (Errors::fallback): New function.
405 (gold_fallback): New function.
406 * errors.h (Errors::fallback): New function.
407 * gold.cc (gold_exit): Change status parameter to enum; adjust
408 all callers.
409 (queue_initial_tasks): Call gold_fallback.
410 * gold.h: Include cstdlib.
411 (Exit_status): New enum type.
412 (gold_exit): Change status parameter to enum.
413 (gold_fallback): New function.
414 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
415 (Layout::create_symtab_sections): Likewise.
416 (Layout::create_shdrs): Likewise.
417 * main.cc (main): Adjust call to gold_exit.
418 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
419 (Output_data_got::add_got_entry_pair): Likewise.
420 (Output_section::add_input_section): Likewise.
421 (Output_section::add_output_section_data): Likewise.
422 (Output_segment::set_section_list_addresses): Likewise.
423 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
424
fb0e076f
CC
4252011-06-07 Cary Coutant <ccoutant@google.com>
426
427 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
428 for incremental links.
429 * output.cc (Output_segment::set_section_list_addresses): Remove
430 FIXME and test for TLS or BSS.
431
a5ee4d5d
CC
4322011-06-07 Cary Coutant <ccoutant@google.com>
433
434 * testsuite/Makefile.am: Add incremental_copy_test,
435 incremental_common_test_1.
436 * testsuite/Makefile.in: Regenerate.
437 * testsuite/common_test_1_v1.c: New source file.
438 * testsuite/common_test_1_v2.c: New source file.
439 * testsuite/copy_test_v1.cc: New source file.
440
5146f448
CC
4412011-06-07 Cary Coutant <ccoutant@google.com>
442
443 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
444 update, allocate common from bss section's free list.
445 * incremental-dump.cc (dump_incremental_inputs): Print flag for
446 linker-defined symbols.
447 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
448 Skip GOT and PLT entries that are no longer referenced.
449 (Output_section_incremental_inputs::write_info_blocks): Mark
450 linker-defined symbols.
451 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
452 * output.cc (Output_section::allocate): New function.
453 * output.h (Output_section::allocate): New function.
454 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
455 linker-defined symbols.
456 (Symbol::override_base_with_special): Copy is_predefined_ flag.
457 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
458 (Symbol::init_base_output_data): Likewise.
459 (Symbol::init_base_output_segment): Likewise.
460 (Symbol::init_base_constant): Likewise.
461 (Sized_symbol::init_output_data): Likewise.
462 (Sized_symbol::init_output_segment): Likewise.
463 (Sized_symbol::init_constant): Likewise.
464 (Symbol_table::do_define_in_output_data): Likewise.
465 (Symbol_table::do_define_in_output_segment): Likewise.
466 (Symbol_table::do_define_as_constant): Likewise.
467 * symtab.h (Symbol::is_predefined): New function.
468 (Symbol::init_base_output_data): Add is_predefined parameter.
469 (Symbol::init_base_output_segment): Likewise.
470 (Symbol::init_base_constant): Likewise.
471 (Symbol::is_predefined_): New data member.
472 (Sized_symbol::init_output_data): Add is_predefined parameter.
473 (Sized_symbol::init_output_segment): Likewise.
474 (Sized_symbol::init_constant): Likewise.
475 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
476
26d3c67d
CC
4772011-06-07 Cary Coutant <ccoutant@google.com>
478
479 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
480 instead of emit_copy_reloc.
481 (Copy_relocs::emit_copy_reloc): Refactor.
482 (Copy_relocs::make_copy_reloc): New function.
483 (Copy_relocs::add_copy_reloc): Remove.
484 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
485 section.
486 (Copy_relocs::make_copy_reloc): New function.
487 (Copy_relocs::add_copy_reloc): Remove.
488 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
489 unchanged input files.
490 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
491 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
492 Reserve BSS space for COPY relocations.
493 (Sized_incremental_binary::do_emit_copy_relocs): New function.
494 (Output_section_incremental_inputs::write_info_blocks): Record
495 whether a symbol is copied from a shared object.
496 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
497 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
498 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
499 (Incremental_input_entry_reader::get_output_symbol_index): Add
500 is_copy parameter.
501 (Incremental_binary::emit_copy_relocs): New function.
502 (Incremental_binary::do_emit_copy_relocs): New function.
503 (Sized_incremental_binary::Sized_incremental_binary): Initialize
504 new data member.
505 (Sized_incremental_binary::add_copy_reloc): New function.
506 (Sized_incremental_binary::do_emit_copy_relocs): New function.
507 (Sized_incremental_binary::Copy_reloc): New struct.
508 (Sized_incremental_binary::Copy_relocs): New typedef.
509 (Sized_incremental_binary::copy_relocs_): New data member.
510 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
511 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
512 * target.h (Sized_target::emit_copy_reloc): New function.
513 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
514
7cdb37d9
CC
5152011-06-02 Cary Coutant <ccoutant@google.com>
516
517 PR gold/12163
518 * gold/archive.cc (Archive::Archive): Initialize new data member.
519 (Archive::include_all_members): Return if archive has already been
520 included.
521 * gold/archive.h (Archive::include_all_members_): New data member.
522
cc643b88
NC
5232011-06-02 Nick Clifton <nickc@redhat.com>
524
525 * dynobj.h: Fix spelling mistake in comment.
526 * output.cc: Likewise.
527
f62a3ca7
DK
5282011-05-31 Doug Kwan <dougkwan@google.com>
529 Asier Llano
530
531 PR gold/12826
cc643b88 532 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
533 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
534 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
535 redundant arm_exidx_test.so.
536 * testsuite/Makefile.in: Regenerate.
537 (check_SCRIPTS): Add pr12826.sh
538 (check_DATA): Add pr12826.stdout
539 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
540 * testsuite/pr12826.sh: New file.
541 * testsuite/pr12826_1.s: Ditto.
542 * testsuite/pr12826_1.s: Ditto.
543
8dbe1edc
ILT
5442011-05-30 Ian Lance Taylor <iant@google.com>
545
546 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
547 sections.
548
c49875be
ILT
5492011-05-29 Ian Lance Taylor <iant@google.com>
550
551 PR gold/12804
552 * testsuite/Makefile.am: Use different file name for two_file_test
553 temporary file for each incremental test.
554 * testsuite/Makefile.in: Rebuild.
555
69d53f7a
ILT
5562011-05-29 Ian Lance Taylor <iant@google.com>
557
558 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
559 binary input file is empty.
560
41d0ab5f
ILT
5612011-05-27 Ian Lance Taylor <iant@google.com>
562
563 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
564 (ver_test_9.so): Likewise.
565 * testsuite/Makefile.in: Rebuild.
566
89d8a36b
CC
5672011-05-26 Cary Coutant <ccoutant@google.com>
568
569 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
570 * incremental.cc (Incremental_inputs::report_input_section): Fix
571 comment, indentation.
572 (Incremental_inputs::report_comdat_group): New function.
573 (Output_section_incremental_inputs::set_final_data_size): Adjust size
574 of data for incremental input file entry.
575 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
576 group count, COMDAT group signatures.
577 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
578 an unchanged input file.
579 * incremental.h (Incremental_object_entry::Incremental_object_entry):
580 Initialize new data member.
581 (Incremental_object_entry::add_comdat_group): New function.
582 (Incremental_object_entry::get_comdat_group_count): New function.
583 (Incremental_object_entry::get_comdat_signature_key): New function.
584 (Incremental_object_entry::groups_): New data member.
585 (Incremental_inputs::report_comdat_group): New function.
586 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
587 data for incremental input file entry.
588 (Incremental_input_entry_reader::get_comdat_group_count): New function.
589 (Incremental_input_entry_reader::get_input_section): Adjust size of
590 data for incremental input file entry.
591 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
592 (Incremental_input_entry_reader::get_comdat_group_signature): New
593 function.
594 * object.cc (Sized_relobj::include_section_group): Report kept
595 COMDAT groups for incremental links.
596
1706a06f
ILT
5972011-05-24 David Meyer <pdox@google.com>
598
599 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
600 with name parameter. Add found_name parameter.
601 * fileread.cc (Input_file::find_file): Adjust code accordingly.
602 * dirsearch.h (class Dirsearch): Update declaration.
603
a10ae760
ILT
6042011-05-24 Ian Lance Taylor <iant@google.com>
605
606 * archive.cc (Library_base::should_include_member): Pull in object
607 from archive if it defines the entry symbol.
608 * parameters.cc (Parameters::entry): New function.
609 * parameters.h (class Parameters): Declare entry.
610 * output.h (class Output_file_header): Remove entry_ field.
611 * output.cc (Output_file_header::Output_file_header): Remove entry
612 parameter. Change all callers.
613 (Output_file_header::entry): Use parameters->entry.
614 * gold.cc (queue_middle_tasks): Likewise.
615 * plugin.cc (Plugin_hook::run): Likewise.
616
aa92d6ed
CC
6172011-05-24 Cary Coutant <ccoutant@google.com>
618
619 * gold.cc (queue_initial_tasks): Pass incremental base filename
620 to Output_file::open_base_file; don't print error message.
621 * incremental-dump.cc (main): Adjust call to
622 Output_file::open_for_modification.
623 * incremental-dump.cc (main): Likewise.
624 * incremental.cc (Incremental_inputs::report_command_line):
625 Ignore --incremental-base option when comparing command lines.
626 Ignore parameter when given as separate argument.
627 * options.h (class General_options): Add --incremental-base.
628 * output.cc (Output_file::Output_file):
629 (Output_file::open_base_file): Add base_name and writable parameters;
630 read base file into new file; print error message here.
631 (Output_file::map_no_anonymous): Add writable parameter; adjust all
632 callers.
633 * output.h (Output_file::open_for_modification): Rename to...
634 (Output_file::open_base_file): ...this; add base_name and
635 writable parameters; adjust all callers.
636 (Output_file::map_no_anonymous): Add writable parameter; adjust all
637 callers.
638 * testsuite/Makefile.am (incremental_test_4): Test
639 --incremental-base.
640 * testsuite/Makefile.in: Regenerate.
641
2eedd706
CC
6422011-05-24 Cary Coutant <ccoutant@google.com>
643
644 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
645 incremental_test_4.
646 * testsuite/Makefile.in: Regenerate.
647 * testsuite/two_file_test_1_v1.cc: New test source file.
648 * testsuite/two_file_test_1b_v1.cc: New test source file.
649 * testsuite/two_file_test_2_v1.cc: New test source file.
650
0f1c85a6
CC
6512011-05-24 Cary Coutant <ccoutant@google.com>
652
653 * dynobj.h (Dynobj::do_dynobj): New function.
654 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
655 flag and soname for shared objects.
656 * incremental.cc (Incremental_inputs::report_object): Make
657 either Incremental_object_entry or Incremental_dynobj_entry; add
658 soname to string table.
659 (Incremental_inputs::report_input_section): Add assertion.
660 (Output_section_incremental_inputs::set_final_data_size): Adjust
661 type of input file entry for shared libraries; adjust size of
662 shared library info entry.
663 (Output_section_incremental_inputs::write_input_files): Write
664 as_needed flag for shared libraries.
665 (Output_section_incremental_inputs::write_info_blocks): Adjust type
666 of input file entry for shared libraries; write soname.
667 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
668 soname from incremental info.
669 * incremental.h (enum Incremental_input_flags): Add
670 INCREMENTAL_INPUT_AS_NEEDED.
671 (Incremental_input_entry::Incremental_input_entry): Initialize new
672 data member.
673 (Incremental_input_entry::set_as_needed): New function.
674 (Incremental_input_entry::as_needed): New function.
675 (Incremental_input_entry::do_dynobj_entry): New function.
676 (Incremental_input_entry::as_needed_): New data member.
677 (Incremental_object_entry::Incremental_object_entry): Don't check
678 for shared library.
679 (Incremental_object_entry::do_type): Likewise.
680 (class Incremental_dynobj_entry): New class.
681 (Incremental_input_entry_reader::as_needed): New function.
682 (Incremental_input_entry_reader::get_soname): New function.
683 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
684 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
685 size of shared library info entry.
686 * layout.cc (Layout::finish_dynamic_section): Don't test for
687 incremental link when adding DT_NEEDED entries.
688 * object.h (Object::Object): Initialize new data member.
689 (Object::dynobj): New function.
690 (Object::set_as_needed): New function.
691 (Object::as_needed): New function.
692 (Object::do_dynobj): New function.
693 (Object::as_needed_): New data member.
694
6fa2a40b
CC
6952011-05-24 Cary Coutant <ccoutant@google.com>
696
697 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
698 info; adjust display of GOT entries.
699 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
700 vector of input objects; remove file_status_.
701 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
702 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
703 got_plt reader; call target hooks to reserve GOT entries.
704 (Output_section_incremental_inputs::set_final_data_size): Adjust size
705 of input file info header and GOT info entry.
706 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
707 relocation info.
708 (Got_plt_view_info::got_descriptor): Remove.
709 (Got_plt_view_info::sym_index): New data member.
710 (Got_plt_view_info::input_index): New data member.
711 (Local_got_offset_visitor::visit): Write input file index.
712 (Global_got_offset_visitor::visit): Write 0 for input file index.
713 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
714 with sym_index and input_index.
715 (Output_section_incremental_inputs::write_got_plt): Adjust size of
716 incremental info GOT entry; replace got_descriptor with input_index.
717 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
718 map from input file index to object.
719 (Sized_relobj_incr::do_layout): Replace direct data member reference
720 with accessor function.
721 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
722 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
723 Adjust size of input file info header.
724 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
725 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
726 (Incremental_input_entry_reader::get_input_section): Adjust size of
727 input file info header.
728 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
729 of incremental info GOT entry.
730 (Incremental_got_plt_reader::get_got_desc): Remove.
731 (Incremental_got_plt_reader::get_got_symndx): New function.
732 (Incremental_got_plt_reader::get_got_input_index): New function.
733 (Sized_incremental_binary::Sized_incremental_binary): Remove
734 file_status_; add input_objects_.
735 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
736 (Sized_incremental_binary::set_file_is_unchanged): Remove.
737 (Sized_incremental_binary::file_is_unchanged): Remove.
738 (Sized_incremental_binary::set_input_object): New function.
739 (Sized_incremental_binary::input_object): New function.
740 (Sized_incremental_binary::file_status_): Remove.
741 (Sized_incremental_binary::input_objects_): New data member.
742 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
743 references.
744 (Sized_relobj_incr::invalid_address): Move to base class.
745 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
746 class.
747 (Sized_relobj_incr::do_output_section_offset): Likewise.
748 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
749 (Sized_relobj_incr::section_offsets_): Likewise.
750 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
751 function.
752 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
753 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
754 with accessor function.
755 (Sized_relobj_file::do_layout): Likewise.
756 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
757 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
758 (Sized_relobj_file::compute_final_local_value): Replace refs to
759 section_offsets_ with accessor function.
760 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
761 * object.h (Relobj::Relobj): Initialize new data members.
762 (Relobj::add_dyn_reloc): New function.
763 (Relobj::first_dyn_reloc): New function.
764 (Relobj::dyn_reloc_count): New function.
765 (Relobj::first_dyn_reloc_): New data member.
766 (Relobj::dyn_reloc_count_): New data member.
767 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
768 references.
769 (Sized_relobj::Address): New typedef.
770 (Sized_relobj::invalid_address): Move here from child class.
771 (Sized_relobj::Sized_relobj): Initialize new data members.
772 (Sized_relobj::sized_relobj): New function.
773 (Sized_relobj::is_output_section_offset_invalid): Move here from
774 child class.
775 (Sized_relobj::get_output_section_offset): Likewise.
776 (Sized_relobj::local_has_got_offset): Likewise.
777 (Sized_relobj::local_got_offset): Likewise.
778 (Sized_relobj::set_local_got_offset): Likewise.
779 (Sized_relobj::do_for_all_local_got_entries): Likewise.
780 (Sized_relobj::clear_got_offsets): New function.
781 (Sized_relobj::section_offsets): Move here from child class.
782 (Sized_relobj::do_output_section_offset): Likewise.
783 (Sized_relobj::do_set_section_offset): Likewise.
784 (Sized_relobj::Local_got_offsets): Likewise.
785 (Sized_relobj::local_got_offsets_): Likewise.
786 (Sized_relobj::section_offsets_): Likewise.
787 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
788 references.
789 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
790 class.
791 (Sized_relobj_file::sized_relobj): New function
792 (Sized_relobj_file::local_has_got_offset): Move to base class.
793 (Sized_relobj_file::local_got_offset): Likewise.
794 (Sized_relobj_file::set_local_got_offset): Likewise.
795 (Sized_relobj_file::get_output_section_offset): Likewise.
796 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
797 (Sized_relobj_file::do_output_section_offset): Likewise.
798 (Sized_relobj_file::do_set_section_offset): Likewise.
799 (Sized_relobj_file::Local_got_offsets): Likewise.
800 (Sized_relobj_file::local_got_offsets_): Likewise.
801 (Sized_relobj_file::section_offsets_): Likewise.
802 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
803 (all constructors).
804 (set_needs_dynsym_index): Convert relobj to derived class pointer.
805 (Output_reloc::get_symbol_index): Likewise.
806 (Output_reloc::local_section_offset): Likewise.
807 (Output_reloc::get_address): Likewise.
808 (Output_reloc::symbol_value): Likewise.
809 (Output_data_got::reserve_slot): Move to class definition.
810 (Output_data_got::reserve_local): New function.
811 (Output_data_got::reserve_slot_for_global): Remove.
812 (Output_data_got::reserve_global): New function.
813 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
814 (all constructors, two instantiations).
815 (Output_reloc::get_relobj): New function (two instantiations).
816 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
817 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
818 (Output_data_reloc::add_global): Adjust type of relobj.
819 (Output_data_reloc::add_global_relative): Likewise.
820 (Output_data_reloc::add_symbolless_global_addend): Likewise.
821 (Output_data_reloc::add_local): Likewise.
822 (Output_data_reloc::add_local_relative): Likewise.
823 (Output_data_reloc::add_symbolless_local_addend): Likewise.
824 (Output_data_reloc::add_local_section): Likewise.
825 (Output_data_reloc::add_output_section): Likewise.
826 (Output_data_reloc::add_absolute): Likewise.
827 (Output_data_reloc::add_target_specific): Likewise.
828 (Output_data_got::reserve_slot): Move definition here.
829 (Output_data_got::reserve_local): New function.
830 (Output_data_got::reserve_global): New function.
831 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
832 section_offsets_ with accessor function.
833 (Sized_relobj_file::write_sections): Likewise.
834 (Sized_relobj_file::do_relocate_sections): Likewise.
835 * target.h (Sized_target::reserve_local_got_entry): New function.
836 (Sized_target::reserve_global_got_entry): New function.
837 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
838 (Target_x86_64::reserve_global_got_entry): New function.
839 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
840
4829d394
CC
8412011-05-23 Cary Coutant <ccoutant@google.com>
842
843 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
844 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
845 bit when checking got_type.
846 * incremental.cc (Sized_incremental_binary::setup_readers):
847 Store symbol table and string table locations; initialize bit vector
848 of file status flags.
849 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
850 unchanged files.
851 (Sized_incremental_binary::do_process_got_plt): New function.
852 (Sized_incremental_binary::get_symtab_view): Use stored locations.
853 (Output_section_incremental_inputs::set_final_data_size): Record
854 file index for each input file.
855 (Output_section_incremental_inputs::write_got_plt): Store file index
856 instead of input entry offset for each GOT entry.
857 * incremental.h
858 (Incremental_input_entry::Incremental_input_entry): Initialize new
859 data member.
860 (Incremental_input_entry::set_offset): Store file index.
861 (Incremental_input_entry::get_file_index): New function.
862 (Incremental_input_entry::file_index_): New data member.
863 (Incremental_binary::process_got_plt): New function.
864 (Incremental_binary::do_process_got_plt): New function.
865 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
866 data members.
867 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
868 (Sized_incremental_binary::set_file_is_unchanged): New function.
869 (Sized_incremental_binary::file_is_unchanged): New function.
870 (Sized_incremental_binary::do_process_got_plt): New function.
871 (Sized_incremental_binary::file_status_): New data member.
872 (Sized_incremental_binary::main_symtab_loc_): New data member.
873 (Sized_incremental_binary::main_strtab_loc_): New data member.
874 * output.cc (Output_data_got::Got_entry::write): Add case
875 RESERVED_CODE.
876 (Output_data_got::add_global): Call add_got_entry.
877 (Output_data_got::add_global_plt): Likewise.
878 (Output_data_got::add_global_with_rel): Likewise.
879 (Output_data_got::add_global_with_rela): Likewise.
880 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
881 (Output_data_got::add_global_pair_with_rela): Likewise.
882 (Output_data_got::add_local): Call add_got_entry.
883 (Output_data_got::add_local_plt): Likewise.
884 (Output_data_got::add_local_with_rel): Likewise.
885 (Output_data_got::add_local_with_rela): Likewise.
886 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
887 (Output_data_got::add_local_pair_with_rela): Likewise.
888 (Output_data_got::reserve_slot): New function.
889 (Output_data_got::reserve_slot_for_global): New function.
890 (Output_data_got::add_got_entry): New function.
891 (Output_data_got::add_got_entry_pair): New function.
892 (Output_section::add_output_section_data): Edit FIXME.
893 * output.h
894 (Output_section_data_build::Output_section_data_build): New
895 constructor with size parameter.
896 (Output_data_space::Output_data_space): Likewise.
897 (Output_data_got::Output_data_got): Initialize new data member; new
898 constructor with size parameter.
899 (Output_data_got::add_constant): Call add_got_entry.
900 (Output_data_got::reserve_slot): New function.
901 (Output_data_got::reserve_slot_for_global): New function.
902 (class Output_data_got::Got_entry): Add RESERVED_CODE.
903 (Output_data_got::add_got_entry): New function.
904 (Output_data_got::add_got_entry_pair): New function.
905 (Output_data_got::free_list_): New data member.
906 * target.h (Sized_target::init_got_plt_for_update): New function.
907 (Sized_target::register_global_plt_entry): New function.
908 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
909 Initialize new data member; call init; add constructor with PLT count.
910 (Output_data_plt_x86_64::init): New function.
911 (Output_data_plt_x86_64::add_relocation): New function.
912 (Output_data_plt_x86_64::reserve_slot): New function.
913 (Output_data_plt_x86_64::free_list_): New data member.
914 (Target_x86_64::init_got_plt_for_update): New function.
915 (Target_x86_64::register_global_plt_entry): New function.
916 (Output_data_plt_x86_64::add_entry): Allocate from free list for
917 incremental updates.
918 (Output_data_plt_x86_64::add_relocation): New function.
919 * testsuite/object_unittest.cc (Object_test): Set default options.
920
ec69d6da
ILT
9212011-05-16 Ian Lance Taylor <iant@google.com>
922
923 * options.h (class General_options): Make -i a synonym for -r.
924
732e31de
ILT
9252011-05-16 Ian Lance Taylor <iant@google.com>
926
927 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
928
403676b5
CC
9292011-05-10 Cary Coutant <ccoutant@google.com>
930
931 * object.cc (Sized_relobj::do_count_local_symbols): Check for
932 strip_all (-s).
933
5b7b7d6e
ILT
9342011-05-06 Ian Lance Taylor <iant@google.com>
935
936 * layout.cc (Layout::layout): If the output section flags change,
937 update the ordering.
938
f0f9babf
CC
9392011-04-25 Cary Coutant <ccoutant@google.com>
940
941 * incremental-dump.cc (dump_incremental_inputs): Print local
942 symbol info for each input file.
943 * incremental.cc
944 (Output_section_incremental_inputs::set_final_data_size): Add local
945 symbol info to input file entries in incremental info.
946 (Output_section_incremental_inputs::write_info_blocks): Likewise.
947 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
948 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
949 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
950 implementation.
951 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
952 (Sized_incr_relobj::do_relocate): Write the local symbols.
953 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
954 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
955 Adjust size of input file header.
956 (Incremental_inputs_reader::get_local_symbol_offset): New function.
957 (Incremental_inputs_reader::get_local_symbol_count): New function.
958 (Incremental_inputs_reader::get_input_section): Adjust size of input
959 file header.
960 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
961 (Sized_incr_relobj::This): New typedef.
962 (Sized_incr_relobj::sym_size): New const data member.
963 (Sized_incr_relobj::Local_symbol): New struct.
964 (Sized_incr_relobj::do_output_local_symbol_count): New function.
965 (Sized_incr_relobj::do_local_symbol_offset): New function.
966 (Sized_incr_relobj::local_symbol_count_): New data member.
967 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
968 (Sized_incr_relobj::local_symbol_index_): New data member.
969 (Sized_incr_relobj::local_symbol_offset_): New data member.
970 (Sized_incr_relobj::local_dynsym_offset_): New data member.
971 (Sized_incr_relobj::local_symbols_): New data member.
972 * object.h (Relobj::output_local_symbol_count): New function.
973 (Relobj::local_symbol_offset): New function.
974 (Relobj::do_output_local_symbol_count): New function.
975 (Relobj::do_local_symbol_offset): New function.
976 (Sized_relobj::do_output_local_symbol_count): New function.
977 (Sized_relobj::do_local_symbol_offset): New function.
978
d0a9ace3
ILT
9792011-04-22 Vladimir Simonov <sv@sw.ru>
980
981 * descriptors.cc (set_close_on_exec): New function.
982 (Descriptors::open): Use set_close_on_exec.
983 * output.cc (S_ISLNK): Define if not defined.
984
94a3fc8b
CC
9852011-04-22 Cary Coutant <ccoutant@google.com>
986
987 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
988 global symbol map.
989 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
990 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
991 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
992 relocations.
993 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
994 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
995 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
996 * incremental.h
997 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
998 function.
999 (Incremental_binary::apply_incremental_relocs): New function.
1000 (Incremental_binary::do_apply_incremental_relocs): New function.
1001 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1002 data member.
1003 (Sized_incremental_binary::add_global_symbol): New function.
1004 (Sized_incremental_binary::global_symbol): New function.
1005 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1006 (Sized_incremental_binary::symbol_map_): New data member.
1007 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
1008 * target.h (Sized_target::apply_relocation): New function.
1009 * target-reloc.h (apply_relocation): New function.
1010 * x86_64.cc (Target_x86_64::apply_relocation): New function.
1011
c87e4302
DK
10122011-04-22 Doug Kwan <dougkwan@google.com>
1013
1014 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
1015 flag of a SHT_ARM_EXIDX section.
1016 * testsuite/Makefile.am (arm_exidx_test): New test rules.
1017 * testsuite/Makefile.in: Regenerate.
1018 * testsuite/arm_exidx_test.s: New file.
1019 * testsuite/arm_exidx_test.sh: Same.
1020
e7782cf6
CC
10212011-04-20 Cary Coutant <ccoutant@google.com>
1022
1023 PR gold/12689
1024 * archive.h (Incremental_archive_entry::Archive_member):
1025 Initialize arg_serial_ (second constructor).
1026
308ecdc7
ILT
10272011-04-17 Ian Lance Taylor <iant@google.com>
1028
1029 * object.cc (Relocate_info::location): Simplify location string.
1030 * errors.cc (Errors::error_at_location): Don't print program
1031 name.
1032 (Errors::warning_at_location): Likewise.
1033 (Errors::undefined_symbol): Likewise.
1034 * testsuite/debug_msg.sh: Update accordingly.
1035
bec5b579
CC
10362011-04-14 Cary Coutant <ccoutant@google.com>
1037
1038 * gold/layout.cc (Layout::symtab_section_offset): New function.
1039 * gold/layout.h (Layout::symtab_section_offset): New function.
1040 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
1041
88597d34
ILT
10422011-04-12 Ian Lance Taylor <iant@google.com>
1043
1044 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
1045 with MREMAP_MAYMOVE.
1046 * output.h (class Output_file): Add map_is_allocated_ field.
1047 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
1048 not available, provide stubs. If mremap is not available, #define
1049 it to gold_mremap.
1050 (MREMAP_MAYMOVE): Define if not defined.
1051 (Output_file::Output_file): Initialize map_is_allocated_.
1052 (Output_file::resize): Check map_is_allocated_.
1053 (Output_file::map_anonymous): If mmap fails, use malloc.
1054 (Output_file::unmap): Don't do anything for an anonymous map.
1055 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
1056 is not available, provide stubs.
1057 (File_read::View::~View): Use free rather than delete[].
1058 (File_read::make_view): Use malloc rather than new[]. If mmap
1059 fails, use malloc.
1060 (File_read::find_or_make_view): Use malloc rather than new[].
1061 * gold.h: Remove HAVE_REMAP code.
1062 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
1063 exists. Rename mremap to gold_mremap. If mmap is not available
1064 don't do anything.
1065 * configure, config.in: Rebuild.
1066
11e361bc
ILT
10672011-04-11 Ian Lance Taylor <iant@google.com>
1068
1069 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
1070 initialize local variable v.
1071
cdc29364
CC
10722011-04-11 Cary Coutant <ccoutant@google.com>
1073
1074 * archive.cc (Archive::include_member): Adjust call to
1075 report_object.
1076 (Add_archive_symbols::run): Track argument serial numbers.
1077 (Lib_group::include_member): Likewise.
1078 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1079 * archive.h (Incremental_archive_entry::Archive_member):
1080 Initialize arg_serial_.
1081 (Archive_member::arg_serial_): New data member.
1082 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1083 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1084 incremental link.
1085 (Sized_dynobj::do_for_all_local_got_entries): New function.
1086 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1087 function.
1088 * fileread.cc (get_mtime): New function.
1089 * fileread.h (get_mtime): New function.
1090 * gold.cc (queue_initial_tasks): Check for incremental update.
1091 (process_incremental_input): New function.
1092 (queue_middle_tasks): Don't force valid target for incremental
1093 update.
1094 * incremental-dump.cc (find_input_containing_global): Adjust
1095 size of symbol info entry.
1096 (dump_incremental_inputs): Dump argument serial number and
1097 in_system_directory flag; bias shndx by 1; print symbol names
1098 when dumping per-file symbol lists; use new symbol info readers.
1099 * incremental.cc
1100 (Output_section_incremental_inputs:update_data_size): New function.
1101 (Sized_incremental_binary::setup_readers): Setup input readers
1102 for each input file; build maps for files added from libraries
1103 and scripts.
1104 (Sized_incremental_binary::check_input_args): New function.
1105 (Sized_incremental_binary::do_check_inputs): Build map of argument
1106 serial numbers to input arguments.
1107 (Sized_incremental_binary::do_file_has_changed): Rename
1108 do_file_is_unchanged to this; compare file modification times.
1109 (Sized_incremental_binary::do_init_layout): New function.
1110 (Sized_incremental_binary::do_reserve_layout): New function.
1111 (Sized_incremental_binary::do_get_input_reader): Remove.
1112 (Sized_incremental_binary::get_symtab_view): New function.
1113 (Incremental_checker::can_incrementally_link_output_file): Remove.
1114 (Incremental_inputs::report_command_line): Exclude --debug options.
1115 (Incremental_inputs::report_archive_begin): Add parameter; track
1116 argument serial numbers; don't put input file entry for archive
1117 before archive members.
1118 (Incremental_inputs::report_archive_end): Put input file entry
1119 for archive after archive members.
1120 (Incremental_inputs::report_object): Add parameter; track argument
1121 serial numbers and in_system_directory flag.
1122 (Incremental_inputs::report_script): Add parameter; track argument
1123 serial numbers.
1124 (Output_section_incremental_inputs::set_final_data_size): Adjust
1125 size of symbol info entry; check for forwarding symbols.
1126 (Output_section_incremental_inputs::write_input_files): Write
1127 in_system_directory flag and argument serial number.
1128 (Output_section_incremental_inputs::write_info_blocks): Map section
1129 indices between incremental info and original input file; store
1130 input section index for each symbol.
1131 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1132 change operator() to visit().
1133 (class Global_got_offset_visitor): Likewise.
1134 (class Global_symbol_visitor_got_plt):
1135 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1136 classes.
1137 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1138 (Sized_incr_relobj::do_read_symbols): New function.
1139 (Sized_incr_relobj::do_layout): New function.
1140 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1141 (Sized_incr_relobj::do_add_symbols): New function.
1142 (Sized_incr_relobj::do_should_include_member): New function.
1143 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1144 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1145 (Sized_incr_relobj::do_section_size): New function.
1146 (Sized_incr_relobj::do_section_name): New function.
1147 (Sized_incr_relobj::do_section_contents): New function.
1148 (Sized_incr_relobj::do_section_flags): New function.
1149 (Sized_incr_relobj::do_section_entsize): New function.
1150 (Sized_incr_relobj::do_section_address): New function.
1151 (Sized_incr_relobj::do_section_type): New function.
1152 (Sized_incr_relobj::do_section_link): New function.
1153 (Sized_incr_relobj::do_section_info): New function.
1154 (Sized_incr_relobj::do_section_addralign): New function.
1155 (Sized_incr_relobj::do_initialize_xindex): New function.
1156 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1157 (Sized_incr_relobj::do_read_relocs): New function.
1158 (Sized_incr_relobj::do_gc_process_relocs): New function.
1159 (Sized_incr_relobj::do_scan_relocs): New function.
1160 (Sized_incr_relobj::do_count_local_symbols): New function.
1161 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1162 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1163 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1164 (Sized_incr_relobj::do_relocate): New function.
1165 (Sized_incr_relobj::do_set_section_offset): New function.
1166 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1167 (Sized_incr_dynobj::do_read_symbols): New function.
1168 (Sized_incr_dynobj::do_layout): New function.
1169 (Sized_incr_dynobj::do_add_symbols): New function.
1170 (Sized_incr_dynobj::do_should_include_member): New function.
1171 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1172 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1173 (Sized_incr_dynobj::do_section_size): New function.
1174 (Sized_incr_dynobj::do_section_name): New function.
1175 (Sized_incr_dynobj::do_section_contents): New function.
1176 (Sized_incr_dynobj::do_section_flags): New function.
1177 (Sized_incr_dynobj::do_section_entsize): New function.
1178 (Sized_incr_dynobj::do_section_address): New function.
1179 (Sized_incr_dynobj::do_section_type): New function.
1180 (Sized_incr_dynobj::do_section_link): New function.
1181 (Sized_incr_dynobj::do_section_info): New function.
1182 (Sized_incr_dynobj::do_section_addralign): New function.
1183 (Sized_incr_dynobj::do_initialize_xindex): New function.
1184 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1185 (make_sized_incremental_object): New function.
1186 (Incremental_library::copy_unused_symbols): New function.
1187 (Incremental_library::do_for_all_unused_symbols): New function.
1188 * incremental.h (enum Incremental_input_flags): New type.
1189 (class Incremental_checker): Remove.
1190 (Incremental_input_entry::Incremental_input_entry): Add argument
1191 serial number.
1192 (Incremental_input_entry::arg_serial): New function.
1193 (Incremental_input_entry::set_is_in_system_directory): New function.
1194 (Incremental_input_entry::is_in_system_directory): New function.
1195 (Incremental_input_entry::arg_serial_): New data member.
1196 (Incremental_input_entry::is_in_system_directory_): New data member.
1197 (class Script_info): Move here from script.h.
1198 (Script_info::Script_info): Add filename parameter.
1199 (Script_info::filename): New function.
1200 (Script_info::filename_): New data member.
1201 (Incremental_script_entry::Incremental_script_entry): Add argument
1202 serial number.
1203 (Incremental_object_entry::Incremental_object_entry): Likewise.
1204 (Incremental_object_entry::add_input_section): Build list of input
1205 sections with map to original shndx.
1206 (Incremental_object_entry::get_input_section_index): New function.
1207 (Incremental_object_entry::shndx_): New data member.
1208 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1209 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1210 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1211 serial number.
1212 (Incremental_inputs::report_archive_begin): Likewise.
1213 (Incremental_inputs::report_object): Likewise.
1214 (Incremental_inputs::report_script): Likewise.
1215 (class Incremental_global_symbol_reader): New class.
1216 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1217 and store flags and input file type.
1218 (Incremental_input_entry_reader::arg_serial): New function.
1219 (Incremental_input_entry_reader::type): Extract type from flags.
1220 (Incremental_input_entry_reader::is_in_system_directory): New function.
1221 (Incremental_input_entry_reader::get_input_section_count): Call
1222 accessor function for type.
1223 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1224 function for type; adjust size of global symbol entry.
1225 (Incremental_input_entry_reader::get_global_symbol_count): Call
1226 accessor function for type.
1227 (Incremental_input_entry_reader::get_object_count): Likewise.
1228 (Incremental_input_entry_reader::get_object_offset): Likewise.
1229 (Incremental_input_entry_reader::get_member_count): Likewise.
1230 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1231 (Incremental_input_entry_reader::get_member_offset): Likewise.
1232 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1233 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1234 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1235 (Incremental_input_entry_reader::get_global_symbol_reader): New
1236 function.
1237 (Incremental_input_entry_reader::get_output_symbol_index): New
1238 function.
1239 (Incremental_input_entry_reader::type_): Remove.
1240 (Incremental_input_entry_reader::flags_): New data member.
1241 (Incremental_inputs_reader::input_file_offset): New function.
1242 (Incremental_inputs_reader::input_file_index): New function.
1243 (Incremental_inputs_reader::input_file): Call input_file_offset.
1244 (Incremental_inputs_reader::input_file_at_offset): New function.
1245 (Incremental_relocs_reader::get_r_type): Reformat.
1246 (Incremental_relocs_reader::get_r_shndx): Reformat.
1247 (Incremental_relocs_reader::get_r_offset): Reformat.
1248 (Incremental_relocs_reader::data): New function.
1249 (Incremental_binary::Incremental_binary): Initialize new data members.
1250 (Incremental_binary::check_inputs): Add cmdline parameter.
1251 (Incremental_binary::file_is_unchanged): Remove.
1252 (Input_reader::arg_serial): New function.
1253 (Input_reader::get_unused_symbol_count): New function.
1254 (Input_reader::get_unused_symbol): New function.
1255 (Input_reader::do_arg_serial): New function.
1256 (Input_reader::do_get_unused_symbol_count): New function.
1257 (Input_reader::do_get_unused_symbol): New function.
1258 (Incremental_binary::input_file_count): New function.
1259 (Incremental_binary::get_input_reader): Change signature to use
1260 index instead of filename.
1261 (Incremental_binary::file_has_changed): New function.
1262 (Incremental_binary::get_input_argument): New function.
1263 (Incremental_binary::get_library): New function.
1264 (Incremental_binary::get_script_info): New function.
1265 (Incremental_binary::init_layout): New function.
1266 (Incremental_binary::reserve_layout): New function.
1267 (Incremental_binary::output_file): New function.
1268 (Incremental_binary::do_check_inputs): New function.
1269 (Incremental_binary::do_file_is_unchanged): Remove.
1270 (Incremental_binary::do_file_has_changed): New function.
1271 (Incremental_binary::do_init_layout): New function.
1272 (Incremental_binary::do_reserve_layout): New function.
1273 (Incremental_binary::do_input_file_count): New function.
1274 (Incremental_binary::do_get_input_reader): Change signature.
1275 (Incremental_binary::input_args_map_): New data member.
1276 (Incremental_binary::library_map_): New data member.
1277 (Incremental_binary::script_map_): New data member.
1278 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1279 new data members.
1280 (Sized_incremental_binary::output_section): New function.
1281 (Sized_incremental_binary::inputs_reader): Add const.
1282 (Sized_incremental_binary::symtab_reader): Add const.
1283 (Sized_incremental_binary::relocs_reader): Add const.
1284 (Sized_incremental_binary::got_plt_reader): Add const.
1285 (Sized_incremental_binary::get_symtab_view): New function.
1286 (Sized_incremental_binary::Inputs_reader): New typedef.
1287 (Sized_incremental_binary::Input_entry_reader): New typedef.
1288 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1289 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1290 (Sized_incremental_binary::do_file_has_changed): New function.
1291 (Sized_incremental_binary::do_init_layout): New function.
1292 (Sized_incremental_binary::do_reserve_layout): New function.
1293 (Sized_input_reader::Inputs_reader): Remove.
1294 (Sized_input_reader::Input_entry_reader): Remove.
1295 (Sized_input_reader::do_arg_serial): New function.
1296 (Sized_input_reader::do_get_unused_symbol_count): New function.
1297 (Sized_input_reader::do_get_unused_symbol): New function.
1298 (Sized_incremental_binary::do_input_file_count): New function.
1299 (Sized_incremental_binary::do_get_input_reader): Change signature;
1300 use index instead of filename.
1301 (Sized_incremental_binary::section_map_): New data member.
1302 (Sized_incremental_binary::input_entry_readers_): New data member.
1303 (class Sized_incr_relobj): New class.
1304 (class Sized_incr_dynobj): New class.
1305 (make_sized_incremental_object): New function.
1306 (class Incremental_library): New class.
1307 * layout.cc (Free_list::num_lists): New static data member.
1308 (Free_list::num_nodes): New static data member.
1309 (Free_list::num_removes): New static data member.
1310 (Free_list::num_remove_visits): New static data member.
1311 (Free_list::num_allocates): New static data member.
1312 (Free_list::num_allocate_visits): New static data member.
1313 (Free_list::init): New function.
1314 (Free_list::remove): New function.
1315 (Free_list::allocate): New function.
1316 (Free_list::dump): New function.
1317 (Free_list::print_stats): New function.
1318 (Layout_task_runner::run): Resize output file for incremental updates.
1319 (Layout::Layout): Initialize new data members.
1320 (Layout::set_incremental_base): New function.
1321 (Layout::init_fixed_output_section): New function.
1322 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1323 incremental updates.
1324 (Layout::create_gold_note): Do not create gold note section for
1325 incremental updates.
1326 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1327 for incremental updates.
1328 (Layout::set_section_offsets): For incremental updates, allocate space
1329 from free list.
1330 (Layout::create_symtab_sections): Layout with offsets relative to
1331 start of section; for incremental updates, allocate space from free
1332 list.
1333 (Layout::create_shdrs): For incremental updates, allocate space from
1334 free list.
1335 (Layout::finish_dynamic_section): For incremental updates, do not
1336 check --as-needed (fixed in subsequent patch).
1337 * layout.h (class Free_list): New class.
1338 (Layout::set_incremental_base): New function.
1339 (Layout::incremental_base): New function.
1340 (Layout::init_fixed_output_section): New function.
1341 (Layout::allocate): New function.
1342 (Layout::incremental_base_): New data member.
1343 (Layout::free_list_): New data member.
1344 * main.cc (main): Print Free_list statistics.
1345 * object.cc (Relobj::finalize_incremental_relocs): Add
1346 clear_counts parameter; clear counts only when clear_counts is set.
1347 (Sized_relobj::Sized_relobj): Initialize new base class.
1348 (Sized_relobj::do_layout): Don't report special sections.
1349 (Sized_relobj::do_for_all_local_got_entries): New function.
1350 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
1351 symtab_off to all symbol table offsets.
1352 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
1353 * object.h (class Got_offset_list): Move to top of file.
1354 (Object::Object): Allow case where input_file == NULL.
1355 (Object::~Object): Likewise.
1356 (Object::input_file): Assert that input_file != NULL.
1357 (Object::lock): Allow case where input_file == NULL.
1358 (Object::unlock): Likewise.
1359 (Object::is_locked): Likewise.
1360 (Object::token): Likewise.
1361 (Object::release): Likewise.
1362 (Object::is_incremental): New function.
1363 (Object::get_mtime): New function.
1364 (Object::for_all_local_got_entries): New function.
1365 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1366 (Object::set_is_in_system_directory): New function.
1367 (Object::is_in_system_directory): New function.
1368 (Object::do_is_incremental): New function.
1369 (Object::do_get_mtime): New function.
1370 (Object::do_for_all_local_got_entries): New function.
1371 (Object::is_in_system_directory_): New data member.
1372 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1373 (class Sized_relobj_base): New class.
1374 (class Sized_relobj): Derive from Sized_relobj_base.
1375 (class Sized_relobj::Symbols): Redeclare from base class.
1376 (class Sized_relobj::local_got_offset_list): Remove.
1377 (class Sized_relobj::Output_sections): Redeclare from base class.
1378 (class Sized_relobj::do_for_all_local_got_entries): New function.
1379 (class Sized_relobj::write_local_symbols): Add offset parameter.
1380 (class Sized_relobj::local_symbol_offset_): Update comment.
1381 (class Sized_relobj::local_dynsym_offset_): Update comment.
1382 * options.cc (Input_arguments::add_file): Remove const.
1383 * options.h (Input_file_argument::Input_file_argument):
1384 Initialize arg_serial_ (all constructors).
1385 (Input_file_argument::set_arg_serial): New function.
1386 (Input_file_argument::arg_serial): New function.
1387 (Input_file_argument::arg_serial_): New data member.
1388 (Input_arguments::Input_arguments): Initialize file_count_.
1389 (Input_arguments::add_file): Remove const.
1390 (Input_arguments::number_of_input_files): New function.
1391 (Input_arguments::file_count_): New data member.
1392 (Command_line::number_of_input_files): Call
1393 Input_arguments::number_of_input_files.
1394 * output.cc (Output_segment_headers::Output_segment_headers):
1395 Set current size.
1396 (Output_section::Input_section::current_data_size): New function.
1397 (Output_section::Output_section): Initialize new data members.
1398 (Output_section::add_input_section): Don't do merge sections for
1399 an incremental link; allocate space from free list for an
1400 incremental update.
1401 (Output_section::add_output_section_data): Allocate space from
1402 free list for an incremental update.
1403 (Output_section::update_data_size): New function.
1404 (Output_section::set_fixed_layout): New function.
1405 (Output_section::reserve): New function.
1406 (Output_segment::set_section_addresses): Remove const.
1407 (Output_segment::set_section_list_addresses): Remove const; allocate
1408 space from free list for an incremental update.
1409 (Output_segment::set_offset): Adjust size of RELRO segment for an
1410 incremental update.
1411 * output.h (Output_data::current_data_size): Move here from
1412 child classes.
1413 (Output_data::pre_finalize_data_size): New function.
1414 (Output_data::update_data_size): New function.
1415 (Output_section_headers::update_data_size): new function.
1416 (Output_section_data_build::current_data_size): Move to Output_data.
1417 (Output_data_strtab::update_data_size): New function.
1418 (Output_section::current_data_size): Move to Output_data.
1419 (Output_section::set_fixed_layout): New function.
1420 (Output_section::has_fixed_layout): New function.
1421 (Output_section::reserve): New function.
1422 (Output_section::update_data_size): New function.
1423 (Output_section::has_fixed_layout_): New data member.
1424 (Output_section::free_list_): New data member.
1425 (Output_segment::set_section_addresses): Remove const.
1426 (Output_segment::set_section_list_addresses): Remove const.
1427 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
1428 New function.
1429 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
1430 New function.
1431 * readsyms.cc (Read_symbols::do_read_symbols): Add library
1432 parameter when calling Add_symbols constructor; store argument
1433 serial number for members of a lib group.
1434 (Add_symbols::locks): Allow case where token == NULL.
1435 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
1436 (Read_member::~Read_member): New function.
1437 (Read_member::is_runnable): New function.
1438 (Read_member::locks): New function.
1439 (Read_member::run): New function.
1440 (Check_script::~Check_script): New function.
1441 (Check_script::is_runnable): New function.
1442 (Check_script::locks): New function.
1443 (Check_script::run): New function.
1444 (Check_library::~Check_library): New function.
1445 (Check_library::is_runnable): New function.
1446 (Check_library::locks): New function.
1447 (Check_library::run): New function.
1448 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
1449 (Add_symbols::library_): New data member.
1450 (class Read_member): New class.
1451 (class Check_script): New class.
1452 (class Check_library): New class.
1453 * reloc.cc (Read_relocs::is_runnable): Allow case where
1454 token == NULL.
1455 (Read_relocs::locks): Likewise.
1456 (Scan_relocs::locks): Likewise.
1457 (Relocate_task::locks): Likewise.
1458 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
1459 to clear counters.
1460 (Sized_relobj::incremental_relocs_scan): Fix comment.
1461 (Sized_relobj::do_relocate): Pass output file offset to
1462 write_local_symbols.
1463 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
1464 from class declaration.
1465 * script.cc (read_input_script): Allocate Script_info; pass
1466 argument serial number to report_script.
1467 * script.h (class Script_info): Move to incremental.h.
1468 * symtab.cc (Symbol_table::add_from_incrobj): New function.
1469 * symtab.h (Symbol_table::add_from_incrobj): New function.
1470 (Symbol_table::set_file_offset): New function.
1471
b961d0d7
CC
14722011-04-05 Cary Coutant <ccoutant@google.com>
1473
1474 * incremental-dump.cc (dump_incremental_inputs): Change signature
1475 to take a Sized_incremental_binary; change caller. Use readers
1476 in Sized_incremental_binary.
1477 * incremental.cc
1478 (Sized_incremental_binary::find_incremental_inputs_sections):
1479 Rename do_find_incremental_inputs_sections to this.
1480 (Sized_incremental_binary::setup_readers): New function.
1481 (Sized_incremental_binary::do_check_inputs): Check
1482 has_incremental_info_ flag; move setup code to setup_readers;
1483 use input readers.
1484 (Sized_incremental_binary::do_file_is_unchanged): New function.
1485 (Sized_incremental_binary::do_get_input_reader): New function.
1486 * incremental.h (class Incremental_binary): Move to end of file.
1487 (Incremental_binary::file_is_unchanged): New function.
1488 (Incremental_binary::do_file_is_unchanged): New function.
1489 (Incremental_binary::Input_reader): New class.
1490 (Incremental_binary::get_input_reader): New function.
1491 (class Sized_incremental_binary): Move to end of file.
1492 (Sized_incremental_binary::Sized_incremental_binary): Setup the
1493 input section reader classes.
1494 (Sized_incremental_binary::has_incremental_info): New function.
1495 (Sized_incremental_binary::inputs_reader): New function.
1496 (Sized_incremental_binary::symtab_reader): New function.
1497 (Sized_incremental_binary::relocs_reader): New function.
1498 (Sized_incremental_binary::got_plt_reader): New function.
1499 (Sized_incremental_binary::do_file_is_unchanged): New function.
1500 (Sized_incremental_binary::Sized_input_reader): New class.
1501 (Sized_incremental_binary::get_input_reader): New function.
1502 (Sized_incremental_binary::find_incremental_inputs_sections):
1503 Rename do_find_incremental_inputs_sections to this.
1504 (Sized_incremental_binary::setup_readers): New function.
1505 (Sized_incremental_binary::has_incremental_info_): New data member.
1506 (Sized_incremental_binary::inputs_reader_): New data member.
1507 (Sized_incremental_binary::symtab_reader_): New data member.
1508 (Sized_incremental_binary::relocs_reader_): New data member.
1509 (Sized_incremental_binary::got_plt_reader_): New data member.
1510 (Sized_incremental_binary::current_input_file_): New data member.
1511
a869183f
PP
15122011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
1513
1514 PR gold/12640
1515 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
1516 violation.
1517
15182011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
1519
1520 * archive.cc (Archive::include_member): Adjust call to report_object.
1521 (Add_archive_symbols::run): Add script_info to call to
1522 report_archive_begin.
1523 (Lib_group::include_member): Adjust call to report_object.
1524 (Add_lib_group_symbols::run): Adjust call to report_object.
1525 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
1526 blocks. Add object count for script input files.
1527 * incremental.cc (Incremental_inputs::report_archive_begin): Add
1528 script_info parameter; change all callers.
1529 (Incremental_inputs::report_object): Add script_info parameter;
1530 change all callers.
1531 (Incremental_inputs::report_script): Store backpointer to
1532 incremental info entry.
1533 (Output_section_incremental_inputs::set_final_data_size): Record
1534 additional information for scripts.
1535 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1536 * incremental.h (Incremental_script_entry::add_object): New function.
1537 (Incremental_script_entry::get_object_count): New function.
1538 (Incremental_script_entry::get_object): New function.
1539 (Incremental_script_entry::objects_): New data member; adjust
1540 constructor.
1541 (Incremental_inputs::report_archive_begin): Add script_info parameter.
1542 (Incremental_inputs::report_object): Add script_info parameter.
1543 (Incremental_inputs_reader::get_object_count): New function.
1544 (Incremental_inputs_reader::get_object_offset): New function.
1545 * options.cc (Input_arguments::add_file): Return reference to
1546 new input argument.
1547 * options.h (Input_argument::set_script_info): New function.
1548 (Input_argument::script_info): New function.
1549 (Input_argument::script_info_): New data member; adjust all
1550 constructors.
1551 (Input_file_group::add_file): Return reference to new input argument.
1552 (Input_file_lib::add_file): Likewise.
1553 (Input_arguments::add_file): Likewise.
1554 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
1555 * script.cc (Parser_closure::Parser_closure): Add script_info
1556 parameter; adjust all callers.
1557 (Parser_closure::script_info): New function.
1558 (Parser_closure::script_info_): New data member.
1559 (read_input_script): Report scripts earlier to incremental info.
1560 (script_add_file): Set script_info in Input_argument.
1561 (script_add_library): Likewise.
1562 * script.h (Script_options::Script_info): Rewrite class.
1563
a869183f 15642011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
1565
1566 * archive.cc (Library_base::should_include_member): Move
1567 method here from class Archive.
1568 (Archive::Archive): Initialize base class.
1569 (Archive::should_include_member): Move to base class.
1570 (Archive::do_for_all_unused_symbols): New function.
1571 (Add_archive_symbols::run): Remove redundant access to
1572 incremental_inputs.
1573 (Lib_group::Lib_group): Initialize base class.
1574 (Lib_group::do_filename): New function.
1575 (Lib_group::include_member): Pass pointer to Lib_group to
1576 report_object.
1577 (Lib_group::do_for_all_unused_symbols): New function.
1578 (Add_lib_group_symbols::run): Report archive information for
1579 incremental links.
1580 * archive.h (class Library_base): New base class.
1581 (class Archive): Derive from Library_base.
1582 (Archive::filename): Move to base class.
1583 (Archive::set_incremental_info): Likewise.
1584 (Archive::incremental_info): Likewise.
1585 (Archive::Should_include): Likewise.
1586 (Archive::should_include_member): Likewise.
1587 (Archive::Armap_entry): Remove.
1588 (Archive::Unused_symbol_iterator): Remove.
1589 (Archive::unused_symbols_begin): Remove.
1590 (Archive::unused_symbols_end): Remove.
1591 (Archive::do_filename): New function.
1592 (Archive::do_get_mtime): New function.
1593 (Archive::do_for_all_unused_symbols): New function.
1594 (Archive::task_): Move to base class.
1595 (Archive::incremental_info_): Likewise.
1596 (class Lib_group): Derive from Library_base.
1597 (Lib_group::do_filename): New function.
1598 (Lib_group::do_get_mtime): New function.
1599 (Lib_group::do_for_all_unused_symbols): New function.
1600 (Lib_group::task_): Move to base class.
1601 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
1602 function.
1603 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1604 function.
1605 * incremental.cc (Incremental_inputs::report_archive_begin):
1606 Use Library_base; call library's get_mtime; add incremental inputs
1607 entry before members.
1608 (class Unused_symbol_visitor): New class.
1609 (Incremental_inputs::report_archive_end): Use Library_base; use
1610 visitor class to record unused symbols; don't add incremental inputs
1611 entry after members.
1612 (Incremental_inputs::report_object): Use Library_base.
1613 * incremental.h
1614 (Incremental_archive_entry::Incremental_archive_entry): Remove
1615 unused Archive parameter.
1616 (Incremental_inputs::report_archive_begin): Use Library_base.
1617 (Incremental_inputs::report_archive_end): Likewise.
1618 (Incremental_inputs::report_object): Likewise.
1619 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1620 function.
1621 * object.h (Object::for_all_global_symbols): New function.
1622 (Object::do_for_all_global_symbols): New function.
1623 (Sized_relobj::do_for_all_global_symbols): New function.
1624 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1625 function.
1626 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1627 function.
1628
61ab3e40
ILT
16292011-03-27 Ian Lance Taylor <iant@google.com>
1630
1631 * archive.cc (Archive::interpret_header): Return -1 if something
1632 goes wrong. Change callers accordingly.
1633
30e1f9e6
CC
16342011-03-25 Cary Coutant <ccoutant@google.com>
1635
1636 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1637 * testsuite/Makefile.in: Regenerate.
1638
9c793f14
RÁE
16392010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1640
1641 * plugin.cc (get_view): New.
1642 (Plugin::load): Pass get_view to the plugin.
1643 (Plugin_manager::get_view): New.
1644
9312bb0a
ILT
16452011-03-21 Ian Lance Taylor <iant@google.com>
1646
1647 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1648 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1649
7e12ba9e
ST
16502011-03-21 Sriraman Tallam <tmsriram@google.com>
1651
1652 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1653 Change == to -eq.
1654 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1655 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1656 Change == to -eq.
1657 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1658 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1659
fd7a005d
ILT
16602011-03-14 Ian Lance Taylor <iant@google.com>
1661
1662 * script-sections.cc (Sort_output_sections::script_compare):
1663 Rename from is_before, change return type.
1664 (Sort_output_sections::operator()): Adjust accordingly.
1665
ed16fd1b
ILT
16662011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1667
1668 PR gold/12572
1669 * testsuite/odr_violation2.cc: Add comment to make all error line
1670 numbers double digits.
1671 * testsuite/debug_msg.sh: Adjust expected errors.
1672
71ff8986
ILT
16732011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1674
1675 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1676 but mark earlier ones as non-canonical
1677 (offset_to_iterator): Update search target and example
1678 (do_addr2line): Return extra lines in a vector*
1679 (format_file_lineno): Extract from do_addr2line
1680 (one_addr2line): Add vector* out-param
1681 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
1682 when a lineno entry appeared last for its instruction
1683 (Dwarf_line_info): Add vector* out-param
1684 * object.cc (Relocate_info): Pass NULL for the vector* out-param
1685 * symtab.cc (Odr_violation_compare): Include the lineno in the
1686 comparison again.
1687 (linenos_from_loc): New. Combine the canonical line for an
1688 address with its other lines.
1689 (True_if_intersect): New. Helper functor to make
1690 std::set_intersection a query.
1691 (detect_odr_violations): Compare sets of lines instead of just
1692 one line for each function. This became less deterministic, but
1693 has fewer false positives.
1694 * symtab.h: Declarations.
1695 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
1696 mix an optimized and non-optimized object in the same binary
1697 (odr_violation2.so): Same.
1698 * testsuite/Makefile.in: Regenerate from Makefile.am.
1699 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
1700 * testsuite/debug_msg.sh: Update line numbers and add
1701 assertions.
1702 * testsuite/odr_violation1.cc: Use OdrDerived, in a
1703 non-optimized context.
1704 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
1705 isn't inlined, and use OdrDerived in an optimized context.
1706 * testsuite/odr_header1.h: Defines OdrDerived, where
1707 optimization will change the
1708 first-instruction-in-the-destructor's file and line number.
1709 * testsuite/odr_header2.h: Defines OdrBase.
1710
a19fefdc
ILT
17112011-03-09 Ian Lance Taylor <iant@google.com>
1712
1713 * fileread.cc (File_read::clear_views): Don't delete the whole
1714 file view.
1715
ecb351e9
ILT
17162011-03-08 Ian Lance Taylor <iant@google.com>
1717
1718 PR gold/12525
1719 * fileread.cc: #include <climits>.
1720 (GOLD_IOV_MAX): Define.
1721 (File_read::read_multiple): Limit number of entries by iov_max.
1722 * fileread.h (class File_read): Always set max_readv_entries to
1723 128.
1724
b821d13c
ILT
17252011-03-07 Ian Lance Taylor <iant@google.com>
1726
1727 PR gold/12525
1728 * options.h (class General_options): Add -dy and -dn.
1729
89243142
CC
17302011-03-02 Cary Coutant <ccoutant@google.com>
1731
1732 * testsuite/script_test_9.t: Add TLS segment.
1733
d0773f31
ILT
17342011-03-02 Simon Baldwin <simonb@google.com>
1735
1736 * configure.ac: Add check for gnu_indirect_function support in
1737 the toolchain building binutils.
1738 * configure: Rebuild.
1739
badc8139
RÁE
17402010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
1741
1742 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
1743 plugin only symbols.
1744 (Symbol_table::sized_finalize_symbol) Mark symbol only present
1745 in plugin files as not needed in the symbol table.
1746
4cf7a849
ST
17472011-02-11 Sriraman Tallam <tmsriram@google.com>
1748
1749 * output.cc (Output_section::add_input_section): Delay fill
1750 generation for section ordering.
1751
b578bd7d
ILT
17522011-02-09 Ian Lance Taylor <iant@google.com>
1753
1754 PR gold/12316
1755 * object.h (class Sized_relobj): Remove clear_local_symbols.
1756 * reloc.cc (Sized_relobj::do_relocate): Don't call
1757 clear_local_symbols.
1758
84ced98a
RÁE
17592010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
1760
1761 * plugin.cc (is_visible_from_outside): Return true for symbols
1762 in the -u option.
1763
55382fb7
ILT
17642011-02-04 Jeffrey Yasskin <jyasskin@google.com>
1765
1766 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
1767 filename.
1768
4e271fff
ST
17692011-02-02 Sriraman Tallam <tmsriram@google.com>
1770
1771 * icf.h (is_section_foldable_candidate): Change type of parameter
1772 to std::string.
1773 * icf.cc (Icf::find_identical_sections): Change type of local variable
1774 section_name to be std::string.
1775 (is_function_ctor_or_dtor): Change type of parameter to std::string.
1776
d433c3ac
ILT
17772011-01-25 Ian Lance Taylor <iant@google.com>
1778
1779 * script.cc (script_add_extern): Rewrite to use
1780 add_symbol_reference.
1781
880473a6
DK
17822011-01-25 Doug Kwan <dougkwan@google.com>
1783
d433c3ac 1784 * icf.cc (get_section_contents): Always lock section's object.
880473a6 1785
f30f86fa
ILT
17862011-01-24 Ian Lance Taylor <iant@google.com>
1787
1788 * options.h (class General_options): Accept
1789 --no-detect-odr-violations.
1790
8e51a0b9
ILT
17912011-01-24 Ian Lance Taylor <iant@google.com>
1792
1793 * version.cc (version_string): Bump to 1.11.
1794
0f3b89d8
ILT
17952011-01-24 Ian Lance Taylor <iant@google.com>
1796
1797 * plugin.cc (class Plugin_rescan): Define new class.
1798 (Plugin_manager::claim_file): Set any_claimed_.
1799 (Plugin_manager::save_archive): New function.
1800 (Plugin_manager::save_input_group): New function.
1801 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
1802 necessary.
1803 (Plugin_manager::new_undefined_symbol): New function.
1804 (Plugin_manager::rescan): New function.
1805 (Plugin_manager::rescannable_defines): New function.
1806 (Plugin_manager::add_input_file): Set any_added_.
1807 * plugin.h (class Plugin_manager): define new fields rescannable_,
1808 undefined_symbols_, any_claimed_, and any_added_. Declare
1809 Plugin_rescan as friend. Declare new functions.
1810 (Plugin_manager::Rescannable): Define type.
1811 (Plugin_manager::Rescannable_list): Define type.
1812 (Plugin_manager::Undefined_symbol_list): Define type.
1813 (Plugin_manager::Plugin_manager): Initialize new fields.
1814 * archive.cc (Archive::defines_symbol): New function.
1815 (Add_archive_symbols::run): Pass archive to plugins if any.
1816 * archive.h (class Archive): Declare defines_symbol.
1817 * readsyms.cc (Input_group::~Input_group): New function.
1818 (Finish_group::run): Pass input_group to plugins if any.
1819 * readsyms.h (class Input_group): Declare destructor.
1820 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
1821 any.
1822
3bb951e5
ILT
18232011-01-10 Ian Lance Taylor <iant@google.com>
1824
1825 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
1826 section as relro.
1827 (Layout::set_segment_offsets): Reset increase_relro before calling
1828 set_section_addresses a second time.
1829
0aa45fac
CC
18302011-01-04 Cary Coutant <ccoutant@google.com>
1831
1832 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
1833 sections before NOBITS sections.
1834
0db46eb4
L
18352011-01-01 H.J. Lu <hongjiu.lu@intel.com>
1836
1837 * version.cc (print_version): Update copyright to 2011.
1838
829c9745
CC
18392010-12-23 Cary Coutant <ccoutant@google.com>
1840
1841 * output.h (Output_data_reloc::add_output_section): Pass OD instead
1842 of OS to this->add. Add OD parameter to second form of the function.
1843
7500420b
ILT
18442010-12-20 Ian Lance Taylor <iant@google.com>
1845
1846 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
1847 second of two consecutive entries with same offset.
1848
f8e9a930
RW
18492010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1850
1851 * testsuite/Makefile.am (ifuncmain2static_LDADD)
1852 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
1853 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
1854 to avoid unneeded links against $(LDADD).
1855 * testsuite/Makefile.in: Regenerate.
1856
2fbb4320
ILT
18572010-12-15 Ian Lance Taylor <iant@google.com>
1858
1859 PR gold/12324
1860 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
1861 for R_X86_64_32 and R_X86_64_PC32.
1862 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
1863 ver_matching_def_pic.o.
1864 (ver_matching_def_pic.o): New target.
1865
fedb228d
RW
18662010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1867
1868 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
1869 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
1870 Move definition before File_read::View member definitions.
1871 (File_read::View::~View): Initialize and hold lock before
1872 updating current_mapped_bytes.
1873
9b547ce6
RW
18742010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1875
1876 * dwarf_reader.cc: Remove outdated comment.
1877 * gold-threads.cc: Fix typo in error message.
1878 * archive.cc: Fix typos in comments.
1879 * archive.h: Likewise.
1880 * arm-reloc-property.cc: Likewise.
1881 * arm-reloc-property.h: Likewise.
1882 * arm-reloc.def: Likewise.
1883 * arm.cc: Likewise.
1884 * attributes.h: Likewise.
1885 * cref.cc: Likewise.
1886 * ehframe.cc: Likewise.
1887 * fileread.h: Likewise.
1888 * gold.h: Likewise.
1889 * i386.cc: Likewise.
1890 * icf.cc: Likewise.
1891 * incremental.h: Likewise.
1892 * int_encoding.cc: Likewise.
1893 * layout.h: Likewise.
1894 * main.cc: Likewise.
1895 * merge.h: Likewise.
1896 * object.cc: Likewise.
1897 * object.h: Likewise.
1898 * options.cc: Likewise.
1899 * readsyms.cc: Likewise.
1900 * reduced_debug_output.cc: Likewise.
1901 * reloc.cc: Likewise.
1902 * script-sections.cc: Likewise.
1903 * sparc.cc: Likewise.
1904 * symtab.h: Likewise.
1905 * target-reloc.h: Likewise.
1906 * target.cc: Likewise.
1907 * target.h: Likewise.
1908 * timer.cc: Likewise.
1909 * timer.h: Likewise.
1910 * x86_64.cc: Likewise.
1911
83e17bd5
CC
19122010-12-09 Cary Coutant <ccoutant@google.com>
1913
1914 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
1915 stack.
1916 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
1917 parameter; change all callers.
1918 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
1919 * options.h (warn_execstack): New option.
1920
017257f8
DK
19212010-12-07 Doug Kwan <dougkwan@google.com>
1922
1923 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1924 like function call relocations.
1925
c20cbc06
ILT
19262010-12-07 Ian Lance Taylor <iant@google.com>
1927
1928 * archive.cc (Archive::get_elf_object_for_member): Permit
1929 punconfigured to be NULL.
1930 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1931 (Archive::include_member): Pass NULL to get_elf_object_for_member
1932 if we searched for the archive and this is the first included
1933 object.
1934
4dbfafcc
ILT
19352010-12-01 Ian Lance Taylor <iant@google.com>
1936
1937 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1938 track_relocs_type_ field.
1939 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1940 Set track_relocs_type_.
1941 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1942 contents when using RELA relocs.
1943 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1944 reloc_map_.
1945 * reloc.cc (Track_relocs::next_addend): New function.
1946 * reloc.h (class Track_relocs): Declare next_addend.
1947
e5e19edd
ILT
19482010-12-01 Ian Lance Taylor <iant@google.com>
1949
1950 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1951 virtual destructor.
1952
9a5ce24c
ILT
19532010-12-01 Ian Lance Taylor <iant@google.com>
1954
1955 * README: Update compilers known to work and fail.
1956
c7791212
NC
19572010-11-23 Matthias Klose <doko@ubuntu.com>
1958
1959 * configure.in: For --enable-gold, handle value `default' instead of
1960 `both*'. Always install ld as ld.bfd, install as ld if gold is
1961 not the default.
1962 * configure: Regenerate.
1963
0ad220c9
DK
19642010-11-18 Doug Kwan <dougkwan@google.com>
1965
1966 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1967 and right_alignment to be zero. Store result alignment only if it is
1968 greater than existing alignment.
1969
ab8056e0
CC
19702010-11-16 Cary Coutant <ccoutant@google.com>
1971
1972 PR gold/12220
1973 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1974 Check for ".zdebug_line".
1975
fd064a5b
CC
19762010-11-16 Doug Kwan <dougkwan@google.com>
1977 Cary Coutant <ccoutant@google.com>
1978
1979 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1980 by reference; adjust all callers.
1981 * output.cc (Output_segment::set_section_addresses): Adjust references
1982 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1983 list is empty.
1984 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1985 end at page boundary.
1986
6fc6ea19
CC
19872010-11-16 Cary Coutant <ccoutant@google.com>
1988
1989 PR gold/12220
1990 * layout.cc (Layout::choose_output_section): Transform names of
1991 compressed sections even when using a script with a SECTIONS clause.
1992 (Layout::output_section_name): Remove code to transform
1993 compressed debug section names.
1994 * output.cc (Output_section::add_input_section): Use uncompressed
1995 section size when tracking input sections.
1996
95a2c8d6
RS
19972010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1998
1999 * symtab.h (Symbol::NON_PIC_REF): Remove.
2000 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
2001 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
2002 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
2003 (Symbol::use_plt_offset): Take a flags argument and pass it
2004 directly to needs_dynamic_reloc. Restrict check for undefined
2005 weak symbols to function calls.
2006 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
2007 (Target_arm::Scan::global): Use it.
2008 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
2009 (Target_arm::Relocate::relocate): Likewise.
2010 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
2011 parameter with an r_type parameter. Use get_reference_flags
2012 to get the flags.
2013 (Target_arm::Relocate::relocate): Update accordingly.
2014 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
2015 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
2016 (Target_i386::Scan::global): Likewise.
2017 (Target_i386::Relocate::relocate): Likewise.
2018 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
2019 parameter with an r_type parameter. Use get_reference_flags
2020 to get the flags.
2021 (Target_i386::Relocate::relocate): Update accordingly.
2022 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
2023 (Target_powerpc::Scan::global): Use it.
2024 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
2025 (Target_powerpc::Relocate::relocate): Likewise.
2026 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
2027 (Target_sparc::Scan::global): Use it.
2028 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
2029 (Target_sparc::Relocate::relocate): Likewise.
2030 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
2031 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
2032 (Target_x86_64::Scan::global): Likewise.
2033 (Target_x86_64::Relocate::relocate): Likewise.
2034
f625ae50
DK
20352010-11-08 Doug Kwan <dougkwan@google.com>
2036 Cary Coutant <ccoutant@google.com>
2037
2038 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
2039 (Arm_exidx_merge_section::section_contents_): New data member.
2040 (Arm_input_section::Arm_input_section): Initialize original_contents_.
2041 (Arm_input_section::~Arm_input_section): De-allocate memory.
2042 (Arm_input_section::original_contents_): New data member.
2043 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
2044 in parameters instead of calling Object::section_contents without
2045 locking.
2046 (Arm_output_section::group_section): New parameter TASK. Pass it
2047 to callees that need locking objects.
2048 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
2049 to lock EXIDX input sections. Fix a formatting issue. Call
2050 Arm_exidx_merged_section::build_contents to create merged section
2051 contents.
2052 (Arm_output_section::create_stub_group): New parameter TASK. Use it
2053 to lock object of stub table owner.
2054 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
2055 TEXT_SIZE to initialize data member TEXT_SIZE_.
2056 (Arm_exidx_input_section::addralign): Fix typo in comment.
2057 (Arm_exidx_input_section::text_size): New method.
2058 (Target_arm::do_relax): New parameter TASK. Pass it to callees
2059 that require locking objects. Lock objects before scanning for stubs
2060 and updating local symbols.
2061 (Arm_input_section<big_endian>::init): Copy contents of original
2062 input section.
2063 (Arm_input_section<big_endian>::do_write): Use saved contents of
2064 original input section instead of calling Object::section_contents
2065 without locking.
2066 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
2067 size without calling Object::section_size().
2068 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
2069 for size. Allocate a buffer for merged EXIDX entries.
2070 (Arm_exidx_merged_section::build_contents): New method.
2071 (Arm_exidx_merged_section::do_write): Move merge section contents
2072 building code to Arm_exidx_merged_section::build_contetns. Write
2073 out contetns in buffer instead of building it on the fly.
2074 (Arm_relobj::make_exidx_input_section): Also pass text section size
2075 to Arm_exidx_input_section constructor.
2076 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
2077 (Arm_dynobj::do_read_symbols): Fix memory leak.
2078 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2079 * target.h: (class Task): Add forward declaration.
2080 (Target::relax): Add new parameter TASK and pass it to
2081 Target::do_relax().
2082 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2083
5f9bcf58
CC
20842010-11-05 Cary Coutant <ccoutant@google.com>
2085
2086 PR gold/10708
2087 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2088 object when reading from the file.
2089 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2090 second layout pass.
2091 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2092 when reading section contents.
2093 (get_section_contents): Likewise.
2094 (icf::find_identical_sections): Likewise.
2095 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2096 object when reading from the file.
2097 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2098 the object when doing deferred section layout.
2099
e597fa08
NC
21002010-11-03 Nick Clifton <nickc@redhat.com>
2101
2102 PR gold/12001
2103 * script.h (class Symbol_assignment: name): New member. Returns
2104 the name of the symbol.
2105 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2106 Returns true if the given symbol name is on the list of
2107 assignments wating to be processed.
2108 * archive.cc (should_incldue_member): If the symbol is undefined,
2109 check to see if it is on the list of symbols pending assignment.
2110
3f9a3278
ILT
21112010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2112
2113 * script-sections.cc (Script_sections::find_memory_region): Check
2114 for a NULL output section pointer.
2115
d06fb4d1
DK
21162010-10-29 Doug Kwan <dougkwan@google.com>
2117
2118 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2119 Output_section::add_relaxed_input_section.
2120 * output.cc (Output_section::add_relaxed_input_section): Add new
2121 arguments LAYOUT and NAME. Set section order index.
2122 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2123 Copy section order index.
2124 * output.h (Output_section::add_relaxed_input_section): Add new
2125 arguments LAYOUT and NAME.
2126
90e24de5
ILT
21272010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2128
2129 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2130 NATIVE_OR_CROSS_LINKER.
2131 * testsuite/Makefile.in: Regenerate.
2132
c9484ea5
DK
21332010-10-20 Doug Kwan <dougkwan@google.com>
2134
2135 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2136 without SHF_LINK_ORDER flags.
2137 * layout.cc (Layout::choose_output_section): Do not filter
2138 SHF_LINK_ORDER flag in a relocatable link.
2139
5bc2f5be
CC
21402010-10-17 Cary Coutant <ccoutant@google.com>
2141
2142 * output.h (Output_segment::set_section_addresses): Change function
2143 signature. Update all callers.
2144 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2145 sections.
2146 (Output_segment::set_section_addresses): Align after last TLS
2147 section. Add padding before last relro section instead of after.
2148
0c91cf04
DK
21492010-10-17 Doug Kwan <dougkwan@google.com>
2150
2151 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2152 GOT output section to be writable.
2153
8c21d9d3
CC
21542010-10-14 Cary Coutant <ccoutant@google.com>
2155
2156 * debug.h (DEBUG_INCREMENTAL): New flag.
2157 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2158 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2159 mode.
2160 * incremental.cc (report_command_line): Ignore all forms of
2161 --incremental.
2162 * layout.cc (Layout::Layout): Check parameters for incremental link
2163 mode.
2164 * options.cc (General_options::parse_incremental): New function.
2165 (General_options::parse_no_incremental): New function.
2166 (General_options::parse_incremental_full): New function.
2167 (General_options::parse_incremental_update): New function.
2168 (General_options::incremental_mode_): New data member.
2169 (General_options::finalize): Check incremental_mode_.
2170 * options.h (General_options): Update help text for --incremental.
2171 Add --no-incremental, --incremental-full, --incremental-update.
2172 (General_options::Incremental_mode): New enum type.
2173 (General_options::incremental_mode): New function.
2174 (General_options::incremental_mode_): New data member.
2175 * parameters.cc (Parameters::incremental_mode_): New data member.
2176 (Parameters::set_options): Set incremental_mode_.
2177 (Parameters::set_incremental_full): New function.
2178 (Parameters::incremental): New function.
2179 (Parameters::incremental_update): New function.
2180 (set_parameters_incremental_full): New function.
2181 * parameters.h (Parameters::set_incremental_full): New function.
2182 (Parameters::incremental): New function.
2183 (Parameters::incremental_update): New function.
2184 (Parameters::incremental_mode_): New data member.
2185 (set_parameters_incremental_full): New function.
2186 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2187 incremental link mode.
2188 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2189 (Sized_relobj::do_relocate_sections): Likewise.
2190 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2191 option.
2192 * testsuite/Makefile.in: Regenerate.
2193 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2194
bb32aa18 21952010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
2196
2197 * script-sections.h (class Script_sections): Make
2198 Sections_elements typedef public.
2199 * script-sections.cc (class Sort_output_sections): Add elements_
2200 field. Add constructor which sets it; change all callers.
2201 (Sort_output_sections::is_before): New function.
2202 (Sort_output_sections::operator()): Call is_before.
2203 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2204 conditional.
2205 * testsuite/script_test_10.sh: New test. Test script section
2206 order.
2207 * testsuite/script_test_10.t: Likewise.
2208 * testsuite/script_test_10.s: Likewise.
2209 * testsuite/Makefile.am: Wrap the cross linker tests and the
2210 common tests into NATIVE_OR_CROSS_LINKER.
2211 (check_SCRIPTS): Add script_test_10.sh.
2212 (check_DATA): Add script_test_10.stdout.
2213 (script_test_10.o, script_test_10): New targets.
2214 (script_test_10.stdout): New target.
2215 * configure, testsuite/Makefile.in: Regenerate.
2216
3cef7179
ILT
22172010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2218
2219 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2220 error for the deprecated relocations.
2221 (Target_arm::Scan::global): Likewise.
2222 (Target_arm::Relocate::relocate): Likewise.
2223
7411e9a8
RS
22242010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2225
2226 * fileread.cc (Input_file::find_file): Initialize *found_name
2227 and *namep when using the fallback search for case 4.
2228
6a9da32a
CC
22292010-10-11 Cary Coutant <ccoutant@google.com>
2230
2231 * options.h (class General_options): Redefine -z lazy as an alias for
2232 the negation of -z now.
2233
ac897c20
ILT
22342010-10-11 Ian Lance Taylor <iant@google.com>
2235
2236 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2237 binding.
2238
ea5cae92
NC
22392010-10-06 Nick Clifton <nickc@redhat.com>
2240
2241 * script-sections.cc(class Memory_region): Remove
2242 current_lma_offset_ field. Rename current_vma_offset_ to
2243 current_offset_. Add last_section_ field.
2244 (Memory_region::get_current_vma_address): Rename to
2245 get_current_address.
2246 (Memory_region::get_current_lma_address): Delete.
2247 (Memory_region::increment_vma_offset): Rename to
2248 increment_offset.
2249 (Memory_region::increment_lma_offset): Delete.
2250 (Memory_region::attributes_compatible): New method. Returns
2251 true if the provided section is compatible with the region.
2252 (Memory_region::get_last_section): New method. Returns the last
2253 section to use the region.
2254 (Memory_region::set_last_section): New method. Stores the last
2255 section to use the region.
2256 (Script_sections::block_in_region): New method. Returns true if
2257 a block of memory is contained within a region.
2258 (Script_sections::find_memory_region): New method. Locates a
2259 memory region to be used to set a VMA or LMA address.
2260 (Output_section_definition::set_section_addresses): Add code to
2261 check for addresses set by memory regions.
2262 (Output_segment::set_section_addresses): Remove memory region
2263 walking code.
2264 (Script_sections::create_segment): Add a warning if a header
2265 segment is created outside of any region.
2266 * script-sections.h (class Script_sections): Add prototypes for
2267 find_memory_region and block_in_region methods.
2268 * testsuite/memory_test.s: Use .long instead of .word.
2269 * testsuite/memory_test.t: Add some more output sections.
2270 * testsuite/memory_test.sh: Update expected output.
2271
a9bfd952
DK
22722010-10-02 Doug Kwan <dougkwan@google.com>
2273
2274 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2275 defintion to symtab.h
2276 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2277 declaration to defintion.
2278
bacff3ab
NC
22792010-10-01 Nick Clifton <nickc@redhat.com>
2280
2281 * expression.cc (eval): Replace dummy argument with NULL.
2282 (eval_maybe_dot): Check for a NULL result section pointer.
2283 (Symbol_expression::value): Likewise.
2284 (Dot_expression::value): Likewise.
2285 (BINARY_EXPRESSION): Likewise.
2286 (Max_expression::value): Likewise.
2287 (Min_expression::value): Likewise.
2288 (Absolute_expression::value): Likewise.
2289 (Addr_expression::value_from_output_section): Likewise.
2290 (Loaddddr_expression::value_from_output_section): Likewise.
2291 (Segment_start_expression::value): Likewise.
2292 * script-sections.cc
2293 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2294 argument with NULL.
2295 (Sections_elememt_dot_assignment::set_section_addresses):
2296 Likewise.
2297 (Output_data_expression::do_write_to_buffer): Likewise.
2298 (Output_section_definition::finalize_symbols): Likewise.
2299 (Output_section_definition::set_section_addresses): Likewise.
2300
f81bc8b5
DK
23012010-09-30 Doug Kwan <dougkwan@google.com>
2302
2303 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2304
c95e9f27
ST
23052010-09-28 Sriraman Tallam <tmsriram@google.com>
2306
2307 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 2308 function.
c95e9f27
ST
2309 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2310 virtual function.
2311 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2312 virtual function.
2313 * icf.cc (get_section_contents): Inline merge sections only when
2314 target allows it.
2315
3cac54d2
RW
23162010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2317
2318 * configure: Regenerate.
2319
2904037a
ILT
23202010-09-17 Ian Lance Taylor <iant@google.com>
2321
2322 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
2323 * testsuite/Makefile.am (memory_test.o): New target.
2324 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2325 memory_test.t.
2326 * testsuite/Makefile.in: Rebuild.
2904037a 2327
bca7fb63
DK
23282010-09-17 Doug Kwan <dougkwan@google.com>
2329
2330 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2331 defintion if relocation uses GOT entries of the symbol.
2332 * testsuite/icf_safe_test.sh: Fix test.
2333 * testsuite/icf_safe_so_test.sh: Fix test.
2334
4ef28648
CC
23352010-09-16 Cary Coutant <ccoutant@google.com>
2336
2337 * script_sections.cc (class Memory_region): Remove "NULL" from
2338 vector initializations.
2339
793990de
CC
23402010-09-15 Cary Coutant <ccoutant@google.com>
2341
2342 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2343 Resolve forwarding symbols.
2344
81e015e2
DK
23452010-09-15 Doug Kwan <dougkwan@google.com>
2346
2347 * gold/testsuite/script_test_3.t: Add ARM special sections.
2348 * gold/testsuite/script_test_4.t: Same.
2349 * gold/testsuite/script_test_5.t: Same.
2350 * gold/testsuite/script_test_6.t: Same.
2351 * gold/testsuite/script_test_7.t: Same.
2352 * gold/testsuite/script_test_7.t: Same.
2353 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2354
36171d64
CC
23552010-09-14 Cary Coutant <ccoutant@google.com>
2356
2357 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
2358 (Target_x86_64::Relocate::relocate_tls): Replace check for
2359 saw_tls_block_reloc_ with test for executable section.
2360
d89051bd
CC
23612010-09-12 Cary Coutant <ccoutant@google.com>
2362
2363 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2364 position-independent executables to shared libraries need dynamic
2365 relocations.
2366 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2367 position-independent executables.
2368 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2369 * testsuite/Makefile.in: Regenerate.
2370
fca41f0f
NC
23712010-09-10 Nick Clifton <nickc@redhat.com>
2372
2373 PR gold/11997
2374 * testsuite/memory_test.t: Discard any sections that are not
2375 needed.
2376
6695e4b3
L
23772010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2378
2379 PR gold/11996
2380 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2381 "This::" to work around a bug in gcc 4.2.
2382
2383 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2384
0f72bf6f
RÁE
23852010-09-09 Rafael Espindola <espindola@google.com>
2386
2387 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
2388 sections with different PF_X flags in the same segment.
2389 (Layout::find_first_load_seg): Search all segments to find the first
2390 one.
2391 * options.h (rosegment): New.
2392
23932010-09-08 Rafael Espindola <espindola@google.com>
a6577478 2394
05a79166 2395 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 2396
aa98ff75
DK
23972010-09-08 Doug Kwan <dougkwan@google.com>
2398
2399 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
2400 (Arm_relobj::do_relocate_sections): Add new parameter for output
2401 file to match the parent.
2402 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
2403 of local symbols instead of input values. Update code to track
2404 changes in gold::relocate_section.
2405 * object.cc (Sized_relobj::compute_final_local_value): New methods.
2406 (Sized_relobj::compute_final_local_value_internal): New methods.
2407 (Sized_relobj::do_finalize_local_symbols): Move code from loop
2408 body into private version of Sized_relobj::compute_final_local_value.
2409 Call the inline method.
2410 * object.h (Symbol_value::Symbol_value): Define destructor. Free
2411 merged symbol value if there is one.
2412 (Symbol_value::has_output_value): New method defintiion.
2413 (Sized_relobj::Compute_final_local_value_status): New enum type.
2414 (Sized_relobj::compute_final_local_value): New methods.
2415 (Sized_relobj::compute_final_local_value_internal): New methods.
2416 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
2417 and arm_cortex_a8.sh.
2418 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
2419 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
2420 New tests.
2421 * Makefile.in: Regenerate.
2422 * testsuite/arm_bl_out_of_range.s: Update test.
2423 * testsuite/thumb_bl_out_of_range.s: Ditto.
2424 * testsuite/thumb_blx_out_of_range.s: Ditto.
2425 * testsuite/arm_branch_out_of_range.sh: New file.
2426 * testsuite/arm_cortex_a8.sh: Ditto.
2427 * testsuite/arm_cortex_a8_b.s: Ditto.
2428 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
2429 * testsuite/arm_cortex_a8_b_local.s: Ditto.
2430 * testsuite/arm_cortex_a8_bl.s: Ditto.
2431 * testsuite/arm_cortex_a8_blx.s: Ditto.
2432 * testsuite/arm_cortex_a8_local.s: Ditto.
2433 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
2434 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2435
05a79166
L
24362010-09-08 Rafael Espindola <espindola@google.com>
2437
2438 * Makefile.am (memory_test.stdout): Run readelf with -W.
2439 * Makefile.in: Regenerate.
2440 * testsuite/memory_test.sh: Make the regexps accept both 32 and
2441 64 bit output.
2442
33dbc701
RÁE
24432010-09-08 Rafael Espindola <espindola@google.com>
2444
2445 * script-sections.cc (Script_sections::add_memory_region): Convert
2446 field precision to int.
2447 * script.cc (script_set_section_region, script_set_section_region):
2448 Convert field precision to int.
2449
731ca54a
RÁE
24502010-09-08 Rafael Espindola <espindola@google.com>
2451
2452 * arm.cc (do_finalize_sections): Create the __exidx_start and
2453 __exdix_end symbols even when the section is missing.
2454
7f8cd844
NC
24552010-09-08 Nick Clifton <nickc@redhat.com>
2456
2457 * README: Remove claim that MEMORY is not supported.
2458 * expression.cc (script_exp_function_origin)
2459 (script_exp_function_length): Move from here to ...
2460 * script.cc: ... here.
2461 (script_set_section_region, script_add_memory)
2462 (script_parse_memory_attr, script_include_directive): New
2463 functions.
2464 * script-sections.cc
2465 (class Memory_region): New class.
2466 (class Output_section_definition): Add set_memory_region,
2467 set_section_vma, set_section_lma and get_section_name methods.
2468 (class Script_Sections): Add add_memory_region,
2469 find_memory_region, find_memory_region_origin,
2470 find_memory_region_length and set_memory_region methods.
2471 Have set_section_addresses method walk the list of set memory
2472 regions.
2473 Extend the print methos to display memory regions.
2474 * script-sections.h: Add prototypes for new methods.
2475 Add enum for MEMORY region attributes.
2476 * yyscript.y: Add support for parsing MEMORY regions.
2477 * script-c.h: Add prototypes for new functions.
2478 * testsuite/Makefile.am: Add test of MEMORY region functionality.
2479 * testsuite/Makefile.in: Regenerate.
2480 * testsuite/memory_test.sh: New script.
2481 * testsuite/memory_test.s: New assembler source file.
2482 * testsuite/memory_test.t: New linker script.
2483
a4649286
DK
24842010-08-27 Doug Kwan <dougkwan@google.com>
2485
2486 * gold/resolve.cc (Symbol_table::should_override): Let a weak
2487 reference override an existing dynamic weak reference.
2488 * testsuite/Makefile.am: Add new test dyn_weak_ref.
2489 * testsuite/Makefile.in: Regenerate.
2490 * testsuite/dyn_weak_ref.sh: New file.
2491 * testsuite/dyn_weak_ref_1.c: Ditto.
2492 * testsuite/dyn_weak_ref_2.c: Ditto.
2493
b56648ad
ILT
24942010-08-27 Ian Lance Taylor <iant@google.com>
2495
2496 * incremental.h (class Incremental_input_entry): Add virtual
2497 destructor.
2498
809313cb
ILT
24992010-08-27 Ian Lance Taylor <iant@google.com>
2500
2501 * testsuite/start_lib_test_3.c: Mark t3 as used.
2502
11e32464
NC
25032010-08-27 Nick Clifton <nickc@redhat.com>
2504
2505 * options.cc (version_script): Fix small typo in previous
2506 whitespace tidyup.
2507
ca09d69a
NC
25082010-08-25 Nick Clifton <nickc@redhat.com>
2509
2510 * archive.cc: Formatting fixes: Remove whitespace between
2511 typename and following asterisk. Remove whitespace between
2512 function name and opening parenthesis.
2513 * archive.h: Likewise.
2514 * arm.cc: Likewise.
2515 * attributes.cc: Likewise.
2516 * attributes.h: Likewise.
2517 * common.cc: Likewise.
2518 * copy-relocs.cc: Likewise.
2519 * dirsearch.h: Likewise.
2520 * dynobj.cc: Likewise.
2521 * ehframe.cc: Likewise.
2522 * ehframe.h: Likewise.
2523 * expression.cc: Likewise.
2524 * fileread.cc: Likewise.
2525 * fileread.h: Likewise.
2526 * gc.h: Likewise.
2527 * gold-threads.cc: Likewise.
2528 * gold.cc: Likewise.
2529 * i386.cc: Likewise.
2530 * icf.h: Likewise.
2531 * incremental-dump.cc: Likewise.
2532 * incremental.cc: Likewise.
2533 * layout.cc: Likewise.
2534 * layout.h: Likewise.
2535 * main.cc: Likewise.
2536 * merge.cc: Likewise.
2537 * merge.h: Likewise.
2538 * object.cc: Likewise.
2539 * object.h: Likewise.
2540 * options.cc: Likewise.
2541 * options.h: Likewise.
2542 * output.cc: Likewise.
2543 * output.h: Likewise.
2544 * plugin.cc: Likewise.
2545 * plugin.h: Likewise.
2546 * powerpc.cc: Likewise.
2547 * reloc.cc: Likewise.
2548 * script-c.h: Likewise.
2549 * script-sections.cc: Likewise.
2550 * script.cc: Likewise.
2551 * stringpool.cc: Likewise.
2552 * symtab.cc: Likewise.
2553 * symtab.h: Likewise.
2554 * target.cc: Likewise.
2555 * timer.cc: Likewise.
2556 * timer.h: Likewise.
2557 * version.cc: Likewise.
2558 * x86_64.cc: Likewise.
2559
b8fa8750
NC
25602010-08-24 Nick Clifton <nickc@redhat.com>
2561
2562 PR 11899
2563 * layout.cc (segment_precedes): Sort segments by their physical
2564 addresses, if they have been set.
2565
9919d93b
CC
25662010-08-23 Cary Coutant <ccoutant@google.com>
2567
2568 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
2569 symbols data.
2570 (Lib_group::include_member): Unlock object after deleting its
2571 symbols data.
2572 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
2573 the bug fixed here.
2574
97b4be1c
CC
25752010-08-19 Neil Vachharajani <nvachhar@google.com>
2576 Cary Coutant <ccoutant@google.com>
2577
2578 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
2579 constructor, and set_blocker.
2580 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
2581 readsyms_blocker_.
2582 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
2583 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
2584 * testsuite/Makefile.am (start_lib_test): New test case.
2585 * testsuite/Makefile.in: Regenerate.
2586 * testsuite/start_lib_test_main.c: New file.
2587 * testsuite/start_lib_test_1.c: New file.
2588 * testsuite/start_lib_test_2.c: New file.
2589 * testsuite/start_lib_test_3.c: New file.
2590
dd0b1884
ILT
25912010-08-19 Ian Lance Taylor <iant@google.com>
2592
2593 * Makefile.in: Rebuild with automake 1.11.1.
2594 * aclocal.m4: Likewise.
2595 * testsuite/Makefile.in: Likewise.
2596
7223e9ca
ILT
25972010-08-19 Ian Lance Taylor <iant@google.com>
2598
2599 PR 10893
2600 * i386.cc (class Output_data_plt_i386): Update declarations.
2601 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
2602 local_ifuncs_ fields.
2603 (Target_i386::do_plt_section_for_global): New function.
2604 (Target_i386::do_plt_section_for_local): New function.
2605 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2606 parameter; change all callers. Initialize global_ifuncs_ and
2607 local_ifuncs_. If doing a static link define __rel_iplt_start and
2608 __rel_iplt_end.
2609 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2610 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2611 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2612 symbols.
2613 (Target_i386::make_plt_section): New function, broken out of
2614 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2615 (Target_i386::make_plt_entry): Call make_plt_section.
2616 (Target_i386::make_local_ifunc_plt_entry): New function.
2617 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2618 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2619 R_386_IRELATIVE to switch.
2620 (Target_i386::Scan::global): Likewise.
2621 (Target_i386::Relocate::relocate): Likewise.
2622 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2623 switch.
2624 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2625 (Target_x86_64::do_plt_section_for_global): New function.
2626 (Target_x86_64::do_plt_section_for_local): New function.
2627 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2628 parameter; change all callers. If doing a static link define
2629 __rela_iplt_start and __rela_iplt_end.
2630 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2631 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2632 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2633 to point to .plt.
2634 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2635 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2636 switch.
2637 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2638 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2639 R_X86_64_IRELATIVE to switch.
2640 (Target_x86_64::Scan::global): Likewise.
2641 (Target_x86_64::Relocate::relocate): Likewise.
2642 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2643 switch.
2644 * target.h (class Target): Add plt_section_for_global and
2645 plt_section_for_local functions. Add do_plt_section_for_global
2646 and do_plt_section_for_local virtual functions.
2647 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2648 clarifying comments.
2649 (Symbol::use_plt_offset): Handle IFUNC symbol.
2650 * object.cc (Sized_relobj::Sized_relobj): Initialize
2651 local_plt_offsets_.
2652 (Sized_relobj::local_has_plt_offset): New function.
2653 (Sized_relobj::local_plt_offset): New function.
2654 (Sized_relobj::set_local_plt_offset): New function.
2655 (Sized_relobj::do_count): Handle IFUNC symbol.
2656 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2657 a bit away from input_shndx_ field. Add set_is_func_symbol and
2658 is_ifunc_symbol functions.
2659 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2660 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2661 local_plt_offsets_ field.
2662 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2663 * output.h (class Output_section_data): Add non-const
2664 output_section function.
2665 (class Output_data_got): Update declarations.
2666 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2667 Add use_plt_offset parameter to global and local constructors.
2668 Change all callers. Change local_sym_index_ field to 31 bits.
2669 Change GSYM_CODE and CONSTANT_CODE accordingly.
2670 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2671 doing a static link don't set sh_link field.
2672 (Output_data_got::Got_entry::write): Use PLT offset if
2673 appropriate.
2674 (Output_data_got::add_global_plt): New function.
2675 (Output_data_got::add_local_plt): New function.
2676 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2677 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2678 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2679 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
2680 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
2681 IFUNC conditional.
2682 * testsuite/ifunc-sel.h: New file.
2683 * testsuite/ifuncmain1.c: New file.
2684 * testsuite/ifuncmain1vis.c: New file.
2685 * testsuite/ifuncmod1.c: New file.
2686 * testsuite/ifuncdep2.c: New file.
2687 * testsuite/ifuncmain2.c: New file.
2688 * testsuite/ifuncmain3.c: New file.
2689 * testsuite/ifuncmod3.c: New file.
2690 * testsuite/ifuncmain4.c: New file.
2691 * testsuite/ifuncmain5.c: New file.
2692 * testsuite/ifuncmod5.c: New file.
2693 * testsuite/ifuncmain6pie.c: New file.
2694 * testsuite/ifuncmod6.c: New file.
2695 * testsuite/ifuncmain7.c: New file.
2696 * configure, testsuite/Makefile.in: Rebuild.
2697
56f75c03
ILT
26982010-08-18 Ian Lance Taylor <iant@google.com>
2699
2700 * incremental.cc
2701 (Output_section_incremental_inputs::write_input_files): Add cast
2702 to avoid signed/unsigned comparison warning.
2703 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2704
55455f89
CC
27052010-08-12 Cary Coutant <ccoutant@google.com>
2706
2707 * common.cc (Sort_commons::operator()): Remove unnecessary code.
2708
e2054bcb
ILT
27092010-08-13 Ian Lance Taylor <iant@google.com>
2710
2711 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2712
74f67560
DK
27132010-08-12 Cary Coutant <ccoutant@google.com>
2714 Doug Kwan <dougkwan@google.com>
2715
2716 * resolve.cc (Symbol_table::should_override): When a weak dynamic
2717 defintion overrides non-weak undef, remember that the original undef
2718 is not weak.
2719 * symtab.cc (Symbol_table::sized_write_global): For undef without
2720 an original weak binding, set binding to global in output.
2721 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
2722 * testsuite/Makefile.in: Regenerate.
2723 * testsuite/strong_ref_weak_def.sh: New file.
2724 * testsuite/strong_ref_weak_def_1.c: Ditto.
2725 * testsuite/strong_ref_weak_def_2.c: Ditto.
2726
d1238d12
CC
27272010-08-12 Cary Coutant <ccoutant@google.com>
2728
2729 * testsuite/incremental_test.sh: Rewrite.
2730 * testsuite/incremental_test_1.c: Rewrite.
2731 * testsuite/incremental_test_2.c: Rewrite.
2732
0e70b911
CC
27332010-08-12 Cary Coutant <ccoutant@google.com>
2734
2735 * arm.cc (Target_arm::got_size): Add const.
2736 (Target_arm::got_entry_count): New function.
2737 (Target_arm::plt_entry_count): New function.
2738 (Target_arm::first_plt_entry_offset): New function.
2739 (Target_arm::plt_entry_size): New function.
2740 (Output_data_plt_arm::entry_count): New function.
2741 (Output_data_plt_arm::first_plt_entry_offset): New function.
2742 (Output_data_plt_arm::get_plt_entry_size): New function.
2743 * i386.cc (Target_i386::got_size): Add const.
2744 (Target_i386::got_entry_count): New function.
2745 (Target_i386::plt_entry_count): New function.
2746 (Target_i386::first_plt_entry_offset): New function.
2747 (Target_i386::plt_entry_size): New function.
2748 (Output_data_plt_i386::entry_count): New function.
2749 (Output_data_plt_i386::first_plt_entry_offset): New function.
2750 (Output_data_plt_i386::get_plt_entry_size): New function.
2751 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
2752 find_incremental_inputs_sections. Dump incremental_got_plt section.
2753 * incremental.cc: Include target.h.
2754 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
2755 parameter. Adjust all callers. Find incremental_got_plt section.
2756 (Incremental_inputs::create_data_sections): Create incremental_got_plt
2757 section.
2758 (Output_section_incremental_inputs::set_final_data_size): Calculate
2759 size of incremental_got_plt section.
2760 (Output_section_incremental_inputs::do_write): Write the
2761 incremental_got_plt section.
2762 (Got_plt_view_info): New struct.
2763 (Local_got_offset_visitor): New class.
2764 (Global_got_offset_visitor): New class.
2765 (Global_symbol_visitor_got_plt): New class.
2766 (Output_section_incremental_inputs::write_got_plt): New function.
2767 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
2768 Add parameter. Adjust all callers.
2769 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2770 (Incremental_inputs::got_plt_section): New function.
2771 (Incremental_inputs::got_plt_section_): New data member.
2772 (Incremental_got_plt_reader): New class.
2773 * layout.cc (Layout::create_incremental_info_sections): Add the
2774 incremental_got_plt section.
2775 * object.h (Got_offset_list::get_list): New function.
2776 (Got offset_list::for_all_got_offsets): New function.
2777 (Sized_relobj::local_got_offset_list): New function.
2778 * powerpc.cc (Target_powerpc::got_size): Add const.
2779 (Target_powerpc::got_entry_count): New function.
2780 (Target_powerpc::plt_entry_count): New function.
2781 (Target_powerpc::first_plt_entry_offset): New function.
2782 (Target_powerpc::plt_entry_size): New function.
2783 (Output_data_plt_powerpc::entry_count): New function.
2784 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
2785 (Output_data_plt_powerpc::get_plt_entry_size): New function.
2786 * sparc.cc (Target_sparc::got_size): Add const.
2787 (Target_sparc::got_entry_count): New function.
2788 (Target_sparc::plt_entry_count): New function.
2789 (Target_sparc::first_plt_entry_offset): New function.
2790 (Target_sparc::plt_entry_size): New function.
2791 (Output_data_plt_sparc::entry_count): New function.
2792 (Output_data_plt_sparc::first_plt_entry_offset): New function.
2793 (Output_data_plt_sparc::get_plt_entry_size): New function.
2794 * symtab.h (Symbol::got_offset_list): New function.
2795 (Symbol_table::for_all_symbols): New function.
2796 * target.h (Sized_target::got_entry_count): New function.
2797 (Sized_target::plt_entry_count): New function.
2798 (Sized_target::plt_entry_size): New function.
2799 * x86_64.cc (Target_x86_64::got_size): Add const.
2800 (Target_x86_64::got_entry_count): New function.
2801 (Target_x86_64::plt_entry_count): New function.
2802 (Target_x86_64::first_plt_entry_offset): New function.
2803 (Target_x86_64::plt_entry_size): New function.
2804 (Output_data_plt_x86_64::entry_count): New function.
2805 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
2806 (Output_data_plt_x86_64::get_plt_entry_size): New function.
2807
09ec0418
CC
28082010-08-12 Cary Coutant <ccoutant@google.com>
2809
2810 * archive.cc: Include incremental.h.
2811 (Archive::Archive): Initialize incremental_info_.
2812 (Archive::include_member): Record archive members in incremental info.
2813 (Add_archive_symbols::run): Record begin and end of an archive in
2814 incremental info.
2815 (Lib_group::include_member): Record objects in incremental info.
2816 * archive.h (Incremental_archive_entry): Forward declaration.
2817 (Archive::set_incremental_info): New member function.
2818 (Archive::incremental_info): New member function.
2819 (Archive::Unused_symbol_iterator): New class.
2820 (Archive::unused_symbols_begin): New member function.
2821 (Archive::unused_symbols_end): New member function.
2822 (Archive::incremental_info_): New data member.
2823 * incremental-dump.cc (find_input_containing_global): New function.
2824 (dump_incremental_inputs): Dump new incremental info sections.
2825 * incremental.cc: Include symtab.h.
2826 (Output_section_incremental_inputs): New class.
2827 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
2828 new incremental info sections.
2829 (Sized_incremental_binary::do_check_inputs): Likewise.
2830 (Incremental_inputs::report_archive): Remove.
2831 (Incremental_inputs::report_archive_begin): New function.
2832 (Incremental_inputs::report_archive_end): New function.
2833 (Incremental_inputs::report_object): New function.
2834 (Incremental_inputs::finalize_inputs): Remove.
2835 (Incremental_inputs::report_input_section): New function.
2836 (Incremental_inputs::report_script): Rewrite.
2837 (Incremental_inputs::finalize): Do nothing but finalize string table.
2838 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2839 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2840 (Incremental_inputs::create_data_sections): New function.
2841 (Incremental_inputs::relocs_entsize): New function.
2842 (Output_section_incremental_inputs::set_final_data_size): New function.
2843 (Output_section_incremental_inputs::do_write): New function.
2844 (Output_section_incremental_inputs::write_header): New function.
2845 (Output_section_incremental_inputs::write_input_files): New function.
2846 (Output_section_incremental_inputs::write_info_blocks): New function.
2847 (Output_section_incremental_inputs::write_symtab): New function.
2848 * incremental.h (Incremental_script_entry): Forward declaration.
2849 (Incremental_object_entry): Forward declaration.
2850 (Incremental_archive_entry): Forward declaration.
2851 (Incremental_inputs): Forward declaration.
2852 (Incremental_inputs_header_data): Remove.
2853 (Incremental_inputs_header): Remove.
2854 (Incremental_inputs_header_write): Remove.
2855 (Incremental_inputs_entry_data): Remove.
2856 (Incremental_inputs_entry): Remove.
2857 (Incremental_inputs_entry_write): Remove.
2858 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
2859 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
2860 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2861 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
2862 Likewise.
2863 (Incremental_input_entry): New class.
2864 (Incremental_script_entry): New class.
2865 (Incremental_object_entry): New class.
2866 (Incremental_archive_entry): New class.
2867 (Incremental_inputs::Incremental_inputs): Initialize new data members.
2868 (Incremental_inputs::report_inputs): Remove.
2869 (Incremental_inputs::report_archive): Remove.
2870 (Incremental_inputs::report_archive_begin): New function.
2871 (Incremental_inputs::report_archive_end): New function.
2872 (Incremental_inputs::report_object): Change prototype.
2873 (Incremental_inputs::report_input_section): New function.
2874 (Incremental_inputs::report_script): Change prototype.
2875 (Incremental_inputs::get_reloc_count): New function.
2876 (Incremental_inputs::set_reloc_count): New function.
2877 (Incremental_inputs::create_data_sections): New function.
2878 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2879 (Incremental_inputs::inputs_section): New function.
2880 (Incremental_inputs::symtab_section): New function.
2881 (Incremental_inputs::relocs_section): New function.
2882 (Incremental_inputs::get_stringpool): Add const.
2883 (Incremental_inputs::command_line): Add const.
2884 (Incremental_inputs::inputs): Remove.
2885 (Incremental_inputs::command_line_key): New function.
2886 (Incremental_inputs::input_file_count): New function.
2887 (Incremental_inputs::input_files): New function.
2888 (Incremental_inputs::relocs_entsize): New function.
2889 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2890 (Incremental_inputs::finalize_inputs): Remove.
2891 (Incremental_inputs::Input_info): Remove.
2892 (Incremental_inputs::lock_): Remove.
2893 (Incremental_inputs::inputs_): Change type.
2894 (Incremental_inputs::inputs_map_): Remove.
2895 (Incremental_inputs::current_object_entry_): New data member.
2896 (Incremental_inputs::inputs_section_): New data member.
2897 (Incremental_inputs::symtab_section_): New data member.
2898 (Incremental_inputs::relocs_section_): New data member.
2899 (Incremental_inputs::reloc_count_): New data member.
2900 (Incremental_inputs_reader): New class.
2901 (Incremental_symtab_reader): New class.
2902 (Incremental_relocs_reader): New class.
2903 * layout.cc (Layout::finalize): Move finalization of incremental info
2904 and creation of incremental info sections to follow finalization of
2905 symbol table. Set offsets for postprocessing sections.
2906 (Layout::create_incremental_info_sections): Call
2907 Incremental_inputs::create_data_sections. Add incremental symtab
2908 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
2909 sections to layout after input sections.
2910 * layout.h (struct Timespec): Forward declaration.
2911 (Layout::incremental_inputs): Add const.
2912 (Layout::create_incremental_info_sections): Add parameter.
2913 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
2914 * object.cc: Include incremental.h.
2915 (Relobj::finalize_incremental_relocs): New function.
2916 (Sized_relobj::do_layout): Record input sections in incremental info.
2917 * object.h (Object::output_section): New function.
2918 (Object::output_section_offset): Moved from Relobj.
2919 (Object::get_incremental_reloc_base): New function.
2920 (Object::get_incremental_reloc_count): New function.
2921 (Object::do_output_section): New function.
2922 (Object::do_output_section_offset): Moved from Relobj.
2923 (Object::do_get_incremental_reloc_base): New function.
2924 (Object::do_get_incremental_reloc_count): New function.
2925 (Object::Object): Initialize new data members.
2926 (Relobj::output_section): Renamed do_output_section and moved to
2927 protected.
2928 (Relobj::output_section_offset): Moved to Object.
2929 (Relobj::do_get_incremental_reloc_base): New function.
2930 (Relobj::do_get_incremental_reloc_count): New function.
2931 (Relobj::allocate_incremental_reloc_counts): New function.
2932 (Relobj::count_incremental_reloc): New function.
2933 (Relobj::finalize_incremental_relocs): New function.
2934 (Relobj::next_incremental_reloc_index): New function.
2935 (Relobj::reloc_counts_): New data member.
2936 (Relobj::reloc_bases_): New data member.
2937 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2938 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2939 (Sized_relobj::incremental_relocs_scan): New function.
2940 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2941 (Sized_relobj::incremental_relocs_write): New function.
2942 (Sized_relobj::incremental_relocs_write_reltype): New function.
2943 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2944 incremental link.
2945 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2946 archives and object files elsewhere.
2947 (Add_symbols::run): Report object files here.
2948 (Finish_group::run): Report end of archive at end of group.
2949 * reloc.cc: Include layout.h, incremental.h.
2950 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2951 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2952 (Sized_relobj::incremental_relocs_scan): New function.
2953 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2954 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2955 (Sized_relobj::incremental_relocs_write): New function.
2956 (Sized_relobj::incremental_relocs_write_reltype): New function.
2957 * script.cc (read_input_script): Rewrite test for incremental link.
2958 Change call to Incremental_inputs::report_script.
2959 * symtab.h (Symbol_table::first_global_index): New function.
2960 (Symbol_table::output_count): New function.
2961
ce0d1972
DK
29622010-08-12 Doug Kwan <dougkwan@google.com>
2963
2964 * arm.cc (Target_arm::merge_object_attributes): Check command line
2965 options --no-wchar-size-warning and --no-enum-size-warning.
2966 * options.h (General_options): Add ld-compatible options
2967 --no-enum-size-warning and --no-wchar-size-warning.
2968
6e5710ce
ILT
29692010-08-04 Ian Lance Taylor <iant@google.com>
2970
2971 * x86_64.cc (Target_x86_64::Scan::local): Use
2972 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2973 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2974 (Target_x86_64::Scan::global): Likewise.
2975 (Target_x86_64::Relocate::relocate): Likewise.
2976 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2977 Likewise.
2978
fef830db
CC
29792010-08-03 Cary Coutant <ccoutant@google.com>
2980
2981 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2982 to reserve space in merged_strings vector. Keep total input size
2983 for stats.
2984 (Output_merge_string::do_print_merge_stats): Print total input size.
2985 * merge.h (Output_merge_string): Add input_size_ field.
2986 * stringpool.cc (Stringpool_template::string_length): Move
2987 implementations out of Stringpool_template class and place in
2988 stringpool.h.
2989 * stringpool.h (string_length): Move out of Stringpool_template.
2990
1e3811b0
ILT
29912010-08-03 Ian Lance Taylor <iant@google.com>
2992
2993 PR 11712
2994 * layout.cc (relaxation_loop_body): If address of load segment is
2995 set, adjust address to include headers if possible.
2996
7af0c620
ILT
29972010-08-03 Ian Lance Taylor <iant@google.com>
2998
2999 * version.cc (version_string): Bump to 1.10.
3000
22f0da72
ILT
30012010-08-03 Ian Lance Taylor <iant@google.com>
3002
3003 PR 11805
3004 * layout.h (enum Output_section_order): Define.
3005 (class Layout): Update declarations.
3006 * layout.cc (Layout::get_output_section): Add order parameter.
3007 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
3008 is_first_non_relro parameters. Change all callers.
3009 (Layout::choose_output_section): Likewise.
3010 (Layout::add_output_section_data): Likewise.
3011 (Layout::make_output_section): Likewise. Set order.
3012 (Layout::default_section_order): New function.
3013 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
3014 * output.cc (Output_section::Output_section): Initialize order_.
3015 Don't initialize deleted fields.
3016 (Output_segment::Output_segment): Don't initialize deleted
3017 fields.
3018 (Output_segment::add_output_section_to_load): New function
3019 replacing add_output_section. Change all callers to call this or
3020 add_output_section_to_nonload.
3021 (Output_segment::add_output_section_to_nonload): New function.
3022 (Output_segment::remove_output_section): Rewrite.
3023 (Output_segment::add_initial_output_data): Likewise.
3024 (Output_segment::has_any_data_sections): Likewise.
3025 (Output_segment::is_first_section_relro): Likewise.
3026 (Output_segment::maximum_alignment): Likewise.
3027 (Output_segment::has_dynamic_reloc): New function replacing
3028 dynamic_reloc_count. Change all callers.
3029 (Output_segment::has_dynamic_reloc_list): New function replacing
3030 dynamic_reloc_count_list. Change all callers.
3031 (Output_segment::set_section_addresses): Rewrite.
3032 (Output_segment::set_offset): Rewrite.
3033 (Output_segment::find_first_and_last_list): Remove.
3034 (Output_segment::set_tls_offsets): Rewrite.
3035 (Output_segment::first_section_load_address): Likewise.
3036 (Output_segment::output_section_count): Likewise.
3037 (Output_segment::section_with_lowest_load_address): Likewise.
3038 (Output_segment::write_section_headers): Likewise.
3039 (Output_segment::print_sections_to_map): Likewise.
3040 * output.h (class Output_data): Remove dynamic_reloc_count_
3041 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
3042 (Output_data::add_dynamic_reloc): Rewrite.
3043 (Output_data::has_dynamic_reloc): New function.
3044 (Output_data::dynamic_reloc_count): Remove.
3045 (class Output_section): Add order_ field. Remvoe is_relro_local_,
3046 is_last_relro_, is_first_non_relro_, is_interp_,
3047 is_dynamic_linker_section_ fields. Add order and set_order
3048 functions. Remove is_relro_local, set_is_relro_local,
3049 is_last_relro, set_is_last_relro, is_first_non_relro,
3050 set_is_first_non_relro functions, is_interp, set_is_interp,
3051 is_dynamic_linker_section, and set_is_dynamic_linker_section
3052 functions.
3053 (class Output_segment): Change Output_data_list from std::list to
3054 std:;vector. Add output_lists_ field. Remove output_data_ and
3055 output_bss_ fields. Update declarations.
3056
3ff2ccb0
ILT
30572010-08-02 Ian Lance Taylor <iant@google.com>
3058
3059 * arm.cc (Target_arm::gc_process_relocs): Use typename.
3060 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
3061 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
3062
88a4108b
ILT
30632010-08-02 Ian Lance Taylor <iant@google.com>
3064
3065 PR 11855
3066 * script.cc (Script_options::Script_options): Initialize
3067 symbol_definitions_ and symbol_references_.
3068 (Script_options::add_symbol_assignment): Update
3069 symbol_definitions_ and symbol_references_.
3070 (Script_options::add_symbol_reference): New function.
3071 (script_symbol): New function.
3072 * script.h (class Script_options): Add symbol_definitions_ and
3073 symbol_references_ fields.
3074 (Script_options::referenced_const_iterator): New type.
3075 (Script_options::referenced_begin): New function.
3076 (Script_options::referenced_end): New function.
3077 (Script_options::is_referenced): New function.
3078 (Script_options::any_unreferenced): New function.
3079 * script-c.h (script_symbol): Declare.
3080 * yyscript.y (exp): Call script_symbol.
3081 * symtab.cc: Include "script.h".
3082 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3083 Change all callers. Check symbols referenced by scripts.
3084 (Symbol_table::add_undefined_symbols_from_command_line): Add
3085 layout parameter. Change all callers.
3086 (Symbol_table::do_add_undefined_symbols_from_command_line):
3087 Likewise. Break out loop body. Check symbols referenced by
3088 scripts.
3089 (Symbol_table::add_undefined_symbol_from_command_line): New
3090 function broken out of
3091 do_add_undefined_symbols_from_command_line.
3092 * symtab.h (class Symbol_table): Update declarations.
3093 * archive.cc: Include "layout.h".
3094 (Archive::should_include_member): Add layout parameter. Change
3095 all callers. Check for symbol mentioned in expression.
3096 * archive.h (class Archive): Update declaration.
3097 * object.cc (Sized_relobj::do_should_include_member): Add layout
3098 parameter.
3099 * object.h (Object::should_include_member): Add layout parameter.
3100 Change all callers.
3101 (Object::do_should_include_member): Add layout parameter.
3102 (class Sized_relobj): Update declaration.
3103 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3104 parameter.
3105 * dynobj.h (class Sized_dynobj): Update declaration.
3106 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3107 layout parameter.
3108 * plugin.h (class Sized_pluginobj): Update declaration.
3109
5f1ab67a
ILT
31102010-08-02 Ian Lance Taylor <iant@google.com>
3111
3112 PR 11866
3113 * output.cc (Output_segment::set_offset): Search for the first and
3114 last sections rather than assuming that the list is in order.
3115 (Output_segment::find_first_and_last_list): New function.
3116 * output.h (class Output_segment): Update declarations.
3117 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3118 (relro_strip_test_SOURCES): New variable.
3119 (relro_strip_test_DEPENDENCIES): New variable.
3120 (relro_strip_test_LDFLAGS): New variable.
3121 (relro_strip_test_LDADD): New variable.
3122 (relro_strip_test.so): New target.
3123
a8df5856
ILT
31242010-08-02 Ian Lance Taylor <iant@google.com>
3125
3126 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3127 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3128 (Target_i386::got_tlsdesc_section): New function.
3129 (Target_i386::got_section): Create space for GOT entries for
3130 TLSDESC relocations.
3131 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3132 R_386_TLS_GOTDESC.
3133 (Target_i386::Scan::global): Likewise.
3134 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3135 using TLSDESC GOT.
3136 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3137 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3138 (Target_x86_64::got_tlsdesc_section): New function.
3139 (Target_x86_64::got_section): Create space for GOT entries for
3140 TLSDESC relocations.
3141 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3142 R_386_TLS_GOTDESC.
3143 (Target_x86_64::Scan::global): Likewise.
3144 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3145 using TLSDESC GOT.
3146
0c10a0a6
ILT
31472010-08-02 Ian Lance Taylor <iant@google.com>
3148
3149 * testsuite/final_layout.sh: Use dc to convert from hex to
3150 decimal.
3151
41cbeecc
ST
31522010-07-29 Sriraman Tallam <tmsriram@google.com>
3153
3154 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3155 paramter to the call to gold::gc_process_relocs.
3156 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3157 paramter to the call to gold::gc_process_relocs.
3158 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3159 parameter to the call to gold::gc_process_relocs.
3160 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3161 template parameter to the call to gold::gc_process_relocs.
3162 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3163 paramter to the call to gold::gc_process_relocs.
3164 * gc.h (get_embedded_addend_size): New function.
3165 (gc_process_relocs): Save the size of the reloc for use by ICF.
3166 * icf.cc (get_section_contents): Get the addend from the text section
3167 for SHT_REL relocation sections.
3168 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3169 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3170 * int_encoding.h (read_from_pointer): New overloaded function.
3171 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3172 * testsuite/icf_sht_rel_addend_test.sh: New file.
3173 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3174 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3175
6ea55b82
RW
31762010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3177
3178 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3179 * Makefile.in: Regenerate.
3180 * testsuite/Makefile.in: Regenerate.
3181
9691462b
ILT
31822010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3183
3184 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3185 * gold/testsuite/debug_msg.cc: Likewise.
3186 * gold/testsuite/odr_violation1.cc
3187 * gold/testsuite/odr_violation2.cc
3188
76897331
CC
31892010-07-21 Cary Coutant <ccoutant@google.com>
3190
3191 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3192 string, and length fields.
3193 (Output_merge_string::Merged_strings_list): New type.
3194 (Output_merge_string::Merged_strings_lists): New typedef.
3195 (Output_merge_string): Replace merged_strings_ with
3196 merged_strings_lists_.
3197 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3198 Merged_strings_list per input object and section. Don't store pointer
3199 to the string. Don't store length with each merged string entry.
3200 (Output_merge_string::finalize_merged_data): Loop over list of merged
3201 strings lists. Recompute length of each merged string.
3202
78384e8f
CC
32032010-07-15 Cary Coutant <ccoutant@google.com>
3204
3205 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3206 here.
3207
783659f9
ILT
32082010-07-14 Ian Lance Taylor <iant@google.com>
3209
3210 * descriptors.cc (Descriptors::open): Report correct name in error
3211 message.
3212
131687b4
DK
32132010-07-13 Doug Kwan <dougkwan@google.com>
3214
3215 * arm.cc (Arm_input_section::Arm_input_section): For a
3216 SHT_ARM_EXIDX section, always keeps the input sections.
3217 (Arm_input_section::set_exidx_section_link): New method.
3218 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3219 has_errors_ to false.
3220 (Arm_exidx_input_section::has_errors,
3221 Arm_exidx_input_section::set_has_errors): New methods.
3222 (Arm_exidx_input_section::has_errors_): New data member.
3223 (Arm_relobj::get_exidx_shndx_list): New method.
3224 (Arm_output_section::append_text_sections_to_list): Do not skip
3225 section without SHF_EXECINSTR.
3226 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3227 errors.
3228 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3229 section header. Make error messages more verbose. Check for
3230 a non-executable section linked to an EXIDX section.
3231 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3232 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3233 check that there is no deferred EXIDX section if we exit early.
3234 Instead of not making an EXIDX section in case of an error, make one
3235 and set the has_errors flag of it.
3236 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3237 in a relocatable link.
3238 (Target_arm::do_relax): Look for the EXIDX output section instead of
3239 assuming that it is called .ARM.exidx.
3240 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3241 section list. Do not check for SHF_EXECINSTR section flags but
3242 skip any input section with errors.
3243 * output.cc (Output_section::Output_section): Initialize
3244 always_keeps_input_sections_ to false.
3245 (Output_section::add_input_section): Check for
3246 always_keeps_input_sections_.
3247 * output.h (Output_section::always_keeps_input_sections,
3248 Output_section::set_always_keeps_input_sections): New methods.
3249 (Output_section::always_keeps_input_sections): New data member.
3250
69517287
RÁE
32512010-07-13 Rafael Espindola <espindola@google.com>
3252
3253 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3254 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3255
82742395
ILT
32562010-07-13 Philip Herron <herron.philip@googlemail.com>
3257 Ian Lance Taylor <iant@google.com>
3258
3259 * output.h (Output_section_lookup_maps::add_merge_section):
3260 Correct check of whether value was inserted.
3261 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3262 (Output_section_lookup_maps::add_relaxed_input_section):
3263 Likewise.
3264 * arm.cc (Target_arm::got_section): Remove used local os.
3265 * i386.cc (Target_i386::got_section): Likewise.
3266 * x86_64.cc (Target_x86_64::got_section): Likewise.
3267 * sparc.cc (Target_sparc::got_section): Likewise.
3268 (Target_sparc::relocate): Remove unused local have_got_offset.
3269 * powerpc.cc (Target_powerpc::relocate): Likewise.
3270
f2d707b5
ILT
32712010-07-13 Ian Lance Taylor <iant@google.com>
3272
241531d6
ILT
3273 * compressed_output.cc (zlib_decompress): Fix signature in
3274 !HAVE_ZLIB_H case.
3275
f2d707b5
ILT
3276 * archive.cc (Archive::include_member): Unlock an external member
3277 of a thin archive. Don't bother to delete an object we know is
3278 NULL.
3279
a2e47362
CC
32802010-07-12 Cary Coutant <ccoutant@google.com>
3281
3282 * compressed_output.cc (zlib_decompress): New function.
3283 (get_uncompressed_size): New function.
3284 (decompress_input_section): New function.
3285 * compressed_output.h (get_uncompressed_size): New function.
3286 (decompress_input_section): New function.
3287 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3288 Handle compressed debug sections.
3289 * layout.cc (is_compressed_debug_section): New function.
3290 (Layout::output_section_name): Map compressed section names to
3291 canonical names.
3292 * layout.h (is_compressed_debug_section): New function.
3293 (is_debug_info_section): Recognize compressed debug sections.
3294 * merge.cc: Include compressed_output.h.
3295 (Output_merge_data::do_add_input_section): Handle compressed
3296 debug sections.
3297 (Output_merge_string::do_add_input_section): Handle compressed
3298 debug sections.
3299 * object.cc: Include compressed_output.h.
3300 (Sized_relobj::Sized_relobj): Initialize new data members.
3301 (build_compressed_section_map): New function.
3302 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3303 * object.h (Object::section_is_compressed): New method.
3304 (Object::do_section_is_compressed): New method.
3305 (Sized_relobj::Compressed_section_map): New type.
3306 (Sized_relobj::do_section_is_compressed): New method.
3307 (Sized_relobj::compressed_sections_): New data member.
3308 * output.cc (Output_section::add_input_section): Handle compressed
3309 debug sections.
3310 * reloc.cc: Include compressed_output.h.
3311 (Sized_relobj::write_sections): Handle compressed debug sections.
3312
ce279a62
CC
33132010-07-08 Cary Coutant <ccoutant@google.com>
3314
3315 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3316 weak when resolving to a dynamic def.
3317 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3318 for weak undef/dynamic def cases. Adjust callers.
3319 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3320 undef_binding_weak_.
3321 (Symbol_table::sized_write_globals): Adjust symbol binding.
3322 (Symbol_table::sized_write_symbol): Add binding parameter.
3323 * symtab.h (Symbol::set_undef_binding): New method.
3324 (Symbol::is_undef_binding_weak): New method.
3325 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3326 (Symbol_table::should_override): Add new parameter.
3327 (Symbol_table::sized_write_symbol): Add new parameter.
3328
3329 * testsuite/weak_undef_file1.cc: Add new test case.
3330 * testsuite/weak_undef_file2.cc: Fix header comment.
3331 * testsuite/weak_undef_test.cc: Add new test case.
3332
b2286c10
DK
33332010-06-29 Doug Kwan <dougkwan@google.com>
3334
3335 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3336 Initialize USE_SYMBOL_.
3337 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3338 definition.
3339 (Arm_reloc_property::uses_symbol_): New data member declaration.
3340 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3341 uses symbol value and symbol is undefined but not weakly undefined.
3342
4802450a
RÁE
33432010-06-28 Rafael Espindola <espindola@google.com>
3344
3345 * plugin.cc (Plugin::load): Use dlerror.
3346
e5ca47ba
ILT
33472010-06-26 Jeffrey Yaskin <jyasskin@google.com>
3348
3349 * symtab.cc (detect_odr_violations): When reporting an ODR
3350 violation, report an object where the symbol is defined.
3351
8a75a161
DK
33522010-06-25 Doug Kwan <dougkwan@google.com>
3353
3354 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
3355 (Target_arm::section_may_have_icf_unsafe_pointers): New method
3356 definition.
3357 (Target_arm::Scan::local_reloc_may_be_function_pointer,
3358 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
3359 target hook to detect function points.
3360 (Target_arm::Scan::possible_function_pointer_reloc): New method.
3361 * icf.h (Icf::check_section_for_function_pointers): Change type of
3362 parameter SECTION_NAME to const reference to std::string. Use
3363 target hook to determine if section may have unsafe pointers.
3364 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3365 method definition.
3366
42218b9f
RÁE
33672010-06-21 Rafael Espindola <espindola@google.com>
3368
3369 * fileread.cc (Input_file::find_fie): New
3370 (Input_file::open): Use Input_file::find_fie.
3371 * fileread.h (Input_file::find_fie): New
3372 * plugin.cc (set_extra_library_path): New.
3373 (Plugin::load): Add set_extra_library_path to the transfer vector.
3374 (Plugin_manager::set_extra_library_path): New.
3375 (Plugin_manager::add_input_file): Use the extra search path if set.
3376 (set_extra_library_path(): New.
3377 * plugin.h (Plugin_manager): Add set_extra_library_path and
3378 extra_search_path_.
3379
a0506cca
CC
33802010-06-19 Cary Coutant <ccoutant@google.com>
3381
3382 * layout.cc (gdb_sections): Add .debug_types.
3383 (lines_only_debug_sections): Likewise.
3384
6508b958
RÁE
33852010-06-18 Rafael Espindola <espindola@google.com>
3386
3387 * plugin.cc (add_input_file,add_input_library)
3388 (Plugin_manager::add_input_file): Make filename arguments const.
3389 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
3390 const.
3391
3e235302
DK
33922010-06-16 Doug Kwan <dougkwan@google.com>
3393
3394 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
3395 .ARM.attributes section if we have not merged any input
3396 attributes sections.
3397
106e8a6c
DK
33982010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3399
3400 * arm.cc: Allow combining objects with no EABI version
3401 information.
3402
91ff43fe
RÁE
34032010-06-15 Rafael Espindola <espindola@google.com>
3404
3405 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
3406
68ed838c
ILT
34072010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3408
3409 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
3410 (struct iovec): Correct !HAVE_READV definition.
3411
f3a2388f
CC
34122010-06-10 Cary Coutant <ccoutant@google.com>
3413
3414 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
3415 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
3416 reloc sections.
3417 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
3418
3419 PR 11683
3420 * symtab.h (Symbol::is_placeholder): New member function.
3421 * target-reloc.h (relocate_section): Check for placeholder symbols.
3422
3423 * testsuite/Makefile.am (plugin_test_8): New test.
3424 (plugin_test_9): New test.
3425 * testsuite/Makefile.in: Regenerate.
3426
e1df38aa
NC
34272010-06-09 Nick Clifton <nickc@redhat.com>
3428
3429 * yyscript.y (input_list_element): Allow strings prefixed with
3430 the '-' character. Treat these as libraries.
3431 * script.cc (script_add_library): New function. Adds a library
3432 specified by "-l<name>" found in an input script.
3433 * script-c.h: Add prototype for script_add_library.
3434
25bbe950
DK
34352010-06-07 Doug Kwan <dougkwan@google.com>
3436
3437 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
3438 Restrict stub-group size to be within long conditional branch
3439 range when working around cortex-A8 erratum.
3440
0f32ea4c
ILT
34412010-06-07 Damien Diederen <dd@crosstwine.com>
3442
3443 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
3444 #ifdef typo.
3445
8fe2a369
ST
34462010-06-03 Sriraman Tallam <tmsriram@google.com>
3447
3448 PR gold/11658
3449 * output.cc
3450 (Output_section::Input_section_sort_entry::compare_section_ordering):
3451 Change to return non-zero correctly.
3452 (Output_section::Input_section_sort_section_order_index_compare
3453 ::operator()): Change to fix ambiguity in comparisons.
3454
6e9ba2ca
ST
34552010-06-01 Sriraman Tallam <tmsriram@google.com>
3456
3457 * gold.h (is_wildcard_string): New function.
3458 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
3459 (Layout::layout_eh_frame): Ditto.
3460 (Layout::find_section_order_index): New method.
3461 (Layout::read_layout_from_file): New method.
3462 * layout.h (Layout::find_section_order_index): New method.
3463 (Layout::read_layout_from_file): New method.
3464 (Layout::input_section_position_): New private member.
3465 (Layout::input_section_glob_): New private member.
3466 * main.cc (main): Call read_layout_from_file here.
3467 * options.h (--section-ordering-file): New option.
3468 * output.cc (Output_section::input_section_order_specified_): New
3469 member.
3470 (Output_section::Output_section): Initialize new member.
3471 (Output_section::add_input_section): Add new parameter.
3472 Keep input sections when --section-ordering-file is used.
3473 (Output_section::set_final_data_size): Sort input sections when
3474 section ordering file is specified.
3475 (Output_section::Input_section_sort_entry): Add new parameter.
3476 Check sorting type.
3477 (Output_section::Input_section_sort_entry::compare_section_ordering):
3478 New method.
3479 (Output_section::Input_section_sort_compare::operator()): Change to
3480 consider section_order_index.
3481 (Output_section::Input_section_sort_init_fini_compare::operator()):
3482 Change to consider section_order_index.
3483 (Output_section::Input_section_sort_section_order_index_compare
3484 ::operator()): New method.
3485 (Output_section::sort_attached_input_sections): Change to sort
3486 according to section order when specified.
e1df38aa
NC
3487 (Output_section::add_input_section<32, true>): Add new parameter.
3488 (Output_section::add_input_section<64, true>): Add new parameter.
3489 (Output_section::add_input_section<32, false>): Add new parameter.
3490 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
3491 * output.h (Output_section::add_input_section): Add new parameter.
3492 (Output_section::input_section_order_specified): New
3493 method.
3494 (Output_section::set_input_section_order_specified): New method.
3495 (Input_section::Input_section): Initialize section_order_index_.
3496 (Input_section::section_order_index): New method.
3497 (Input_section::set_section_order_index): New method.
3498 (Input_section::section_order_index_): New member.
3499 (Input_section::Input_section_sort_section_order_index_compare): New
3500 struct.
3501 (Output_section::input_section_order_specified_): New member.
3502 * script-sections.cc (is_wildcard_string): Delete and move modified
3503 method to gold.h.
3504 (Output_section_element_input::Output_section_element_input): Modify
3505 call to is_wildcard_string.
3506 (Output_section_element_input::Input_section_pattern
3507 ::Input_section_pattern): Ditto.
3508 (Output_section_element_input::Output_section_element_input): Ditto.
3509 * testsuite/Makefile.am (final_layout): New test case.
3510 * testsuite/Makefile.in: Regenerate.
3511 * testsuite/final_layout.cc: New file.
3512 * testsuite/final_layout.sh: New file.
3513
3537c84b
RÁE
35142010-06-01 Rafael Espindola <espindola@google.com>
3515
3516 * plugin.cc (Plugin::load): Pass the output name to the plugin.
3517
105b6afd
RÁE
35182010-06-01 Rafael Espindola <espindola@google.com>
3519
3520 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
3521 visibility of symbols.
3522
29e11421
DK
35232010-05-27 Doug Kwan <dougkwan@google.com>
3524
3525 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
3526 from start of output section instead of address for a local symbol
3527 in a merged or relaxed section when doing a relocatable link.
3528
5e0f337e
RÁE
35292010-05-26 Rafael Espindola <espindola@google.com>
3530
3531 PR 11604
3532 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
3533 adding sections the garbage collector removed.
3534 * gold/testsuite/Makefile.am: Add test.
3535 * gold/testsuite/Makefile.in: Regenerate.
3536 * gold/testsuite/plugin_test_7.sh: New.
3537 * gold/testsuite/plugin_test_7_1.c: New.
3538 * gold/testsuite/plugin_test_7_2.c: New.
3539
f4187277
RÁE
35402010-05-26 Rafael Espindola <espindola@google.com>
3541
3542 * script-sections.cc (Output_section_definition::set_section_addresses):
3543 Check for --section-start.
3544
5c388529
DK
35452010-05-26 Doug Kwan <dougkwan@google.com>
3546
3547 * arm.cc (Arm_scan_relocatable_relocs): New class.
3548 (Target_arm::relocate_special_relocatable): New method.
3549 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
3550 (Arm_relocate_functions::thumb_branch_common): Same.
3551 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
3552 instead of Default_scan_relocatable_relocs.
3553 * target-reloc.h (relocate_for_relocatable): Let target handle
3554 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
3555 * target.h (Sized_target::relocate_special_relocatable): New method.
3556
bca1c3ae
ILT
35572010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3558
3559 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
3560
0439c796
DK
35612010-05-23 Doug Kwan <dougkwan@google.com>
3562
3563 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
3564 instead of a cast.
3565 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
3566 with a direct branch, not a conditional branch, to a stub.
3567 * merge.cc (Output_merge_base::record_input_section): New method
3568 defintion.
3569 (Output_merge_data::do_add_input_section): Record input section if
3570 keeps-input-sections flag is set.
3571 (Output_merge_string::do_add_input_section): Ditto.
3572 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
3573 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
3574 INPUT_SECTIONS_.
3575 (Output_merge_base::keeps_input_sections,
3576 Output_merge_base::set_keeps_input_sections,
3577 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
3578 method definitions.
3579 (Output_merge_base::Input_sections): New type declaration.
3580 (Output_merge_base::input_sections_begin,
3581 Output_merge_base::input_sections_end,
3582 Output_merge_base::do_set_keeps_input_sections): New method definitions.
3583 (Output_merge_base::bool keeps_input_sections_,
3584 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
3585 Output_merge_base::input_sections_): New data members.
3586 (Output_merge_data::do_set_keeps_input_sections): New method
3587 defintion.
3588 (Output_merge_string::do_set_keeps_input_sections): Ditto.
3589 * output.cc (Output_section::Input_section::relobj): Move method
3590 defintion from class declaration to here and handle merge sections.
3591 (Output_section::Input_section::shndx): Ditto.
3592 (Output_section::Output_section): Remove initializations of removed
3593 data members and initialize new data member LOOKUP_MAPS_.
3594 (Output_section::add_input_section): Set keeps-input-sections flag
3595 for a newly created merge output section as appropriate. Adjust code
3596 to use Output_section_lookup_maps class.
3597 (Output_section::add_relaxed_input_section): Adjst code for lookup
3598 maps code refactoring.
3599 (Output_section::add_merge_input_section): Add a new parameter
3600 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
3601 class. If adding input section to a newly created merge output
3602 section fails, remove the new merge section.
3603 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3604 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3605 (Output_section::find_merge_section): Ditto.
3606 (Output_section::build_lookup_maps): New method defintion.
3607 (Output_section::find_relaxed_input_section): Adjust code to use
3608 Output_section_lookup_maps class.
3609 (Output_section::get_input_sections): Export merge sections. Adjust
3610 code to use Output_section_lookup_maps class.
3611 (Output_section:::add_script_input_section): Adjust code to use
3612 Output_section_lookup_maps class. Update lookup maps for merge
3613 sections also.
3614 (Output_section::discard_states): Use Output_section_lookup_maps.
3615 (Output_section::restore_states): Same.
3616 * output.h (Merge_section_properties): Move class defintion out of
3617 Output_section.
3618 (Output_section_lookup_maps): New class.
3619 (Output_section::Input_section::is_merge_section): New method
3620 defintion.
3621 (Output_section::Input_section::relobj): Move defintion out of class
3622 defintion. Declare method only.
3623 (Output_section::Input_section::shndx): Ditto.
3624 (Output_section::Input_section::output_merge_base): New method defintion.
3625 (Output_section::Input_section::u2_.pomb): New union field.
3626 (Output_section::Merge_section_by_properties_map,
3627 Output_section::Output_section_data_by_input_section_map,
3628 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3629 Remove types.
3630 (Output_section::add_merge_input_section): Add new parameter
3631 KEEPS_INPUT_SECTIONS.
3632 (Output_section::build_lookup_maps): New method declaration.
3633 (Output_section::merge_section_map_,
3634 Output_section::merge_section_by_properties_map_,
3635 Output_section::relaxed_input_section_map_,
3636 Output_section::is_relaxed_input_section_map_valid_): Remove data
3637 members.
3638 (Output_section::lookup_maps_): New data member.
3639
76295588
L
36402010-05-21 Doug Kwan <dougkwan@google.com>
3641
3642 PR gold/11619
3643 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3644 avoid a compilation error.
3645
d103a984
RÁE
36462010-05-19 Rafael Espindola <espindola@google.com>
3647
3648 * script-sections.cc (Output_section_definition::allocate_to_segment):
3649 Update the phdrs_list even when the output section is NULL.
3650 * testsuite/Makefile.am: Add test.
3651 * testsuite/Makefile.in: Regenerate.
3652 * testsuite/script_test_9.cc: New.
3653 * testsuite/script_test_9.sh: New.
3654 * testsuite/script_test_9.t: New.
3655
6625d24e
DK
36562010-05-19 Doug Kwan <dougkwan@google.com>
3657
3658 * arm.cc (Arm_input_section::original_size): New method.
3659 (Arm_input_section::do_addralign): Add a cast.
3660 (Arm_input_section::do_output_offset): Remove static cast.
3661 (Arm_input_section::original_addralign,
3662 Arm_input_section::original_size_): Change type to uint32_t.
3663 (Arm_input_section::init): Add safe casts for section alignment
3664 and size.
3665 (Arm_input_section::set_final_data_size): Do not set address and
3666 offset of stub table.
3667 (Arm_output_section::fix_exidx_coverage): Change use of of
3668 Output_section::Simple_input_section to that of
3669 Output_section::Input_section.
3670 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3671 except for the first pass.
3672 * output.cc (Output_section::get_input_sections): Change type of
3673 input_sections to std::list<Input_section>.
3674 (Output_section::add_script_input_section): Rename from
3675 Output_section::add_simple_input_section. Change type of SIS
3676 parameter from Simple_input_section to Input_section.
3677 * output.h (Output_section::Simple_input_section): Remove class.
3678 (Output_section::Input_section): Change class visibility to public.
3679 (Output_section::Input_section::addralign): Use stored alignments
3680 for special input sections if set.
3681 (Output_section::Input_section::set_addralign): New method.
3682 (Output_section::get_input_sections): Change parameter type from
3683 list of Simple_input_section to list of Input_section.
3684 (Output_section::add_script_input_section): Rename from
3685 Output_section::add_simple_input_section. Change first parameter's
3686 type from Simple_input_section to Input_section and remove the
3687 second and third parameters.
3688 * script-sections.cc (Input_section::Input_section_list): Change
3689 type to list of Output_section::Input_section/
3690 (Input_section_info::Input_section_info): Change parameter type of
3691 INPUT_SECTION to Output_section::Input_section.
3692 (Input_section_info::input_section): Change return type.
3693 (Input_section_info::input_section_): Change type to
3694 Output_section::Input_section.
3695 (Output_section_element_input::set_section_addresses): Adjust code
3696 to use Output_section::Input_section instead of
3697 Output_section::Simple_input_section. Adjust code for renaming
3698 of Output_section::add_simple_input_section.
3699 (Orphan_output_section::set_section_addresses): Ditto.
3700
e1e82ea4
RW
37012010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3702
3703 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
3704 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
3705
91e75c8a
RÁE
37062010-05-18 Rafael Espindola <espindola@google.com>
3707
3708 * options.cc (General_options::finalize): Handle -nostdlib.
3709 * options.h (nostdlib): New option.
3710 * script.cc (script_add_search_dir): Handle -nostdlib.
3711
da59ad79
DK
37122010-05-12 Doug Kwan <dougkwan@google.com>
3713
3714 * arm.cc (Target_arm::do_finalize_sections): Create an empty
3715 attributes section only if there no attributes section after merging.
3716 (Target_arm::merge_object_attributes): Move value of
e1df38aa 3717 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
3718 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
3719 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
3720 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
3721 and arm_attr_merge_7.stdout.
3722 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
3723 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
3724 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
3725 arm_attr_merge_7b.o): New rules.
3726 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
3727 arm_attr_merge_7
3728 * testsuite/Makefile.in: Regenerate.
3729 * testsuite/arm_attr_merge.sh: New file.
3730 * testsuite/arm_attr_merge_[67][ab].s: Same.
3731
3e01a7fd
NC
37322010-05-05 Nick Clifton <nickc@redhat.com>
3733
3734 * po/es.po: Updated Spanish translation.
3735
7ad2014a
L
37362010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3737
3738 * Makefile.am (install-exec-local): Properly install gold as
3739 default cross linker.
3740 * Makefile.in: Regenerated.
3741
4fda8867
NC
37422010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3743 Nick Clifton <nickc@redhat.com>
3744
3745 * configure.ac (install_as_default): Define and set to false
3746 unless --enable-gold or --enable-gold=both/gold has been
3747 specified.
3748 * configure: Regenerate.
3749
3750 * Makefile.am (install-exec-local): Install the executable as
3751 'ld.gold'. If install_as_default is true then also install it as
3752 'ld'.
3753 * Makefile.in: Regenerated.
3754
bd288ea2
ILT
37552010-04-24 Ian Lance Taylor <iant@google.com>
3756
3757 * layout.cc (Layout::layout_reloc): In relocatable link don't
3758 combine reloc sections for grouped sections.
3759
ef38fd8a
ST
37602010-04-23 Sriraman Tallam <tmsriram@google.com>
3761
3762 * gc.h (gc_process_relocs): Pass information on relocs pointing to
3763 sections that are not ordinary to icf.
3764 * icf.cc (get_section_contents): Handle relocation pointing to section
3765 with no object or shndx information.
3766 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
3767 * testsuite/Makefile.in: Regenerate.
3768 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
3769 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
3770
f6973bdc
ILT
37712010-04-22 Ian Lance Taylor <iant@google.com>
3772
3773 * expression.cc (Expression::Expression_eval_info): Add
3774 result_alignment_pointer field.
3775 (Expression::eval_with_dot): Add result_alignment_pointer
3776 parameter. Change all callers.
3777 (Expression::eval_maybe_dot): Likewise.
3778 (class Binary_expression): Add alignment_pointer parameter to
3779 left_value and right_value. Change all callers.
3780 (BINARY_EXPRESSION): Set result alignment.
3781 (class Trinary_expression): Add alignment_pointer parameter to
3782 arg2_value and arg3_value. Change all callers.
3783 (Trinary_cond::value): Set result alignment.
3784 (Max_expression::value, Min_expression::value): Likewise.
3785 (Align_expression::value): Likewise.
3786 * script-sections.cc (class Sections_element): Add dot_alignment
3787 parameter to set_section_addresses virtual function. Update
3788 instantiations.
3789 (class Output_section_element): Likewise.
3790 (Script_sections::create_segments): Add dot_alignment parameter.
3791 Change all callers.
3792 (Script_sections::create_segments_from_phdrs_clause): Likewise.
3793 (Script_sections::set_phdrs_clause_addresses): Likewise.
3794 * script-sections.h: Update declarations.
3795 * script.h: Update declarations.
3796 * output.h (Output_segment::set_minimum_p_align): Don't decrease
3797 min_p_align.
3798 * testsuite/script_test_3.t: Set large alignment.
3799 * testsuite/script_test_3.sh: Make sure that at least one LOAD
3800 segment has expected alignment.
3801
9c9c98a5
NC
38022010-04-22 Nick Clifton <nickc@redhat.com>
3803
3804 * po/gold.pot: Updated by the Translation project.
3805 * po/vi.po: Updated Vietnamese translation.
3806
2253bfba
L
38072010-04-22 H.J. Lu <hongjiu.lu@intel.com>
3808
3809 * testsuite/Makefile.am (check_PROGRAMS): Add
3810 icf_virtual_function_folding_test.
3811 * testsuite/Makefile.in: Regenerated.
3812
85fdf906
AH
38132010-04-15 Andrew Haley <aph@redhat.com>
3814
3815 * options.h (merge_exidx_entries): New option.
3816 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
3817 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
3818 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
3819 (Target_arm::merge_exidx_entries): New function.
3820 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
3821 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
3822 to Arm_exidx_fixup constructor.
3823 Add new arg, merge_exidx_entries.
3824 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
3825 Arm_output_section::fix_exidx_coverage.
3826
ce97fa81
ST
38272010-04-18 Sriraman Tallam <tmsriram@google.com>
3828
3829 * icf.cc (get_section_contents): Check for preemptible functions.
3830 Ignore addend when appropriate.
3831 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
3832 section folded.
3833 (add_from_relobj): Check for section folded.
3834 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
3835 * symtab.h (should_add_dynsym_entry): Add new parameter.
3836 * target-reloc.h (scan_relocs): Check for section folded.
3837 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
3838 Check reloc types for function pointers in shared objects.
3839 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
3840 case.
3841 (icf_preemptible_functions_test): New test case.
3842 (icf_string_merge_test): New test case.
3843 * testsuite.Makefile.in: Regenerate.
3844 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
3845 bar_glob. Refactor code.
3846 * testsuite/icf_preemptible_functions_test.cc: New file.
3847 * testsuite/icf_preemptible_functions_test.sh: New file.
3848 * testsuite/icf_string_merge_test.cc: New file.
3849 * testsuite/icf_string_merge_test.sh: New file.
3850 * testsuite/icf_virtual_function_folding_test.cc: New file.
3851 * testsuite/icf_virtual_function_folding_test.sh: New file.
3852
04ceb17c
DK
38532010-04-14 Doug Kwan <dougkwan@google.com>
3854
3855 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
3856 for local symbol recounting if we remove a section due to ICF.
3857 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
3858 there are no regular objects in input.
3859
153e7da4
DK
38602010-04-13 Doug Kwan <dougkwan@google.com>
3861
3862 * arm.cc (Arm_input_section::set_final_data_size): Compute
3863 accurate final data size instead of using current data size.
3864
4dbd9faf
DK
38652010-04-09 Doug Kwan <dougkwan@google.com>
3866
3867 * layout.cc (Layout::choose_output_section): Handle script section
3868 types.
3869 (Layout::make_output_section_for_script): Add section type parameter.
3870 Handle script section types.
3871 * layout.h (Layout::make_output_section_for_script): Add section
3872 type parameter.
3873 * output.cc (Output_section::Output_section): Initialize data member
3874 is_noload_.
3875 (Output_section::do_reset_address_and_file_offset): Do not set address
3876 to 0 if section is a NOLOAD section.
3877 * output.h (Output_section::is_noload): New method.
3878 (Output_section::set_is_noload): Ditto.
3879 (Output_section::is_noload_): New data member.
3880 * script-c.h (Script_section_type): New enum type.
3881 (struct Parser_output_section_header): Add new file section_type.
3882 * script-sections.cc (Sections_element::output_section_name): Add
3883 parameter for returning script section type.
3884 (Output_section_definition::output_section_name): Ditto.
3885 (Output_section_definition::section_type)P; New method.
3886 (Output_section_definiton::script_section_type_name): Ditto.
3887 (Output_section_definition::script_section_type_): New data member.
3888 (Output_section_definition::Output_section_definition): Initialize
3889 data member Output_section_definition::script_section_type_.
3890 (Output_section_definition::create_sections): Pass script section type
3891 to Layout::make_output_section_for_script.
3892 (Output_section_definition::output_section_name): Return script
3893 section type to caller.
3894 (Output_section_definition::set_section_address): Do not advance
3895 dot value and load address if section type is NOLOAD. Set address
3896 of NOLOAD sections regardless of section flags.
3897 (Output_section_definition::print): Print section type if it is
3898 not SCRIPT_SECTION_TYPE_NONE.
3899 (Output_section_definition::section_type): New method.
3900 (Output_section_definition::script_section_type_name): Ditto.
3901 (Script_sections::output_section_name): Add new parameter
3902 PSECTION_TYPE for returning script section type. Pass it to
3903 section elements. Handle discard sections.
3904 (Sort_output_sections::operator()): Handle NOLOAD sections.
3905 * script-sections.h (Script_sections::Section_type): New enum type.
3906 (Script_sections::output_section_name): Add a new parameter for
3907 returning script section type.
3908 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
3909 INFO and NOLOAD.
3910 * yyscript.y (union): Add new field SECTION_TYPE.
3911 (COPY, DSECT, INFO, NOLOAD): New tokens.
3912 (opt_address_and_section_type): Change type to output_section_header.
3913 (section_type): New non-terminal
3914 (section_header): Handle section type.
2253bfba 3915 (opt_address_and_section_type): Return section type value.
4dbd9faf 3916
721ea635
L
39172010-04-09 H.J. Lu <hongjiu.lu@intel.com>
3918
3919 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3920 * testsuite/plugin_common_test_2.c (foo): Likewise.
3921
6bf924b0
DK
39222010-04-08 Doug Kwan <dougkwan@google.com>
3923
3924 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3925 Output_merge_data.
3926 * output.cc (Output_section::add_merge_input_section): Simplify
3927 code and return status of Output_merge_base::add_input_section.
e1df38aa 3928 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3929 returns true.
3930
24af6f92
DK
39312010-04-07 Doug Kwan <dougkwan@google.com>
3932
3933 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3934 if section is marked as containing instructions but has no mapping
3935 symbols.
3936 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3937 correct section index.
3938 (Arm_relobj::find_linked_text_section): Ditto.
3939
00698fc5
CC
39402010-04-07 Cary Coutant <ccoutant@google.com>
3941
3942 * archive.cc (include_member): Destroy Read_symbols_data object before
3943 releasing file.
3944 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3945 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3946 (Read_symbols_data::~Read_symbols_data) New destructor.
3947 (Section_relocs::Section_relocs) New constructor.
3948 (Section_relocs::~Section_relocs) New destructor.
3949 (Read_relocs_data::Read_relocs_data) New constructor.
3950 (Read_relocs_data::~Read_relocs_data) New destructor.
3951 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3952 pointers to NULL after deleting.
3953
7296d933
DK
39542010-04-07 Doug Kwan <dougkwan@google.com>
3955
3956 * arm.cc: Replace "endianity" with "endianness" in comments.
3957 (Arm_exidx_cantunwind): Ditto.
3958 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3959 (Arm_relobj::merge_flags_and_attributes): New method.
3960 (Arm_relobj::merge_flags_and_attributes_): New data member.
3961 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3962 (Arm_relobj::scan_sections_for_stubs): Ditto.
3963 (Arm_relobj::do_read_symbols): Check to see if we really want to
3964 merge processor-specific flags and attributes. Exit early if
3965 an object is empty except for section names and the undefined symbol.
3966 (Target_arm::do_finalize_sections): Move check for ELF format to
3967 Arm_relobj::do_read_symbols. Merge processor specific flags and
3968 attributes from a regular object only when we have determined that
3969 it is aapropriate. Do not create an .ARM.attributes section in
3970 output if there is no regular input object.
3971 (Target_arm::merge_processor_specific_flags): Check
3972 --warn-mismatch before printing any error.
3973 (Target_arm::merge_object_attributes): Ditto.
3974 * gold.cc (queue_middle_tasks): Handle the case in which there is
3975 no regular object in input.
3976 * options.cc (General_options::parse_EB): New method.
3977 (General_options::parse_EL): Same.
3978 (General_options::General_options): Initialize endianness_.
3979 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3980 New options.
3981 (General_options::Endianness): New enum.
3982 (General_options::endianness): New method.
3983 (General_options::endianness_): New data member.
3984 * parameters.cc (Parameters::set_options): Check target endianness.
3985 (Parameters::set_target_once): Ditto.
3986 (Parameters::check_target_endianness): New method.
3987 (parameters_force_valid_target): If either -EL or -EB is specified,
3988 use it to define endianness of default target.
3989 * parameters.h (Parameters::check_target_endianness): New method
3990 declaration.
3991 * target.h (class Target): Change "endianity" to "endianness"
3992 in comments.
3993
efc8d4f2
RW
39942010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3995
3996 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3997 * configure: Regenerate.
3998 * Makefile.in: Regenerate.
3999 * testsuite/Makefile.in: Regenerate.
4000
be234d88
CC
40012010-04-06 Cary Coutant <ccoutant@google.com>
4002
4003 gcc PR lto/42757
4004 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
4005 prevailing definitions of common symbols.
4006 * testsuite/plugin_test_6.sh: New test case.
4007 * testsuite/plugin_common_test_1.c: New test case.
4008 * testsuite/plugin_common_test_2.c: New test case.
4009 * testsuite/Makefile.am (plugin_test_6): New test case.
4010 * testsuite/Makefile.in: Regenerate.
4011
bd32c6bd
NC
40122010-04-06 Nick Clifton <nickc@redhat.com>
4013
4014 * po/vi.po: New Vietnamese translation.
4015
323c532f
DK
40162010-03-30 Doug Kwan <dougkwan@google.com>
4017
4018 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
4019
4fcd97eb
DK
40202010-03-25 Doug Kwan <dougkwan@google.com>
4021
4022 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
4023 to avoid a conversion warning on a 32-bit host.
4024
4ebf39db
ILT
40252010-03-24 Ian Lance Taylor <iant@google.com>
4026
4027 * testsuite/script_test_3.t: Add a TLS segment.
4028 * testsuite/Makefile.am (check_PROGRAMS): Add
4029 tls_phdrs_script_test.
4030 (tls_phdrs_script_test_SOURCES): Define.
4031 (tls_phdrs_script_test_DEPENDENCIES): Define.
4032 (tls_phdrs_script_test_LDFLAGS): Define.
4033 (tls_phdrs_script_test_LDADD): Define.
4034 * testsuite/Makefile.in: Rebuild.
4035
4a599bdd
CC
40362010-03-23 Cary Coutant <ccoutant@google.com>
4037
4038 * fileread.cc (find_or_make_view): Fix comment.
4039
6c93b22c
ILT
40402010-03-23 Ian Lance Taylor <iant@google.com>
4041
4042 * script-sections.cc (class Orphan_section_placement): Define
4043 PLACE_TLS and PLACE_TLS_BSS.
4044 (Orphan_section_placement::Orphan_section_placement): Initialize
4045 new places.
4046 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
4047 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
4048 (tls_script_test_SOURCES): Define.
4049 (tls_script_test_DEPENDENCIES): Define.
4050 (tls_script_test_LDFLAGS): Define.
4051 (tls_script_test_LDADD): Define.
4052 * testsuite/Makefile.in: Rebuild.
4053
a2c7281b
DK
40542010-03-22 Doug Kwan <dougkwan@google.com>
4055
4056 * arm.cc (Arm_relocate_functions::abs8,
4057 Arm_relocate_functions::abs16): Use correct check for overflow
4058 specified in the ARM ELF specs.
4059 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
4060 target of a BLX instruction specially.
4061 (Reloc_stub::stub_type_for_reloc): Ditto.
4062 (Relocate::relocate): Use symbolic names instead of numeric relocation
4063 codes to report error.
4064 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
4065 workaround.
4066 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
4067 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
4068 thumb2_blx_out_of_range.stdout
4069 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
4070 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
4071 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
4072 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
4073 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
4074 thumb2_blx_in_range, thumb2_blx_in_range.o,
4075 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
4076 thumb2_blx_out_of_range.o): New rules.
4077 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
4078 thumb2_blx_in_range and thumb2_blx_out_of_range.
4079 * testsuite/Makefile.in: Regenerate.
4080 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4081 * testsuite/thumb_blx_in_range.s: New file.
4082 * testsuite/thumb_blx_out_of_range.s: New file.
4083
b0193076
RÁE
40842010-03-22 Rafael Espindola <espindola@google.com>
4085
4086 * archive.cc (Should_include): Move to archive.h.
4087 (should_include_member): Make it a member of Archive.
4088 (Lib_group): New.
4089 (Add_lib_group_symbols): New.
4090 * archive.h: Include options.h.
4091 (Archive_member): Moved from Archive.
4092 (Should_include): Moved from archive.cc.
4093 (Lib_group): New.
4094 (Add_lib_group_symbols): New.
4095 * dynobj.cc (do_should_include_member): New.
4096 * dynobj.h (do_should_include_member): New.
4097 * gold.cc (queue_initial_tasks): Update call to queue.
4098 * main.cc (main): Print lib group stats.
4099 * object.cc (do_should_include_member): New.
4100 * object.h: Include archive.h.
4101 (Object::should_include_member): New.
4102 (Object::do_should_include_member): New.
4103 (Sized_relobj::do_should_include_member): New.
4104 * options.cc (General_options::parse_start_lib): New.
4105 (General_options::parse_end_lib): New.
4106 (Input_arguments::add_file): Handle lib groups.
4107 (Input_arguments::start_group): Check we are not in a lib.
4108 (Input_arguments::start_lib): New.
4109 (Input_arguments::end_lib): New.
4110 * options.h (General_options): Add start_lib and end_lib.
4111 (Input_argument::lib_): New.
4112 (Input_argument::lib): New.
4113 (Input_argument::is_lib): New.
4114 (Input_file_lib): New.
4115 (Input_arguments::in_lib_): New.
4116 (Input_arguments::in_lib): New.
4117 (Input_arguments::start_lib): New.
4118 (Input_arguments::end_lib_): New.
4119 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4120 in unused members as preempted.
4121 (Sized_pluginobj::do_should_include_member): New.
4122 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4123 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4124 return the blocker.
4125 (Read_symbols::do_whole_lib_group): New.
4126 (Read_symbols::do_lib_group): New.
4127 (Read_symbols::do_read_symbols): Handle lib groups.
4128 (Read_symbols::get_name): Handle lib groups.
4129 * readsyms.h (Read_symbols): Add an archive member pointer.
4130 (Read_symbols::do_whole_lib_group): New.
4131 (Read_symbols::do_lib_group): New.
4132 (Read_symbols::member_): New.
4133 * script.cc (read_input_script): Update call to queue_soon.
4134
d099120c
DK
41352010-03-19 Doug Kwan <dougkwan@google.com>
4136
4137 * arm.cc (Stub_table::Stub_table): Initialize new data members
4138 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4139 (Stub_table::add_reloc_stub): Assign stub offset and update
4140 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4141 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4142 New data members.
4143 (Stub_table::update_data_size_and_addralign): Use
4144 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4145 instead of going over all reloc stubs.
4146 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4147 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4148 Stringpool_template::offset_ to size of Stringpool_char.
4149 (Stringpool_template::new_key_offset): Remove code to initialize
4150 Stringpool_template::offset_.
4151 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4152 Stringpool_template::offset_ to zero.
4153
1aa37384
DK
41542010-03-15 Doug Kwan <dougkwan@google.com>
4155
4156 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4157 offset_.
4158 (Stringpool_template::new_key_offset): New method.
4159 (Stringpool_template::add_string): Assign offsets when adding new
4160 strings.
4161 (Stringpool_template::set_string_offsets): Do not set string offsets
4162 when not optimizing.
4163 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4164 member size_.
4165 (Chunked_vector::clear): Clear size_.
4166 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4167 (Chunked_vector::size): Return size_.
4168 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 4169 (Chunked_vector::size_): New data member.
1aa37384
DK
4170 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4171 (Stringpool_template::new_key_offset): New method declaration.
4172 (Stringpool_template::offset_): New data member.
4173
b672b057
RÁE
41742010-03-15 Rafael Espindola <espindola@google.com>
4175
4176 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4177 Add_symbols' constructor.
4178 * readsyms.h (Add_symbols): Remove the input_group member.
4179
b6848d3c
ILT
41802010-03-10 Ian Lance Taylor <iant@google.com>
4181
4182 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4183 target to ask whether a reference to a symbol requires a stack
4184 split.
4185 * target.h (Target::is_call_to_non_split): New function.
4186 (Target::do_is_call_to_non_split): Declare virtual function.
4187 * target.cc: Include "symtab.h".
4188 (Target::do_is_call_to_non_split): New function.
4189 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4190
a2a5469e
CC
41912010-03-10 Cary Coutant <ccoutant@google.com>
4192
4193 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4194 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4195 (File_read::open[2]): Add whole_file_view_ to list of views.
4196 (File_read::make_view): Remove test of whole_file_view_.
4197 (File_read::find_or_make_view): Create whole_file_view_ if
4198 necessary.
4199 (File_read::clear_views): Replace bool parameter with enum;
4200 adjust all callers. Don't delete views with permanent data;
4201 do delete cached views and views from archives if
4202 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4203 if clearing the corresponding view.
4204 * fileread.h (File_read::Clear_views_mode): New enum.
4205 (File_read::View::is_permanent_view): New method.
4206 (File_read::clear_views): Replace bool parameter
4207 with enum; adjust all callers.
4208 * options.h (General_options): Change keep_files_mapped option;
4209 add map_whole_files.
4210 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4211 releasing the file.
4212 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4213 the file.
4214
8861f32b
DM
42152010-03-10 David S. Miller <davem@davemloft.net>
4216
4217 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4218
d62d0f5f
ST
42192010-03-09 Sriraman Tallam <tmsriram@google.com>
4220
4221 * icf.cc (get_section_contents): Add '@' marker after processing the
4222 merge reloc.
4223
9177756d
DK
42242010-03-08 Doug Kwan <dougkwan@google.com>
4225
4226 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4227 due to a conversion warning.
4228 (Arm_relobj::update_output_local_symbol_count): Check for local
4229 symbol with unset output index.
4230
9e9e071b
ILT
42312010-03-05 Ian Lance Taylor <iant@google.com>
4232
4233 * options.h (class General_options): Add --spare-dynamic-tags.
4234 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4235 --spare-dynamic-tags.
4236
a81ee015
ILT
42372010-03-05 Ian Lance Taylor <iant@google.com>
4238
4239 * incremental.cc: Include "libiberty.h".
4240
44ec90b9
RO
42412010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4242
4243 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4244 function, is_info_ member.
4245 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4246 (Versions::Versions): Update caller.
4247 (Versions::define_base_version): Likewise.
4248 (Versions::add_def): Likewise.
4249
0897ed3b
ST
42502010-03-03 Sriraman Tallam <tmsriram@google.com>
4251
4252 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4253 (Scan::possible_function_pointer_reloc): New function.
4254 (Scan::local_reloc_may_be_function_pointer): Change to call
4255 possible_function_pointer_reloc.
4256 (Scan::global_reloc_may_be_function_pointer): Ditto.
4257 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4258 relocations in ".data.rel.ro._ZTV" section.
4259 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4260 * testsuite/icf_safe_so_test.cc: Ditto.
4261 * testsuite/icf_safe_test.cc: Ditto.
4262 * testsuite/icf_safe_test.sh: Ditto.
4263
d3bbad62
ILT
42642010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4265 Ian Lance Taylor <iant@google.com>
4266
4267 * target-reloc.h (relocate_section): Check the symbol table index
4268 for -1U before setting the local symbol index.
4269 (scan_relocatable_relocs): If copying the relocation, record that
4270 the local symbol is required.
4271 * object.h (Symbol_value::is_output_symtab_index_set): New
4272 function.
4273 (Symbol_value::may_be_discarded_from_output_symtab): New
4274 function.
4275 (Symbol_value::has_output_symtab_entry): New function.
4276 (Symbol_value::needs_output_symtab_entry): Remove.
4277 (Symbol_value::output_symtab_index): Make sure the symbol index is
4278 set.
4279 (Symbol_value::set_output_symtab_index): Make sure the symbol
4280 index is not set. Make sure the new index is valid.
4281 (Symbol_value::set_must_have_output_symtab_entry): New function.
4282 (Symbol_value::has_output_dynsym_entry): New function.
4283 (Symbol_value::set_output_dynsym_index): Make sure the new index
4284 is valid.
4285 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4286 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4287 local symbol if permitted.
4288 (Sized_relobj::do_finalize_local_symbols): Call
4289 is_output_symtab_index_set rather than needs_output_symtab_entry.
4290 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4291 rather than needs_output_symtab_entry. Call
4292 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4293 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4294 is_output_symtab_index_set rather than needs_output_symtab_entry.
4295 * testsuite/discard_locals_relocatable_test.c: New file.
4296 * testsuite/discard_locals_test.sh: Test -r.
4297 * testsuite/Makefile.am (check_DATA): Add
4298 discard_locals_relocatable_test1.syms,
4299 discard_local_relocatable_test2.syms.
4300 (MOSTLYCLEANFILES): Likewise. Also add
4301 discard_locals_relocatable_test1.lout and
4302 discard_locals_relocatable_test2.out.
4303 (discard_locals_relocatable_test1.syms): New target.
4304 (discard_locals_relocatable_test.o): New target.
4305 (discard_locals_relocatable_test1.out): New target.
4306 (discard_locals_relocatable_test2.syms): New target.
4307 (discard_locals_relocatable_test2.out): New target.
4308 (various): Add missing ../ld-new dependencies.
4309 * testsuite/Makefile.in: Rebuild.
4310
7e8ccf26
NC
43112010-03-03 Nick Clifton <nickc@redhat.com>
4312
4313 * po/fi.po: New Finnish translation.
4314
2a0ff005
DK
43152010-03-01 Doug Kwan <dougkwan@google.com>
4316
4317 * layout.cc (Layout::Layout): Force section types of .init_array*,
4318 .preinit_array* and .fini_array* sections.
4319 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4320 Fix check of return value of std::string::find.().
4321 (Output_section::Input_section_sort_compare::operator()): Remove
4322 comment about .init_array.
4323 (Output_section::Input_section_sort_init_fini_compare::operator()):
4324 New method.
4325 (Output_section::sort_attached_input_sections): Handle .init_array
4326 and .fini_array specially.
4327 * output.h (Output_section::Inut_section_sort_compare): Update
4328 comment.
4329 (Output_section::Input_section_sort_init_fini_compare): New struct.
4330
c3e4ae29
DK
43312010-02-26 Doug Kwan <dougkwan@google.com>
4332
4333 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4334 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4335 * testsuite/debug_msg.sh: Avoid matching source line number for
4336 use of global variable undef_int.
4337
2fd9ae7a
DK
43382010-02-26 Doug Kwan <dougkwan@google.com>
4339
4340 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4341 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4342 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4343 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4344 * options.cc (General_options::General_options): Initialize member
4345 fix_v4bx_.
4346 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
4347 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
4348 and rm_no_fix_v4bx.stdout
4349 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
4350 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
4351 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
4352 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
4353 and arm_no_fix_v4bx.
4354 * Makefile.in: Regenerate.
4355 * testsuite/arm_fix_v4bx.s: New file.
4356 * testsuite/arm_fix_v4bx.sh: Ditto.
4357
67ec7d0b
DK
43582010-02-24 Doug Kwan <dougkwan@google.com>
4359
4360 * arm.cc (Target_arm::got_section): Make the .got section the first
4361 non RELRO section in the data segment.
4362 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4363 suffixes of section names.
4364
10165461
DK
43652010-02-24 Doug Kwan <dougkwan@google.com>
4366
4367 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4368 flags and attributes merging if an input file is a binary file.
4369 * fileread.cc (Input_file::open): Record format of original file.
4370 * fileread.h (Input_file::Format): New enum type.
4371 (Input_file::Input_file): Initialize data member format_.
4372 (Input_file::format): New method definition.
4373 (Input_file::format_):: New data member.
4374
4a54abbb
DK
43752010-02-24 Doug Kwan <dougkwan@google.com>
4376
4377 * arm.cc (Arm_output_data_got): New class.
4378 (ARM_TCB_SIZE): New constant
4379 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4380 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4381 If user uses a script with a SECTIONS clause, issue only a warning
4382 for a misplaced EXIDX input section. Otherwise, issue an error.
4383 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4384 garbage collection.
4385 (Target_arm::got_mode_index_entry): Handle static linking.
4386 (Target_arm::Scan::local): Ditto.
4387 (Target_arm::Scan::global): Ditto.
4388 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
4389 all incorrectly implemented relocations.
e1df38aa 4390 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
4391 Arm_output_section::fix_exidx_coverage.
4392 * layout.cc (Layout::section_name_mapping): Remove trailing dots
4393 from ".ARM.exidx." and ".ARM.extab.".
4394
ca419a6f
ILT
43952010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4396
4397 * arm.cc (Target_arm::do_finalize_sections): Create attribute
4398 section if it does not already exist.
4399 * attributes.cc (Attributes_section_data::Attributes_section_data):
4400 Don't crash if size is zero.
4401
135b9c78
ILT
44022010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4403 Ian Lance Taylor <iant@google.com>
4404
4405 * gold.cc (queue_middle_tasks): If no input files were opened,
4406 exit.
4407 * workqueue.h (Task_function::Task_function): Assert that there is
4408 a blocker.
4409
bb0bfe4f
DK
44102010-02-22 Doug Kwan <dougkwan@google.com>
4411
4412 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
4413 * icf.cc (get_section_contents): Cast snprintf arguments to long long
4414 types to avoid warnings due to different uint64_t implementations
4415 on different hosts.
4416
2a2b6d42
DK
44172010-02-21 Doug Kwan <dougkwan@google.com>
4418
4419 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
4420 handling of the maximum backward branch offset.
4421 (Arm_relocate_functions::thumb_branch_common): Ditto.
4422 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
4423 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 4424 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
4425 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
4426 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
4427 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
4428 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
4429 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
4430 thumb_bl_out_of_range thumb_bl_out_of_range.o,
4431 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
4432 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
4433 thumb2_bl_out_of_range.o): New rules.
4434 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
4435 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
4436 thumb2_bl_out_of_range
4437 * testsuite/Makefile.in: Regenerate.
4438 * testsuite/arm_bl_in_range.s: New file.
4439 * testsuite/arm_bl_out_of_range.s: Ditto.
4440 * testsuite/arm_branch_in_range.sh: Ditto.
4441 * testsuite/arm_branch_range.t: Ditto.
4442 * testsuite/thumb2_branch_range.t: Ditto.
4443 * testsuite/thumb_bl_in_range.s: Ditto.
4444 * testsuite/thumb_bl_out_of_range.s: Ditto.
4445 * testsuite/thumb_branch_range.t: Ditto.
4446
b487ad64
ST
44472010-02-20 Sriraman Tallam <tmsriram@google.com>
4448
4449 * gc.h (gc_process_relocs): Change vectors to point to the new list.
4450 Add reloc offset information.
4451 * icf.cc (get_section_contents): Change iterators to point to the new
4452 vectors. Add reloc offset information to the contents.
4453 * icf.h (Icf::Sections_reachable_info): New typedef.
4454 (Icf::Sections_reachable_list): New typedef.
4455 (Icf::Offset_info): New typedef.
4456 (Icf::Reloc_info): New struct typedef.
4457 (Icf::Reloc_info_list): New typedef.
4458 (Icf::symbol_reloc_list): Delete method.
4459 (Icf::addend_reloc_list): Delete method.
4460 (Icf::section_reloc_list): Delete method.
4461 (Icf::reloc_info_list): New method.
4462 (Icf::reloc_info_list_): New member.
4463
f96accdf
DK
44642010-02-19 Doug Kwan <dougkwan@google.com>
4465
4466 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
4467 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
4468 * arm.cc (Arm_relocation_functions): New forward declaration.
4469 (Target_arm::Target_arm): Initialize new data members
4470 got_mod_index_offset_ and tls_base_symbol_defined_.
4471 (Target_arm::Relocate::relocate_tls): New method.
4472 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
4473 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
4474 New methods.
4475 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
4476 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
4477 (Target_arm::got_mod_index_offset_,
4478 Target_arm::tls_base_symbol_defined_): New data members.
4479 (Target_arm::Scan::local, Target::Scan::global,
4480 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
4481 relocations.
4482
c8761b9a
DK
44832010-02-18 Doug Kwan <dougkwan@google.com>
4484
4485 * arm.cc (Arm_relobj::find_linked_text_section): New method.
4486 (Arm_relobj::make_exidx_input_section): Pass section index of linked
4487 text section as a parameter becuase some broken tools may not set
4488 the link in section header.
4489 (Target_arm::has_got_section): New method.
4490 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
4491 without any mapping symbol as data only. Remove warning.
4492 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
4493 link in its section header, try to discover the link by inspecting the
4494 REL31 relocation at the beginning of the section.
4495 (Target_arm::Scan::check_non_pic): Report name of offending relocation
4496 in error message.
4497 (Target_arm::Scan::global): Treat any reference to the symbol
4498 _GLOBAL_OFFSET_TABLE_ as a GOT access.
4499
21bb3914
ST
45002010-02-12 Sriraman Tallam <tmsriram@google.com>
4501
4502 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
4503 (Scan::global_reloc_may_be_function_pointer): New function.
4504 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4505 (Scan::global_reloc_may_be_function_pointer): New function.
4506 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4507 (Scan::global_reloc_may_be_function_pointer): New function.
4508 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
4509 (Scan::global_reloc_may_be_function_pointer): New function.
4510 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
4511 (Scan::global_reloc_may_be_function_pointer): New function.
4512 (Scan::possible_function_pointer_reloc): New function.
4513 (Target_x86_64::can_check_for_function_pointers): New function.
4514 * gc.h (gc_process_relocs): Scan relocation types to determine if
4515 function pointers were taken for targets that support it.
4516 * icf.cc (Icf::find_identical_sections): Include functions for
4517 folding in safe ICF whose pointer is not taken.
4518 * icf.h (Secn_fptr_taken_set): New typedef.
4519 (fptr_section_id_): New member.
4520 (section_has_function_pointers): New function.
4521 (set_section_has_function_pointers): New function.
4522 (check_section_for_function_pointers): New function.
4523 * options.h: Fix comment for safe ICF option.
4524 * target.h (can_check_for_function_pointers): New function.
4525 * testsuite/Makefile.am: Add icf_safe_so_test test case.
4526 Modify icf_safe_test for X86-64.
4527 * testsuite/Makefile.in: Regenerate.
4528 * testsuite/icf_safe_so_test.cc: New file.
4529 * testsuite/icf_safe_so_test.sh: New file.
4530 * testsuite/icf_safe_test.cc (kept_func_3): New function.
4531 (main): Change to take pointer to function kept_func_3.
4532 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
4533 folding is done correctly for X86-64.
4534
0da6fa6c
DM
45352010-02-12 David S. Miller <davem@davemloft.net>
4536
4537 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
4538 is_symbolless parameter.
4539 (Output_reloc<SHT_REL>::is_symbolless): New.
4540 (Output_reloc<SHT_REL>::is_symbolless_): New.
4541 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
4542 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
4543 (Output_reloc<SHT_RELA>::is_symbolless): New.
4544 (Output_data_reloc::add_global): Handle is_symbolless.
4545 (Output_data_reloc::add_global_relative): Likewise.
4546 (Output_data_reloc::add_local): Likewise.
4547 (Output_data_reloc::add_local_relative): Likewise.
4548 (Output_data_reloc::add_symbolless_global_addend): New.
4549 (Output_data_reloc::add_symbolless_local_addend): New.
4550 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
4551 is_symbolless.
4552 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
4553 instead of ->is_relative_
4554 (Output_reloc::write): Likewise.
4555 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
4556 (Output_reloc::write_rel): Simplify.
4557
4558 * sparc.cc (Target_sparc::Scan::local): Use
4559 ->add_symbolless_local_addend as needed.
4560 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
4561 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
4562 based upon relocation offset.
4563
e4782e83
DK
45642010-02-11 Doug Kwan <dougkwan@google.com>
4565
4566 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
4567 (Target_arm::Scan::global): Ditto. Also remove a comment before the
4568 beginning of function.
4569 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
4570 and MOVT_ABS relocations. Those are non issued in scanning. Fix
4571 parameter is_32bit in calls to should_apply_static_reloc.
4572 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
4573 (check_DATA): Add arm_abs_global.stdout.
4574 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
4575 arm_abs_global.stdout): New rules.
4576 (MOSTLLYCLEANFILES): Add arm_abs_global
4577 * Makefile.in: Regenerate.
4578 * testsuite/arm_abs_global.s: New file.
4579 * testsuite/arm_abs_global.sh: Ditto.
4580 * testsuite/arm_abs_lib.s: Ditto.
4581
93ceb764
ILT
45822010-02-11 Ian Lance Taylor <iant@google.com>
4583
4584 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
4585 Read_relocs task.
4586 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
4587 Allocate_commons_task first.
4588 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
4589 task, rather than symtab_lock_.
4590 (Gc_process_relocs::~Gc_process_relocs): New function.
4591 (Gc_process_relocs::is_runnable): Check this_blocker_.
4592 (Gc_process_relocs::locks): Use next_blocker_ rather than
4593 blocker_.
4594 (Scan_relocs::~Scan_relocs): New function.
4595 (Scan_relocs::is_runnable): Check this_blocker_ rather than
4596 symtab_lock_.
4597 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
4598 next_blocker_.
4599 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
4600 fields. Add this_blocker_ and next_blocker_ fields. Adjust
4601 constructor accordingly.
4602 (class Gc_process_relocs): Likewise.
4603 (class Scan_relocs): Likewise.
4604 * common.h (class Allocate_commons_task): Remove symtab_lock_
4605 field, and corresponding constructor parameter.
4606 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4607 symtab_lock_.
4608 (Allocate_commons_task::locks): Likewise.
4609
114dfbe1
ILT
46102010-02-11 Ian Lance Taylor <iant@google.com>
4611
4612 * gold-threads.h (class Once): Define.
4613 (class Initialize_lock): Rewrite as child of Once.
4614 * gold-threads.cc (class Once_initialize): Define.
4615 (once_pointer_control): New static variable.
4616 (once_pointer, once_arg): New static variables.
4617 (c_run_once): New static function.
4618 (Once::Once, Once::run_once, Once::internal_run): New functions.
4619 (class Initialize_lock_once): Remove.
4620 (initialize_lock_control): Remove.
4621 (initialize_lock_pointer): Remove.
4622 (initialize_lock_once): Remove.
4623 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4624 (Initialize_lock::initialize): Rewrite.
4625 (Initialize_lock::do_run_once): New function.
4626 * archive.cc (Archive::interpret_header): Only clear name if it is
4627 not already empty.
4628 * fileread.cc: Include "gold-threads.h"
4629 (file_counts_lock): New static variable.
4630 (file_counts_initialize_lock): Likewise.
4631 (File_read::release): Only increment counts when using --stats.
4632 Use a lock around the increment.
4633 * parameters.cc (class Set_parameters_target_once): Define.
4634 (set_parameters_target_once): New static variable.
4635 (Parameters::Parameters): Move here from parameters.h.
4636 (Parameters::set_target): Rewrite.
4637 (Parameters::set_target_once): New function.
4638 (Parameters::clear_target): Move here and rewrite.
4639 * parameters.h (class Parameters): Update declarations. Add
4640 set_parameters_target_once_ field.
4641 (Parameters::Parameters): Move to parameters.cc.
4642 (Parameters::clear_target): Likewise.
4643 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4644 task.
4645 (Start_group::~Start_group): New function.
4646 (Start_group::is_runnable): New function.
4647 (Start_group::locks, Start_group::run): New functions.
4648 (Finish_group::run): Change saw_undefined to size_t.
4649 * readsyms.h (class Start_group): Define.
4650 (class Finish_group): Change saw_undefined_ field to size_t.
4651 (Finish_group::Finish_group): Remove saw_undefined and
4652 this_blocker parameters. Change all callers.
4653 (Finish_group::set_saw_undefined): New function.
4654 (Finish_group::set_blocker): New function.
4655 * symtab.h (class Symbol_table): Change saw_undefined to return
4656 size_t. Change saw_undefined_ field to size_t.
4657 * target-select.cc (Set_target_once::do_run_once): New function.
4658 (Target_selector::Target_selector): Initialize set_target_once_
4659 field. Don't initialize lock_ and initialize_lock_ fields.
4660 (Target_selector::instantiate_target): Rewrite.
4661 (Target_selector::set_target): New function.
4662 * target-select.h (class Set_target_once): Define.
4663 (class Target_selector): Update declarations. Make
4664 Set_target_once a friend. Remove lock_ and initialize_lock_
4665 fields. Add set_target_once_ field.
4666
fa17a3f4
ILT
46672010-02-10 Ian Lance Taylor <iant@google.com>
4668
4669 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4670 queueing any tasks.
4671 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4672 (queue_middle_tasks): Add all blockers before queueing any tasks.
4673 (queue_final_tasks): Likewise.
4674 * token.h (Task_token::add_blockers): New function.
4675 * object.h (Input_objects::number_of_relobjs): New function.
4676
c7177d31
ILT
46772010-02-10 Ian Lance Taylor <iant@google.com>
4678
5de0e392
ILT
4679 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
4680 shared, not if not position independent.
4681 * x86_64.cc (Relocate::relocate_tls): Likewise.
4682 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
4683 (tls_pie_pic_test): New target.
4684 * testsuite/Makefile.in: Rebuild.
4685
c7177d31
ILT
4686 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
4687 (tls_test_main_pie.o, tls_test_pie.o): New targets.
4688 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
4689 * testsuite/Makefile.in: Rebuild.
4690
684b268a
DM
46912010-02-09 David S. Miller <davem@davemloft.net>
4692
4693 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4694 R_SPARC_RELATIVE using ->add_local_relative().
4695 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
4696
612a8d3d
DM
4697 * output.h (Output_data_dynamic::add_section_size): New method
4698 that takes two Output_data objects.
4699 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
4700 entry param. Handle it in initializers.
4701 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
4702 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
4703 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
4704 arg.
4705 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
4706 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
4707 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
4708 for dynrel_includes_plt.
4709 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4710 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4711 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
4712 before .rela.plt
4713 (Target_sparc::do_finalize_sections): Update to pass true for
4714 dynrel_includes_plt.
4715 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
4716 output before .rela.plt
4717 (Target_powerpc::do_finalize_sections): Update to pass true for
4718 dynrel_includes_plt when 32-bit.
4719
cb1be87e
DK
47202010-02-08 Doug Kwan <dougkwan@google.com>
4721
4722 * arm.cc (Arm_relobj::simple_input_section_output_address): New
4723 method.
4724 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
4725 Arm_relobj::scan_section_for_cortex_a8_stubs,
4726 Arm_relobj::do_relocation_section): Instead of calling
4727 Output_section::output_address, use faster
4728 Arm_relobj::simple_input_section_output_address.
4729
705b5121
DM
47302010-02-08 David S. Miller <davem@davemloft.net>
4731
4732 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
4733 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
4734 relocation helper function.
4735
024c4466
DM
4736 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
4737 just like R_SPARC_GOT{10,13,22}.
4738 (Target_sparc::Scan::local): Likewise.
4739 (Target_sparc::Relocate:relocate): Likewise.
4740
9109c078
ILT
47412010-02-06 Ian Lance Taylor <iant@google.com>
4742
4743 * configure.ac: Rewrite targetobjs duplicate removal code to use
4744 only shell constructs.
4745 * configure: Rebuild.
4746
cf846138
DK
47472010-02-05 Doug Kwan <dougkwan@google.com>
4748
4749 PR 11247
4750 * arm.cc (Arm_relobj::section_is_scannable): New method.
4751 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
4752 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
4753
6cfaf60b
DK
47542010-02-04 Doug Kwan <dougkwan@google.com>
4755
4756 PR 11247
4757 * arm-reloc-property.cc (cstdio): Include.
4758 * configure.ac (targetobjs): Remove duplicates.
4759 * configure: Regenerate.
4760 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
4761 big and little endian version for a given address size.
4762
5c57f1be
DK
47632010-02-03 Doug Kwan <dougkwan@google.com>
4764
4765 * arm-reloc-property.cc
4766 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4767 definition.
4768 * arm-reloc-property.h
4769 (Arm_reloc_property_table::get_implemented_static_reloc_property):
4770 New method definition.
4771 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4772 declaration.
4773 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
4774 overflow to N.
4775 (GOT_PREL): Change implemented to Y.
4776 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
4777 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
4778 (Arm_relocate_functions::movw_abs_nc): Remove method.
4779 (Arm_relocate_functions::movt_abs): Ditto.
4780 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
4781 (Arm_relocate_functions::thm_movt_abs): Ditto.
4782 (Arm_relocate_functions::movw_rel_nc): Ditto.
4783 (Arm_relocate_functions::movw_rel): Ditto.
4784 (Arm_relocate_functions::movt_rel): Ditto.
4785 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
4786 (Arm_relocate_functions:thm_movw_rel): Ditto.
4787 (Arm_relocate_functions:thm_movt_rel): Ditto.
4788 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
4789 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
4790 New method definitions.
4791 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
4792 (Arm_relocation_functions::arm_grp_ldr): Ditto.
4793 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
4794 (Arm_relocation_functions::arm_grp_ldc): Ditto.
4795 (Target_arm::Relocate::relocate): Check for non-static or
4796 unimplemented relocation code and exit early. Change calls to
4797 Target_arm::reloc_uses_thumb_bit and
4798 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
4799 instead. Refactor code to handle similar relocations to increase
4800 code sharing. Remove check for unsupported relocation code in switch
4801 statement.
4802 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
4803 relocation property table to find out size. Change error message to
4804 print out the name of a relocation code instead of the numeric value.
4805 (Target_arm::scan_reloc_for_stub): Use relocation property table
4806 instead of calling Target_arm::reloc_uses_thumb_bit().
4807
218c5831
DK
48082010-02-02 Doug Kwan <dougkwan@google.com>
4809
4810 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
4811 types of relaxed input section.
4812
0d31c79d
DK
48132010-02-02 Doug Kwan <dougkwan@google.com>
4814
4815 * Makefile.am (HFILES): Add arm-reloc-property.h.
4816 (DEFFILES): New.
4817 (TARGETSOURCES): Add arm-reloc-property.cc
4818 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
4819 (libgold_a_SOURCES): $(DEFFILES)
4820 * Makefile.in: Regenerate.
4821 * arm-reloc-property.cc: New file.
4822 * arm-reloc-property.h: New file.
4823 * arm-reloc.def: New file.
4824 * arm.cc: Update comments.
4825 (arm-reloc-property.h): New included header.
4826 (arm_reloc_property_table): New global variable.
4827 (Target_arm::do_select_as_default_target): New method definition.
4828 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
4829 arm-reloc-property to targ_extra_obj.
4830 * parameters.cc (set_parameters_target): Call
4831 Target::select_as_default_target().
4832 * target.h (Target::select_as_default_target): New method definition.
4833 (Target::do_select_as_default_target): Same.
4834
546c7457
DK
48352010-02-01 Doug Kwan <dougkwan@google.com>
4836
4837 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
4838 first_output_text_section_.
4839 (Arm_exidx_fixup::first_output_text_section): New method definition.
4840 (Arm_exidx_fixup::first_output_text_section_): New data member.
4841 (Arm_exidx_fixup::process_exidx_section): Record the first text
4842 output section seen.
4843 (Arm_output_section::fix_exidx_coverage): Set correct linked section
4844 and entsize in output section header.
4845
11b861d5
DK
48462010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4847
4848 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
4849 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
4850 (Arm_relocate_functions::thm_alu11): New Method.
4851 (Arm_relocate_functions::thm_pc8): New Method.
4852 (Arm_relocate_functions::thm_pc12): New Method.
4853 (Target_arm::Scan::local): Handle the relocations.
4854 (Target_arm::Scan::global): Likewise.
4855 (Target_arm::Relocate::relocate): Likewise.
4856 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4857
c9a2c125
DK
48582010-01-29 Doug Kwan <dougkwan@google.com>
4859
4860 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
4861 of relocation types as ld.
4862
1521477a
DK
48632010-01-29 Doug Kwan <dougkwan@google.com>
4864
4865 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
4866 to public.
4867 (Arm_relocate_functions::thumb_branch_common): Ditto.
4868 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
4869 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
4870 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
4871 Arm_relocate_functions::jump24): Remove.
4872 (Target_arm::Relocate::relocate): Adjust code to call
4873 Arm_relocation_functions::arm_branch_common and
4874 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 4875 wrappers. Merge switch-cases together to reduce source code size.
1521477a 4876
e7eca48c
DK
48772010-01-29 Doug Kwan <dougkwan@google.com>
4878
4879 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
4880 output_local_symbol_count_needs_update_.
4881 (Arm_relobj::output_local_symbol_count_needs_update,
4882 Arm_relobj::set_output_local_symbol_count_needs_update,
4883 Arm_relobj::update_output_local_symbol_count): New methods.
4884 (Arm_relobj::output_local_symbol_count_needs_update_): New data
4885 member.
4886 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
4887 of pointed function as in a R_ARM_PREL31 relocation.
4888 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
4889 for output local symbol count updating.
4890 (Target_arm::do_relax): Update output local symbol counts in objects
4891 if necessary.
4892 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
4893
02961d7e
ILT
48942010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4895
4896 * arm.cc: Added support for the ARM relocations:
4897 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
4898 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
4899 (Arm_relocate_functions::movw_rel_nc): Renamed (was
4900 movw_prel_nc).
4901 (Arm_relocate_functions::movw_rel): New method.
4902 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
4903 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
4904 thm_movw_prel_nc).
4905 (Arm_relocate_functions::thm_movw_rel): New method.
4906 (Arm_relocate_functions::thm_movt_rel): Renamed (was
4907 thm_movt_prel).
4908 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
4909 relocations.
4910 (Target_arm::Scan::global): Likewise.
4911 (Target_arm::Relocate::relocate): Likewise.
4912 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4913 Likewise.
4914
b10d2873
ILT
49152010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4916
4917 * arm.cc: Added support for ARM group relocations.
4918 (Target_arm::reloc_needs_sym_origin): New method.
4919 (Arm_relocate_functions::calc_grp_kn): New method.
4920 (Arm_relocate_functions::calc_grp_residual): New method.
4921 (Arm_relocate_functions::calc_grp_gn): New method.
4922 (Arm_relocate_functions::arm_grp_alu): New Method.
4923 (Arm_relocate_functions::arm_grp_ldr): New Method.
4924 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4925 (Arm_relocate_functions::arm_grp_ldc): New Method.
4926 (Target_arm::Scan::local): Handle the ARM group relocations.
4927 (Target_arm::Scan::global): Likewise.
4928 (Target_arm::Relocate::relocate): Likewise.
4929 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4930 Likewise.
4931
2b328d4e
DK
49322010-01-26 Doug Kwan <dougkwan@google.com>
4933
4934 * arm.cc (set): Include.
4935 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4936 pointer type.
4937 (Arm_output_section::Text_section_list): New type.
4938 (Arm_output_section::append_text_sections_to_list): New method.
4939 (Arm_output_section::fix_exidx_coverage): Ditto.
4940 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4941 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4942 Relobj::set_section_offset() instead of
4943 Sized_relobj::invalidate_section_offset().
4944 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4945 parameter for section headers. Ignore relocation sections for
4946 unallocated sections and EXIDX sections.
4947 (Target_arm::fix_exidx_coverage): New method.
4948 (Target_arm::output_section_address_less_than): New type.
4949 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4950 linked text section instead of the EXIDX section.
4951 (Arm_output_section::create_stub_group): Add an assertion to check
4952 that this is not an EXIDX output section.
4953 (Arm_output_section::append_text_sections_to_list): New method.
4954 (Arm_output_section::fix_exidx_coverage): Ditto.
4955 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4956 Arm_relobj::section_needs_reloc_stub_scanning.
4957 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4958 first pass.
4959 (Target_arm::fix_exidx_coverage): New method.
4960 * object.h (Relobj::set_output_section): New method.
4961 (Sized_relobj::invalidate_section_offset): Remove method.
4962 (Sized_relobj::do_invalidate_section_offset): Remove method.
4963 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4964
c7f3c371
DK
49652010-01-25 Doug Kwan <dougkwan@google.com>
4966
4967 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4968 Fix warning due to signed and unsigned comparison on a 32-bit host.
4969
8923b24c
DK
49702010-01-22 Doug Kwan <dougkwan@google.com>
4971
4972 * arm.cc (Target_arm::do_relax): Record an output section for section
4973 offset adjustment it contains any stub table that has changed.
4974 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4975 offsets in an output section if necessary.
4976 * output.cc (Output_section::Output_section): Initialize
4977 section_offsets_need_adjustments_.
4978 (Output_section::add_input_section_for_script): Renamed to
4979 Output_section::add_simple_input_section.
4980 (Output_section::save_states): Add a comment.
4981 (Output_section::discard_states): New method defintion.
4982 (Output_section::adjust_section_offsets): Same.
4983 * output.h (Output_section::add_input_section_for_script): Renamed to
4984 Output_section::add_simple_input_section.
4985 (Output_section::discard_states): New method declaration.
4986 (Output_section::adjust_section_offsets): Same.
4987 (Output_section::section_offsets_need_adjustment,
4988 Output_section::set_section_offsets_need_adjustment): New method
4989 definitions.
4990 (Output_section::section_offsets_need_adjustment_): New data member.
4991 * script-sections.cc
4992 (Output_section_element_input::set_section_address): Adjust code for
4993 renaming of Output_section::add_input_section_for_script.
4994 (Orphan_output_section::set_section_address): Same.
4995
9b2fd367
DK
49962010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4997
4998 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4999 Fix_v4bx enum values .
5000 * gold/options.h (General_options): New option definitions.
5001 (General_options::fix_v4bx): New method.
5002 (General_options::Fix_v4bx): New enum.
5003 * gold/options.cc (General_options::parse_fix_v4bx): New method.
5004 (General_options::parse_fix_v4bx_interworking): New method.
5005
80d0d023
DK
50062010-01-22 Doug Kwan <dougkwan@google.com>
5007
5008 * arm.cc (Arm_exidx_fixup): New class.
5009
af2cdeae
DK
50102010-01-21 Doug Kwan <dougkwan@google.com>
5011
5012 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
5013 classes.
5014 (Arm_exidx_section_offset_map): New type.
5015
993d07c1
DK
50162010-01-21 Doug Kwan <dougkwan@google.com>
5017
5018 * arm.cc (Arm_exidx_input_section): New class.
5019 (Arm_relobj::exidx_input_section_by_link,
5020 Arm_relobj::exidx_input_section_by_shndx,
5021 Arm_relobj::make_exidx_input_section): New methods.
5022 (read_arm_attributes_section): Remove.
5023 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
5024 information about them.
5025 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
5026 to here.
5027
5ac169d4
DK
50282010-01-20 Doug Kwan <dougkwan@google.com>
5029
5030 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
5031 Input_section_specifier to Section_id.
5032 (Target_arm::new_arm_input_section: Adjust code for change of key
5033 type.
5034 (Target_arm::find_arm_input_section): Ditto.
5035 * gc.h (object.h): Include for Section_id nand Section_id_hash.
5036 (Section_id): Remove.
5037 (Garbage_collection::Section_id_hash): Remove.
5038 * icf.h (object.h): Include for Section_id nand Section_id_hash.
5039 (Section_id): Remove.
5040 (Icf::Section_id_hash): Remove.
5041 * object.h (Section_id, Const_section_id, Section_id_hash,
5042 Const_section_id_hash): New type definitions.
5043 * output.cc (Output_section::add_relaxed_input_section): Change to
5044 use Const_section_id instead of Input_section_specifier as key type.
5045 (Output_section::add_merge_input_section): Ditto.
5046 (Output_section::build_relaxation_map): Change to use Section_id
5047 instead of Input_section_specifier as key type.
5048 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5049 Ditto.
5050 (Output_section::convert_input_sections_to_relaxed_sections): Change
5051 to use Const_section_id instead of Input_section_specifier as key type.
5052 (Output_section::find_merge_section): Ditto.
5053 (Output_section::find_relaxed_input_section): Ditto.
5054 * output.h (Input_section_specifier): Remove class.
5055 (Output_section::Output_section_data_by_input_section_map): Change
5056 key type to Const_section_id.
5057 (Output_section::Output_relaxed_input_section_by_input_section_map):
5058 Ditto.
5059 (Output_section::Relaxation_map): Change key type to Section_id.
5060
a2162063
ILT
50612010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5062
5063 * gold/arm.cc: Added support for R_ARM_V4BX relocation
5064 (class Arm_v4bx_stub): New class.
5065 (DEF_STUBS): Updated definition to support v4_veneer_bx.
5066 (Stub_factory::make_arm_v4bx_stub): New method.
5067 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
5068 (Stub_table::empty): Handle v4bx stubs.
5069 (Stub_table::add_arm_v4bx_stub): New method.
5070 (Stub_table::find_arm_v4bx_stub): New method.
5071 (Arm_relocate_functions::v4bx): New method.
5072 (Target_arm::fix_v4bx): New method.
5073 (Target_arm::Target_arm): Handle R_ARM_V4BX.
5074 (Stub_table::relocate_stubs): Likewise.
5075 (Stub_table::do_write): Likewise.
5076 (Stub_table::update_data_size_and_addralign): Likewise.
5077 (Stub_table::finalize_stubs): Likewise.
5078 (Target_arm::Scan::local): Likewise.
5079 (Target_arm::Scan::global): Likewise.
5080 (Target_arm::do_finalize_sections): Likewise.
5081 (Target_arm::Relocate::relocate): Likewise.
5082 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5083 Likewise.
5084 (Target_arm::scan_reloc_for_stub): Likewise.
5085 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5086
5696ab0b
ILT
50872010-01-19 Ian Lance Taylor <iant@google.com>
5088
5089 * output.cc (Output_section_headers::do_sized_write): Write large
5090 segment count to sh_info field.
5091 (Output_file_header::do_sized_write): For large segment count,
5092 write PN_XNUM to e_phnum field.
5093
800d0f56
ILT
50942010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5095
5096 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5097 (Arm_relocate_functions::thm_jump8): New function.
5098 (Arm_relocate_functions::thm_jump11): New function.
5099 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5100 R_ARM_THM_JUMP11.
5101 (Target_arm::Scan::global): Likewise.
5102 (Target_arm::Relocate::relocate): Likewise.
5103 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5104 Likewise.
5105
41263c05
DK
51062010-01-14 Doug Kwan <dougkwan@google.com>
5107
5108 * arm.cc (map, utility): Include headers.
5109 (Target_arm::apply_cortex_a8_workaround): New method.
5110 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5111 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5112 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5113 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5114 the --[no-]fix-cortex-a8 command line options.
5115 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5116 (Target_arm::relocate_stub): Use addend in instruction template.
5117 * options.h (DEFINE_bool): Set the user-set flag.
5118 (General_options): Add --[no-]-fix-cortex options.
5119 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 5120 : Update fast look-up map after conversion.
41263c05 5121
459e9b03
ST
51222010-01-14 Sriraman Tallam <tmsriram@google.com>
5123
5124 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5125 in the first pass of do_layout.
5126
b521dfe4
DK
51272010-01-13 Doug Kwan <dougkwan@google.com>
5128
5129 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5130 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5131 apparent compiler problem of not folding static constant integral
5132 data members of elfcpp::Elf_sizes<32>.
5133
44272192
DK
51342010-01-13 Doug Kwan <dougkwan@google.com>
5135
5136 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5137 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5138 Arm_relobj::scan_section_for_cortex_a8_erratum,
5139 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5140 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5141 sections to scan for relocation stubs into a new method
5142 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5143 relocation and Cortex-A8 stub scanning.
5144 (Target_arm::do_relax): Force stubs to be after stubbed sections
5145 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 5146 the beginning of a new relaxation pass. Update a comment.
44272192
DK
5147 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5148
44b71ece
ILT
51492010-01-12 Ian Lance Taylor <iant@google.com>
5150
5151 * target-reloc.h (visibility_error): New inline function.
5152 (relocate_section): Call visibility_error.
5153 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5154 (MOSTLYCLEANFILES): Likewise.
5155 (protected_4_pic.o, protected_3.err): New targets.
5156 * testsuite/protected_4.cc: New file.
5157
a120bc7f
DK
51582010-01-12 Doug Kwan <dougkwan@google.com>
5159
5160 * arm.cc (Cortex_a8_reloc): New class.
5161 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5162 and cortex_a8_relocs_info_.
5163 (Target_arm::fix_cortex_a8): New method definition.
5164 (Target_arm::Cortex_a8_relocs_info): New type.
5165 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5166 New data member declarations.
5167 (Target_arm::scan_reloc_for_stub): Record information about
5168 relocations for THUMB branches that might be exempted from the
5169 Cortex-A8 workaround.
5170 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5171 at the beginning of a relaxation pass.
5172
20138696
DK
51732010-01-12 Doug Kwan <dougkwan@google.com>
5174
5175 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5176 (Arm_relobj::Mapping_symbol_position,
5177 Arm_reloj::Mapping_symbol_position_less,
5178 Arm_relobj::Mapping_symbols_info): New types.
5179 (Target_arm::is_mapping_symbol_name): New method definition.
5180 (Arm_relobj::do_count_local_symbols): Save information about mapping
5181 symbols.
5182
089d69dc
DK
51832010-01-11 Doug Kwan <dougkwan@google.com>
5184
5185 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5186 Arm_relocate_functions::thumb32_branch_upper,
5187 Arm_relocate_functions::thumb32_branch_lower,
5188 Arm_relocate_functions::thumb32_cond_branch_offset,
5189 Arm_relocate_functions::thumb32_cond_branch_upper,
5190 Arm_relocate_functions::thumb32_cond_branch_lower,
5191 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5192 branch offset encoding.
5193 (Arm_relocate_functions::thumb_branch_common): Use new branch
5194 offset encoding methods to avoid code duplication.
5195 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5196 (Stub_addend_reader::operator()): Use new branch encoding method
5197 to avoid code duplication.
5198
99e5bff2
DK
51992010-01-11 Doug Kwan <dougkwan@google.com>
5200
5201 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5202 (Target_arm::do_finalize_sections): Define special EXIDX section
5203 symbols only if referenced.
5204 * gc.h (Garbage_collection::add_reference): New method.
5205 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5206 code duplication.
5207
98e090bd
ILT
52082010-01-11 Ian Lance Taylor <iant@google.com>
5209
d0a91bd8
ILT
5210 * script.cc (Version_script_info::build_expression_list_lookup):
5211 Change complaing about duplicate wildcard match from error to
5212 warning.
5213
98e090bd
ILT
5214 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5215 of 2009-12-30.
5216 (Version_script_info::Version_script_info): Initialize globs_,
5217 default_version_, default_is_global_, and exact_. Don't
5218 initialize globals_ or locals_.
5219 (Version_script_info::build_lookup_tables): Build local symbols
5220 first.
5221 (Version_script_info::unquote): New function.
5222 (Version_script_info::add_exact_match): New function.
5223 (Version_script_info::build_expression_list_lookup): Remove lookup
5224 parameter. Add is_global parameter. Change all callers. Handle
5225 wildcard pattern specially. Unquote pattern. Call
5226 add_exact_match.
5227 (Version_script_info::get_name_to_match): New function.
5228 (Version_script_info::get_symbol_version): New function.
5229 (Version_script_info::get_symbol_version_helper): Remove.
5230 (Version_script_info::check_unmatched_names): Call unquote.
5231 * script.h (class Version_script_info): Change get_symbol_version
5232 to be non-inline and add is_global parameter; change all callers.
5233 Rewrite symbol_is_local. Update declarations. Define struct
5234 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5235 Remove globals_ and locals_ members. Add exact_, globs_,
5236 default_version_, is_global_.
5237 (Version_script_info::Glob): Remove pattern, add expression and
5238 is_global. Update constructor. Change all callers.
5239 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5240 default version.
5241 (Versions::symbol_section_contents): If a symbol is undefined, or
5242 defined in a dynamic object, set the version index to
5243 VER_NDX_LOCAL.
5244 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5245 symbol_is_local.
5246 (Symbol_table::add_from_pluginobj): Likewise.
5247 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5248
d56962d3
DK
52492010-01-11 Doug Kwan <dougkwan@google.com>
5250
5251 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5252 (incremental_dump_LDADD): Add linking option for libintl.
5253 * Makefile.in: Regenerate.
5254
94e6ee91
L
52552010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5256
5257 PR gold/11144
5258 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5259 instead of -Ds.
5260 * testsuite/Makefile.in: Regenerated.
5261
e96c574b
DK
52622010-01-10 Doug Kwan <dougkwan@google.com>
5263
5264 * options.h (DEFINE_var): Use parentheses around argument varname__
5265 in macro body to avoid any unintended subsequent substitutions.
5266
7198066b
ILT
52672010-01-10 Ian Lance Taylor <iant@google.com>
5268
ba4d53bf
ILT
5269 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5270 candidates before doing symbol resolution.
5271
7198066b
ILT
5272 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5273 ODR candidates if only one is weak.
5274
a2beed37
ILT
52752010-01-08 Ian Lance Taylor <iant@google.com>
5276
5277 * script.cc (Version_script_info::build_expression_list_lookup):
5278 Don't warn about ambiguous version, just record the ambiguity.
5279 (Version_script_info::get_symbol_version_helper): Give error if
5280 version is ambiguous.
5281
2fb7225c
DK
52822010-01-08 Doug Kwan <dougkwan@google.com>
5283
5284 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5285 prev_data_size_ and prev_addralign_. Remove initializer for
5286 deleted data member has_been_changed_.
5287 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5288 to determine if the table is empty.
5289 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5290 Remove.
5291 (Stub_table::add_reloc_stub): Define method in class definition
5292 instead of just declaring it there.
5293 (Stub_table::add_cortex_a8_stub): New method definition.
5294 (Stub_table::update_data_size_and_addralign): Ditto.
5295 (Stub_table::finalize_stubs): Ditto.
5296 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5297 (Stub_table::do_addralign_): Return address alignment in the
5298 (Stub_table::do_reset_address_and_file_offset): Define method in
5299 class definition instead of declaring it there. Set current data
5300 size to be the data size of the previous pass.
5301 (Stub_table::set_final_data_size): Use current data size as the
5302 final data size.
5303 (Stub_table::relocate_stub): Change parameter type of stub from
5304 Reloc_stub pointer to Stub pointer.
5305 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5306 (Stub_table::Cortex_a8_stub_list): New typedef.
5307 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5308 Stub_table::prev_addralign_): New data member.
5309 (Arm_relobj::Arm_relobj): Initialize data member
5310 section_has_cortex_a8_workaround_.
5311 (Arm_relobj::section_has_cortex_a8_workaround,
5312 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5313 definitions.
5314 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5315 declarations.
5316 (Target_arm::relocate_stub): Change parameter type of stub from
5317 Reloc_stub pointer to Stub pointer.
5318 (Insn_template::size, Insn_template::alignment): Handle
5319 THUMB16_SPECIAL_TYPE.
5320 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5321 Stub_table::update_data_size_and_addralign,
5322 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5323 definitions.
5324 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5325 (Stub_table::do_write): Ditto.
5326 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5327
880cd20d
ILT
53282010-01-08 Ian Lance Taylor <iant@google.com>
5329
5330 PR 11108
5331 * symtab.h (class Symbol): Remove fields is_target_special_ and
5332 has_plt_offset_. Add field is_defined_in_discarded_section_.
5333 (Symbol::is_defined_in_discarded_section): New function.
5334 (Symbol::set_is_defined_in_discarded_section): New function.
5335 (Symbol::has_plt_offset): Rewrite.
5336 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5337 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5338 Don't initialize is_target_special_ or has_plt_offset_.
5339 Initialize is_defined_in_discarded_section_.
5340 (Symbol_table::add_from_relobj): If appropriate, set
5341 is_defined_in_discarded_section.
5342 * resolve.cc (Symbol::override_base_with_special): Don't test
5343 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5344 * target-reloc.h (relocate_section): Do special handling for
5345 symbols defined in discarded sections for global symbols as well
5346 as local symbols.
5347
2703e3eb
ILT
53482010-01-08 Ian Lance Taylor <iant@google.com>
5349
5350 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
5351 the SHT_SYMTAB case.
5352
339d40a3
ILT
53532010-01-08 Ian Lance Taylor <iant@google.com>
5354
5355 * object.cc (Sized_relobj::do_layout): Don't get confused if
5356 layout_eh_frame returns NULL.
5357
abecea76
ILT
53582010-01-08 Ian Lance Taylor <iant@google.com>
5359
5360 PR 11084
5361 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
5362 dynamic symbol table, use the normal symbol table.
5363 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5364 symbol table.
5365
6b7dd3f3
ILT
53662010-01-08 Ian Lance Taylor <iant@google.com>
5367
5368 PR 11072
5369 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5370 sections.
5371
36c50e63
L
53722010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5373
5374 * version.cc (print_version): Change to "Copyright 2010".
5375
e291e7b9
ILT
53762010-01-08 Ian Lance Taylor <iant@google.com>
5377
5378 PR 10287
5379 PR 11063
5380 * i386.cc (class Target_i386): Change return type of plt_section
5381 to be non-const.
5382 (class Output_data_plt_i386): Add tls_desc_rel_ field.
5383 (Output_data_plt_i386::Output_data_plt_i386): Initialize
5384 tls_desc_rel_ field.
5385 (Output_data_plt_i386::rel_tls_desc): New function.
5386 (Target_i386::rel_tls_desc_section): New function.
5387 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
5388 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
5389 R_386_TLS_DESC reloc in rel_tls_desc_section.
5390 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
5391 Define struct Tlsdesc_info.
5392 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
5393 (Target_x86_64::do_reloc_symbol_index): New function.
5394 (Target_x86_64::add_tlsdesc_info): New function.
5395 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
5396 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
5397 tlsdesc_rel_ field.
5398 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
5399 all callers.
5400 (Output_data_plt_x86_64::rela_tlsdesc): New function.
5401 (Target_x86_64::rela_tlsdesc_section): New function.
5402 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
5403 handling.
5404 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
5405 (Target_x86_64::do_reloc_addend): New function.
5406 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
5407 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
5408 declarations. Define TARGET_CODE. Add arg field to u1_ union.
5409 (Output_reloc::type): New function.
5410 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
5411 (Output_reloc::is_target_specific): New function.
5412 (Output_reloc::target_arg): New function.
5413 (class Output_reloc) [SHT_RELA]: Add four new constructors for
5414 absolute relocs and target specific relocs.
5415 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
5416 add_target_specific.
5417 (class Output_data_reloc) [SHT_RELA]: Likewise.
5418 * output.cc (Output_reloc::Output_reloc): Add four new versions
5419 for absolute relocs and target specific relocs.
5420 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
5421 (Output_reloc::get_symbol_index): Likewise.
5422 (Output_reloc::local_section_offset): Check that local_sym_index_
5423 is not TARGET_CODE or 0.
5424 (Output_reloc::symbol_value): Likewise.
5425 (Output_reloc::write) [SHT_RELA]: Call target for target specific
5426 reloc.
5427 * target.h (class Target): Add reloc_symbol_index and reloc_addend
5428 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
5429 functions.
5430 * layout.cc (add_target_dynamic_tags): Use output section for
5431 DT_PLTRELSZ and DT_JMPREL.
5432
3a44184e
ILT
54332010-01-07 Ian Lance Taylor <iant@google.com>
5434
5435 PR 11061
5436 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
5437 function.
5438 (class Output_data_reloc_generic): Define.
5439 (class Output_data_reloc_base): Change base class to
5440 Output_data_reloc_generic. Change add() method to call
5441 bump_relative_reloc_count for a relative reloc. Remove
5442 sort_relocs_ field.
5443 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
5444 to sort_relocs().
5445 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
5446 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
5447 appropriate.
5448 * layout.h (class Layout): Update declaration.
5449
ea715a34
ILT
54502010-01-07 Ian Lance Taylor <iant@google.com>
5451
5452 * output.h (class Output_data): Add const version of
5453 output_section and do_output_section.
5454 (class Output_section_data): Add const version of
5455 do_output_section.
5456 (class Output_section): Likewise.
5457 * layout.cc (Layout::add_target_dynamic_tags): New function.
5458 * layout.h (class Layout): Update declarations.
5459 * arm.cc (Target_arm::do_finalize_sections): Use
5460 add_target_dynamic_tags.
5461 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5462 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5463 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5464 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5465
659948a4
ILT
54662010-01-07 Ian Lance Taylor <iant@google.com>
5467
5468 PR 11042
5469 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
5470 object as needed.
5471
9d3b86f6
ILT
54722010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
5473 Ian Lance Taylor <iant@google.com>
5474
5475 PR 11019
5476 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
5477 Xindex::read_symtab_xindex.
5478
bb0d3eb0
DK
54792010-01-07 Doug Kwan <dougkwan@google.com>
5480
5481 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
5482 (Insn_template::thumb16_bcond_insn): New method declaration.
5483 (Insn_template): Fix spelling.
5484 (Stub::thumb16_special): New method declaration.
5485 (Stub::do_write): Define virtual method which was previously pure
5486 virtual.
5487 (Stub::do_thumb16_special): New method declaration.
5488 (Stub::do_fixed_endian_write): New template member.
5489 (Reloc_stub::do_write): Remove.
5490 (Reloc_stub::do_fixed_endian_write): Remove.
5491 (Cortex_a8_stub): New class definition.
5492 (Stub_factory::make_cortex_a8_stub): New method definition.
5493 (Stub_factory::Stub_factory): Add missing static storage class
5494 qualifier for elf32_arm_stub_a8_veneer_blx.
5495
ffeef7df
ILT
54962010-01-07 Ian Lance Taylor <iant@google.com>
5497
dc3f80fe
ILT
5498 PR 10980
5499 * options.h (class General_options): Add --warn-unresolved-symbols
5500 and --error-unresolved-symbols.
5501 * errors.cc (Errors::undefined_symbol): Implement
5502 --warn-unresolved-symbols.
5503
ffeef7df
ILT
5504 * options.h (class General_options): Add -z text and -z textoff.
5505 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
5506
f1ec9ded
ST
55072010-01-06 Sriraman Tallam <tmsriram@google.com>
5508
5509 * gc.h (Garbage_collection::Cident_section_map): New typedef.
5510 (Garbage_collection::cident_sections): New function.
5511 (Garbage_collection::add_cident_section): New function.
5512 (Garbage_collection::cident_sections_): New member.
5513 (gc_process_relocs): Add references to sections whose names are C
5514 identifiers.
5515 * gold.h (cident_section_start_prefix): New constant.
5516 (cident_section_stop_prefix): New constant.
5517 (is_cident): New function.
5518 * layout.cc (Layout::define_section_symbols): Replace string constants
5519 with the newly defined constants.
5520 * object.cc (Sized_relobj::do_layout): Track sections whose names are
5521 C identifiers.
5522 * testsuite/Makefile.am: Add gc_orphan_section_test.
5523 * testsuite/Makefile.in: Regenerate.
5524 * testsuite/gc_orphan_section_test.cc: New file.
5525 * testsuite/gc_orphan_section_test.sh: New file.
5526
6eda8c29
ILT
55272010-01-06 Ian Lance Taylor <iant@google.com>
5528
b9674e17
ILT
5529 PR 10980
5530 * options.h (class General_options): Add --warn-shared-textrel.
5531 * layout.cc (Layout::finish_dynamic_section): Implement
5532 --warn-shared-textrel.
5533
6eda8c29
ILT
5534 PR 10980
5535 * options.h (class General_options): Add --warn-multiple-gp.
5536
32dcd44e
ILT
55372010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5538
5539 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
5540 $(THREADSLIB) and $(LIBDL).
5541 * Makefile.in: Rebuild.
5542
a192ba05
ILT
55432010-01-06 Ian Lance Taylor <iant@google.com>
5544
5545 PR 10980
5546 * options.cc (General_options::parse_section_start): New function.
5547 (General_options::section_start): New function.
5548 (General_options::General_options): Initialize all members.
5549 * options.h: Include <map>
5550 (class General_options): Add --section-start. Add section_starts_
5551 member.
5552 * layout.cc (Layout::attach_allocated_section_to_segment): If
5553 --section-start was used, set the address of the segment. Remove
5554 local sort_sections.
5555 (Layout::relaxation_loop_body): If the address of the load segment
5556 has been set by --section-start, don't use it.
5557 * output.h (Output_segment::update_flags_for_output_section): New
5558 function.
5559 * output.cc (Output_segment::add_output_section): Call
5560 update_flags_for_output_section.
5561
dde3f402
ILT
55622010-01-05 Ian Lance Taylor <iant@google.com>
5563
62dfdd4d
ILT
5564 PR 10980
5565 * options.h (class General_options): Add --undefined-version.
5566 * script.cc (struct Version_expression): Add was_matched_by_symbol
5567 field.
5568 (Version_script_info::matched_symbol): New function.
5569 (Version_script_info::get_symbol_version_helper): Call
5570 matched_symbol.
5571 (Version_script_info::check_unmatched_names): New function.
5572 * script.h (class Version_script_info): Update declarations.
5573 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
5574
9c4ae156
ILT
5575 * options.h (class General_options): Use DEFINE_bool_alias for
5576 allow_multiple_definition.
5577 * resolve.cc (Symbol_table::should_override): Don't test
5578 allow_multiple_definition.
5579
dde3f402
ILT
5580 PR 10980
5581 * options.h (class General_options): Add --cref.
5582 * main.cc (main): Print cref table if --cref. Don't close mapfile
5583 until after printing cref table.
5584 * cref.cc: Include "symtab.h".
5585 (class Cref_inputs): Define Cref_table_compare and Cref_table.
5586 (Cref_table_compare::operator()): New function.
5587 (Cref_inputs::gather_cref): New function.
5588 (filecol): New static const.
5589 (Cref_inputs::print_cref): New function.
5590 (Cref::print_cref): New function.
5591 * cref.h: Include <cstdio>.
5592 (class Cref): Update declarations.
5593 * mapfile.h (Mapfile::file): New function.
5594 * object.h (class Object): Define Symbols. Declare virtual
5595 do_get_global_symbols.
5596 (Object::get_global_symbols): New function.
5597 * object.cc (Input_objects::add_object): Pass object to cref_ if
5598 --cref.
5599 (Input_objects::archive_start): Likewise.
5600 (Input_objects::archive_stop): Likewise.
5601 (Input_objects::print_cref): New function.
5602 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5603 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5604 --cref.
5605 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5606 function.
5607 * plugin.h (class Sized_pluginobj): Update declarations.
5608
8781f709
ILT
56092010-01-05 Ian Lance Taylor <iant@google.com>
5610
5611 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5612 to is_default_version. Rename insdef to insdefault.
5613 (Symbol_table::add_from_relobj): Rename def to is_default_version
5614 and local to is_forced_local.
5615 (Symbol_table::add_from_pluginobj): Likewise.
5616 (Symbol_table::add_from_dynobj): Likewise.
5617 (Symbol_table::define_special_symbol): Rename insdef to
5618 insdefault.
5619
fe35d28d
ILT
56202010-01-04 Ian Lance Taylor <iant@google.com>
5621
30bc8c46
ILT
5622 PR 10980
5623 * options.h (class General_options): Add
5624 --allow-multiple-definition and -z muldefs.
5625 * resolve.cc (Symbol_table::should_override): Don't warn about a
5626 multiple symbol definition if --allow-multiple-definition or -z
5627 muldefs.
5628
7eaea549
ILT
5629 PR 10980
5630 * options.h (class General_options): Add --add-needed and
5631 --copy-dt-needed-entries. Tweak --as-needed help entry.
5632 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5633 error if --copy-dt-needed-entries aka --add-needed is used and
5634 would cause a change in behaviour.
5635
fe35d28d
ILT
5636 PR 10980
5637 * options.h (class General_options): Add -G as a short version of
5638 --shared. Add no-op options -assert, -g, and -i.
5639
55a2bb35
ST
56402010-01-04 Sriraman Tallam <tmsriram@google.com>
5641
5642 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5643 check for .text or .gnu.linkonce.t sections.
5644 * icf.cc (Icf::find_identical_sections): Ditto.
5645 Change the detection for mangled function name within the section
5646 name.
5647 * icf.h (is_section_foldable_candidate): New function.
5648
719328e1
ILT
56492009-12-30 Ian Lance Taylor <iant@google.com>
5650
5651 PR 10980
5652 * options.h (class General_options): Permit two dashes with
5653 --retain-symbols-file.
5654
d7bb5745
ILT
56552009-12-30 Ian Lance Taylor <iant@google.com>
5656
403a15dd
ILT
5657 PR 10979
5658 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5659 don't put the file header and segment headers in the text
5660 segment.
5661
eda294df
ILT
5662 PR 10979
5663 * common.cc (Sort_commons::operator()): Stabilize sort when both
5664 entries are NULL.
5665 (Symbol_table::do_allocate_commons_list): When allocating common
5666 symbols, skip a symbol which is no longer common.
5667 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5668 an object before checking its type.
5669 * testsuite/common_test_2.c: New file.
5670 * testsuite/common_test_3.c: New file.
5671 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5672 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5673 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5674 (common_test_2_pic.o, common_test_2.so): New targets.
5675 (common_test_3_pic.o, common_test_3.so): New targets.
5676 * testsuite/Makefile.in: Rebuild.
5677
d7bb5745
ILT
5678 PR 10979
5679 * script.cc (read_input_script): If we see a new SECTIONS clause,
5680 and we have added an input section, give an error.
5681 * layout.h (class Layout): Add have_added_input_section function.
5682 Add have_added_input_section_ field.
5683 * layout.cc (Layout::Layout): Initialize
5684 have_added_input_section_.
5685 (Layout::layout): Set have_added_input_section_.
5686 (Layout::layout_eh_frame): Likewise.
5687
fc59c572
ILT
56882009-12-30 Ian Lance Taylor <iant@google.com>
5689
5690 PR 10931
5691 * options.h (class General_options): Add --sort-common option.
5692 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
5693 * common.cc (Sort_common): Add sort_order parameter to
5694 constructor. Add sort_order_ field.
5695 (Sort_commons::operator): Check sort_order_.
5696 (Symbol_table::allocate_commons): Determine the sort order.
5697 (Symbol_table::do_allocate_commons): Add sort_order parameter.
5698 Change all callers.
5699 (Symbol_table::do_allocate_commons_list): Likewise.
5700
1c74fab0
ILT
57012009-12-30 Ian Lance Taylor <iant@google.com>
5702
5703 PR 10916
5704 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
5705 symbols from this object, don't change the visibility of an
5706 undefined symbol.
5707 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
5708
6affe781
ILT
57092009-12-30 Ian Lance Taylor <iant@google.com>
5710
5711 PR 10861
5712 * script.h (class Version_script_info): Define Language enum.
5713 Update declarations. Define Glob, Exact, and Lookup types. Add
5714 new fields globals_, locals_, and is_finalized_.
5715 * script.cc: Various formatting fixes.
5716 (class Parser_closure): Change language_stack_ from a vector of
5717 std::string to one of Version_script_info::Language. Adjust all
5718 uses accordingly.
5719 (class Lazy_demangler): Remove.
5720 (struct Version_expression): Change language from std::string to
5721 Version_script_info::Language.
5722 (Version_script_info::Version_script_info): New function.
5723 (Version_script_info::~Version_script_info): Don't call clear.
5724 (Version_script_info::finalize): New function.
5725 (Version_script_info::build_lookup_tables): New function.
5726 (Version_script_info::build_expression_list_lookup): New
5727 function.
5728 (Version_script_info::get_symbol_version_helper): Rewrite to use
5729 lookup tables.
5730 (Version_script_info::print_expression_list): Adjust to use
5731 Version_script_info::Language.
5732 (script_push_lex_into_version_mode): Check that the version script
5733 has not been finalized.
5734 (version_script_push_lang): Change language string to
5735 Version_script_info::Language.
5736 * options.cc (Command_line::version_script): New function.
5737 * options.h (class General_options): Add finalize_dynamic_list
5738 function. Change version_script from declaration to definition.
5739 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
5740 * testsuite/version_script.map: Remove duplicate def of foo.
5741 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
5742 version_script.map.
5743 * testsuite/Makefile.in: Rebuild.
5744
818bf354
ILT
57452009-12-30 Ian Lance Taylor <iant@google.com>
5746
5747 PR 10843
5748 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
5749 if the input symbol index is 0, make the output symbol index 0.
5750
ebcc8304
ILT
57512009-12-30 Ian Lance Taylor <iant@google.com>
5752
5753 PR 10670
5754 * options.h (class General_options): Add -x/--discard-all.
5755 * object.cc (Sized_relobj::do_count_local_symbols): Handle
5756 --discard-all. If the local symbol needs a dynamic entry, check
5757 that before handling --discard-locals.
5758
176fe33f
ILT
57592009-12-30 Ian Lance Taylor <iant@google.com>
5760
bb321bb1
ILT
5761 PR 10450
5762 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
5763 flags to PF_R.
5764 (Output_segment::add_output_section): Don't change the flags if
5765 the type is PT_TLS.
5766
176fe33f
ILT
5767 PR 10450
5768 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
5769 GNU hash table if they need a dynamic value. Otherwise, don't add
5770 them if they are defined in a dynamic object or are forced local.
5771
e8cd95c7
ILT
57722009-12-29 Ian Lance Taylor <iant@google.com>
5773
1b81fb71
ILT
5774 PR 10450
5775 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
5776 .gnu.hash table for a 32-bit target.
5777
8d6d383d
ILT
5778 PR 10450
5779 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
5780 regular and a dynamic object only needs a dynamic symbol table
5781 entry if it is externally visible.
5782
e785ec03
ILT
5783 PR 10450
5784 * i386.cc (class Target_i386): Initialize global_offset_table_ in
5785 constructor. Add global_offset_table_ field.
5786 (Target_i386::got_section): Set global_offset_table_.
5787 (Target_i386::do_finalize_sections): Set global_offset_table_
5788 size.
5789 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
5790 in constructor. Add global_offset_table_ field.
5791 (Target_x86_64::got_section): Set global_offset_table_.
5792 (Target_x86_64::do_finalize_sections): Set global_offset_table_
5793 size.
5794
1a2dff53
ILT
5795 * layout.cc (Layout::Layout): Initialize increase_relro_.
5796 (Layout::get_output_section): Add is_relro, is_last_relro, and
5797 is_first_non_relro parameters. Change all callers.
5798 (Layout::choose_output_section): Likewise.
5799 (Layout::add_output_section_data): Likewise.
5800 (Layout::make_output_section): Likewise.
5801 (Layout::set_segment_offsets): Clear increase_relro when using a
5802 linker script.
5803 * layout.h (class Layout): Add increase_relro method. Add
5804 increase_relro_ field. Update declarations.
5805 * output.cc (Output_section::Output_section): Initialize
5806 is_last_relro_ and is_first_non_relro_.
5807 (Output_segment::add_output_section): Group relro sections is
5808 do_sort is true. Handle is_last_relro and is_first_non_relro.
5809 (Output_segment::maximum_alignment): Remove relro handling.
5810 (Output_segment::set_section_addresses): Add increase_relro
5811 parameter. Change all callers. Add initial alignment to align
5812 relro sections on separate page. Remove old relro handling.
5813 (Output_segment::set_section_list_addresses): Remove in_relro
5814 parameter. Change all callers.
5815 (Output_segment::set_offset): Add increase parameter. Change all
5816 callers. Remove old relro handling.
5817 * output.h (class Output_section): Add new methods: is_last_relro,
5818 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
5819 Add is_last_relro_ and is_first_non_relro_ fields.
5820 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
5821 Create separate .got.plt section. Call increase_relro.
5822 * x86_64.cc (Target_x86_64::got_section): Likewise.
5823 * testsuite/relro_script_test.t: Add .got.plt.
5824
f0ba79e2
ILT
5825 PR 10450
5826 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
5827 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
5828 (Layout::finalize): Call set_dynamic_symbol_size.
5829 (Layout::set_dynamic_symbol_size): New function.
5830 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
5831 set_dynamic_symbol_size.
5832
e8cd95c7
ILT
5833 PR 10450
5834 * output.h (class Output_section): Add is_entsize_zero_ field.
5835 * output.cc (Output_section::Output_section): Initialize
5836 is_entsize_zero_.
5837 (Output_section::set_entsize): If two different entsizes are
5838 requested, force it to zero.
5839 (Output_section::add_input_section): Set flags for .debug_str
5840 before updating section flags. Set entsize.
5841 (Output_section::update_flags_for_input_section): Set SHF_MERGE
5842 and SHF_STRING if all input sections have those flags.
5843
3e1b9a8a
RÁE
58442009-12-29 Rafael Espindola <espindola@google.com>
5845
5846 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
5847 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
5848 reporting.
3e1b9a8a 5849
3dcad376
ST
58502009-12-29 Sriraman Tallam <tmsriram@google.com>
5851
5852 * options.cc (General_options::parse_version): Allow -v to exit
5853 without an error if there is nothing to link.
5854
084e2665
ILT
58552009-12-29 Ian Lance Taylor <iant@google.com>
5856
5857 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
5858 using a version of gcc before 4.1.
5859 * configure: Rebuild.
5860
250acde3
CD
58612009-12-28 Chris Demetriou <cgd@google.com>
5862
5863 * attributes.cc (Output_attributes_section_data::do_write): Use
5864 std::vector::front rather than std::vector::data.
5865
99fff23b
ILT
58662009-12-28 Ian Lance Taylor <iant@google.com>
5867
5868 * symtab.h (class Symbol_table): Add enum Defined.
5869 * resolve.cc (Symbol_table::should_override): Add defined
5870 parameter. Change all callers. Test whether object is NULL
5871 before calling a method on it.
5872 (Symbol_table::report_resolve_problem): Add defined parameter.
5873 Change all callers.
5874 (Symbol_table::should_override_with_special): Likewise.
5875 * symtab.cc (Symbol_table::define_in_output_data): Add defined
5876 parameter. Change all callers.
5877 (Symbol_table::do_define_in_output_data): Likewise.
5878 (Symbol_table::define_in_output_segment): Likewise.
5879 (Symbol_table::do_define_in_output_segment): Likewise.
5880 (Symbol_table::define_as_constant): Likewise.
5881 (Symbol_table::do_define_as_constant): Likewise.
5882 * script.h (class Symbol_assignment): Add is_defsym parameter to
5883 constructor; change all callers.
5884 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
5885 parameter. Change all callers. Add is_defsym_ field.
5886 (class Parser_closure): Add parsing_defsym parameter to
5887 constructor; change all callers. Add parsing_defsym accessor
5888 function. Add parsing_defsym_ field.
5889
556bd683
ILT
58902009-12-28 Ian Lance Taylor <iant@google.com>
5891
5892 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 5893 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 5894
1782c879
ILT
58952009-12-23 Ian Lance Taylor <iant@google.com>
5896
5897 * i386.cc (Target_i386::do_calls_non_split): Recognize
5898 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
5899 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
5900 -fsplit-stack prologue when using %r11.
1782c879 5901
329ca2b1
ST
59022009-12-21 Sriraman Tallam <tmsriram@google.com>
5903
5904 * options.cc (General_options::parse_version): Make -v continue and do
5905 the link like GNU ld does.
5906
d675ff46
RÁE
59072009-12-17 Rafael Avila de Espindola <espindola@google.com>
5908
5909 * Makefile.am (CCFILES): Add timer.cc.
5910 (HFILES): Add timer.h.
5911 * configure.ac: Check for sysconf and times.
5912 * main.cc: include timer.h.
5913 (main): Use Timer instead of get_run_time.
5914 * timer.cc: New.
5915 * timer.h: New.
5916 * workqueue.cc: include timer.h.
5917 (Workqueue::find_and_run_task):
5918 Report user, sys and wall time.
5919 * Makefile.in: Regenerate.
5920 * config.in: Regenerate.
5921 * configure: Regenerate.
5922
d6344fb5
DK
59232009-12-16 Doug Kwan <dougkwan@google.com>
5924
5925 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5926 sections.
5927 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5928 relaxed input sections.
5929 * output.cc (Output_section::find_relaxed_input_section): Change
5930 return type to Output_relaxed_input_section pointer. Adjust code
5931 for new type of relaxed_input_section_map_.
5932 * output.h (Output_section::find_relaxed_input_section): Change
5933 return type to Output_relaxed_input_section pointer.
5934 (Output_section::Output_relaxed_input_section_by_input_section_map):
5935 New type.
5936 (Output_section::relaxed_input_section_map_): Change type to
5937 Output_section::Output_relaxed_input_section_by_input_section_map.
5938 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5939 input section.
5940
0e0d5469
ILT
59412009-12-15 Ian Lance Taylor <iant@google.com>
5942
5943 * layout.cc (Layout::create_shstrtab): Only write out after input
5944 sections if we are compressing debug sections.
5945
0649a889
ILT
59462009-12-15 Ian Lance Taylor <iant@google.com>
5947
5948 * archive.cc (Archive::add_symbols): Only look up a symbol without
5949 a version if there is, in fact, a version.
5950
2ea97941
ILT
59512009-12-14 Ian Lance Taylor <iant@google.com>
5952
5953 Revert -Wshadow changes, all changes from:
5954 2009-12-11 Doug Kwan <dougkwan@google.com>
5955 2009-12-11 Nick Clifton <nickc@redhat.com>
5956 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5957
b0eec2cc
DK
59582009-12-11 Doug Kwan <dougkwan@google.com>
5959
5960 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5961 due to -Wshadow.
5962 * attributes.cc (Object_attribute::size): Ditto.
5963 (Attributes_section_data::size): Ditto.
5964 (Attributes_section_data::Attributes_section_data): Ditto.
5965 (Output_attributes_section_data::do_write): Ditto.
5966 * attributes.h (Object_attribute::set_type): Ditto.
5967 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5968
91d6fa6a
NC
59692009-12-11 Nick Clifton <nickc@redhat.com>
5970
5971 * archive.cc: Fix shadowed variable warnings.
5972 * arm.cc: Likewise.
5973 * compressed_output.cc: Likewise.
5974 * compressed_output.h: Likewise.
5975 * configure: Likewise.
5976 * dwarf_reader.cc: Likewise.
5977 * dynobj.cc: Likewise.
5978 * dynobj.h: Likewise.
5979 * ehframe.cc: Likewise.
5980 * ehframe.h: Likewise.
5981 * errors.cc: Likewise.
5982 * expression.cc: Likewise.
5983 * fileread.cc: Likewise.
5984 * fileread.h: Likewise.
5985 * freebsd.h: Likewise.
5986 * i386.cc: Likewise.
5987 * icf.cc: Likewise.
5988 * incremental.h: Likewise.
5989 * layout.cc: Likewise.
5990 * layout.h: Likewise.
5991 * mapfile.cc: Likewise.
5992 * merge.cc: Likewise.
5993 * merge.h: Likewise.
5994 * object.cc: Likewise.
5995 * object.h: Likewise.
5996 * options.h: Likewise.
5997 * output.cc: Likewise.
5998 * output.h: Likewise.
5999 * parameters.cc: Likewise.
6000 * plugin.cc: Likewise.
6001 * powerpc.cc: Likewise.
6002 * reduced_debug_output.cc: Likewise.
6003 * reduced_debug_output.h: Likewise.
6004 * reloc.cc: Likewise.
6005 * reloc.h: Likewise.
6006 * resolve.cc: Likewise.
6007 * script-sections.cc: Likewise.
6008 * script.cc: Likewise.
6009 * script.h: Likewise.
6010 * sparc.cc: Likewise.
6011 * symtab.cc: Likewise.
6012 * symtab.h: Likewise.
6013 * target-select.cc: Likewise.
6014 * target-select.h: Likewise.
6015 * token.h: Likewise.
6016 * workqueue.cc: Likewise.
6017 * workqueue.h: Likewise.
6018 * x86_64.cc: Likewise.
6019
a0351a69
DK
60202009-12-10 Doug Kwan <dougkwan@google.com>
6021
6022 * arm.cc (attributes.h): New include.
6023 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
6024 (Arm_relobj::~Arm_relobj): Delete object pointed by
6025 attributes_section_data_.
6026 (Arm_relobj::attributes_section_data): New method definition.
6027 (Arm_relobj::attributes_section_data_): New data member declaration.
6028 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
6029 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
6030 attributes_section_data_.
6031 (Arm_dynobj::attributes_section_data): New method definition.
6032 (Arm_dynobj::attributes_section_data_): New data member declaration.
6033 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
6034 initialization value of may_use_blx_ to false.
6035 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
6036 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
6037 object attributes to compute results instead of hard-coding.
6038 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
6039 Target_arm::get_secondary_compatible_arch,
6040 Target_arm::set_secondary_compatible_arch
6041 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6042 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
6043 New method declarations.
6044 (Target_arm::get_aeabi_object_attribute): New method definition.
6045 (Target_arm::attributes_section_data_): New data member declaration.
6046 (read_arm_attributes_section): New template definition.
6047 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
6048 (Arm_dynobj::do_read_symbols): Ditto.
6049 (Target_arm::do_finalize_sections): Merge attributes sections from
6050 input. Check for BLX use after attributes section merging.
6051 Fix __exidx_start and __exidx_end visibility. Create an
6052 .ARM.attributes section if necessary.
6053 (Target_arm::get_secondary_compatible_arch,
6054 Target_arm::set_secondary_compatible_arch,
6055 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6056 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 6057 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
6058 New method definitions.
6059
b59befec
ILT
60602009-12-09 Ian Lance Taylor <iant@google.com>
6061
6062 * plugin.cc (Plugin::load): Don't cast from void* to a function
6063 pointer.
6064
1276bc89
ILT
60652009-12-09 Ian Lance Taylor <iant@google.com>
6066
6067 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
6068 information fields.
6069
2f2de248
L
60702009-12-09 H.J. Lu <hongjiu.lu@intel.com>
6071
6072 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
6073 Replace two_file_shared_1.so with two_file_shared_2.so.
6074 * testsuite/Makefile.in: Regenerated.
6075
4f787271
DK
60762009-12-08 Doug Kwan <dougkwan@google.com>
6077
6078 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6079 (HFILES): Add attributes.h and int_encoding.h.
6080 * Makefile.in: Regenerate.
6081 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6082 function definitions to int_encoding.cc
6083 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6084 prototypes to int_encoding.h
6085 * reduced_debug_output.cc (int_encoding.h): New include.
6086 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6087 function definitions to int_encoding.cc
6088 (insert_into_vector, read_from_pointer): Move template definitions to
6089 int_encoding.h
6090 * attributes.cc: New file.
6091 * attributes.h: New file.
6092 * int_encoding.cc: New file.
6093 * int_encoding.h: New file.
6094
20b52f1a
RÁE
60952009-12-07 Rafael Avila de Espindola <espindola@google.com>
6096
6097 PR gold/11055
6098 * incremental-dump.cc (dump_incremental_inputs): New.
6099 (main): Use dump_incremental_inputs.
6100
53d7974c
L
61012009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6102
6103 PR gold/10893
6104 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6105 checking elfcpp::STT_FUNC.
6106 (Target_i386::Relocate::relocate): Likewise.
6107 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6108
6109 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6110 symbols from shared libraries into normal FUNC symbols.
6111
6112 * symtab.h (Symbol): Add is_func and use it.
6113
05a352e6
DK
61142009-12-05 Doug Kwan <dougkwan@google.com>
6115
6116 * arm.cc (Target_arm::arm_info): Initialize new fields
6117 attributes_section and attributes_vendor.
6118 * i386.cc (Target_i386::i386_info): Same.
6119 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6120 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6121 fields attributes_section and attributes_vendor.
53d7974c 6122 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
6123 * target.h (Target::attributes_section, Target::attributes_vendor,
6124 Target::is_attributes_section, Target::attribute_arg_type,
6125 Target::attributes_order): New method definitions.
6126 (Target::Target_info::attributes_section,
6127 Target::Target_info::attributes_vendor): New fields.
6128 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6129 virtual method definitions.
6130 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6131 attributes_section and attributes_vendor.
6132 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6133
f4e5969c
DK
61342009-12-05 Doug Kwan <dougkwan@google.com>
6135
6136 * arm.cc: Update comments about interworking and stub generation.
6137 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6138 considered as non-PIC.
6139 (Arm_relocate_functions::base_abs): Fix formatting.
6140 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6141 of function to use GOT entry address instead of offset.
6142 (Target_arm::Scan::global): Issue an error if a symbol would need a
6143 PLT does not get one because it is untyped. Remove code to create
6144 dynamic symbols for relative branches.
6145 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6146 takes unsigned integer instead of boolean.
6147
1abce4a6
L
61482009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6149
6150 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6151 (two_file_test_LDADD): Likewise.
6152 (common_test_1_LDADD): Likewise.
6153 (exception_test_LDADD) Likewise.
6154 (weak_test_LDADD): Likewise.
6155 (many_sections_test_LDADD): Likewise.
6156 (initpri1_LDADD): Likewise.
6157 (script_test_1_LDADD): Likewise.
6158 (script_test_2_LDADD): Likewise.
6159 (justsyms_LDADD): Likewise.
6160 (binary_test_LDADD): Likewise.
6161 (large_LDADD): Likewise.
6162 * testsuite/Makefile.in: Regenerated.
6163
adcf2816 61642009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 6165
adcf2816
L
6166 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6167 (Symbol_table::override_with_special): Likewise.
6168 (Symbol_table::add_from_object): Likewise.
6169
28e67f5d
RÁE
61702009-12-04 Rafael Avila de Espindola <espindola@google.com>
6171
6172 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6173 Don't set the data_offset twice.
6174
ae10a101
RÁE
61752009-12-04 Rafael Avila de Espindola <espindola@google.com>
6176
6177 * testsuite/Makefile.in: Regenerate.
6178
f59f41f3
DK
61792009-12-03 Doug Kwan <dougkwan@google.com>
6180
6181 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6182 (Target_arm::do_finalize_sections): Add parameter for symbol table
6183 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6184 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6185 parameter for symbol table pointer.
6186 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6187 an additional parameter for a pointer to symbol table.
6188 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6189 parameter for a symbol table pointer.
6190 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6191 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6192 Ditto.
6193 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6194 parameter for a symbol table pointer.
6195
ca55d848
RÁE
61962009-12-03 Rafael Avila de Espindola <espindola@google.com>
6197
6198 * incremental.cc (Incremental_inputs_header)
6199 (Incremental_inputs_header_write, Incremental_inputs_entry)
6200 (Incremental_inputs_entry_write): Move ...
6201 * incremental.h (Incremental_inputs_header)
6202 (Incremental_inputs_header_write, Incremental_inputs_entry)
6203 (Incremental_inputs_entry_write): here.
6204
3aec4f9c
RÁE
62052009-12-02 Rafael Avila de Espindola <espindola@google.com>
6206
6207 * incremental.cc (make_sized_incremental_binary): Set the target.
6208 Error if it is incompatible.
6209 * output.h (Output_file): Add filename method.
6210
9c0ae74d
RÁE
62112009-12-02 Rafael Avila de Espindola <espindola@google.com>
6212
6213 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6214 from the get_* methods.
6215
a45500ae
RÁE
62162009-12-02 Rafael Avila de Espindola <espindola@google.com>
6217
6218 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6219 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6220 Write 0 for the data_offset of scripts.
6221
325e6408
RÁE
62222009-12-02 Rafael Avila de Espindola <espindola@google.com>
6223
6224 * testsuite/Makefile.am: Add the incremental_test.sh test.
6225 * testsuite/incremental_test.sh: New.
6226 * testsuite/incremental_test_1.c: New.
6227 * testsuite/incremental_test_2.c: New.
6228
954c3e2e
RÁE
62292009-12-01 Rafael Avila de Espindola <espindola@google.com>
6230
6231 * incremental-dump.cc (main): Fix typos.
6232
f8086623
RÁE
62332009-11-27 Rafael Avila de Espindola <espindola@google.com>
6234
6235 PR gold/11025
6236 * incremental-dump.cc (main): Use llu to print 64 bit values.
6237
3b0dd6ac
L
62382009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6239 H.J. Lu <hongjiu.lu@intel.com>
6240
6241 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6242 $(LIBDL).
6243 (incremental_dump_LDADD): Likewise.
6244 * Makefile.in: Regenerated.
6245
a6d1ef57 62462009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 6247
a6d1ef57
DK
6248 Revert:
6249
6250 2009-11-25 Doug Kwan <dougkwan@google.com>
6251
6252 * arm.cc (Target_arm::Target_arm): Move method definition
6253 outside of class definition. Add code to handle
6254 --target1-rel, --target1-abs and --target2= options.
6255 (Target_arm::get_reloc_reloc_type): Change method to be
6256 non-static and const.
6257 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6258 New data member declaration.
6259 (Target_arm::Scan::local, Target_arm::Scan::global,
6260 Target_arm::Relocate::relocate,
6261 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6262 Adjust call to Target_arm::get_real_reloc_type.
6263 (Target_arm::get_real_reloc_type): Use command line options
6264 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6265 * options.h (--target1-rel, --target1-abs, --target2): New
6266 ARM-only options.
6267
50aeb7d4
DK
62682009-11-25 Doug Kwan <dougkwan@google.com>
6269
6270 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6271 class definition. Add code to handle --target1-rel, --target1-abs
6272 and --target2= options.
6273 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6274 and const.
6275 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6276 member declaration.
6277 (Target_arm::Scan::local, Target_arm::Scan::global,
6278 Target_arm::Relocate::relocate,
6279 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6280 call to Target_arm::get_real_reloc_type.
6281 (Target_arm::get_real_reloc_type): Use command line options to
6282 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6283 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6284 options.
6285
51938283
DK
62862009-11-25 Doug Kwan <dougkwan@google.com>
6287
6288 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6289 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6290 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6291 formatting.
6292 (Arm_relocate_functions::thm_call): Replace body with a call to
6293 Arm_relocate_functions::thumb_branch_common.
6294 (Arm_relocate_functions::thm_jump24,
6295 Arm_relocate_functions::thm_xpc22): New method definitions.
6296 (Arm_relocate_functions::thumb_branch_common): New method definition.
6297 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6298 operator.
6299 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6300 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6301
e2b8f3c4
RÁE
63022009-11-24 Rafael Avila de Espindola <espindola@google.com>
6303
6304 * Makefile.am: Build incremental-dump
6305 * Makefile.in: Regenerate.
6306 * incremental-dump.cc: New.
6307 * incremental.cc (Incremental_inputs_header_data,
6308 Incremental_inputs_entry_data): Move to incremental.h
6309 * incremental.h: (Incremental_inputs_header_data,
6310 Incremental_inputs_entry_data): Move from incremental.cc
6311
bcba9aec
RÁE
63122009-11-24 Rafael Avila de Espindola <espindola@google.com>
6313
6314 * incremental.cc (Incremental_inputs_header,
6315 Incremental_inputs_header_write, Incremental_inputs_entry,
6316 Incremental_inputs_entry_write): Add a typedef with the data type.
6317
7c3afe08
RÁE
63182009-11-24 Rafael Avila de Espindola <espindola@google.com>
6319
6320 * incremental.cc (Incremental_inputs_header,
6321 Incremental_inputs_header_write, Incremental_inputs_entry,
6322 Incremental_inputs_entry_write): Update comment about which
6323 type has the filed descriptions.
6324
d204b6e9
DK
63252009-11-15 Doug Kwan <dougkwan@google.com>
6326
6327 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6328 (Arm_relocate_functions::arm_branch_common): Change method defintion
6329 in class definition to a method declaration and update list of formal
6330 parameters.
6331 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6332 Arm_relocation_functions::jump24): Adjust call to
6333 Arm_relocate_functions::arm_branch_common. Update list of formal
6334 parameters.
6335 (Arm_relocate_functions::xpc25): New method definition.
6336 (Arm_relocate_functions::arm_branch_common): Move method defintion
6337 out from class definition. Use stubs for mode-switching and extending
6338 branch ranges.
6339 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6340 specially. Change code to enable use of stubs in ARM branches.
6341
43d12afe
DK
63422009-11-10 Doug Kwan <dougkwan@google.com>
6343
6344 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6345 in method declaration.
6346 (Target_arm::relocate_stub): New method declaration.
6347 (Target_arm::default_target): Change to return a pointer instead of
6348 a const reference.
6349 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
6350 Target_arm::default_target.
6351 (Arm_Relobj::do_relocate_sections): Remove options paramater in
6352 method definition.
6353 (Target_arm::relocate_section): Adjust view.
6354 (Target_arm::relocate_stub): New method definition.
6355
ac33a407
DK
63562009-11-10 Doug Kwan <dougkwan@google.com>
6357
6358 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
6359 a format warning.
6360 * incremental.cc (open_incremental_binary): Initialized local
6361 variables to avoid warnings.
6362 * object.cc (make_elf_object): Ditto.
6363 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6364 a format warning.
e1df38aa 6365
88ee28e9
L
6366009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6367
6368 PR gold/10930
6369 * testsuite/plugin_test.c: Include "config.h".
6370
2daedcd6
DK
63712009-11-09 Doug Kwan <dougkwan@google.com>
6372
6373 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6374 (arm_symbol_value): Remove.
6375 (Arm_relocate_functions::arm_branch_common,
6376 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6377 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6378 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6379 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6380 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6381 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
6382 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
6383 Arm_relocate_functions::thm_mobw_abs_nc,
6384 Arm_relocate_functions::thm_mov_abs,
6385 Arm_relocate_functions::movw_prel_nc,
6386 Arm_relocate_functions::thm_movt_abs,
6387 Arm_relocate_functions::movt_prel,
6388 Arm_relocate_functions::thm_movw_prel_nc,
6389 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
6390 (Target_arm::Relocate::relocate): Only decompose address into two
6391 parts if relocation type uses the thumb-bit and pass the actual
6392 bit instead of a flag indicating that the thumb-bit is used. Adjust
6393 calls to methods in Arm_relocate_functions for this change.
6394
1276bc89 63952009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
6396
6397 PR 10925
6398 * reloc.cc: Instantiate
6399 Sized_relobj::initialize_input_to_output_maps and
6400 Sized_relobj:free_input_to_output_maps.
6401
e53ad1b5
ILT
64022009-11-06 Ian Lance Taylor <iant@google.com>
6403
6404 PR 10876
6405 * defstd.cc (in_segment): Set only_if_ref true for "end".
6406
eb44217c
DK
64072009-11-06 Doug Kwan <dougkwan@google.com>
6408
6409 * arm.cc (class Reloc_stub): Correct a comment.
6410 (Target_arm::Target_arm): Initialize arm_input_section_map_.
6411 (Target_arm::scan_section_for_stubs): New method declaration.
6412 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
6413 Change methods from private to protected.
6414 (Target_arm::do_may_relax): New method definition.
6415 (Target_arm::do_relax, Target_arm::group_sections,
6416 Target_arm::scan_reloc_for_stub,
6417 Target_arm::scan_reloc_section_for_stubs): New method declarations.
6418 (Target_arm::arm_input_section_map_): New data member declaration.
6419 (Target_arm::scan_reloc_for_stub,
6420 Target_arm::scan_reloc_section_for_stubs,
6421 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
6422 Target_arm::do_relax): New method definitions.
6423
5d329b7d
ILT
64242009-11-06 Mikolaj Zalewski <mikolaj@google.com>
6425
6426 * configure.ac: Check for (struct stat)::st_mtim
6427 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
6428 * config.in: Regenerate.
6429 * configure: Regenerate.
6430
96a0d71b
ILT
64312009-11-05 Ian Lance Taylor <iant@google.com>
6432
6433 PR 10910
6434 * output.cc (Output_segment::add_output_section): Add missing
6435 return statement.
6436
594c8e5e
ILT
64372009-11-04 Ian Lance Taylor <iant@google.com>
6438
6439 PR 10880
6440 * object.h (class Object): Add is_needed and set_is_needed
6441 methods. Add is_needed_ field. Make bool fields into bitfields.
6442 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
6443 defined in a dynamic object and referenced by a regular object,
6444 set is_needed for the dynamic object.
6445 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
6446 if the file is marked with as_needed and it is not needed.
6447
22b127cc
ILT
64482009-11-04 Ian Lance Taylor <iant@google.com>
6449
6450 PR 10887
6451 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
6452 tags if data is discarded by linker script.
6453 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6454 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6455 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6456 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6457
f5c870d2
ILT
64582009-11-04 Ian Lance Taylor <iant@google.com>
6459
6460 * layout.cc (Layout::get_output_section): Add is_interp and
6461 is_dynamic_linker_section parameters. Change all callers.
6462 (Layout::choose_output_section): Likewise.
6463 (Layout::make_output_section): Likewise.
6464 (Layout::add_output_section_data): Add is_dynamic_linker_section
6465 parameter. Change all callers.
6466 * layout.h (class Layout): Update declarations.
6467 * output.h (class Output_section): Add is_interp, set_is_interp,
6468 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
6469 Add is_interp_, is_dynamic_linker_section_ fields. Change
6470 generate_code_fills_at_write_ to a bitfield.
6471 * output.cc (Output_section::Output_sections): Initialize new
6472 fields.
6473 (Output_segment::add_output_section): Add do_sort parameter.
6474 Change all callers.
6475
1ae4d23b
ILT
64762009-11-03 Ian Lance Taylor <iant@google.com>
6477
6478 PR 10860
6479 * options.h (class General_options): Add --warn-common.
6480 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
6481 merging two common symbols.
6482 (Symbol_table::should_override): Handle --warn-common when merging
6483 a common symbol with a defined symbol. Use report_resolve_problem
6484 for multiple definitions.
6485 (Symbol_table::report_resolve_problem): New function.
6486 * symtab.h (class Symbol_table): Declare report_resolve_problem.
6487
55da9579
DK
64882009-11-03 Doug Kwan <dougkwan@google.com>
6489
6490 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
6491 stub_factory_.
6492 (Target_arm::stub_factory): New method definition.
6493 (Target_arm::new_arm_input_section,
6494 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
6495 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 6496 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
6497 New type definitions.
6498 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
6499 member declarations.
6500 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
6501 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
6502 New method definitions.
6503
37a9ac43
ILT
65042009-11-03 Ian Lance Taylor <iant@google.com>
6505
6506 * options.h (class General_options): Add --warn_constructors.
6507
b3d6a3d4
ILT
65082009-11-03 Ian Lance Taylor <iant@google.com>
6509
6510 PR 10893
6511 * defstd.cc (in_section): Add entries for __rel_iplt_start,
6512 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
6513
934b01dd
ILT
65142009-11-03 Ian Lance Taylor <iant@google.com>
6515
6516 PR 10895
6517 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
6518 --msgid-bugs-address.
6519 (install-pdf): New target.
6520 (install-data_yes): Look up one directory to find mkinstalldirs.
6521
03c1939b
L
65222009-11-03 H.J. Lu <hongjiu.lu@intel.com>
6523
6524 * po/Make-in (.po.gmo): Don't generate .gmo files in source
6525 tree.
6526
ebd95253
DK
65272009-10-30 Doug Kwan <dougkwan@google.com>
6528
6529 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
6530
e9bbb538
DK
65312009-10-30 Doug Kwan <dougkwan@google.com>
6532
6533 * arm.cc (Stub_addend_reader): New struct template definition
6534 and partial specializations.
6535 (Stub_addend_reader::operator()): New method definition for a
6536 partially specialized template.
6537
d5b40221
DK
65382009-10-30 Doug Kwan <dougkwan@google.com>
6539
6540 * arm.cc (Arm_relobj::processor_specific_flags): New method
6541 definition.
6542 (Arm_relobj::do_read_symbols): New method declaration.
6543 (Arm_relobj::processor_specific_flags_): New data member declaration.
6544 (Arm_dynobj): New class definition.
6545 (Target_arm::do_finalize_sections): Add input_objects parameter.
6546 (Target_arm::do_adjust_elf_header): New method declaration.
6547 (Target_arm::are_eabi_versions_compatible,
6548 (Target_arm::merge_processor_specific_flags): New method declaration.
6549 (Target_arm::do_make_elf_object): New overloaded method definitions
6550 and declaration.
6551 (Arm_relobj::do_read_symbols): New method definition.
6552 (Arm_dynobj::do_read_symbols): Ditto.
6553 (Target_arm::do_finalize_sections): Add input_objects parameters.
6554 Merge processor-specific flags from all input objects.
6555 (Target_arm::are_eabi_versions_compatible,
6556 Target_arm::merge_processor_specific_flags,
6557 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
6558 New method definitions.
6559 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
6560 Input_objects pointer type parameter.
6561 * layout.cc (Layout::finalize): Pass input objects to target's.
6562 finalize_sections function.
6563 * output.cc (Output_file_header::do_sized_write): Set ELF file
6564 header's processor-specific flags.
6565 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
6566 Input_objects pointer type parameter.
6567 * sparc.cc (Target_sparc::do_finalize_sections): Same.
6568 * target.h (Input_objects): New forward class declaration.
6569 (Target::processor_specific_flags,
6570 Target::are_processor_specific_flags_sect): New method definitions.
6571 (Target::finalize_sections): Add input_objects parameter.
6572 (Target::Target): Initialize processor_specific_flags_ and
6573 are_processor_specific_flags_set_.
6574 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
6575 parameter.
6576 (Target::set_processor_specific_flags): New method definition.
6577 (Target::processor_specific_flags_,
6578 Target::are_processor_specific_flags_set_): New data member
6579 declarations.
6580 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
6581 Input_objects pointer type parameter.
6582
ebabffbd
DK
65832009-10-30 Doug Kwan <dougkwan@google.com>
6584
6585 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
6586
ad0f2072
ILT
65872009-10-28 Ian Lance Taylor <iant@google.com>
6588
6589 * object.h (class Relobj): Drop options parameter from
6590 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
6591 do_scan_relocs, do_relocate. Change all callers.
6592 (class Sized_relobj): Drop options parameters from
6593 do_gc_process_relocs, do_scan_relocs, do_relocate,
6594 do_relocate_sections, relocate_sections, emit_relocs_scan,
6595 emit_relocs_scan_reltype. Change all callers.
6596 (struct Relocate_info): Remove options field and all references to
6597 it.
6598 * reloc.h (class Read_relocs): Remove options constructor
6599 parameter and options_ field. Change all callers.
6600 (class Gc_process_relocs, class Scan_relocs): Likewise.
6601 (class Relocate_task): Likewise.
6602 * target-reloc.h (scan_relocs): Remove options parameter. Change
6603 all callers.
6604 (scan_relocatable_relocs): Likewise.
6605 * target.h (class Sized_target): Remove options parameter from
6606 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6607 all callers.
6608 * gc.h (gc_process_relocs): Remove options parameter. Change all
6609 callers.
6610 * arm.cc: Update functions to remove options parameters.
6611 * i386.cc: Likewise.
6612 * powerpc.cc: Likewise.
6613 * sparc.cc: Likewise.
6614 * x86_64.cc: Likewise.
6615 * testsuite/testfile.cc: Likewise.
6616
8ffa3667
DK
66172009-10-28 Doug Kwan <dougkwan@google.com>
6618
6619 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6620 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6621 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6622 New method definitions.
6623
40f36857
CC
66242009-10-28 Cary Coutant <ccoutant@google.com>
6625
6626 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6627 (Plugin::cleanup_done_): New member.
6628 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6629 (Plugin_manager::cleanup_done_): Remove.
6630 (Plugin_manager::add_input_file): Edit error message.
6631 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6632 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6633
2c849493
ILT
66342009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6635
6636 * fileread.cc: (File_read::View::~View): Use the new
6637 data_ownership_ filed.
6638 (File_read::~File_read): Dispose the new whole_file_view_.
6639 (File_read::open): Mmap the whole file if needed.
6640 (File_read::open): Use whole_file_view_ instead of contents_.
6641 (File_read::find_view): Use whole_file_view_ if applicable.
6642 (File_read::do_read): Use whole_file_view_ instead of contents_.
6643 (File_read::make_view): Use whole_file_view_ instead of contents_,
6644 update File_read::View::View call.
6645 (File_read::find_or_make_view): Update File_read::View::View
6646 call.
6647 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6648 remove contents_
6649 (File_read::View::Data_ownership): New enum.
6650 (File_read::View::View): Replace bool mapped_ with Data_ownership
6651 argument.
6652 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6653 (File_read::View::data_ownership_): New field.
6654 (File_read::contents_): Remove (replaced by whole_file_view_).
6655 (File_read::whole_file_view_): New field.
6656 * options.h (class General_options): Add --keep-files-mapped.
6657
24998053
CC
66582009-10-27 Cary Coutant <ccoutant@google.com>
6659
6660 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6661 * testsuite/Makefile.am (plugin_test_5): New test case.
6662 * testsuite/Makefile.in: Regenerate.
6663
72adc4fa
DK
66642009-10-25 Doug Kwan <dougkwan@google.com>
6665
6666 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6667 from private to protected to allow access by child class.
6668 (Sized_relobj::do_relocate_sections): New method declaration.
6669 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6670 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6671 Sized_relobj::relocate_sections. Instantiate template explicitly
6672 for different target sizes and endianity.
6673
07f508a2
DK
66742009-10-24 Doug Kwan <dougkwan@google.com>
6675
6676 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6677 (Arm_input_section::as_arm_input_section): New method.
6678 (Arm_output_section): New class definition.
6679 (Arm_output_section::create_stub_group,
6680 Arm_output_section::group_sections): New method definitions.
6681
10ad9fe5
DK
66822009-10-22 Doug Kwan <dougkwan@google.com>
6683
6684 * arm.cc (Arm_input_section): New class definition.
6685 (Arm_input_section::init, Arm_input_section:do_write,
6686 Arm_input_section::set_final_data_size,
6687 Arm_input_section::do_reset_address_and_file_offset): New method
6688 definitions.
6689
56ee5e00
DK
66902009-10-21 Doug Kwan <dougkwan@google.com>
6691
6692 * arm.cc (Stub_table, Arm_input_section): New forward class
6693 declarations.
6694 (Stub_table): New class defintion.
6695 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
6696 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
6697 New method definition.
6698
b569affa
DK
66992009-10-21 Doug Kwan <dougkwan@google.com>
6700
6701 * arm.cc: Update copyright comments.
6702 (Target_arm): New forward class template declaration.
6703 (Arm_address): New type.
6704 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
6705 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
6706 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
6707 constants.
6708 (Insn_template): Same.
6709 (DEF_STUBS): New macro.
6710 (Stub_type): New enum type.
6711 (Stub_template): New class definition.
6712 (Stub): Same.
6713 (Reloc_stub): Same.
6714 (Stub_factory): Same.
6715 (Target_arm::Target_arm): Initialize may_use_blx_ and
6716 should_force_pic_veneer_.
6717 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
6718 Target_arm::should_force_pic_veneer,
6719 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
6720 Target_arm::using_thumb_only, Target_arm:;default_target): New
6721 method defintions.
6722 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
6723 New data member declarations.
6724 (Insn_template::size, Insn_template::alignment): New method defintions.
6725 (Stub_template::Stub_template): New method definition.
6726 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
6727 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
6728 (Stub_factory::Stub_factory): New method definition.
6729 * gold.h (string_hash): New template.
6730 * output.h (Input_section_specifier::hash_value): Use
6731 gold::string_hash.
6732 (Input_section_specifier::string_hash): Remove.
6733 * stringpool.cc (Stringpool_template::string_hash): Use
6734 gold::string_hash.
6735
6c172549
DK
67362009-10-20 Doug Kwan <dougkwan@google.com>
6737
6738 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
6739 symbols of relaxed input sections.
6740 * output.h (Output_section::find_relaxed_input_section): Make
6741 method public.
6742
c5617f2f
DK
67432009-10-16 Doug Kwan <dougkwan@google.com>
6744
6745 * dynobj.cc (Versions::Versions): Initialize version_script_.
6746 Only insert base version symbol definition for a shared object
6747 if version script defines any version versions.
6748 (Versions::define_base_version): New method definition.
6749 (Versions::add_def): Check that base version is not needed.
6750 (Versions::add_need): Define base version lazily.
6751 * dynobj.h (Versions::define_base_version): New method declaration.
6752 (Versions::needs_base_version_): New data member declaration.
6753 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
6754 (check_DATA): Add no_version_test.stdout.
6755 (libno_version_test.so, no_version_test.o no_version_test.stdout):
6756 New make rules.
6757 * testsuite/Makefile.in: Regenerate.
6758 * testsuite/no_version_test.c: New file.
6759 * testsuite/no_version_test.sh: Ditto.
6760
3c12dcdb
DK
67612009-10-16 Doug Kwan <dougkwan@google.com>
6762
6763 * expression.cc (class Segment_start_expression): New class definition.
6764 (Segment_start_expression::value): New method definition.
6765 (script_exp_function_segment_start): Return a new
6766 Segment_start_expression.
6767 * gold/script-c.h (script_saw_segment_start_expression): New function
6768 prototype.
6769 * script-sections.cc (Script_sections::Script_sections): Initialize
6770 SAW_SEGMENT_START_EXPRESSION_ to false.
6771 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
6772 and -Tbbs options to specify section addresses if given in
6773 command line and no SEGMENT_START expression is seen in a script.
6774 * script-sections.h (Script_sections::saw_segment_start_expression,
6775 Script_sections::set_saw_segment_start_expression): New method
6776 definition.
6777 (Script_sections::saw_segment_start_expression_): New data member
6778 declaration.
6779 * script.cc (script_saw_segment_start_expression): New function.
6780 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
6781 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
6782 script_test_7.sh and script_test_8.sh.
6783 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
6784 script_test_8.stdout.
6785 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
6786 (script_test_6, script_test_6.stdout, script_test_7,
6787 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
6788 * Makefile.in: Regenerate.
6789 * testsuite/script_test_6.sh: New file.
6790 * testsuite/script_test_6.t: Same.
6791 * testsuite/script_test_7.sh: Same.
6792 * testsuite/script_test_7.t: Same.
6793 * testsuite/script_test_8.sh: Same.
6794
64b1ae37
DK
67952009-10-16 Doug Kwan <dougkwan@google.com>
6796
6797 * output.cc (Output_segment::set_section_list_address): Cast
6798 expressions to unsigned long long type to avoid format warnings.
6799
661be1e2
ILT
68002009-10-15 Ian Lance Taylor <iant@google.com>
6801
12edd763 6802 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 6803 dot assignment to script_sections_.
12edd763
ILT
6804 * script-sections.cc (Script_sections::add_dot_assignment):
6805 Initialize if necessary.
6806
68b6574b
ILT
6807 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
6808 program headers with no load segment if there is a linker script.
6809
661be1e2
ILT
6810 * layout.cc (Layout::set_segment_offsets): Align the file offset
6811 to the segment aligment for -N or -n with no load segment.
6812 * output.cc (Output_segment::add_output_section): Don't crash if
6813 the first section is a TLS section.
6814 (Output_segment::set_section_list_addresses): Print an error
6815 message if the address moves backward in a linker script.
6816 * script-sections.cc
6817 (Output_section_element_input::set_section_addresses): Don't
6818 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
6819 (Orphan_output_section::set_section_addresses): Likewise.
6820
f15f61a7
DK
68212009-10-15 Doug Kwan <dougkwan@google.com>
6822
6823 * layout.cc (Layout::finish_dynamic_section): Generate tags
6824 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
6825 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
6826 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
6827
82bb573a
ILT
68282009-10-14 Ian Lance Taylor <iant@google.com>
6829
6830 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
6831 fields.
6832 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
6833 data_shdr fields of relinfo.
6834 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
6835 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
6836 R_386_TLS_LDO_32, adjust based on section flags.
6837 (Target_i386::Relocate::fix_up_ldo): Remove.
6838
374ad285
ILT
68392009-10-13 Ian Lance Taylor <iant@google.com>
6840
6841 Add support for -pie.
6842 * options.h (class General_options): Add -pie and
6843 --pic-executable.
6844 (General_options::output_is_position_independent): Test -pie.
6845 (General_options::output_is_executable): Return true if not shared
6846 and not relocatable.
6847 (General_options::output_is_pie): Remove.
6848 * options.cc (General_options::finalize): Reject incompatible uses
6849 of -pie.
6850 * gold.cc (queue_middle_tasks): A -pie link is not static.
6851 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
6852 * symtab.cc (Symbol::final_value_is_known): Return false if
6853 output_is_position_independent.
6854 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
6855 output_is_position_independent.
6856 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
6857 output_is_position_independent.
6858 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
6859 output_is_position_independent.
6860 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
6861 two_file_pie_test.
6862 (basic_pie_test.o, basic_pie_test): New targets.
6863 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
6864 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
6865 (two_file_pie_test): New target.
6866 * testsuite/Makefile.in: Rebuild.
6867 * README: Remove note saying that -pie is not supported.
6868
c6585162
ILT
68692009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
6870
6871 * options.h (class General_options): Add -init and -fini.
6872 * layout.cc (Layout::finish_dynamic_section): Emit
6873 given init and fini functions.
6874
032ce4e9
ST
68752009-10-13 Sriraman Tallam <tmsriram@google.com>
6876
6877 * gc.h (gc_process_relocs): Check if icf is enabled using new
6878 function.
6879 * gold.cc (queue_initial_tasks): Likewise.
6880 (queue_middle_tasks): Likewise.
6881 * object.cc (do_layout): Likewise.
6882 * symtab.cc (is_section_folded): Likewise.
6883 * main.cc (main): Likewise.
6884 * reloc.cc (Read_relocs::run): Likewise.
6885 (Sized_relobj::do_scan_relocs): Likewise.
6886 * icf.cc (is_function_ctor_or_dtor): New function.
6887 (Icf::find_identical_sections): Check if function is ctor or dtor when
6888 safe icf is chosen.
6889 * options.h (General_options::icf): Change option to be an enum.
6890 (Icf_status): New enum.
6891 (icf_enabled): New method.
6892 (icf_safe_folding): New method.
6893 (set_icf_status): New method.
6894 (icf_status_): New variable.
6895 * (options.cc) (General_options::finalize): Set icf_status_.
6896 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
6897 icf_test and icf_keep_unique_test to use the --icf enum flag.
6898 * testsuite/icf_safe_test.sh: New file.
e1df38aa 6899 * testsuite/icf_safe_test.cc: New file.
032ce4e9 6900
f345227a
ST
69012009-10-12 Sriraman Tallam <tmsriram@google.com>
6902
6903 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
6904 includes to gc.h and icf.h.
6905 * arm.cc: Include gc.h.
6906 * gold.cc: Likewise.
6907 * i386.cc: Likewise.
6908 * powerpc.cc: Likewise.
6909 * sparc.cc: Likewise.
6910 * x86_64.cc: Likewise.
6911 * gc.h: Include icf.h.
6912
1c7814ed
ILT
69132009-10-11 Ian Lance Taylor <iant@google.com>
6914
6915 * plugin.cc: Include "gold.h" before other header files.
6916
ae3b5189
CD
69172009-10-10 Chris Demetriou <cgd@google.com>
6918
6919 * options.h (Input_file_argument::Input_file_type): New enum.
6920 (Input_file_argument::is_lib_): Replace with...
6921 (Input_file_argument::type_): New member.
6922 (Input_file_argument::Input_file_argument): Take Input_file_type
6923 'type' rather than boolean 'is_lib' as second argument.
6924 (Input_file_argument::is_lib): Use type_.
6925 (Input_file_argument::is_searched_file): New function.
6926 (Input_file_argument::may_need_search): Handle is_searched_file.
6927 * options.cc (General_options::parse_library): Support -l:filename.
6928 (General_options::parse_just_symbols): Update for Input_file_argument
6929 changes.
6930 (Command_line::process): Likewise.
6931 * archive.cc (Archive::get_file_and_offset): Likewise.
6932 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6933 * script.cc (read_script_file, script_add_file): Likewise.
6934 * fileread.cc (Input_file::Input_file): Likewise.
6935 (Input_file::will_search_for): Handle is_searched_file.
6936 (Input_file::open): Likewise.
6937 * readsyms.cc (Read_symbols::get_name): Likewise.
6938 * testsuite/Makefile.am (searched_file_test): New test.
6939 * testsuite/Makefile.in: Regenerate.
6940 * testsuite/searched_file_test.cc: New file.
6941 * testsuite/searched_file_test_lib.cc: New file.
6942
f3048a1d
ILT
69432009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6944 Ian Lance Taylor <iant@google.com>
6945
6946 * descriptor.cc: Include <cstdio> and "binary-io.h".
6947 (Descriptors::open): Open the files in binary mode always.
6948 * script.cc (Lex::get_token): Treat \r as whitespace.
6949
d4780e57
ILT
69502009-10-09 Ian Lance Taylor <iant@google.com>
6951
6952 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6953
d9a893b8
ILT
69542009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6955 Ian Lance Taylor <iant@google.com>
6956
6957 * configure.ac: Check for readv function also.
6958 * fileread.cc (readv): Define if not HAVE_READV.
6959 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6960 does not exist.
6961 * config.in: Regenerate.
6962 * configure: Regenerate.
6963
c0a62865
DK
69642009-10-09 Doug Kwan <dougkwan@google.com>
6965
6966 * layout.cc (Layout::make_output_section): Call target hook to make
6967 ordinary output section.
6968 (Layout::finalize): Adjust parameter list of call the
6969 Target::may_relax().
6970 * layout.h (class Layout::section_list): New method.
6971 * merge.h (Output_merge_base::entsize): Change visibility to public.
6972 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6973 New methods.
6974 (Output_merge_string::do_is_string): New method.
6975 * object.cc (Sized_relobj::do_setup): renamed from
6976 Sized_relobj::set_up.
6977 * object.h (Sized_relobj::adjust_shndx,
6978 Sized_relobj::initializ_input_to_output_maps,
6979 Sized_relobj::free_input_to_output_maps): Change visibilities to
6980 protected.
6981 (Sized_relobj::setup): Virtualize.
6982 (Sized_relobj::do_setup): New method declaration.
6983 (Sized_relobj::invalidate_section_offset,
6984 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6985 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6986 * options.cc (parse_int): New function.
6987 * options.h (parse_int): New declaration.
6988 (DEFINE_int): New macro.
6989 (stub_group_size): New option.
6990 * output.cc (Output_section::Output_section): Initialize memebers
6991 merge_section_map_, merge_section_by_properties_map_,
6992 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6993 (Output_section::add_input_section): Handled deferred code-fill
6994 generation and remove an old comment.
6995 (Output_section::add_relaxed_input_section): New method definition.
6996 (Output_section::add_merge_input_section): Use merge section by
6997 properties map to speed to search. Update merge section maps
6998 as appropriate.
6999 (Output_section::build_relaxation_map): New method definition.
7000 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7001 Same.
7002 (Output_section::relax_input_section): Renamed to
7003 Output_section::convert_input_sections_to_relaxed_sections and change
7004 interface to take a vector of pointers to relaxed sections.
7005 (Output_section::find_merge_section,
7006 Output_section::find_relaxed_input_section): New method definitions.
7007 (Output_section::is_input_address_mapped,
7008 Output_section::output_offset, Output_section::output_address):
7009 Use output section data maps to speed up searching.
7010 (Output_section::find_starting_output_address): Add comments.
7011 (Output_section::do_write,
7012 Output_section::write_to_postprocessing_buffer): Do code-fill
7013 generation as appropriate.
7014 (Output_section::get_input_sections): Invalidate relaxed input section
7015 map.
7016 (Output_section::restore_states): Adjust type of checkpoint .
7017 Invalidate relaxed input section map.
7018 * output.h (Output_merge_base): New class declaration.
7019 (Input_section_specifier): New class defintion.
7020 (class Output_relaxed_input_section) Change base class to
7021 Output_section_data_build.
7022 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
7023 base class initializer.
7024 (Output_section::add_relaxed_input_section): New method declaration.
7025 (Output_section::Input_section): Change visibility to protected.
7026 (Output_section::Input_section::relobj,
7027 Output_section::Input_section::shndx): Handle relaxed input sections.
7028 Output_section::input_sections) Change visibility to protected. Also
7029 define overload to return a non-const pointer.
7030 (Output_section::Merge_section_properties): New class defintion.
7031 (Output_section::Merge_section_by_properties_map,
7032 Output_section::Output_section_data_by_input_section_map,
7033 Output_section::Relaxation_map): New types.
7034 (Output_section::relax_input_section): Rename method to
7035 Output_section::convert_input_sections_to_relaxed_sections and change
7036 interface to take a vector of relaxed section pointers.
7037 (Output_section::find_merge_section,
7038 Output_section::find_relaxed_input_section,
7039 Output_section::build_relaxation_map,
7040 Output_section::convert_input_sections_in_list_to_relaxed_sections):
7041 New method declarations.
7042 (Output_section::merge_section_map_
7043 Output_section::merge_section_by_properties_map_,
7044 Output_section::relaxed_input_section_map_,
7045 Output_section::is_relaxed_input_section_map_valid_,
7046 Output_section::generate_code_fills_at_write_): New data members.
7047 * script-sections.cc
7048 (Output_section_element_input::set_section_addresses): Call
7049 current_data_size and addralign methods of relaxed input sections.
7050 (Orphan_output_section::set_section_addresses): Call current_data_size
7051 and addralign methods of relaxed input sections.
7052 * symtab.cc (Symbol_table::compute_final_value): Extract template
7053 from the body of Symbol_table::sized_finalize_symbol.
7054 (Symbol_table::sized_finalized_symbol): Call
7055 Symbol_table::compute_final_value.
7056 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
7057 (Symbol_table::compute_final_value): New templated method declaration.
7058 * target.cc (Target::do_make_output_section): New method defintion.
7059 * target.h (Target::make_output_section): New method declaration.
7060 (Target::relax): Add more parameters for input objects, symbol table
7061 and layout. Adjust call to do_relax.
7062 (Target::do_make_output_section): New method declaration.
7063 (Target::do_relax): Add parameters for input objects, symbol table
7064 and layout.
7065
d446d6c4
ILT
70662009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7067
7068 * pread.c: Include stdio.h.
7069
bc06c745
ILT
70702009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7071
7072 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
7073 defined.
7074
75aea3d0
ILT
70752009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7076
7077 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7078 Change read_shndx type to unsigned int.
7079 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7080 int.
7081 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7082 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7083 Change read_shndx type to unsigned int.
7084 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7085 int.
7086 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7087 * layout.cc (Layout::create_symtab_sections): Cast the result of
7088 local_symcount * symsize to off_t in the gold_assert.
7089
be8fcb75
ILT
70902009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7091
7092 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7093 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7094 R_ARM_BASE_ABS.
7095 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7096 (Arm_relocate_functions::thm_abs5): New function.
7097 (Arm_relocate_functions::abs12): New function.
7098 (Arm_relocate_functions::abs16): New function.
7099 (Arm_relocate_functions::base_abs): New function.
7100 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7101 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7102 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7103 R_ARM_BASE_ABS.
7104 (Scan::global): Likewise.
7105 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7106 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7107 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7108 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7109 R_ARM_BASE_ABS.
7110
c2a122b6
ILT
71112009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7112
7113 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7114 (Arm_relocate_functions::movt_prel): New function.
7115 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7116 (Arm_relocate_functions::thm_movt_prel): New function.
7117 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7118 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7119 (Scan::global, Relocate::relocate): Likewise.
7120 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7121
c4aa1e2d
ILT
71222009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7123
7124 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7125 Incremental_checker.
7126 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7127 unsigned int.
7128 (class Incremental_inputs_header): New class.
7129 (Incremental_inputs_header_writer): Edit comment.
7130 (Incremental_inputs_entry): New class.
7131 (Incremental_inputs_entry_writer): Edit comment.
7132 (Sized_incremental_binary::do_find_incremental_inputs_section):
7133 Add *strtab_shndx parameter, fill it.
7134 (Sized_incremental_binary::do_check_inputs): New method.
7135 (Incremental_checker::can_incrementally_link_output_file): Use
7136 Sized_incremental_binary::check_inputs.
7137 (Incremental_inputs::report_command_line): Save command line in
7138 command_line_.
7139 * incremental.h:
7140 (Incremental_binary::find_incremental_inputs_section): New
7141 method.
7142 (Incremental_binary::do_find_incremental_inputs_section): Add
7143 strtab_shndx parameter.
7144 (Incremental_binary::do_check_inputs): New pure virtual method.
7145 (Sized_incremental_binary::do_check_inputs): Declare.
7146 (Incremental_checker::Incremental_checker): Add incremental_inputs
7147 parameter, use it to initialize incremental_inputs_.
7148 (Incremental_checker::incremental_inputs_): New field.
7149 (Incremental_checker::command_line): New method.
7150 (Incremental_checker::inputs): New method.
7151 (Incremental_checker::command_line_): New field.
7152
c549a694
ILT
71532009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7154
7155 * incremental.cc: Include <cstdarg> and "target-select.h".
7156 (vexplain_no_incremental): New function.
7157 (explain_no_incremental): New function.
7158 (Incremental_binary::error): New method.
7159 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7160 method.
7161 (make_sized_incremental_binary): New function.
7162 (open_incremental_binary): New function.
7163 (can_incrementally_link_file): Add checks if output is ELF and has
7164 inputs section.
7165 * incremental.h: Include "elfcpp_file.h" and "output.h".
7166 (Incremental_binary): New class.
7167 (Sized_incremental_binary): New class.
7168 (open_incremental_binary): Declare.
7169 * object.cc (is_elf_object): Use
7170 elfcpp::Elf_recognizer::is_elf_file.
7171 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7172 * output.h (Output_file::filesize): New method.
7173
fd3c5f0b
ILT
71742009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7175
7176 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7177 New function.
7178 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7179 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7180 function.
7181 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7182 function.
7183 (Arm_relocate_functions::movw_abs_nc): New function.
7184 (Arm_relocate_functions::movt_abs): New function.
7185 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7186 (Arm_relocate_functions::thm_movt_abs): New function.
7187 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7188 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7189 (Scan::global): Likewise.
7190 (Relocate::relocate): Likewise.
7191 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7192
7f5309a5
ILT
71932009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7194
7195 * arm.cc (Arm_relocate_functions::got_prel) New function.
7196 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7197 (Relocate::relocate): Likewise.
7198 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7199
364c7fa5
ILT
72002009-10-06 Ian Lance Taylor <iant@google.com>
7201
7202 * options.h (class General_options): Define
7203 split_stack_adjust_size parameter.
7204 * object.h (class Object): Add uses_split_stack_ and
7205 has_no_split_stack_ fields. Add uses_split_stack and
7206 has_no_split_stack accessor functions. Declare
7207 handle_split_stack_section.
7208 (class Reloc_symbol_changes): Define.
7209 (class Sized_relobj): Define Function_offsets. Declare
7210 split_stack_adjust, split_stack_adjust_reltype, and
7211 find_functions.
7212 * object.cc (Object::handle_split_stack_section): New function.
7213 (Sized_relobj::do_layout): Call handle_split_stack_section.
7214 * dynobj.cc (Sized_dynobj::do_layout): Call
7215 handle_split_stack_section.
7216 * reloc.cc (Sized_relobj::relocate_sections): Call
7217 split_stack_adjust for executable sections in split_stack
7218 objects. Pass reloc_map to relocate_section.
7219 (Sized_relobj::split_stack_adjust): New function.
7220 (Sized_relobj::split_stack_adjust_reltype): New function.
7221 (Sized_relobj::find_functions): New function.
7222 * target-reloc.h: Include "object.h".
7223 (relocate_section): Add reloc_symbol_changes parameter. Change
7224 all callers.
7225 * target.h (class Target): Add calls_non_split method. Declare
7226 do_calls_non_split virtual method. Declare match_view and
7227 set_view_to_nop.
7228 * target.cc: Include "elfcpp.h".
7229 (Target::do_calls_non_split): New function.
7230 (Target::match_view): New function.
7231 (Target::set_view_to_nop): New function.
7232 * gold.cc (queue_middle_tasks): Give an error if mixing
7233 split-stack and non-split-stack objects with -r.
7234 * i386.cc (Target_i386::relocate_section): Add
7235 reloc_symbol_changes parameter.
7236 (Target_i386::do_calls_non_split): New function.
7237 * x86_64.cc (Target_x86_64::relocate_section): Add
7238 reloc_symbol_changes parameter.
7239 (Target_x86_64::do_calls_non_split): New function.
7240 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7241 parameter.
7242 * powerpc.cc (Target_powerpc::relocate_section): Add
7243 reloc_symbol_changes parameter.
7244 * sparc.cc (Target_sparc::relocate_section): Add
7245 reloc_symbol_changes parameter.
7246 * configure.ac: Call AM_CONDITIONAL for the default target.
7247 * configure: Rebuild.
7248 * testsuite/Makefile.am (TEST_AS): New variable.
7249 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7250 (check_DATA): Add split_i386 and split_x86_64 files.
7251 (SPLIT_DEFSYMS): Define.
7252 (split_i386_[1234n].o): New targets.
7253 (split_i386_[124]): New targets.
7254 (split_i386_[1234r].stdout): New targets.
7255 (split_x86_64_[1234n].o): New targets.
7256 (split_x86_64_[124]): New targets.
7257 (split_x86_64_[1234r].stdout): New targets.
7258 (MOSTLYCLEANFILES): Add new executables.
7259 * testsuite/split_i386.sh: New file.
7260 * testsuite/split_x86_64.sh: New file.
7261 * testsuite/split_i386_1.s: New file.
7262 * testsuite/split_i386_2.s: New file.
7263 * testsuite/split_i386_3.s: New file.
7264 * testsuite/split_i386_4.s: New file.
7265 * testsuite/split_i386_n.s: New file.
7266 * testsuite/split_x86_64_1.s: New file.
7267 * testsuite/split_x86_64_2.s: New file.
7268 * testsuite/split_x86_64_3.s: New file.
7269 * testsuite/split_x86_64_4.s: New file.
7270 * testsuite/split_x86_64_n.s: New file.
7271 * testsuite/testfile.cc (Target_test): Update relocation_section
7272 function.
7273 * testsuite/Makefile.in: Rebuild.
7274
e8a9fcda
ILT
72752009-10-06 Ian Lance Taylor <iant@google.com>
7276
7277 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7278 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7279 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7280 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7281 the address on ldo_addrs_.
7282 (Target_i386::Relocate::fix_up_ldo): New function.
7283
e99daf92
ILT
72842009-10-06 Rafael Espindola <espindola@google.com>
7285
7286 * plugin.cc (add_input_library): New.
7287 (Plugin::load): Add add_input_library to tv.
7288 (Plugin_manager::add_input_file): Add the is_lib argument.
7289 (add_input_file): Update call to Plugin_manager::add_input_file.
7290 (add_input_library): New.
7291 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7292
966d4097
DK
72932009-09-30 Doug Kwan <dougkwan@google.com>
7294
7295 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7296 symbol and call Symbol::may_need_copy_reloc to determine if
7297 a copy reloc is needed.
7298 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7299 nocopyreloc is given in command line.
7300 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7301 given in command line.
7302 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7303 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7304 of the removed Target_i386::may_need_copy_reloc.
7305 * options.h (copyreloc): New option with default value false.
7306 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7307 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7308 instead of the removed Target_powerpc::may_need_copy_reloc.
7309 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7310 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7311 instead of the removed Target_sparc::may_need_copy_reloc.
7312 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7313 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7314 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7315 instead of the removed Target_x86_64::may_need_copy_reloc.
7316
029ba973
ILT
73172009-09-30 Ian Lance Taylor <iant@google.com>
7318
7319 * object.h (class Object): Remove target_ field, and target,
7320 sized_target, and set_target methods.
7321 (Object::sized_target): Remove.
7322 (class Sized_relobj): Update declarations. Remove sized_target.
7323 * object.cc (Sized_relobj::setup): Remove target parameter.
7324 Change all callers.
7325 (Input_objects::add_object): Don't do anything with the target.
7326 (make_elf_sized_object): Add punconfigured parameter. Change all
7327 callers. Set or test parameter target.
7328 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7329 Change all callers.
7330 * parameters.cc (Parameters::set_target): Change parameter type to
7331 be non-const.
7332 (Parameters::default_target): Remove.
7333 (set_parameters_target): Change parameter type to be non-const.
7334 (parameters_force_valid_target): New function.
7335 (parameters_clear_target): New function.
7336 * parameters.h (class Parameters): Update declarations. Remove
7337 default_target method. Add sized_target and clear_target
7338 methods. Change target_ to be non-const.
7339 (set_parameters_target): Update declaration.
7340 (parameters_force_valid_target): Declare.
7341 (parameters_clear_target): Declare.
7342 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7343 as NULL if we aren't searching.
7344 (Add_symbols::run): Don't check for compatible target.
7345 * fileread.cc (Input_file::open_binary): Call
7346 parameters_force_valid_target.
7347 * gold.cc (queue_middle_tasks): Likewise.
7348 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
7349 set_target on object.
7350 * dynobj.h (class Sized_dynobj): Update declarations.
7351 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
7352 make_elf_object returns NULL.
7353 (Archive::include_member): Don't check whether object target is
7354 compatible.
7355 * output.cc (Output_section::add_input_section): Get target from
7356 parameters.
7357 (Output_section::relax_input_section): Likewise.
7358 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
7359 parameters.
7360 (Sized_relobj::do_scan_relocs): Likewise.
7361 (Sized_relobj::relocate_sections): Likewise.
7362 * resolve.cc (Symbol_table::resolve): Likewise.
7363 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7364 parameter. Change all callers.
7365 (Symbol_table::add_from_object): Get target from parameters.
7366 (Symbol_table::add_from_relobj): Don't check object target.
7367 (Symbol_table::add_from_dynobj): Likewise.
7368 (Symbol_table::define_special_symbol): Get target from
7369 parameters.
7370 * symtab.h (class Symbol_table): Update declaration.
7371 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7372 parameter. Change all callers. Clear parameter target.
7373 (Binary_test): Test target here.
7374 * testsuite/object_unittest.cc (gold_testsuite): Remove
7375 target_test_pointer parameter. Change all callers.
7376 (Object_test): Test target here.
7377
a6a22b83
ILT
73782009-09-26 Ian Lance Taylor <iant@google.com>
7379
7380 * testsuite/initpri1.c: Don't try to use constructor priorities if
7381 compiling with gcc before 4.3.
7382
6a8f49fe
ILT
73832009-09-22 Mikolaj Zalewski <mikolajz@google.com>
7384
7385 * testsuite/retain_symbols_file_test.sh (check_present): Change
7386 output file name to retain_symbols_file_test.stdout.
7387 (check_absent): Likewise.
7388
8c604651
CS
73892009-09-18 Craig Silverstein <csilvers@google.com>
7390
7391 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
7392 * options.cc: Include <cerrno> and <fstream>.
7393 (General_options::finalize): Parse -retain-symbols-file tag.
7394 * options.h: New flag.
7395 (General_options): New method should_retain_symbol, new
7396 variable symbols_to_retain.
7397 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
7398 should_retain_symbol map.
7399 * testsuite/Makefile.am (retain_symbols_file_test): New test.
7400 * testsuite/Makefile.in: Regenerate.
7401 * testsuite/retain_symbols_file_test.sh: New file.
7402
ca58b19f
NC
74032009-09-18 Nick Clifton <nickc@redhat.com>
7404
7405 * po/es.po: Updated Spanish translation.
7406
20e6d0d6
DK
74072009-09-17 Doug Kwan <dougkwan@google.com>
7408
7409 * debug.h (DEBUG_RELAXATION): New constant.
7410 (DEBUG_ALL): Add DEBUG_RELAXATION.
7411 (debug_string_to_enum): Add relaxation debug option.
7412 * layout.cc
7413 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
7414 Layout::Relaxation_debug_check::read_sections,
7415 Layout::Relaxation_debug_check::read_sections): New method definitions.
7416 (Layout::Layout): Initialize data members
7417 record_output_section_data_from_scrips_,
7418 script_output_section_data_list_ and relaxation_debug_check_.
7419 (Layout::save_segments, Layout::restore_segments,
7420 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7421 Layout::relaxation_loop_body): New method definitions.
7422 (Layout::finalize): Support relaxation. Move section layout code to
7423 Layout::relaxation_loop_body.
7424 (Layout::set_asection_address_from_script): Move code for orphan
7425 section placement out.
7426 (Layout::place_orphan_sections_in_script): New method definition.
7427 * layout.h (Output_segment_headers, Output_file_header):
7428 New forward class declarations.
7429 (Layout::~Layout): Define.
7430 (Layout::new_output_section_data_from_script): New method definition.
7431 (Layout::place_orphan_sections_in_script): New method declaration.
7432 (Layout::Segment_states): New type declaration.
7433 (Layout::save_segments, Layout::restore_segments,
7434 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7435 Layout::relaxation_loop_body): New method declarations.
7436 (Layout::Output_section_data_list): New type declaration.
7437 (Layout::Relaxation_debug_check): New class definition.
7438 (Layout::record_output_section_data_from_script_,
7439 Layout::script_output_section_data_list_, Layout::segment_states_,
7440 Layout::relaxation_debug_check_): New data members.
7441 * output.cc: (Output_section_headers::do_size): New method definition.
7442 (Output_section_headers::Output_section_headers): Move size
7443 computation to Output_section_headers::do_size.
7444 (Output_segment_headers::do_size): New method definition.
e1df38aa 7445 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
7446 Output_file_header::do_size and call it.
7447 (Output_file_header::do_size): New method definition.
7448 (Output_data_group::Output_data_group): Adjust call to
7449 Output_section_data.
7450 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
7451 (Output_symtab_xindex::do_write): Add array bound check.
7452 (Output_section::Input_section::print_to_mapfile): Handle
7453 RELAXED_INPUT_SECTION_CODE.
7454 (Output_section::Output_section): Initialize data member checkpoint_.
7455 (Output_section::~Output_section): Delete checkpoint object pointed
7456 by checkpoint_.
7457 (Output_section::add_input_section): Always add an Input_section if
7458 relaxing.
7459 (Output_section::add_merge_input_section): Add assert.
7460 (Output_section::relax_input_section): New method definition.
7461 (Output_section::set_final_data_size): Set load address to zero for
7462 an unallocated section.
7463 (Output_section::do_address_and_file_offset_have_reset_values):
7464 New method definition.
7465 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
7466 Handle relaxed input section.
7467 (Output_section::sort_attached_input_sections): Checkpoint input
7468 section list lazily.
7469 (Output_section::get_input_sections): Change type of input_sections to
7470 list of Simple_input_section pointers. Checkpoint input section list
7471 lazily. Also handle relaxed input sections.
7472 (Output_section::add_input_section_for_script): Take a reference to
7473 a Simple_input_section object instead of Relobj pointer and section
7474 index as parameter. Handle relaxed input sections.
7475 (Output_section::save_states, Output_section::restore_states): New
7476 method definitions.
7477 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
7478 (Output_data::is_data_size_fixed): New method definition.
7479 (Output_data::reset_addresss_and_file_offset): Do not reset data size
7480 if it is fixed.
7481 (Output_data::address_and_file_offset_have_reset_values): New method
7482 definition.
7483 (Output_data::do_address_and_file_offset_have_reset_values): New method
7484 definition.
7485 (Output_data::set_data_size): Check that data size is not fixed.
7486 (Output_data::fix_data_size): New method definition.
7487 (Output_data::is_data_size_fixed_): New data member.
7488 (Output_section_headers::set_final_data_size): New method definition.
7489 (Output_section_headers::do_size): New method declaration.
7490 (Output_segment_headers::set_final_data_size): New method definition.
7491 (Output_segment_headers::do_size): New method declaration.
7492 (Output_file_header::set_final_data_size)::New method definition.
7493 (Output_file_header::do_size)::New method declaration.
7494 (Output_section_data::Output_section_data): Add new parameter
7495 is_data_size_fixed and use it to fix data size.
7496 (Output_data_const::Output_data_const): Adjust call to base class
7497 constructor and fix data size.
7498 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
7499 base class constructor and fix data size.
7500 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
7501 base class constructor and fix data size.
7502 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
7503 class constructor and fix data size.
7504 (Output_data_group::set_final_data_size): New method definition.
7505 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
7506 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
7507 class constructor and fix data size.
7508 (Output_relaxed_input_section): New class definition.
7509 (Output_section::Simple_input_section): New class definition.
7510 (Output_section::get_input_sections): Adjust parameter list.
7511 (Output_section::add_input_section_for_script): Same.
7512 (Output_section::save_states, Output_section::restore_states,
7513 Output_section::do_address_and_file_offset_have_reset_values,
7514 (Output_section::Input_section::Input_section): Handle
7515 RELAXED_INPUT_SECTION_CODE. Add new overload for
7516 Output_relaxed_input_section.
7517 (Output_section::Input_section::is_input_section,
7518 Output_section::Input_section::set_output_section): Handle relaxed
7519 input section.
7520 (Output_section::Input_section::is_relaxed_input_section,
7521 Output_section::Input_section::output_section_data,
7522 Output_section::Input_section::relaxed_input_section): New method
7523 definitions.
7524 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
7525 value.
7526 (Output_section::Input_section::u1_): Update comments.
7527 (Output_section::Input_section::u2_): Add new union member poris.
7528 (Output_section::Checkpoint_output_section): New classs definition.
7529 (Output_section::relax_input_section): New method declaration.
7530 (Output_section::checkpoint_): New data member.
7531 (Output_segment): Update comments.
7532 (Output_segment::Output_segment): Un-privatize copy constructor.
7533 (Output_segment::operator=): Un-privatize.
7534 * script-sections.cc (Output_section_element::Input_section_list):
7535 Change element type to Output_section::Simple_input_section.
7536 (Output_section_element_dot_assignment::set_section_addresses):
7537 Register output section data for relaxation clean up.
7538 (Output_data_exression::Output_data_expression): Adjust call to base
7539 constructor to fix data size.
7540 (Output_section_element_data::set_section_addresses): Register
7541 Output_data_expression object for relaxation clean up.
7542 (struct Input_section_info): Replace Relobj pointer and section index
7543 pair with Output_section::Simple_input_section and Convert struct to a
7544 class.
7545 (Input_section_sorter::operator()): Adjust access to
e1df38aa 7546 Input_section_info data member to use accessors.
20e6d0d6
DK
7547 (Output_section_element_input::set_section_addresses): Use layout
7548 parameter. Adjust code to use Output_section::Simple_input_section
7549 and Input_secction_info classes. Register filler for relaxation
7550 clean up.
7551 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
7552 and section index pair with Output_section::Simple_input_section
7553 class. Adjust code accordingly.
7554 (Phdrs_element::release_segment): New method definition.
7555 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
7556 segment list.
7557 (Script_sections::release_segments): New method definition.
7558 * gold/script-sections.h (Script_sections::release_segments): New
7559 method declaration.
7560 * gold/target.h (Target::may_relax, Target::relax,
7561 Target::do_may_relax, Target::do_relax): New method definitions.
7562
5e445df6
ILT
75632009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7564
7565 * arm.cc (has_signed_unsigned_overflow): New function.
7566 (Arm_relocate_functions::abs8): New function.
7567 (Target_arm::Scan::local): Handle R_ARM_ABS8.
7568 (Target_arm::Scan::global): Likewise.
7569 (Target_arm::relocate::relocate): Likewise.
7570 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7571 Likewise.
7572
8c604651 75732009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
7574
7575 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
7576 * testsuite/Makefile.in: Regenerate.
7577
1e9cc1c2
NC
75782009-09-11 Nick Clifton <nickc@redhat.com>
7579
7580 * po/gold.pot: Updated by the Translation project.
7581
6a89f575
CC
75822009-09-08 Cary Coutant <ccoutant@google.com>
7583
7584 * output.cc (Output_file::open): Add execute permission to empty file.
7585 * testsuite/Makefile.am (permission_test): New test.
7586 * testsuite/Makefile.in: Regenerate.
7587
fdcac5af
ILT
75882009-09-02 Ian Lance Taylor <iant@google.com>
7589
7590 * output.cc (Output_file::resize): Call map_no_anonymous rather
7591 than map.
7592
44453f85
ILT
75932009-09-01 Mikolaj Zalewski <mikolajz@google.com>
7594
7595 * gold.cc: Include "incremental.h".
7596 (queue_initial_tasks): Call Incremental_checker methods.
7597 * incremental.cc: Include "output.h".
7598 (Incremental_checker::can_incrementally_link_output_file): New
7599 method.
7600 * incremental.h (Incremental_checker): New class.
7601
7602 * output.cc (Output_file::open_for_modification): New method.
7603 (Output_file::map_anonymous): Changed return type to bool. Record
7604 map in base_ field.
7605 (Output_file::map_no_anonymous): New method, broken out of map.
7606 (Output_file::map): Use map_no_anonymous and map_anonymous.
7607 * output.h (class Output_file): Update declarations.
7608
293c1386
CC
76092009-08-24 Cary Coutant <ccoutant@google.com>
7610
7611 * options.h (Command_line::Pre_options): New class.
7612 (Command_line::pre_options): New member.
7613 * options.cc (gold::options::ready_to_register): New variable.
7614 (One_option::register_option): Do nothing if not registering options.
7615 Assert if same short option registered twice.
7616 (General_options::General_options): Turn off option registration when
7617 done constructing.
7618 (Command_line::Pre_options::Pre_options): New constructor.
7619
f773f3d2
CC
76202009-08-24 Cary Coutant <ccoutant@google.com>
7621
06a73cfe
CC
7622 * options.h (General_options::no_keep_memory): Remove incorrect
7623 short option.
f773f3d2 7624
a15af8e2
RW
76252009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7626
7627 * Makefile.am (am__skiplex, am__skipyacc): New.
7628 * Makefile.in: Regenerate.
7629
c462b41b
RW
76302009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7631
14ec8efd
RW
7632 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7633 (INCLUDES): ... this.
7634 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7635 (AM_CPPFLAGS): Renamed from ...
7636 (INCLUDE): ... this.
7637 * Makefile.in, testsuite/Makefile.in: Regenerate.
7638
81ecdfbb
RW
7639 * Makefile.in: Regenerate.
7640 * aclocal.m4: Likewise.
7641 * config.in: Likewise.
7642 * configure: Likewise.
7643 * testsuite/Makefile.in: Likewise.
7644
c462b41b
RW
7645 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7646 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7647 * Makefile.in: Regenerate.
7648 * testsuite/Makefile.in: Regenerate.
7649
2da73f13
CC
76502009-08-19 Cary Coutant <ccoutant@google.com>
7651
7652 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7653 symbols in shared libraries overridden by hidden or internal symbols
7654 in the main program.
7655
2db70501
CD
76562009-08-19 Chris Demetriou <cgd@google.com>
7657
7658 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7659 checking source file names in error messages.
7660
f733487b
DK
76612009-08-18 Doug Kwan <dougkwan@google.com>
7662
7663 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7664 an elcpp::Ehdr as parameter. Adjust call to set_target.
7665 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7666 an elfcpp::Ehdr as parameter.
7667 * object.cc (Object::set_target): Remove the version that looks up
7668 a target and sets it.
7669 (Sized_relobj::setup): Take a Target object instead of
7670 an elfcpp::Ehdr as parameter. Adjust call to set_target.
7671 (make_elf_sized_object): Find target and ask target to
7672 make an ELF object.
7673 * object.h: (Object::set_target): Remove the version that looks up
7674 a target and sets it.
7675 (Sized_relobj::setup): Take a Target object instead of
7676 an elfcpp:Ehdr as parameter.
7677 * target.cc: Include dynobj.h.
7678 (Target::do_make_elf_object_implementation): New.
7679 (Target::do_make_elf_object): New.
7680 * target.h (Target::make_elf_object): New template declaration.
7681 (Target::do_make_elf_object): New method declarations.
7682 (Target::do_make_elf_object_implementation): New template declaration.
7683
cc70f101
ILT
76842009-08-14 Ian Lance Taylor <iant@google.com>
7685
7686 * gold.h (FUNCTION_NAME): Define.
7687 (gold_unreachable): Use FUNCTION_NAME.
7688
ef5e0cb1
ST
76892009-08-12 Sriraman Tallam <tmsriram@google.com>
7690
7691 * icf.cc (Icf::find_identical_sections): Issue a warning when a
7692 symbol in the --keep-unique list is not found.
7693
48c187ce
ST
76942009-08-12 Sriraman Tallam <tmsriram@google.com>
7695
7696 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
7697 been maked as --keep-unique.
7698 (Icf::unfold_section): New function.
7699 * icf.h (Icf::unfold_section): New function.
7700 * options.h (General_options::keep_unique): New option.
7701 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
7702 * testsuite/Makefile.in: Regenerate.
7703 * testsuite/icf_keep_unique_test.sh: New file.
7704 * testsuite/icf_keep_unique_test.cc: New file.
7705
645afe0c
CC
77062009-08-12 Cary Coutant <ccoutant@google.com>
7707
7708 PR 10471
7709 * resolve.cc (Symbol_table::resolve): Check for references from
7710 dynamic objects to hidden and internal symbols.
7711 * testsuite/Makefile.am (hidden_test.sh): New test.
7712 * testsuite/Makefile.in: Regenerate.
7713 * testsuite/hidden_test.sh: New script.
7714 * testsuite/hidden_test_1.c: New test source.
7715 * testsuite/hidden_test_main.c: New test source.
7716
11af873f
DK
77172009-08-11 Doug Kwan <dougkwan@google.com>
7718
7719 * arm.cc: Update comments.
7720 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
7721 segment to locate the .ARM.exidx section if present.
7722
b9f7d72d
DK
77232009-08-09 Doug Kwan <dougkwan@google.com>
7724
7725 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
7726 patch.
7727
ddd3c53c
ST
77282009-08-07 Sriraman Tallam <tmsriram@google.com>
7729 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
7730 compiler warnings.
7731
27721062
ST
77322009-08-06 Sriraman Tallam <tmsriram@google.com>
7733
7734 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
7735 valid tls_segment only for non-debug-section relocations.
7736 * testsuite/Makefile.am: Add gc_tls_test.
7737 * testsuite/Makefile.in: Regenerate.
7738 * testsuite/gc_tls_test.cc: New file.
7739 * testsuite/gc_tls_test.sh: New file.
7740
ef15dade 77412009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 7742
ef15dade
ST
7743 * icf.cc: New file.
7744 * icf.h: New file.
7745 * Makefile.am (CCFILES): Add icf.cc.
7746 (HFILES): Add icf.h
7747 * Makefile.in: Regenerate.
7748 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
7749 * gc.h (gc_process_relocs): Populate lists used by icf to contain
7750 section, symbol and addend information for the relocs.
7751 * gold.cc (queue_middle_tasks): Call identical code folding.
7752 * gold.h: Add defines for multimap.
7753 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
7754 to the call of finalize_local_symbols.
7755 * main.cc (main): Create object of class Icf.
7756 * object.cc (Sized_relobj::do_layout): Allow this function to be
7757 called twice during icf.
7758 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
7759 to sections marked as identical by icf.
7760 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
7761 when available.
7762 (Sized_relobj::do_section_entsize): New function.
7763 * object.h (Object::section_entsize): New function.
7764 (Object::do_section_entsize): New pure virtual function.
7765 (Relobj::finalize_local_symbols): Add new parameter.
7766 (Relobj::do_section_entsize): New function.
7767 * options.h (General_options::icf): New option.
7768 (General_options::icf_iterations): New option.
7769 (General_options::print_icf_sections): New option.
7770 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
7771 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
7772 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
7773 icf.
7774 * symtab.cc (Symbol_table::is_section_folded): New function.
7775 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
7776 to sections marked as identical by icf.
7777 * symtab.h (Symbol_table::set_icf): New function.
7778 (Symbol_table::icf): New function.
7779 (Symbol_table::is_section_folded): New function.
7780 (Symbol_table::icf_): New data member.
7781 * target-reloc.h (relocate_section): Ignore sections folded by icf.
7782 * testsuite/Makefile.am: Add commands to build icf_test.
7783 * testsuite/Makefile.in: Regenerate.
7784 * testsuite/icf_test.sh: New file.
7785 * testsuite/icf_test.cc: New file.
7786
c3b65ac4
CD
77872009-07-24 Chris Demetriou <cgd@google.com>
7788
7789 * layout.cc (is_compressible_debug_section): Fix incorrect
7790 comment about compressed section names.
7791
1caf2c51
ILT
77922009-07-20 Ian Lance Taylor <ian@airs.com>
7793
7794 PR 10419
7795 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
7796
1ef4d87f
ILT
77972009-07-16 Ian Lance Taylor <iant@google.com>
7798
7799 PR 10400
7800 * layout.h: #include <map>.
7801 (class Kept_section): Change from struct to class. Add accessors
7802 and setters. Add section size to Comdat_group mapping. Change
7803 Comdat_group to std::map. Add is_comdat_ field. Add
7804 linkonce_size field in union.
7805 (class Layout): Update declaration of find_or_add_kept_section.
7806 Don't declare find_kept_object.
7807 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
7808 parameter. Add object, shndx, is_comdat, and is_group_name
7809 parameters. Change all callers. Adjust for new Kept_section.
7810 (Layout::find_kept_object): Remove.
7811 * object.cc (Sized_relobj::include_section_group): Update use of
7812 Kept_section. Rename secnum to shndx. Only record
7813 Kept_comdat_section if sections are the same size.
7814 (Sized_relobj::include_linkonce_section): Update use of
7815 Kept_section. Only record Kept_comdat_section if sections are the
7816 same size. Set size of linkonce section.
7817 (Sized_relobj::map_to_kept_section): Update call to
7818 get_kept_comdat_section.
7819 * object.h (class Sized_relobj): Rename fields in
7820 Kept_comdat_section to drop trailing underscores; change object
7821 field to Relobj*. Change Kept_comdat_section_table to store
7822 struct rather than pointer.
7823 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
7824 Add kept_object and kept_shndx parameters. Change all callers.
7825 (Sized_relobj::get_kept_comdat_section): Change return type to
7826 bool. Add kept_object and kept_shndx parameters. Change all
7827 callers.
7828 * plugin.cc (Pluginobj::include_comdat_group): Update call to
7829 Layout::find_or_add_kept_section.
7830
37c3b7b0
ILT
78312009-07-09 Ian Lance Taylor <iant@google.com>
7832
7833 * merge.cc (Object_merge_map::initialize_input_to_output_map):
7834 Reserve space in the hash table.
7835
98fa85cb
ILT
78362009-07-06 Mikolaj Zalewski <mikolajz@google.com>
7837
7838 * fileread.cc (File_read::get_mtime): New method.
7839 * fileread.h (Timespec): New structure.
7840 (File_read::get_mtime): New method.
7841 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
7842 Renamed from timestamp_nsec.
7843 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
7844 Elf_Xword.
e1df38aa 7845 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 7846 timestamp_nsec.
e1df38aa 7847 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
7848 (Incremental_inputs::report_obejct): Save mtime; style fix.
7849 (Incremental_inputs::report_script): Save mtime; style fix.
7850 (Incremental_inputs::finalize_inputs): Style fix.
7851 (Incremental_inputs::finalize): Style fix.
7852 (Incremental_inputs::create_input_section_data): Store inputs
7853 mtime.
7854 * incremental.h (Incremental_inputs::report_script): Add mtime
7855 argument.
7856 (Incremental_inputs::Input_info::Input_info): Intialize only one
7857 union member.
7858 (Incremental_inputs::Input_info::archive): Move to nameless
7859 union.
7860 (Incremental_inputs::Input_info::obejct): Move to nameless union.
7861 (Incremental_inputs::Input_info::script): Move to nameless union.
7862 (Incremental_inputs::mtime): New field.
7863 * script.cc (read_input_script): Pass file mtime to
7864 Incremental_input.
7865 * script.h (Script_info::inputs): Style fix.
7866
c9d70757
ILT
78672009-07-01 Ian Lance Taylor <ian@airs.com>
7868
7869 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
7870 instead of 32.
7871
9c547ec3
ILT
78722009-06-24 Ian Lance Taylor <iant@google.com>
7873
7874 PR 10156
7875 * layout.cc (Layout::choose_output_section): If we find an
7876 existing section, update the flags.
7877 (Layout::create_notes): New function, broken out of
7878 Layout::finalize.
7879 (Layout::finalize): Don't create note sections.
7880 (Layout::create_note): Don't crash if linker script discards
7881 section.
7882 (Layout::create_gold_note): Likewise.
7883 (Layout::create_build_id): Likewise. Don't set
7884 after_input_sections on the section.
7885 (Layout::create_executable_stack_info): Remove target parameter.
7886 Change caller.
7887 * layout.h (class Layout): Declare create_notes. Update
7888 declaration of create_executable_stack_info.
7889 * gold.cc (queue_middle_tasks): Call create_notes.
7890 * output.cc (Output_section::update_flags_for_input_section): Move
7891 here from output.h. If SHF_ALLOC flag is newly set, mark address
7892 invalid.
7893 * output.h (Output_data::mark_address_invalid): New function.
7894 (class Output_section): Only declare, not define,
7895 update_flags_for_input_section. Remove set_flags.
7896
55458500
ILT
78972009-06-24 Ian Lance Taylor <iant@google.com>
7898
7899 * script-sections.cc (Output_section_definition::
7900 set_section_addresses): Rename shadowing local load_address to
7901 laddr.
7902
1307d6cd
ILT
79032009-06-24 Ian Lance Taylor <iant@google.com>
7904
7905 PR 10244
7906 * reloc.cc (relocate_sections): Skip empty relocation sections.
7907
ec3f783e
ILT
79082009-06-23 Ian Lance Taylor <iant@google.com>
7909
7910 PR 10156
7911 * layout.cc (Layout::create_note): Use choose_output_section
7912 rather than make_output_section.
7913
459c9f1c
ILT
79142009-06-23 Ian Lance Taylor <iant@google.com>
7915
7916 PR 10237
7917 * options.cc (General_options::parse_V): Set printed_version_.
7918 (General_options::General_options): Initialize printed_version_.
7919 * options.h (class General_options): Add printed_version_ field.
7920 * gold.cc (queue_initial_tasks): If there are no input files,
7921 don't give a fatal error if we printed the version information.
7922 (queue_middle_tasks): If using -r with a shared object, give a
7923 fatal error rather than an ordinary error.
7924
1518dc8f
ILT
79252009-06-23 Ian Lance Taylor <iant@google.com>
7926
7927 PR 10219
7928 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7929 (Layout::make_output_section): Set have_stabstr_section_ if we see
7930 a .stab*str section.
7931 (Layout::finalize): Call link_stabs_sections.
7932 (Layout::link_stabs_sections): New file.
7933 * layout.h (class Layout): Add have_stabstr_section_ field.
7934 Declare link_stabs_sections.
7935
3d857b98
DK
79362009-06-23 Doug Kwan <dougkwan@google.com>
7937
7938 * Makefile.am (libgold_a_LIBADD): New.
7939 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7940 * Makefile.in: Regenerate.
7941 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7942 * configure: Regenerate.
7943 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7944 * fileread.cc: Include sys/state.h
7945 * gold.h: Declare memmem and strndup if found missing.
7946 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7947
0639a6f6
ILT
79482009-06-23 Ian Lance Taylor <iant@google.com>
7949
7950 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7951 * configure: Rebuild.
7952
8d63875c
ILT
79532009-06-23 Ian Lance Taylor <iant@google.com>
7954
7955 PR 10147
7956 * object.cc (Object::section_contents): Don't try to get a view if
7957 the section has length zero.
7958 (Object::handle_gnu_warning_section): If the section is empty, use
7959 the name of the section as the warning.
7960
f7c8a183
ILT
79612009-06-23 Ian Lance Taylor <iant@google.com>
7962
7963 PR 10133
7964 * stringpool.h (class Stringpool_template): Add optimize_ field.
7965 (Stringpool_template::set_optimize): New function.
7966 * stringpool.cc (Stringpool_template::Stringpool_template):
7967 Initialize optimize_ field.
7968 (Stringpool_template::set_string_offsets): Test local optimize
7969 fild rather than parameter.
7970 * layout.cc (Layout::Layout): Call set_optimize on the section
7971 name stringpool.
7972
e6a307ba
ILT
79732009-06-22 Ian Lance Taylor <iant@google.com>
7974
7975 PR 10030
7976 * yyscript.y: Parse TARGET.
7977 * script.cc (script_set_target): New function.
7978 * script-c.h (script_set_target): Declare.
7979 * options.cc (General_options::string_to_object_format): Rename
7980 from string_to_object_format in anonymous namespace. Change
7981 callers.
7982 * options.h (class General_options): Declare
7983 string_to_object_format.
7984
3ee173de
ILT
79852009-06-22 Ian Lance Taylor <iant@google.com>
7986
7987 * script-sections.cc (Script_sections::create_segments): Don't put
7988 program headers in a PT_LOAD segment if -n or -N.
7989
79902009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7991
7992 PR 10141
7993 * options.h (class General_options): Add -z lazy and -z now. Sort
7994 -z options into alphabetical order.
7995 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7996
cd6739a1 79972009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7998
7999 * layout.cc (Layout::make_output_section): Call
8000 Target::new_output_section.
8001 (Layout::attach_allocated_section_to_segment): Put large section
8002 sections in a separate load segment with the large segment flag
8003 set.
8004 (Layout::segment_precedes): Sort large data segments after other
8005 load segments.
8006 (align_file_offset): New static function.
8007 (Layout::set_segment_offsets): Use align_file_offset.
8008 * output.h (class Output_section): Add is_small_section_ and
8009 is_large_section_ fields.
8010 (Output_section::is_small_section): New function.
8011 (Output_section::set_is_small_section): New function.
8012 (Output_section::is_large_section): New function.
8013 (Output_section::set_is_large_section): New function.
8014 (Output_section::is_large_data_section): New function.
8015 (class Output_segment): Add is_large_data_segment_ field.
8016 (Output_segment::is_large_data_segment): New function.
8017 (Output_segment::set_is_large_data_segment): New function.
8018 * output.cc (Output_section::Output_section): Initialize new
8019 fields.
8020 (Output_segment::Output_segment): Likewise.
8021 (Output_segment::add_output_section): Add assertion that large
8022 data sections always go in large data segments. Force small data
8023 sections to the end of the list of data sections. Force small BSS
8024 sections to the start of the list of BSS sections. For large BSS
8025 sections to the end of the list of BSS sections.
8026 * symtab.h (class Symbol): Declare is_common_shndx.
8027 (Symbol::is_defined): Check Symbol::is_common_shndx.
8028 (Symbol::is_common): Likewise.
8029 (class Symbol_table): Define enum Commons_section_type. Update
8030 declarations. Add small_commons_ and large_commons_ fields.
8031 * symtab.cc (Symbol::is_common_shndx): New function.
8032 (Symbol_table::Symbol_table): Initialize new fields.
8033 (Symbol_table::add_from_object): Put small and large common
8034 symbols in the right list.
8035 (Symbol_table::sized_finalized_symbol): Check
8036 Symbol::is_common_shndx.
8037 (Symbol_table::sized_write_globals): Likewise.
8038 * common.cc (Symbol_table::do_allocate_commons): Allocate new
8039 common symbol lists. Don't call do_allocate_commons_list if the
8040 list is empty.
8041 (Symbol_table::do_allocate_commons_list): Remove is_tls
8042 parameter. Add comons_section_type parameter. Change all
8043 callers. Handle small and large common symbols.
8044 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
8045 Symbol::is_common_shndx.
8046 * resolve.cc (symbol_to_bits): Likewise.
8047 * target.h (Target::small_common_shndx): New function.
8048 (Target::small_common_section_flags): New function.
8049 (Target::large_common_shndx): New function.
8050 (Target::large_common_section_flags): New function.
8051 (Target::new_output_section): New function.
8052 (Target::Target_info): Add small_common_shndx, large_common_shndx,
8053 small_common_section_flags, and large_common_section_flags
8054 fields.
8055 (Target::do_new_output_section): New virtual function.
8056 * arm.cc (Target_arm::arm_info): Initialize new fields.
8057 * i386.cc (Target_i386::i386_info): Likewise.
8058 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
8059 Likewise.
8060 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
8061 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8062 (Target_x86_64::do_new_output_section): New function.
8063 * configure.ac: Define conditional MCMODEL_MEDIUM.
8064 * testsuite/Makefile.am (check_PROGRAMS): Add large.
8065 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
8066 (large_LDFLAGS): Define.
8067 * testsuite/large.c: New file.
8068 * testsuite/testfile.cc (Target_test::test_target_info):
8069 Initialize new fields.
8070 * configure, testsuite/Makefile.in: Rebuild.
8071
bb04269c
DK
80722009-06-05 Doug Kwan <dougkwan@google.com>
8073
8074 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 8075 * Makefile.in: Regenerate.
bb04269c
DK
8076 * i386.cc (class Target_i386): Define new virtual method to
8077 override do_is_local_label_name in parent.
8078 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8079 local symbols if --discard-locals or -X is given.
8080 * options.h (class General_options): Declare new options
8081 '--discard-locals' and '-X' for discarding locals.
8082 * target.h (class Target): Define new methods is_local_label_name.
8083 Declare new virtual method do_is_local_label_name.
8084 * target.cc: New file.
8085 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8086 (check_SCRIPTS): Add discard_locals_test.sh.
8087 (check_DATA): Add discard_local_tests.syms.
8088 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8089 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8090 * testsuite/Makefile.in: Regenerate.
8091 * testsuite/discard_locals_test.c: New file.
8092 * testsuite/discard_locals_test.sh: Same.
8093
805bb01c
DK
80942009-06-05 Doug Kwan <dougkwan@google.com>
8095
8096 * object.cc (Sized_relobj::Sized_relobj): Initialize
8097 discarded_eh_frame_shndx_ to -1U.
8098 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8099 section.
8100 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8101 a discarded .eh_frame section.
8102 (Sized_relobj::do_finalize_local_symbols): Ditto.
8103 * object.h (class Sized_relobj): Declare new member
8104 discarded_eh_frame_shndx_.
8105 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8106 (local_labels_test.o, local_labels_test): New rules.
8107 * testsuite/Makefile.in: Regenerate.
8108
1dcd334d
DK
81092009-06-04 Doug Kwan <dougkwan@google.com>
8110
8111 * layout.cc (Layout::section_name_mapping): Add mapping for
8112 special ARM sections.
8113
96d49306
DK
81142009-06-03 Doug Kwan <dougkwan@google.com>
8115
8116 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8117 (utils::has_overflow): Same.
8118
dff16297
ILT
81192009-06-03 Ian Lance Taylor <iant@google.com>
8120
8121 * layout.cc (Layout::section_name_mapping): New array, replacing
8122 Layout::linkonce_mapping.
8123 (Layout::section_name_mapping_count): New variable, replacing
8124 Layout::linkonce_mapping_count.
8125 (Layout::linkonce_output_name): Remove.
8126 (Layout::output_section_name): Rewrite.
8127 * layout.h (class Layout): Rename Linkonce_mapping to
8128 Section_name_mapping, linkonce_mapping to section_name_mapping,
8129 linkonce_mapping_count to section_name_mapping_count. Don't
8130 declare linkonce_output_name.
8131
c121c671
DK
81322009-06-03 Doug Kwan <dougkwan@google.com>
8133
8134 * gold/arm.cc (namespace utils): New.
8135 (Target_arm::reloc_is_non_pic): Define new method.
8136 (class Arm_relocate_functions): New.
8137 (Target_arm::Relocate::relocate): Handle relocation types used by
8138 Android.
8139
07800fab
ILT
81402009-06-03 Ian Lance Taylor <iant@google.com>
8141
8142 * arm.cc (Target_arm::scan::global): Use || instead of |.
8143
c121c671
DK
81442009-06-02 Doug Kwan <dougkwan@google.com>
8145
8146 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8147 issued_non_pic_error_.
8148 (class Target_arm::Scan): Declare new method check_non_pic.
8149 Define new method symbol_needs_plt_entry.
8150 Declare new data member issued_non_pic_error_.
8151 (class Target_arm::Relocate): Declare new method
8152 should_apply_static_reloc.
8153 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8154 (Target_arm::Scan::check_non_pic): Define new method.
8155 (Target_arm::Scan::local): Handle a small subset of reloc types used
8156 by Android.
8157 (Target_arm::Scan::local): Same.
8158 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8159
b19b0c6d
ILT
81602009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8161
8162 * incremental.cc (Incremental_inputs::report_command_line): Filter
8163 out --incremental-* options.
8164
94cdfcff
DK
81652009-05-29 Doug Kwan <dougkwan@google.com>
8166
8167 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8168 template class.
8169 (class Target_arm): Update comment.
8170 (Target_arm::Target_arm): Initialize new data members GOT_,
8171 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8172 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8173 and Target_arm::rel_dyn_section.
8174 Declare new_enum Target_arm::Got_type.
8175 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8176 and DYNBSS_.
8177 Update commments for member do_dynsym_value.
8178 (Target_arm::got_size, Target_arm::plt_section,
8179 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8180 new methods inside class defintion.
8181 (Target_arm::got_section): Define new method.
8182 (Target_arm::rel_dyn_section): Same.
8183 (Output_data_plt_arm): New template class.
8184 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8185 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8186 (Output_data_plt_arm::add_entry): Same.
8187 (Output_data_plt_arm::first_plt_entry): Define new
8188 static data member for PLT instruction template.
8189 (Output_data_plt_arm::plt_entry): Same.
8190 (Output_data_plt_arm::do_write): Define new method.
8191 (Target_arm::make_plt_entry): Same.
8192 (Target_arm::do_finalize_sections): Same.
8193 (Target_arm::do_dynsym_value): Same.
8194
4a657b0d
DK
81952009-05-28 Doug Kwan <dougkwan@google.com>
8196
8197 * Makefile.am (TARGETSOURCES): Add arm.cc.
8198 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8199 * Makefile.in: Regenerate.
8200 * arm.cc: New file.
8201 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8202
e7ae8c36
DK
82032009-05-26 Doug Kwan <dougkwan@google.com>
8204
8205 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8206 (General_options::check_excluded_libs): Strip off directories in
8207 archive name before matching like GNU ld does.
8208 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8209 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8210 (exclude_libs_test_LDFLAGS): Add linker option
8211 -Wl,--exclude-libs,libexclude_libs_test_3
8212 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8213 an explicit archive without using -l.
8214 (alt/libexclude_libs_test_3.a): New make rule.
8215 * testsuite/Makefile.in: Regenerate.
8216 * testsuite/exclude_libs_test.c : Declare lib3_default().
8217 (main): Call it.
8218 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8219 * exclude_libs_test_3.c: New file.
8220
f12e7348
NC
82212009-05-26 Nick Clifton <nickc@redhat.com>
8222
8223 * po/id.po: New Indonesian translation.
8224 * po/gold.pot: Updated template file.
8225
4daadc0d
ST
82262009-05-22 Sriraman Tallam <tmsriram@google.com>
8227
e1df38aa 8228 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
8229 gc_comdat_test files. Add -Wl,--gc-sections to build
8230 gc_comdat_test.
8231 * testsuite/Makefile.in: Regenerate.
8232 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8233
531813ad
ST
82342009-05-21 Sriraman Tallam <tmsriram@google.com>
8235
8236 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8237 kept comdat section was garbage collected.
8238 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8239 * testsuite/Makefile.in: Regenerate.
8240 * testsuite/gc_comdat_test.sh: New file.
8241 * testsuite/gc_comdat_test_1.cc: New file.
8242 * testsuite/gc_comdat_test_2.cc: New file.
8243
65514900
CC
82442009-05-19 Doug Kwan <dougkwan@google.com>
8245
8246 * archive.cc (Archive::Archive): Move constructor from archive.h
8247 to here. Initialize no_export_.
8248 (Archive::get_elf_object_for_member): Set no_export flag of object.
8249 * archive.h (Archive::Archive): Move constructor body to
8250 archive.cc.
8251 (Archive::no_export): New method.
8252 (Archive::no_export_): New field.
8253 * object.h (Object::Object): Initialize no_export_ to false.
8254 (Object::no_export, Object::set_no_export): New methods.
8255 (Object::no_export_): New field.
8256 * options.cc (General_options::parse_exclude_libs): New method.
8257 (General_options::check_excluded_libs) Same.
8258 * options.h (exclude_libs): New option.
8259 (General_options::check_excluded_libs): New method declaration.
8260 (General_options::excluded_libs_): New field.
8261 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8262 default or protected visibility if an object has no-export flag set.
8263 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8264 (check_SCRIPTS): Add exclude_libs_test.sh.
8265 (check_DATA): Add exclude_libs_test.syms.
8266 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8267 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8268 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8269 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8270 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8271 libexclude_libs_test_2.a): New rules.
8272 * testsuite/Makefile.in: Regenerate.
8273 * testsuite/exclude_libs_test.c: New file.
8274 * testsuite/exclude_libs_test.sh: Ditto.
8275 * testsuite/exclude_libs_test_1.c: Ditto.
8276 * testsuite/exclude_libs_test_2.c: Ditto.
8277
1b77ea50
ILT
82782009-05-15 Ian Lance Taylor <iant@google.com>
8279
8280 * configure.ac: Check for declarations for cases where libiberty.h
8281 checks HAVE_DECL_xxx.
8282 * configure, config.in: Rebuild.
8283
072fe7ce
ILT
82842009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8285
8286 * gold.h (Incremental_argument_list): Remove (invalid) forward
8287 declaration.
8288 * incremental.cc (Incremental_inputs::report_achive): New method.
8289 (Incremental_inputs::report_object): New method.
8290 (Incremental_inputs::report_script): New method.
8291 (Incremental_inputs::finalize_inputs): New method.
8292 (Incremental_inputs::finalize): Call finalize_inputs().
8293 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8294 Create inputs entries.
8295 * incremental.h (Incremental_input_type): New enum.
8296 (Incremental_inputs::Incremental_input): Initialize new fields.
8297 (Incremental_inputs::report_inputs): New method.
8298 (Incremental_inputs::report_achive): New method.
8299 (Incremental_inputs::report_object): New method.
8300 (Incremental_inputs::report_script): New method.
8301 (Incremental_inputs::finalize_inputs): New method.
8302 (Incremental_inputs::Input_info): New struct.
8303 (Incremental_inputs::Input_info_map): New typedef.
8304 (Incremental_inputs::lock_): New field.
8305 (Incremental_inputs::Inputs_): New field.
8306 (Incremental_inputs::Inputs_map): New field.
8307 * main.cc (main): Call Incremental_input::report_inputs.
8308 * options.h (Input_argument_list): Typedef moved from
8309 Input_arguments.
8310 (Input_file_group::Files): Remove, use ::Input_argument_list.
8311 (Input_file_group::Input_argument_list): Remove, use
8312 ::Input_argument_list.
8313 * plugin.cc (Plugin_manager::add_input_file): Add error in
8314 incremental build.
8315 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8316 functions.
8317 * script.cc (read_input_script): Call
8318 Incremental_input::report_script.
8319 * script.h (Script_info): New class.
8320
b0481b0b
ILT
83212009-04-27 Ian Lance Taylor <iant@google.com>
8322
8323 * x86_64.cc (do_adjust_output_section): Set entsize to
8324 plt_entry_size.
8325
b22a5a41 83262009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
8327
8328 * output.cc (Output_file::close): After short writes, continue
8329 writing from the correct offset in the buffer being written.
8330
40fde488
CD
83312009-04-23 Chris Demetriou <cgd@google.com>
8332
8333 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8334 * configure: Regenerate.
8335 * config.in: Regenerate.
8336 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8337 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8338
3ce2c28e
ILT
83392009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8340
8341 * incremental.cc (Incremental_inputs_header_data): Renamed from
8342 Incremental_input_header_data.
8343 (Incremental_inputs_header_data::data_size): New field.
8344 (Incremental_inputs_header_data::put_input_file_count): Renamed
8345 from input_file_count.
8346 (Incremental_inputs_header_data::put_command_line_offset): Renamed
8347 from command_line_offset.
8348 (Incremental_inputs_header_data::put_reserved): Renamed from
8349 put_reserved.
8350 (Incremental_inputs_entry_data): Renamed from
8351 Incremental_input_entry_data.
8352 (Incremental_inputs_entry_data::data_size): New field.
8353 (Incremental_inputs::report_command_line): New method.
8354 (Incremental_inputs::finalize): New method.
8355 (Incremental_inputs::create_incremental_inputs_data): New method.
8356 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
8357 * incremental.h: New file.
8358 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
8359 (Layout::finalize): Create incremental inputs section in
8360 incremental builds.
8361 (Layout::create_incremental_info_sections): New method.
8362 * layout.h (Layout::incremental_inputs): New method.
8363 (Layout::create_incremental_info_sections): New method.
8364 (Layout::incremental_inputs_): New field.
8365 * main.cc (main): Notify Incremental_input of the command line.
8366
e55bde5e
ILT
83672009-04-01 Ian Lance Taylor <iant@google.com>
8368 Mikolaj Zalewski <mikolajz@google.com>
8369
8370 * gold.h (reserve_unordered_map): Define, three versions, one for
8371 each version of Unordered_map.
8372 * layout.cc (Layout::Layout): Remove options parameter. Add
8373 number_of_input_files parameter. Don't initialize options_.
8374 Initialize number_of_input_files_ and resized_signatures_. Move
8375 sections_are_attached_.
8376 (Layout::layout_group): Reserve space for group_signatures_.
8377 (Layout::find_or_add_kept_section): Change name parameter to be a
8378 reference. Resize signatures_ map when it gets large enough.
8379 (Layout::layout_eh_frame): Use parameters->options() instead of
8380 this->options_.
8381 (Layout::make_output_section): Likewise.
8382 (Layout::attach_allocated_section_to_segment): Likewise.
8383 (Layout::finalize, Layout::create_executable_stack): Likewise.
8384 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
8385 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
8386 * layout.h (class Layout): Update declarations. Remove options_
8387 field. Add number_of_input_files_ and resized_signatures_
8388 fields. Move sections_are_attached_ field.
8389 * main.cc (main): Pass number of input files to Layout
8390 constructor. Don't pass options.
8391
154b857c
ILT
83922009-03-30 Ian Lance Taylor <iant@google.com>
8393
8394 * ffsll.c (ffsll): Correct implementation.
8395
2f35ab9b
ILT
83962009-03-27 Ian Lance Taylor <iant@google.com>
8397
fd03461a
ILT
8398 * ffsll.c: New file.
8399 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
8400 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
8401 * ftruncate.c (ftruncate): Declare before definition.
8402 * mremap.c (mremap): Likewise.
8403 * pread.c (pread): Likewise.
8404 * configure, Makefile.in, config.in: Rebuild.
8405
2f35ab9b
ILT
8406 * mremap.c: New file.
8407 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
8408 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
8409 (mremap): Declare if HAVE_MREMAP is not defined.
8410 * configure, Makefile.in, config.in: Rebuild.
8411
33aea2fd
CC
84122009-03-27 Cary Coutant <ccoutant@google.com>
8413
8414 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
8415 position independent.
8416 * sparc.cc (Target_sparc::check_non_pic): Likewise.
8417 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
8418
6d479619
CC
84192009-03-24 Cary Coutant <ccoutant@google.com>
8420
8421 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
8422 an executable.
8423 (needs_dynamic_reloc): Likewise.
8424
afc06bb8
ILT
84252009-03-24 Ian Lance Taylor <iant@google.com>
8426
8427 * yyscript.y (file_cmd): Recognize EXTERN.
8428 (extern_name_list, extern_name_list_body): New nonterminals.
8429 * script.cc (script_add_extern): Define.
8430 * script-c.h (script_add_extern): Declare.
8431
f6060a4d
ILT
84322009-03-24 Rafael Avila de Espindola <espindola@google.com>
8433
8434 * object.cc (is_elf_object): Define.
8435 * object.h (is_elf_object): Declare.
8436 * archive.cc (Archive::get_elf_object_for_member): Call
8437 is_elf_object.
33aea2fd 8438 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 8439
26736d8e
ILT
84402009-03-24 Elliott Hughes <enh@google.com>
8441
8442 * output.cc (Output_file::map_anonymous): Define.
8443 (Output_file::map): Use map_anonymous. If the regular mmap fails,
8444 try an anonymous one. Report the size if the mmap fails.
8445 * output.h (class Output_file): Declare map_anonymous.
8446
22fd9730
ILT
84472009-03-24 Ian Lance Taylor <iant@google.com>
8448
8449 * target-select.cc (instantiate_target): Don't acquire the lock if
8450 the instantiated_target_ field has already been set.
8451
cb010894
ILT
84522009-03-23 Ian Lance Taylor <iant@google.com>
8453
7f055c20
ILT
8454 * gold-threads.h (class Initialize_lock): Define.
8455 * gold-threads.cc (class Initialize_lock_once): Define.
8456 (initialize_lock_control): New static variable.
8457 (initialize_lock_pointer): New static variable.
8458 (initialize_lock_once): New static function.
8459 (Initialize_lock::Initialize_lock): Define.
8460 (Initialize_lock::initialize): Define.
8461 * target-select.h: Include "gold-threads.h".
8462 (class Target_selector): Add lock_ and initialize_lock_ fields.
8463 Don't define instantiate_target, just declare it.
8464 * target-select.cc (Target_selector::Target_selector): Initialize
8465 new fields.
8466 (Target_selector::instantiate_target): Define.
8467 * descriptors.h: Include "gold-threads.h".
8468 (class Descriptors): Add initialize_lock_ field.
8469 * descriptors.cc (Descriptors::Descriptors): Initialize new
8470 field.
8471 (Descriptors::open): Use initialize_lock_ field
8472 * errors.h (class Errors): Add initialize_lock_ field.
8473 * errors.cc (Errors::Errors): Initialize new field.
8474 (Errors::initialize_lock): Use initialize_lock_ field.
8475 * powerpc.cc (class Target_selector_powerpc): Remove
8476 instantiated_target_ field. In do_recognize call
8477 instantiate_target rather than do_instantiate_target. In
8478 do_instantiate_target just allocate a new target.
8479 * sparc.cc (class Target_selector_sparc): Likewise.
8480
36959681
ILT
8481 * freebsd.h: New file.
8482 * i386.cc: Include "freebsd.h".
8483 (Target_i386): Derive from Target_freebsd rather than
8484 Sized_target.
8485 (Target_selector_i386): Derive from Target_selector_freebsd rather
8486 than Target_selector.
8487 * x86_64.cc: Include "freebsd.h".
8488 (Target_x86_64): Derive from Target_freebsd rather than
8489 Sized_target.
8490 (Target_selector_x86_64): Derive from Target_selector_freebsd
8491 rather than Target_selector.
8492 * target.h (class Target): Add adjust_elf_header and
8493 do_adjust_elf_header.
8494 * output.cc (Output_file_header:: do_sized_write): Call target
8495 adjust_elf_header routine.
8496 * configure.tgt: Set targ_osabi.
8497 * configure.ac: Define GOLD_DEFAULT_OSABI.
8498 * parameters.cc (Parameters::default_target): Pass
8499 GOLD_DEFAULT_OSABI to select_target.
8500 * target-select.h (class Target_selector): Make instantiate_target
8501 protected rather than private.
8502 * Makefile.am (HFILES): Add freebsd.h.
8503 * configure, Makefile.in, config.in: Rebuild.
8504
cb010894
ILT
8505 * merge.cc (do_add_input_section): Correct pend value. Change
8506 message about last entry not being null terminated from error to
8507 warning.
8508
0e879927
ILT
85092009-03-20 Mikolaj Zalewski <mikolajz@google.com>
8510
8511 * incremental.cc: New file.
8512 * Makefile.am (CCFILES): Add incremental.cc.
8513 * Makefile.in: Rebuild.
8514
41105937
PP
85152009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
8516
8517 * layout.cc (Layout::output_section_name): Preserve names
8518 of '.note.' sections.
e1df38aa 8519
60439920
ILT
85202009-03-19 Ian Lance Taylor <iant@google.com>
8521
8522 * descriptors.cc (Descriptors::open): Check that the options are
8523 valid before using them.
8524
0d371ad3
ILT
85252009-03-18 Ian Lance Taylor <iant@google.com>
8526
8527 * script-sections.h: Include <list>.
8528 (class Script_sections): Change Sections_elements from std::vector
8529 to std::list. Typedef public Elements_iterator. Add
8530 orphan_section_placement_, data_segment_align_start_, and
8531 saw_data_segment_align_ fields. Remove data_segment_align_index_
8532 field.
8533 * script-sections.cc (class Orphan_section_placement): New class.
8534 (class Sections_element): Add virtual functions is_relro and
8535 orphan_section_init. Remove virtual function place_orphan_here.
8536 (class Output_section_definition): Add is_relro and
8537 orphan_section_init. Remove place_orphan_here.
8538 (class Orphan_output_section): Likewise.
8539 (Script_sections::Script_sections): Update for field changes.
8540 (Script_sections::data_segment_align): Set saw_data_segment_align_
8541 and data_segment_align_start_, not data_segment_align_index.
8542 (Script_sections::data_segment_relro_end): Check
8543 saw_data_segment_align_. Use data_segment_align_start_ rather
8544 than data_segment_align_index_.
8545 (Script_sections::place_orphan): Rewrite to use
8546 Orphan_section_placement.
8547
9201d894
ILT
85482009-03-17 Ian Lance Taylor <iant@google.com>
8549
9c5b8369
ILT
8550 * archive.cc (Archive::add_symbols): Check for a version attached
8551 to the symbol name in the archive map.
8552 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
8553 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
8554 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
8555 (ver_test_11.a): New target.
8556 * testsuite/Makefile.in: Rebuild.
8557
9201d894
ILT
8558 * configure.ac: Check for chsize and posix_fallocate. Replace
8559 ftruncate.
8560 * ftruncate.c: New file, from gnulib.
8561 * output.cc (posix_fallocate): Define dummy version if not
8562 HAVE_POSIX_FALLOCATE.
8563 (Output_file::map): Call posix_fallocate rather than lseek and
8564 write.
8565 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
8566 * configure, Makefile.in, config.in: Rebuild.
8567
ef4ab7a8 85682009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 8569
ef4ab7a8
PP
8570 * layout.h (Layout::create_note): Add section_name parameter.
8571 * layout.cc (Layout::create_note): Likewise.
8572 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 8573
8c500701
ILT
85742009-03-17 Ian Lance Taylor <iant@google.com>
8575
e85b18e1
ILT
8576 * descriptors.cc: Include "options.h".
8577 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
8578 (Descriptors::open): Always use O_CLOEXEC when opening a new
8579 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
8580 then set FD_CLOEXEC.
8581
9efe6174
ILT
8582 * sparc.cc (class Target_sparc): Add has_got_section.
8583 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
8584 make sure we have a GOT section.
8585
8586 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
8587 (Target_sparc::Scan::local): Likewise.
8588 (Target_sparc::Scan::global): Likewise.
8589 (Target_sparc::Relocate::relocate): Likewise.
8590 (Target_sparc::Relocate::relocate_tls): Likewise.
8591
8c500701
ILT
8592 * symtab.cc (Symbol_table::define_default_version): New function,
8593 broken out of add_from_object.
8594 (Symbol_table::add_from_object): Call define_default_version.
8595 (Symbol_table::define_special_symbol): Add resolve_oldsym
8596 parameter. Change all callers. If the version for a symbol comes
8597 from a version script, resolve it with the symbol with the same
8598 name with no version. Also add the symbol without a version if
8599 appropriate.
8600 (do_define_in_output_data): If resolving with oldsym, don't delete
8601 sym.
8602 (do_define_in_output_segment): Likewise.
8603 (do_define_as_constant): Likewise.
8604 * symtab.h (class Symbol_table): Update declarations.
8605
f1ed28fb
ILT
86062009-03-13 Ian Lance Taylor <iant@google.com>
8607
15f8229b
ILT
8608 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8609 (Read_symbols::requeue): New function.
8610 (Read_symbols::do_read_symbols): If make_elf_object fails because
8611 the target type is not configured, and the file was searched for,
8612 issue a warning and retry with the next directory.
8613 (Add_symbols::run): If the file has an incompatible format, and
8614 it was searched for, requeue the Read_symbols task. On error,
8615 release the object.
8616 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8617 dirindex parameter to constructor. Change all callers. Declare
8618 incompatible_warning and requeue.
8619 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8620 input_argument_ and input_group_ fields. Add them to
8621 constructor. Change all callers.
8622 (class Read_script): Add dirindex_ field. Add it to constructor.
8623 Change all callers.
8624 * archive.cc (Archive::setup): Remove input_objects parameter.
8625 Change all callers.
8626 (Archive::get_file_and_offset): Likewise.
8627 (Archive::read_all_symbols): Likewise.
8628 (Archive::read_symbols): Likewise.
8629 (Archive::get_elf_object_for_member): Remove input_objects
8630 parameter. Add punconfigured parameter. Change all callers.
8631 (Archive::add_symbols): Change return type to bool. Check return
8632 value of include_member.
8633 (Archive::include_all_members): Likewise.
8634 (Archive::include_member): Change return type to bool. Return
8635 false if first included object has incompatible target. Set
8636 included_member_ field.
8637 (Add_archive_symbols::run): If add_symbols returns false, requeue
8638 Read_symbols task.
8639 * archive.h (class Archive): Add included_member_ field.
8640 Initialize it in constructor. Add input_file and searched_for
8641 methods. Update declarations.
8642 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8643 input_argument_ fields. Add them to constructor. Change all
8644 callers.
8645 * script.cc: Include "target-select.h".
8646 (class Parser_closure): Add skip_on_incompatible_target_ and
8647 found_incompatible_target_ fields. Add
8648 skip_on_incompatible_target parameter to constructor. Change all
8649 callers. Add methods skip_on_incompatible_target,
8650 clear_skip_on_incompatible_target, found_incompatible_target, and
8651 set_found_incompatible_target.
8652 (read_input_script): Add dirindex parameter. Change all callers.
8653 If parser finds an incompatible target, requeue Read_symbols
8654 task.
8655 (script_set_symbol): Clear skip_on_incompatible_target in
8656 closure.
8657 (script_add_assertion, script_parse_option): Likewise.
8658 (script_start_sections, script_add_phdr): Likewise.
8659 (script_check_output_format): New function.
8660 * script.h (read_input_script): Update declaration.
8661 * script-c.h (script_check_output_format): Declare.
8662 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8663 (ignore_cmd): Remove OUTPUT_FORMAT.
8664 * fileread.cc (Input_file::Input_file): Add explicit this.
8665 (Input_file::will_search_for): New function.
8666 (Input_file::open): Add pindex parameter. Change all callers.
8667 * fileread.h (class Input_file): Add input_file_argument method.
8668 Declare will_search_for. Update declarations.
8669 * object.cc (make_elf_object): Add punconfigured parameter.
8670 Change all callers.
8671 * object.h (class Object): Make input_file public. Add
8672 searched_for method.
8673 (make_elf_object): Update declaration.
8674 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8675 restart search.
8676 * dirsearch.h (class Dirsearch): Update declaration.
8677 * options.h (class General_options): Add --warn-search-mismatch.
8678 * parameters.cc (Parameters::is_compatible_target): New function.
8679 * parameters.h (class Parameters): Declare is_compatible_target.
8680 * workqueue.cc (Workqueue::add_blocker): New function.
8681 * workqueue.h (class Workqueue): Declare add_blocker.
8682
f1ed28fb
ILT
8683 * fileread.cc (Input_file::open): Remove options parameter.
8684 Change all callers.
8685 (Input_file::open_binary): Likewise.
8686 * script.cc (read_input_script): Likewise.
8687 * readsyms.h (class Read_symbols): Remove options_ field. Remove
8688 options parameter from constructor. Change all callers.
8689 (class Read_script): Likewise.
8690 * fileread.h (class Input_file): Update declarations.
8691 * script.h (read_input_script): Update declaration.
8692
34dd024a
NC
86932009-03-10 Nick Clifton <nickc@redhat.com>
8694
8695 * po/es.po: New Spanish translation.
8696
6d71b17c
CC
86972009-03-06 Cary Coutant <ccoutant@google.com>
8698
8699 * options.cc (parse_short_option): Keep dash_z from registering itself.
8700
031cdbed
ILT
87012009-03-03 Ian Lance Taylor <iant@google.com>
8702
8703 PR 9918
8704 * target-reloc.h (relocate_section): Pass output_section to
8705 relocate.
8706 * i386.cc (Target_i386::should_apply_static_reloc): Add
8707 output_section parameter. Change all callers.
8708 (Target_i386::Relocate::relocate): Add output_section parameter.
8709 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8710 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
8711 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
8712 * testsuite/two_file_shared.sh: New script.
8713 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
8714 (check_DATA): Add two_file_shared.dbg.
8715 (two_file_shared.dbg): New target.
8716 * testsuite/Makefile.in: Rebuild.
8717
15d5fa16
ILT
87182009-03-01 Ian Lance Taylor <iant@google.com>
8719
8720 * configure.ac: Check for byteswap.h.
8721 * configure: Rebuild.
8722 * config.in: Rebuild.
8723
8a4c0b0d
ILT
87242009-03-01 Mikolaj Zalewski <mikolajz@google.com>
8725
8726 * layout.cc (Layout::find_or_add_kept_section): New function.
8727 (Layout::add_comdat): Removed.
8728 * layout.h (struct Kept_section): Move out of class Layout.
8729 Remove trailing underscores from field names. Add group_sections
8730 field. Rename group_ field to is_group. Change all uses.
8731 (class Layout): Declare find_or_add_kept_section, not add_comdat.
8732 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
8733 comdat_groups_ field.
8734 (Sized_relobj::include_section_group): Use
8735 find_or_add_kept_section and Kept_section::group_sections.
8736 (Sized_relobj::include_linkonce_section): Likewise.
8737 * object.cc (class Sized_relobj): Don't define Comdat_group or
8738 Comdat_group_table. Remove find_comdat_group and
8739 add_comdat_group. Remove comdat_groups_ field.
8740 * plugin.cc (include_comdat_group): Use
8741 Layout::find_or_add_kept_section.
8742
b4ecf66b
ILT
87432009-02-28 Ian Lance Taylor <iant@google.com>
8744
14359ca0
ILT
8745 * README: --gc-sections and map files are now supported. Document
8746 some build requirements.
8747
b4ecf66b
ILT
8748 PR 6992
8749 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
8750 relocatable link set the value of the section symbol to zero.
8751 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
8752 relocatable link don't include the section address in the local
8753 symbol value.
8754
0602e05a
ILT
87552009-02-27 Ian Lance Taylor <iant@google.com>
8756
fd9d194f
ILT
8757 PR 6811
8758 * options.h (class Search_directory): Add is_system_directory.
8759 (class General_options): Declare is_in_system_directory.
8760 * options.cc (get_relative_sysroot): Make static.
8761 (get_default_sysroot): Make static.
8762 (General_optoins::is_in_system_directory): New function.
8763 * fileread.cc (Input_file::is_in_system_directory): New function.
8764 * fileread.h (class Input_file): Declare is_in_system_directory.
8765 * object.h (class Object): Add is_in_system_directory.
8766 (class Input_objects): Remove system_library_directory_ field.
8767 * object.cc (Input_objects::add_object): Don't set
8768 system_library_directory_.
8769 (input_objects::found_in_system_library_directory): Remove.
8770 * symtab.cc (Symbol_table::write_globals): Remove input_objects
8771 parameter. Change all callers.
8772 (Symbol_table::sized_write_globals): Likewise.
8773 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
8774 Call Object::is_in_system_directory.
8775 * symtab.h (class Symbol_table): Update declarations.
8776
61edd21f
ILT
8777 PR 5990
8778 * descriptors.h (Open_descriptor): Add is_on_stack field.
8779 * descriptors.cc (Descriptors::open): If the descriptor is on the
8780 top of the stack, remove it. Initialize is_on_stack field.
8781 (Descriptors::release): Only add pod to stack if it is not on the
8782 stack already.
8783 (Descriptors::close_some_descriptor): Clear stack_next and
8784 is_on_stack fields.
8785
e29e076a
ILT
8786 PR 7091
8787 * output.cc (Output_section::find_starting_output_address): Rename
8788 from starting_output_address; add PADDR parameter; change return
8789 type.
8790 * output.h (class Output_section): Declare
8791 find_starting_output_address instead of starting_output_address.
8792 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
8793 section symbol for which we can't find a merge section.
8794
0602e05a
ILT
8795 PR 9836
8796 * symtab.cc (Symbol_table::add_from_object): If the visibility is
8797 hidden or internal, force the symbol to be local.
8798 * resolve.cc (Symbol::override_visibility): Define.
8799 (Symbol::override_base): Use override_visibility.
8800 (Symbol_table::resolve): Likewise.
8801 (Symbol::override_base_with_special): Likewise.
8802 (Symbol_table::override_with_special): If the visibility is hidden
8803 or internal, force the symbol to be local.
8804 * symtab.h (class Symbol): Add set_visibility and
8805 override_visibility.
8806 * testsuite/ver_test_1.sh: New file.
8807 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
8808 (check_DATA): Add ver_test_1.syms.
8809 (ver_test_1.syms): New target.
8810 * testsuite/Makefile.in: Rebuild.
8811
401a9a73
CC
88122009-02-25 Cary Coutant <ccoutant@google.com>
8813
8814 * layout.cc (Layout::choose_output_section): Don't rename sections
8815 when using a linker script that has a SECTIONS clause.
8816 * Makefile.in: Regenerate.
8817
8818 * testsuite/Makefile.am (script_test_5.sh): New test case.
8819 * testsuite/Makefile.in: Regenerate.
8820 * testsuite/script_test_5.cc: New file.
8821 * testsuite/script_test_5.sh: New file.
8822 * testsuite/script_test_5.t: New file.
8823
f488e4b0
CC
88242009-02-13 Rafael Avila de Espindola <espindola@google.com>
8825
8826 * archive.cc (Archive::include_member): Update calls to add_symbols.
8827 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
8828 the Layout argument.
8829 * dynobj.h (do_add_symbols): Add the Layout argument.
8830 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
8831 Layout argument.
8832 * object.h (Object::add_symbols): Add the Layout argument.
8833 (Object::do_add_symbols): Add the Layout argument.
8834 (Sized_relobj::do_add_symbols): Add the Layout argument.
8835 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
8836 Unify the two versions.
8837 (Add_plugin_symbols): Remove.
8838 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
8839 (Sized_pluginobj::do_add_symbols): Unify the two versions.
8840 (Add_plugin_symbols): Remove.
8841 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
8842 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
8843 (Add_symbols::run): Make it work with Pulginobj.
8844
89dd1680
ILT
88452009-02-06 Ian Lance Taylor <iant@google.com>
8846
8847 * object.cc (Sized_relobj::do_layout): Make info message start
8848 with lower case letter.
8849
266d0a74
ILT
88502009-02-06 Mikolaj Zalewski <mikolajz@google.com>
8851
602b464e
ILT
8852 * binary.cc: Fix file comment.
8853
266d0a74
ILT
8854 * options.h (enum Incremental_disposition): Define.
8855 (class General_options): Add new options: --incremental,
8856 --incremental_changed, --incremental_unchanged,
8857 --incremental_unknown. Add incremental_disposition_ and
8858 implicit_incremental_ fields.
8859 (General_options::incremental_disposition): New function.
8860 (class Position_dependent_options): Add incremental_disposition
8861 option.
8862 (Position_dependent_options::copy_from_options): Set incremental
8863 dispositions.
8864 * options.cc (General_options::parse_incremental_changed): New
8865 function.
8866 (General_options::parse_incremental_unchanged): New function.
8867 (General_options::parse_incremental_unknown): New function.
8868 (General_options::General_options): Initialize new fields
8869 incremental_disposition_ and implicit_incremental_.
8870 (General_options::finalize): Check for uasge of --incremental-*
8871 without --incremental.
8872
f073bbf7
CD
88732009-02-06 Chris Demetriou <cgd@google.com>
8874
8875 * gold.h (gold_undefined_symbol): Change to take only a Symbol
8876 pointer and to report location as the file name associated with
8877 the symbol.
8878 (gold_undefined_symbol_at_location): New function to replace the
8879 old gold_undefined_symbol functionality.
8880 * target-reloc.h (relocate_section): Update to use
8881 gold_undefined_symbol_at_location.
8882 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8883 Call gold_undefined_symbol function rather than gold_error.
8884 * errors.h (Errors::undefined_symbol): Take location as a
8885 string, rather than calculating it from a relocation.
8886 * errors.cc (Errors::fatal): Print "fatal error:" before the
8887 formatted message.
8888 (Errors::error, Errors::error_at_location): Print "error: "
8889 before the formatted message.
8890 (Errors::undefined_symbol): Take location as a string, rather
8891 than calculating it from a relocation.
8892 (gold_undefined_symbol_at_location): New function akin to
8893 old gold_undefined_symbol, calculates location from relocation.
8894 (gold_undefined_symbol): Change to take only a Symbol pointer
8895 and to report location as the file name associated with the symbol.
8896 * testsuite/debug_msg.sh: Update for changed error messages.
8897 * testsuite/undef_symbol.sh: Likewise.
8898
8e94a90c
ILT
88992009-02-04 Duncan Sands <baldrick@free.fr>
8900
8901 PR 9812
8902 * reduced_debug_output.h
8903 (Output_reduced_debug_abbrev_section::failed): Use format for
8904 gold_warning.
8905 (Output_reduced_debug_info_section::faild): Likewise.
8906
88a0e15b
ILT
89072009-01-31 Mikolaj Zalewski <mikolajz@google.com>
8908
8909 * script.cc (Lazy_demangler): New class.
8910 (Version_script_info::get_symbol_version_helper): Demangle a
8911 symbol only once.
8912
5efc7cd2
CC
89132009-01-29 Cary Coutant <ccoutant@google.com>
8914
8915 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
8916 to __tls_get_addr.
8917 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8918
e0ebcf42
ILT
89192009-01-28 Ian Lance Taylor <iant@google.com>
8920
5efc7cd2 8921 * version.cc (version_string): Bump to 1.9.
75fe7426 8922
e0ebcf42
ILT
8923 * gold.h: Include <cstring> and <stdint.h>.
8924 * version.cc: Include <cstdio>.
8925 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8926 warning.
8927 * reduced_debug_output.cc (insert_into_vector): Rename from
8928 Insert_into_vector; change all callers. Use Swap_unaligned to
8929 avoid aliasing issue; remove union since it is unnecessary.
8930
8e2813be 89312009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8932
8933 * Makefile.am (CCFILES): Add gc.cc.
8934 (HFILES): Add gc.h.
8935 * Makefile.in: Regenerate.
8936 * gold.cc (Gc_runner): New class.
8937 (queue_initial_tasks): Call garbage collection related tasks
8938 when corresponding options are invoked.
8939 (queue_middle_gc_tasks): New function.
8940 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8941 processed early before laying out sections during garbage collection.
8942 * gold.h (queue_middle_gc_tasks): New function.
8943 (is_prefix_of): Move from "layout.cc".
8944 * i386.cc (Target_i386::gc_process_relocs): New function.
8945 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8946 * main.cc (main): Create object of class "Garbage_collection".
8947 * object.cc (Relobj::copy_symbols_data): New function.
8948 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8949 (Sized_relobj::do_layout): Allow this function to be called twice
8950 during garbage collection and defer layout of section during the
6d03d481
ST
8951 first call.
8952 * object.h (Relobj::get_symbols_data): New function.
8953 (Relobj::is_section_name_included): New function.
8954 (Relobj::copy_symbols_data): New function.
8955 (Relobj::set_symbols_data): New function.
8956 (Relobj::get_relocs_data): New function.
8957 (Relobj::set_relocs_data): New function.
8958 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8959 (Relobj::gc_process_relocs): New function.
8960 (Relobj::do_gc_process_relocs): New pure virtual function.
8961 (Relobj::sd_): New data member.
8962 (Sized_relobj::is_output_section_offset_invalid): New function.
8963 (Sized_relobj::do_gc_process_relocs): New function.
8964 * options.h (General_options::gc_sections): Modify to not be a no-op.
8965 (General_options::print_gc_sections): New option.
8966 * plugin.cc (Plugin_finish::run): Remove function call to
8967 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8968 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8969 * reloc.cc (Read_relocs::run): Add task to process relocs and
8970 determine unreferenced sections when doing garbage collection.
8971 (Gc_process_relocs): New class.
8972 (Sized_relobj::do_gc_process_relocs): New function.
8973 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8974 sections that are garbage collected.
8975 * reloc.h (Gc_process_relocs): New class.
8976 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8977 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8978 symbols whose corresponding sections are garbage collected.
8979 (Symbol_table::Symbol_table): Add new parameter for the garbage
8980 collection object.
8981 (Symbol_table::gc_mark_undef_symbols): New function.
8982 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8983 (Symbol_table::gc_mark_dyn_syms): New function.
8984 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8985 as garbage.
8986 (Symbol_table::add_from_object): Likewise.
8987 (Symbol_table::add_from_relobj): When building shared objects, do not
8988 treat externally visible symbols as garbage.
8989 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8990 table information for static and relocatable links.
8991 * symtab.h (Symbol_table::set_gc): New function.
8992 (Symbol_table::gc): New function.
8993 (Symbol_table::gc_mark_undef_symbols): New function.
8994 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8995 (Symbol_table::gc_mark_dyn_syms): New function.
8996 (Symbol_table::gc_): New data member.
e1df38aa 8997 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8998 function.
8999 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
9000 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
9001
3b293544
CF
90022009-01-20 Chris Faylor <me.sourceware@sourceware.org>
9003
9004 * options.h (General_options::gc_sections): Define as a no-op for now.
9005 (General_options::no_keep_memory): Ditto.
9006 (General_options::Bshareable): Define.
9007 * options.cc (General_options::finalize): Honor -Bshareable.
9008
83d22aa8
AS
90092009-01-20 Andreas Schwab <schwab@suse.de>
9010
9011 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
9012 read the value in the contents, since we don't use it. Use the
9013 template endianness when writing.
9014 (Relocate::relocate): Use it for R_PPC_REL16_HA.
9015
cd536b21
AS
90162009-01-19 Andreas Schwab <schwab@suse.de>
9017
9018 * configure.tgt (powerpc64-*): Fix targ_obj.
9019
99e9a495
ILT
90202009-01-15 Ian Lance Taylor <iant@google.com>
9021
9022 * object.cc (Sized_relobj::write_local_symbols): Don't write out
9023 local symbols when stripping all symbols.
9024
bbbfea06
CC
90252009-01-14 Cary Coutant <ccoutant@google.com>
9026
99e9a495 9027 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 9028
0f7c0701
CC
90292009-01-14 Cary Coutant <ccoutant@google.com>
9030
9031 * archive.cc (Archive::get_elf_object_for_member): Remove call
9032 to File_read::claim_for_plugin.
9033 * descriptors.cc (Descriptors::open): Remove reference to
9034 is_claimed.
9035 (Descriptors::claim_for_plugin): Remove.
9036 * descriptors.h (Descriptors::claim_for_plugin): Remove.
9037 (Descriptors::is_claimed): Remove.
9038 (claim_descriptor_for_plugin): Remove.
9039 * fileread.cc (File_read::claim_for_plugin): Remove.
9040 * fileread.h (File_read::claim_for_plugin): Remove.
9041 (File_read::descriptor): Reopen descriptor if necessary.
9042 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
9043 (Plugin_manager::all_symbols_read): Add task parameter. Change
9044 all callers.
9045 (Plugin_manager::get_input_file): New function.
9046 (Plugin_manager::release_input_file): New function.
9047 (Pluginobj::Pluginobj): Add filesize parameter and initialize
9048 corresponding data member.
9049 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
9050 and pass to base constructor. Change all callers.
9051 (get_input_file, release_input_file): New functions.
9052 (make_sized_plugin_object): Add filesize parameter. Change all callers.
9053 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
9054 (Plugin_manager::all_symbols_read): Add task parameter.
9055 (Plugin_manager::get_input_file): New function.
9056 (Plugin_manager::release_input_file): New function.
9057 (Plugin_manager::task_): New data member.
9058 (Pluginobj::Pluginobj): Add filesize parameter.
9059 (Pluginobj::filename): New function.
9060 (Pluginobj::descriptor): New function.
9061 (Pluginobj::filesize): New function.
9062 (Pluginobj::filesize_): New data member.
9063 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
9064 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
9065 File_read::claim_for_plugin; use Object::unlock to unlock the file.
9066
9067 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
9068 with archive libraries.
9069 * testsuite/Makefile.in: Regenerate.
9070 * testsuite/plugin_test.c (struct sym_info): New type.
9071 (get_input_file, release_input_file): New static variables.
9072 (onload): Capture new transfer vector entries.
9073 (claim_file_hook): Stop reading at end of file according to filesize.
9074 Factor out parsing of readelf output into separate function.
9075 (all_symbols_read_hook): Exercise get_input_file and release_input_file
9076 APIs and get the source file name from the symbol table. Convert
9077 source file name to corresponding object file name. Print info
9078 message when adding new input files.
9079 (parse_readelf_line): New function.
9080 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9081 * testsuite/plugin_test_2.sh: Likewise.
9082 * testsuite/plugin_test_3.sh: Likewise.
9083 * testsuite/plugin_test_4.sh: New test case.
9084
62a6d109
ILT
90852009-01-07 Ian Lance Taylor <iant@google.com>
9086
9087 * version.cc (version_string): Bump to 1.8.
9088
483620e8
CC
90892008-12-23 Cary Coutant <ccoutant@google.com>
9090
9091 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9092 * plugin.cc (Plugin_manager::finish): Rename as
9093 layout_deferred_objects. Move cleanup to separate function.
9094 (Plugin_manager::cleanup): New function.
9095 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9096 separately.
9097 * plugin.h (Plugin_manager::finish): Rename as
9098 layout_deferred_objects.
9099 (Plugin_manager::cleanup): New function.
9100 (Plugin_manager::cleanup_done): New field.
9101
d66a9eb3
CC
91022008-12-23 Cary Coutant <ccoutant@google.com>
9103
9104 * plugin.cc (is_visible_from_outside): New function.
9105 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9106 so we don't return "IR only" status for exported symbols or -r links.
9107
9108 * testsuite/Makefile.am (plugin_test_3): New test case.
9109 * testsuite/Makefile.in: Regenerate.
9110 * testsuite/plugin_test_3.sh: New file.
9111
5995b570
CC
91122008-12-22 Cary Coutant <ccoutant@google.com>
9113
9114 * object.cc (Sized_relobj::layout_section): New function.
9115 (Sized_relobj::do_layout): Defer layout of input sections until after
9116 plugin has provided replacement files.
9117 (Sized_relobj::do_layout_deferred_sections): New function.
9118 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9119 (Relobj::layout_deferred_sections): New function.
9120 (Relobj::do_layout_deferred_sections): New function.
9121 (Sized_relobj::do_layout_deferred_sections): New function.
9122 (Sized_relobj::layout_section): New function.
9123 (Sized_relobj::Deferred_layout): New structure.
9124 (Sized_relobj::deferred_layout_): New field.
9125 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9126 Change all callers. Layout deferred sections.
9127 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9128 references.
9129 (Plugin_hook::run): Move code from do_plugin_hook inline.
9130 (Plugin_hook::do_plugin_hook): Remove.
9131 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9132 (Plugin_manager::finish): Renamed, was cleanup.
9133 (Plugin_manager::should_defer_layout): New function.
9134 (Plugin_manager::add_deferred_layout_object): New function.
9135 (Plugin_manager::Deferred_layout_list): New type.
9136 (Plugin_manager::deferred_layout_objects_): New field.
9137 (Plugin_hook::do_plugin_hook): Remove.
9138
ee769c88
ILT
91392008-12-17 Ian Lance Taylor <iant@google.com>
9140
9141 * options.h (class General_options): Add --no case for
9142 --export-dynamic.
9143
abc8dcba
CC
91442008-12-16 Cary Coutant <ccoutant@google.com>
9145
9146 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9147 vector.
9148 (Plugin_manager::claim_file): Create plugin object even if
9149 plugin did not call the add_symbols callback.
9150 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9151 asking for more symbols than were added.
9152 * testsuite/Makefile.am (plugin_test_1): Add test case with
9153 no global symbols.
9154 (empty.syms): New target.
9155 * testsuite/Makefile.in: Regenerate.
9156 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9157 message. Don't call add_symbols if no globals.
9158 (all_symbols_read_hook): Don't provide replacement for empty
9159 claimed file.
9160
b0074644
ILT
91612008-12-12 Ian Lance Taylor <iant@google.com>
9162
68943102
ILT
9163 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9164 r_type == 0 for a local symbol with r_sym == 0.
9165 (scan_relocatable_relocs): Pass r_sym to
9166 local_non_section_strategy.
9167 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9168 r_sym parameter.
9169
b0074644
ILT
9170 * configure.ac: Update test for TLS descriptors: they are
9171 supported as of glibc 2.9.
9172 * configure: Rebuild.
9173
c2508178
ILT
91742008-12-11 Ian Lance Taylor <iant@google.com>
9175
9176 PR 7091
9177 * target-reloc.h (Default_scan_relocatable_relocs): For each
9178 function, map r_type == 0 to RELOC_DISCARD.
9179
2756a258
CC
91802008-12-10 Cary Coutant <ccoutant@google.com>
9181
9182 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9183 object to override a kept COMDAT group from a plugin object.
9184
bb6f53d3
ILT
91852008-12-09 Ian Lance Taylor <iant@google.com>
9186
fbc558e1
ILT
9187 PR 7088
9188 * yyscript.y (file_cmd): Handle INPUT.
9189
bb6f53d3
ILT
9190 * testsuite/initpri1.c: Change all declarations to be full
9191 prototypes by adding void, to avoid compiler warnings.
9192
4674ecfc
CC
91932008-12-05 Rafael Avila de Espindola <espindola@google.com>
9194
9195 * options.cc (General_options::parse_plugin_opt): New.
9196 (General_options::add_plugin): The argument now is just the filename.
9197 (General_options::add_plugin_option): New.
9198 * options.h (plugin_opt): New.
9199 (add_plugin): Change argument name.
9200 (add_plugin_option): New.
9201 * plugin.cc (Plugin::load): Don't parse the plugin option.
9202 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9203 (Plugin::add_option): New.
9204 (Plugin::args_): Change type.
9205 (Plugin::filename_): New.
9206 (Plugin_manager::add_plugin_option): New.
9207 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9208 * testsuite/Makefile.in: Regenerate.
9209
fd06b4aa
CC
92102008-12-05 Cary Coutant <ccoutant@google.com>
9211
9212 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9213 Handle --strip-lto-sections option.
9214 * options.h (strip_lto_sections): New option.
9215
6c52134c
CC
92162008-12-01 Cary Coutant <ccoutant@google.com>
9217
9218 * plugin.cc (ld_plugin_message): Change format parameter to const.
9219 Fix mismatch between new[] and delete.
9220
a45248e0
CC
92212008-11-14 Cary Coutant <ccoutant@google.com>
9222
9223 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9224 instead of -1U.
9225
c82fbeee
CS
92262008-11-05 Craig Silverstein <csilvers@google.com>
9227
9228 * options.cc (General_options::parse_dynamic_list): New function.
9229 * options.h (General_options): New flags dynamic_list,
9230 dynamic_list_data, dynamic_list_cpp_new, and
9231 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9232 (General_options::in_dynamic_list): New function.
9233 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9234 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9235 (Lex::can_continue_name): Likewise.
9236 (yylex): Likewise.
9237 (read_script_file): New parameter script_options.
9238 (read_dynamic_list): New function.
9239 (Script_options::define_dynamic_list): New function.
9240 (dynamic_list_keyword_parsecodes): New variable.
9241 (dynamic_list_keywords): New variable.
9242 * script.h (Script_options::define_dynamic_list): New function
9243 prototype.
9244 (read_dynamic_list): New function prototype.
9245 * symtab.cc (strprefix): New macro.
9246 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9247 dynamic_list_data, dynamic_list_cpp_new, and
9248 dynamic_list_cpp_typeinfo.
9249 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9250 (dynamic_list_expr): New rule.
9251 (dynamic_list_nodes): Likewise.
9252 (dynamic_list_node): Likewise.
9253 * testsuite/Makefile.am (dynamic_list): New test.
9254 * testsuite/Makefile.in: Regenerated.
9255 * testsuite/dynamic_list.t: New file.
9256 * testsuite/dynamic_list.sh: New file.
9257
e0bb29a5
CS
92582008-11-05 Craig Silverstein <csilvers@google.com>
9259
9260 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9261 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9262 (t11_last): Likewise.
9263 * testsuite/ver_test_6.c (main): Likewise.
9264
4e1e25e0
CC
92652008-10-07 Cary Coutant <ccoutant@google.com>
9266
9267 * options.c (General_options::finalize): Add check for -static and
9268 -shared.
9269 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9270 is not empty.
9271
92f03fcb
CC
92722008-10-02 Cary Coutant <ccoutant@google.com>
9273
9274 * plugin.cc (make_sized_plugin_object): Fix conditional
9275 compilation to work when not all targets are enabled.
9276
fbd8a257
CC
92772008-09-29 Cary Coutant <ccoutant@google.com>
9278
9279 * archive.cc (Archive::get_file_and_offset): Use filename instead
9280 of name to get library path.
9281 (Archive::include_member): Unlock external member of a thin archive.
9282
9283 * testsuite/Makefile.am (TEST_AR): New variable.
9284 (thin_archive_test_1): New test.
9285 (thin_archive_test_2): New test.
81636b3f
CC
9286 * testsuite/Makefile.in: Regenerate.
9287 * testsuite/thin_archive_main.cc: New file.
9288 * testsuite/thin_archive_test_1.cc: New file.
9289 * testsuite/thin_archive_test_2.cc: New file.
9290 * testsuite/thin_archive_test_3.cc: New file.
9291 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 9292
eff45813
CC
92932008-09-29 Cary Coutant <ccoutant@google.com>
9294
9295 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9296 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9297 instead of -1U.
9298 (Sized_relobj::do_finalize_local_symbols): Likewise.
9299 (Sized_relobj::map_to_kept_section): Likewise.
9300 * object.h (Sized_relobj::invalid_address): New constant.
9301 (Sized_relobj::do_output_section_offset): Check for invalid_address
9302 and return -1ULL.
9303 * output.cc (Output_reloc::local_section_offset): Use constant
9304 invalid_address instead of -1U.
9305 (Output_reloc::get_address): Likewise.
9306 (Output_section::output_address): Change -1U to -1ULL.
9307 * output.h (Output_reloc::invalid_address): New constant.
9308 * reloc.cc (Sized_relobj::write_sections): Use constant
9309 invalid_address instead of -1U.
9310 (Sized_relobj::relocate_sections): Likewise.
9311 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9312 values for merge sections.
9313 * target-reloc.h (relocate_for_relocatable): Use constant
9314 invalid_address instead of -1U.
9315
89fc3421
CC
93162008-09-19 Cary Coutant <ccoutant@google.com>
9317
9318 Add plugin functionality for link-time optimization (LTO).
9319 * configure.ac (plugins): Add --enable-plugins option.
9320 * configure: Regenerate.
9321 * config.in: Regenerate.
9322 * Makefile.am (LIBDL): New variable.
9323 (CCFILES): Add plugin.cc.
9324 (HFILES): Add plugin.h.
9325 (ldadd_var): Add LIBDL.
9326 * Makefile.in: Regenerate.
9327
9328 * archive.cc: Include "plugin.h".
9329 (Archive::setup): Don't preread archive symbols when using a plugin.
9330 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9331 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9332 files.
9333 (Archive::include_member): Add symbols from plugin objects.
9334 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9335 * descriptors.cc (Descriptors::open): Check for file descriptors
9336 abandoned by plugins.
9337 (Descriptors::claim_for_plugin): New function.
9338 * descriptors.h (Descriptors::claim_for_plugin): New function.
9339 (Open_descriptor::is_claimed): New field.
9340 (claim_descriptor_for_plugin): New function.
9341 * fileread.cc (File_read::claim_for_plugin): New function.
9342 * fileread.h (File_read::claim_for_plugin): New function.
9343 (File_read::descriptor): New function.
9344 * gold.cc: Include "plugin.h".
9345 (queue_initial_tasks): Add task to call plugin hooks for generating
9346 new object files.
9347 * main.cc: Include "plugin.h".
9348 (main): Load plugin libraries.
9349 * object.h (Pluginobj): Declare.
9350 (Object::pluginobj): New function.
9351 (Object::do_pluginobj): New function.
9352 (Object::set_target): New function.
9353 * options.cc: Include "plugin.h".
9354 (General_options::parse_plugin): New function.
9355 (General_options::General_options): Initialize plugins_ field.
9356 (General_options::add_plugin): New function.
9357 * options.h (Plugin_manager): Declare.
9358 (General_options): Add --plugin option.
9359 (General_options::has_plugins): New function.
9360 (General_options::plugins): New function.
9361 (General_options::add_plugin): New function.
9362 (General_options::plugins_): New field.
9363 * plugin.cc: New file.
9364 * plugin.h: New file.
9365 * readsyms.cc: Include "plugin.h".
9366 (Read_symbols::do_read_symbols): Check for archive before checking
9367 for ELF file. Call plugin hooks to claim files.
9368 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9369 from a real object file; force override when processing replacement
9370 files.
9371 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9372 (Symbol::init_base_object): Likewise.
9373 (Symbol::init_base_output_data): Likewise.
9374 (Symbol::init_base_output_segment): Likewise.
9375 (Symbol::init_base_constant): Likewise.
9376 (Symbol::init_base_undefined): Likewise.
9377 (Symbol::output_section): Assert that object is not a plugin.
9378 (Symbol_table::add_from_pluginobj): New function.
9379 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9380 undefined.
9381 (Symbol_table::sized_write_globals): Likewise.
9382 (Symbol_table::add_from_pluginobj): Instantiate template.
9383 * symtab.h (Sized_pluginobj): Declare.
9384 (Symbol::in_real_elf): New function.
9385 (Symbol::set_in_real_elf): New function.
9386 (Symbol::in_real_elf_): New field.
9387 (Symbol_table::add_from_pluginobj): New function.
9388
9389 * testsuite/Makefile.am (AM_CFLAGS): New variable.
9390 (LIBDL): New variable.
9391 (LDADD): Add LIBDL.
9392 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
9393 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
9394 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
9395 (MOSTLYCLEANFILES): Likewise.
9396 * testsuite/Makefile.in: Regenerate.
9397 * testsuite/plugin_test.c: New file.
9398 * testsuite/plugin_test_1.sh: New file.
9399 * testsuite/plugin_test_2.sh: New file.
9400
de31bda5
ILT
94012008-09-16 Ian Lance Taylor <iant@google.com>
9402
9c2d0ef9
ILT
9403 * target-reloc.h (relocate_section): Check whether a symbol is
9404 defined by the ABI before reporting an undefined symbol error.
9405 * target.h (Target::is_defined_by_abi): Make parameter const.
9406 (Target::do_is_defined_by_abi): Likewise.
9407 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
9408 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
9409 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
9410 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
9411 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
9412 * testsuite/Makefile.in: Rebuild.
9413
de31bda5
ILT
9414 * fileread.cc (make_view): Add casts to avoid warning.
9415
9fa33bee
AO
94162008-09-16 Alexandre Oliva <aoliva@redhat.com>
9417
9418 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
9419 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9420
183fd0e3
AO
94212008-09-16 Alexandre Oliva <aoliva@redhat.com>
9422
9423 * options.h (General_options::output_is_executable): New.
9424 (General_options::output_is_pie): New.
9425 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
9426 for shared libraries.
9427 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9428
7be8330a
CD
94292008-09-11 Chris Demetriou <cgd@google.com>
9430
9431 * options.h (origin): New -z option.
9432 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
9433 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
9434 in DT_FLAGS_1.
9435
a9caad02
CC
94362008-09-05 Cary Coutant <ccoutant@google.com>
9437
9438 * fileread.cc (File_read::make_view): Add check for attempt to map
9439 beyond end of file.
9440
ae6dce4d
CC
94412008-09-05 Cary Coutant <ccoutant@google.com>
9442
9443 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
9444 explicit instantiations.
9445
d7ab2a47
KVH
94462008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
9447
9448 PR gold/6858
9449 * options.cc (General_options::finalize): Allow undefined symbols
9450 in shlibs if linking -shared.
9451
9452 PR gold/6859
9453 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
9454 symbols as not needing a dynsym entry.
9455
1e52a9c1
CS
94562008-08-20 Craig Silverstein <csilvers@google.com>
9457
9458 * fileread.cc (File_read::open): Do not lock the file unless it
9459 was successfully opened.
9460
d85c80a3
CC
94612008-08-14 Cary Coutant <ccoutant@google.com>
9462
9463 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
9464 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
9465 * testsuite/tls_test.cc (struct int128): 128-bit struct
9466 for testing TLS relocs with non-zero addend.
9467 (v12): New TLS variable.
9468 (t12): New test.
9469 (t_last): Add check for v12.
9470 * testsuite/tls_test.h (t12): New function.
9471 * testsuite/tls_test_main.cc (thread_routine): Call new test.
9472
2d924fd9
ILT
94732008-08-13 Ian Lance Taylor <iant@google.com>
9474
9475 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
9476 set tls_segment_ or relro_segment_.
9477 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
9478 when appropriate.
9479 * output.h (Output_section::clear_is_relro): New function.
9480 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
9481 sections specially even when output_data_ is empty.
9482 (Output_segment::maximum_alignment): When first section is relro,
9483 only force alignment for PT_LOAD segments.
9484 * script.cc (script_data_segment_align): New function.
9485 (script_data_segment_relro_end): New function.
9486 * script-c.h (script_data_segment_align): Declare.
9487 (script_data_segment_relro_end): Declare.
9488 * script-sections.h (class Script_sections): Declare
9489 data_segment_align and data_segment_relro_end. Add fields
9490 segment_align_index_ and saw_relro_end_.
9491 * script-sections.cc (class Sections_element): Add set_is_relro
9492 virtual function. Add new bool* parameter to place_orphan_here.
9493 Add get_output_section virtual function.
9494 (class Output_section_definition): Add set_is_relro. Add new
9495 bool* parameter to place_orphan_here. Add get_output_section.
9496 Add is_relro_ field.
9497 (Output_section_definition::Output_section_definition): Initialize
9498 evaluated_address_, evaluated_load_address, evaluated_addralign_,
9499 and is_relro_ fields.
9500 (Output_section_definition::place_orphan_here): Add is_relro
9501 parameter.
9502 (Output_section_definition::set_section_addresses): Set relro for
9503 output section.
9504 (Output_section_definition::alternate_constraint): Likewise.
9505 (class Orphan_output_section): Add new bool* parameter to
9506 place_orphan_here. Add get_output_section.
9507 (Orphan_output_section::place_orphan_here): Add is_relro
9508 parameter.
9509 (Script_sections::Script_sections): Initialize
9510 data_segment_align_index_ and saw_relro_end_.
9511 (Script_sections::data_segment_align): New function.
9512 (Script_sections::data_segment_relro_end): New function.
9513 (Script_sections::place_orphan): Set or clear is_relro.
9514 (Script_sections::set_section_addresses): Force alignment of first
9515 TLS section.
9516 * yyscript.y (exp): Call script_data_segment_align and
9517 script_data_segment_relro_end.
9518 * testsuite/relro_script_test.t: New file.
9519 * testsuite/relro_test.cc (using_script): Declare.
9520 (t1, t2): Test using_script.
9521 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
9522 (relro_script_test_SOURCES): Define.
9523 (relro_script_test_DEPENDENCIES): Define.
9524 (relro_script_test_LDFLAGS): Define.
9525 (relro_script_test_LDADD): Define.
9526 (relro_script_test.so): New target.
9527 * testsuite/Makefile.in: Rebuild.
9528
f827c9a9
CC
95292008-08-06 Cary Coutant <ccoutant@google.com>
9530
9531 * archive.cc (Archive::total_archives, Archive::total_members)
9532 (Archive::total_members_loaded): New variables.
9533 (Archive::setup): Add parameter. Add option to preread
9534 archive symbols.
9535 (Archive::read_armap): Add counter.
9536 (Archive::get_file_and_offset): New function.
9537 (Archive::get_elf_object_for_member): New function.
9538 (Archive::read_all_symbols): New function.
9539 (Archive::read_symbols): New function.
9540 (Archive::add_symbols): Add counters.
9541 (Archive::include_all_members): Use armap to find members if it's
9542 already built.
9543 (Archive::include_member): Skip reading symbols if already read.
9544 Factored code into Archive::get_file_and_offset and
9545 Archive::get_elf_object_for_member. Changed call to
9546 Mapfile::report_include_archive_member.
9547 (Archive::print_stats): New function.
9548 * archive.h: Declare Object and Read_symbols_data classes.
9549 (Archive::Archive): Add initializers for new members.
9550 (Archive::setup): Add parameter.
9551 (Archive::print_stats): New function.
9552 (Archive::total_archives, Archive::total_members)
9553 (Archive::total_members_loaded): New variables.
9554 (Archive::get_file_and_offset): New function.
9555 (Archive::get_elf_object_for_member): New function.
9556 (Archive::read_all_symbols): New function.
9557 (Archive::read_symbols): New function.
9558 (Archive::Archive_member): New class.
9559 (Archive::members_): New member.
9560 (Archive::num_members_): New member.
9561 * main.cc: Include archive.h.
9562 (main): Call Archive::print_stats.
9563 * mapfile.cc (Mapfile::report_include_archive_member): Delete
9564 archive parameter; member_name is now the fully-decorated name.
9565 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
9566 * options.h: (General_options): Add --preread-archive-symbols option.
9567 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
9568 Archive::setup.
9569
de4c45bd
ILT
95702008-08-04 Ian Lance Taylor <iant@google.com>
9571
9572 * symtab.h (Symbol::use_plt_offset): New function.
9573 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
9574 * powerpc.cc (Relocate::relocate): Likewise.
9575 * sparc.cc (Relocate::relocate): Likewise.
9576 * x86_64.cc (Relocate::relocate): Likewise.
9577 * testsuite/weak_plt.sh: New test.
9578 * testsuite/weak_plt_main.cc: New test.
9579 * testsuite/weak_plt_shared.cc: New test.
9580 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
9581 (check_PROGRAMS): Add weak_plt.
9582 (check_DATA): Add weak_plt_shared.so.
9583 (weak_plt_main_pic.o, weak_plt): New targets.
9584 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
9585 * testsuite/Makefile.in: Rebuild.
9586
9587 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
9588 gcctestdir/ld.
9589 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
9590 * testsuite/Makefile.in: Rebuild.
9591
323ee3f4
AM
95922008-08-04 Alan Modra <amodra@bigpond.net.au>
9593
9594 * Makefile.am (POTFILES.in): Set LC_ALL=C.
9595 * Makefile.in: Regenerate.
9596 * po/POTFILES.in: Regenerate.
9597
7c07ecec
ILT
95982008-07-29 Ian Lance Taylor <iant@google.com>
9599
9600 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
9601 symbols before other symbols.
9602 * testsuite/script_test_2.cc (test_addr): Declare.
9603 (test_addr_alias): Declare.
9604 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9605 values.
7c07ecec
ILT
9606 * testsuite/script_test_2.t: Define test_addr_alias and
9607 test_addr.
9608
5778530e
ILT
96092008-07-24 Ian Lance Taylor <iant@google.com>
9610
2a00e4fb
ILT
9611 PR 5990
9612 * descriptors.cc: New file.
9613 * descriptors.h: New file.
9614 * gold-threads.h (class Hold_optional_lock): New class.
9615 * fileread.cc: Include "descriptors.h".
9616 (File_read::~File_read): Release descriptor rather than closing
9617 it.
9618 (File_read::open) [file]: Call open_descriptor rather than open.
9619 Set is_descriptor_opened_.
9620 (File_read::open) [memory]: Assert that descriptor is not open.
9621 (File_read::reopen_descriptor): New function.
9622 (File_read::release): Release descriptor.
9623 (File_read::do_read): Make non-const. Reopen descriptor.
9624 (File_read::read): Make non-const.
9625 (File_read::make_view): Reopen descriptor.
9626 (File_read::do_readv): Likewise.
9627 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9628 Update declarations.
9629 * layout.cc: Include "descriptors.h".
9630 (Layout::create_build_id): Use open_descriptor rather than open.
9631 * output.cc: Include "descriptors.h".
9632 (Output_file::open): Use open_descriptor rather than open.
9633 * archive.cc (Archive::const_iterator): Change Archive to be
9634 non-const.
9635 (Archive::begin, Archive::end): Make non-const.
9636 (Archive::count_members): Likewise.
9637 * archive.h (class Archive): Update declarations.
9638 * object.h (Object::read): Make non-const.
9639 * Makefile.am (CCFILES): Add descriptors.cc.
9640 (HFILES): Add descriptors.h.
9641 * Makefile.in: Rebuild.
9642
801647d1
ILT
9643 PR 6716
9644 * gold.h: Always include <clocale>. Add Solaris workarounds
9645 following code in binutils/sysdep.h.
9646
5edd166e
ILT
9647 PR 6048
9648 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9649 this->eh_frame_hdr_ is NULL before using it.
9650
c89ad728
ILT
9651 * dynobj.cc (Versions::Versions): Update comment.
9652
aa86f06b
ILT
9653 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9654 the base version name.
9655
5778530e
ILT
9656 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9657 array size plus one.
9658 (Stringpool_template::set_string_offsets): Subtract one from key
9659 before using it as an array index.
9660 (Stringpool_template::get_offset_with_length): Likewise.
9661 (Stringpool_template::write_to_buffer): Likewise.
9662 * stringpool.h (Stringpool_template::get_offset_from_key):
9663 Likewise.
9664
057ead22
ILT
96652008-07-23 Ian Lance Taylor <iant@google.com>
9666
7f649c59
ILT
9667 PR 6658
9668 * object.h (Merged_symbol_value::value): Do our best to handle a
9669 negative addend.
9670
057ead22
ILT
9671 PR 6647
9672 * script.cc (Version_script_info::get_versions): Don't add empty
9673 version tag to return value.
9674 (Version_script_info::get_symbol_version_helper): Change return
9675 type to bool. Add pversion parameter. Change all callers.
9676 (script_register_vers_node): Don't require a non-NULL tag.
9677 * script.h (class Version_script_info): Update declarations.
9678 (Version_script_info::get_symbol_version): Change return type to
9679 bool. Add version parameter. Change all callers.
9680 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
9681 handling. Handle an empty version from a version script.
9682 (Symbol_table::define_special_symbol): Likewise.
9683 * testsuite/ver_test_10.script: New file.
9684 * testsuite/ver_test_10.sh: New file.
9685 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
9686 (check_DATA): Add ver_test_10.syms.
9687 (ver_test_10.syms, ver_test_10.so): New target.
9688 * testsuite/Makefile.in: Rebuild.
9689
58e54ac2
CD
96902008-07-23 Simon Baldwin <simonb@google.com>
9691
9692 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
9693 to zero for undefined symbols from dynamic libraries.
9694
95d14cd3
ILT
96952008-07-23 Ian Lance Taylor <iant@google.com>
9696
9697 * symtab.cc (Symbol_table::resolve): Remove version parameter.
9698 Change all callers.
9699 * symtab.h (class Symbol_table): Update declaration.
9700 * testsuite/ver_test_9.cc: New file.
9701 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
9702 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9703 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
9704 (ver_test_9.so, ver_test_9.o): New targets.
9705 * testsuite/Makefile.in: Rebuild.
9706
92de84a6
ILT
97072008-07-22 Ian Lance Taylor <iant@google.com>
9708
34810851
ILT
9709 * options.h (class General_options): Define --check-sections.
9710 * layout.cc (Layout::set_segment_offsets): Handle
9711 --check-sections.
9712
af6156ef
ILT
9713 * options.h (class General_options): Define -n/--nmagic and
9714 -N/--omagic.
9715 * options.cc (General_options::finalize): For -n/--nmagic or
9716 -N/--omagic, set -static.
9717 * layout.cc (Layout::attach_allocated_section_to_segment): If
9718 -N/--omagic, don't put read-only and read-write sections in
9719 different segments.
9720 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
9721 finding a read-only segment.
9722 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
9723 don't set the minimum segment alignment to the common page size,
9724 and don't set the file offset to the address modulo the page size.
9725 * script-sections.cc (Script_sections::create_segments): If
9726 -n/--omagic, don't put read-only and read-write sections in
9727 different segments.
9728
92de84a6
ILT
9729 * cref.cc: New file.
9730 * cref.h: New file.
9731 * options.h (class General_options): Add --print-symbol-counts.
9732 * main.cc (main): Issue defined symbol report if requested.
9733 * archive.cc (Archive::interpret_header): Make into a const member
9734 function.
9735 (Archive::add_symbols): Call Input_objects::archive_start and
9736 archive_stop.
9737 (Archive::const_iterator): Define new class.
9738 (Archive::begin, Archive::end): New functions.
9739 (Archive::include_all_members): Rewrite to use iterator.
9740 (Archive::count_members): New function.
9741 * archive.h (class Archive): Update declarations.
9742 (Archive::filename): New function.
9743 * object.cc: Include "cref.h".
9744 (Sized_relobj::Sized_relobj): Initialize defined_count_.
9745 (Sized_relobj::do_get_global_symbol_counts): New function.
9746 (Input_objects::add_object): Add object to cross-referencer.
9747 (Input_objects::archive_start): New function.
9748 (Input_objects::archive_stop): New function.
9749 (Input_objects::print_symbol_counts): New function.
9750 * object.h: Declare Cref and Archive.
9751 (Object::get_global_symbol_counts): New function.
9752 (Object::do_get_global_symbol_counts): New pure virtual function.
9753 (class Sized_relobj): Add defined_count_ field. Update
9754 declarations.
9755 (class Input_objects): Add cref_ field. Update constructor.
9756 Update declarations.
9757 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
9758 defined_count_.
9759 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
9760 symbol counts.
9761 (Sized_dynobj::do_get_global_symbol_counts): New function.
9762 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
9763 defined_count_. Update declarations. Define Symbols typedef.
9764 * symtab.cc (Symbol_table::add_from_relobj): Add defined
9765 parameter. Change all callers.
9766 (Symbol_table::add_from_dynobj): Add sympointers and defined
9767 parameters. Change all callers.
9768 * symtab.h (class Symbol_table): Update declarations.
9769 * Makefile.am (CCFILES): Add cref.cc.
9770 (HFILES): Add cref.h.
9771 * Makefile.in: Rebuild.
9772
3f7c5e1d
CD
97732008-07-22 Simon Baldwin <simonb@google.com>
9774
9775 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
9776 to zero when writing undefined symbols.
9777
e0b64032
ILT
97782008-07-22 Ian Lance Taylor <iant@google.com>
9779
9780 * output.cc (Output_section::add_input_section): Don't try to
9781 merge empty merge sections.
9782
096b02cf
CS
97832008-07-21 Craig Silverstein <csilvers@google.com>
9784
9785 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9786 Include symbol version in error message.
cd536b21 9787
1d1f116d
CD
97882008-07-20 Chris Demetriou <cgd@google.com>
9789
cd536b21 9790 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
9791 (RANDOM_SEED_CFLAGS): New substituted variable.
9792 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
9793 * configure: Rebuild.
9794 * Makefile.in: Likewise.
9795 * testsuite/Makefile.in: Likewise.
9796
a18f591e
ILT
97972008-07-18 Ian Lance Taylor <iant@google.com>
9798
9799 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
9800 where we see NAME/NULL and NAME/VERSION as separate symbols.
9801 * testsuite/ver_test_main.cc (main): Call t4.
9802 (t4, t4_2a): Define.
9803 * testsuite/ver_test_2.cc (t4_2): Define.
9804 * testsuite/ver_test_2.script: Put t4_2a in VER2.
9805 * testsuite/ver_test_4.cc (t4_2a): Define.
9806 * testsuite/ver_test_4.script: Put t4_2a in VER2.
9807 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
9808
c6e3f6ed
ILT
98092008-07-17 Ian Lance Taylor <iant@google.com>
9810
9811 * dynobj.cc (Versions::add_def): If we give an error about a
9812 missing version, go ahead and create the version anyhow.
9813
ef9beddf
ILT
98142008-07-10 Ian Lance Taylor <iant@google.com>
9815
9816 Handle output sections with more than 0x7fffffff bytes.
9817 * object.h (class Relobj): Change map_to_output_ to
9818 output_sections_, and just keep a section pointer. Change all
9819 uses. Move comdat group support to Sized_relobj.
9820 (Relobj::is_section_specially_mapped): Remove.
9821 (Relobj::output_section): Remove poff parameter. Change all
9822 callers.
9823 (Relobj::output_section_offset): New function.
9824 (Relobj::set_section_offset): Rewrite.
9825 (Relobj::map_to_output): Remove.
9826 (Relobj::output_sections): New function.
9827 (Relobj::do_output_section_offset): New pure virtual function.
9828 (Relobj::do_set_section_offset): Likewise.
9829 (class Sized_relobj): Add section_offsets_ field. Add comdat
9830 group support from Relobj. Update declarations.
9831 (Sized_relobj::get_output_section_offset): New function.
9832 (Sized_relobj::do_output_section_offset): New function.
9833 (Sized_relobj::do_set_section_offset): New function.
9834 * object.cc (Relobj::output_section_address): Remove.
9835 (Sized_relobj::Sized_relobj): Initialize new fields.
9836 (Sized_relobj::include_section_group): Cast find_kept_object to
9837 Sized_relobj.
9838 (Sized_relobj::include_linkonce_section): Likewise.
9839 (Sized_relobj::do_layout): Use separate arrays for output section
9840 and output offset.
9841 (Sized_relobj::do_count_local_symbols): Change map_to_output to
9842 output_sections.
9843 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
9844 output_sections and section_offsets.
9845 (Sized_relobj::write_local_symbols): Likewise.
9846 (map_to_kept_section): Compute output address directly.
9847 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
9848 output_sections and section_offsets.
9849 (Sized_relobj::write_sections): Likewise.
9850 (Sized_relobj::relocate_sections): Likewise.
9851 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
9852 * output.h (class Output_reloc): Update declarations. Change
9853 u2_.relobj to Sized_relobj*.
9854 (class Output_data_reloc): Change add functions to use
9855 Sized_relobj*.
9856 * output.cc (Output_reloc::Output_reloc): Change relobj to
9857 Sized_relobj*.
9858 (Output_reloc::local_section_offset): Change return type to
9859 Elf_Addr. Use get_output_section_offset.
9860 (Output_reloc::get_address): Likewise.
9861 (Output_section::is_input_address_mapped): Don't call
9862 is_section_specially_mapped.
9863 (Output_section::output_offset): Likewise.
9864 (Output_section::output_address): Likewise.
9865 (Output_section::starting_output_address): Likewise.
9866 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
9867 parameter to Sized_relobj*.
9868 (Copy_relocs::need_copy_reloc): Likewise.
9869 (Copy_relocs::save): Likewise.
9870 * copy-relocs.h (class Copy_relocs): Update declarations.
9871 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
9872 Sized_relobj*. Change relobj_ field to Sized_relobj*.
9873 * target-reloc.h (relocate_for_relocatable): Change
9874 offset_in_output_section type to Elf_Addr. Change code that uses
9875 it as well.
9876 * layout.cc (Layout::layout): Always set *off.
9877 * mapfile.cc (Mapfile::print_input_section): Use
9878 output_section_offset.
9879 * i386.cc (Target_i386::copy_reloc): Change object parameter to
9880 Sized_relobj*.
9881 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
9882 * sparc.cc (Target_sparc::copy_reloc): Likewise.
9883 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
9884
5cb66f97
ILT
98852008-07-03 Ian Lance Taylor <iant@google.com>
9886
9887 * layout.cc (Layout::include_section): Do not discard unrecognized
9888 SHT_STRTAB sections.
9889
afe47622
CS
98902008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
9891
9892 * script.cc (Lex::can_continue_name): Make '?' allowable in
9893 version-script names.
9894 * testsuite/version_script.map: Change glob pattern to use '?'
9895
5adf9721
ILT
98962008-06-30 Manish Singh <yosh@gimp.org>
9897
9898 PR 6585
9899 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
9900 Correct typo.
9901
e6fde208
ILT
99022008-06-30 Ian Lance Taylor <iant@google.com>
9903
9904 PR 6660
9905 PR 6682
9906 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
9907 versions]: Don't try to read the value in the contents, since we
9908 don't use it. Use the template endianness when writing.
9909
3f2e6a2d
CC
99102008-06-25 Cary Coutant <ccoutant@google.com>
9911
9912 * fileread.cc (File_read::make_view): Assert on zero-length view.
9913 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
9914 symbol table when there are no symbols to read.
9915
c43d3a48
CS
99162008-06-23 Craig Silverstein <csilvers@google.com>
9917
9918 * version.cc (version_string): Bump to 1.7
9919
5f494ea0
CS
99202008-06-18 Craig Silverstein <csilvers@google.com>
9921
9922 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9923 constant 0xFFFF to type Valtype.
9924 (Powerpc_relocate_functions::rel16_ha): Likewise.
9925
c42e122e
ILT
99262008-06-17 Ian Lance Taylor <iant@google.com>
9927
f34787f8
ILT
9928 * output.h (Output_section::Input_section): Initialize p2align_ to
9929 zero for Output_section_data constructors.
9930 (Output_section::Input_section::addralign): If not an input
9931 section, return the alignment of the Output_section_data.
9932 * testsuite/copy_test.cc: New file.
9933 * testsuite/copy_test_1.cc: New file.
9934 * testsuite/copy_test_2.cc: New file.
9935 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9936 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9937 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9938 (copy_test_1_pic.o, copy_test_1.so): New targets.
9939 (copy_test_2_pic.o, copy_test_2.so): New targets.
9940 * testsuite/Makefile.in: Rebuild.
9941
c42e122e
ILT
9942 * script-sections.cc (Script_sections::place_orphan): Initialize
9943 local variable exact.
9944
ce3ac18a
DE
99452008-06-13 David Edelsohn <edelsohn@gnu.org>
9946
9947 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9948
42cacb20
DE
99492008-06-12 David Edelsohn <edelsohn@gnu.org>
9950 David S. Miller <davem@davemloft.net>
9951
9952 * powerpc.cc: New file.
9953 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9954 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9955 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9956 * Makefile.in: Rebuild.
9957
7b308235
ILT
99582008-06-09 Ian Lance Taylor <iant@google.com>
9959
9960 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9961 <exception>.
9962 (throwing, orig_terminate): New static variables.
9963 (terminate_handler): New static function.
9964 (t2): Set terminate handler.
9965
f0b886e3
ILT
99662008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9967
9968 PR 6584
cd536b21 9969 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9970 alignment.
9971
3e90f135
CC
99722008-05-30 Cary Coutant <ccoutant@google.com>
9973
9974 * archive.cc (Archive::include_all_members) Correct to step
9975 over symbol table and extended name table in thin archives.
9976
e09ad04a
ILT
99772008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9978
9979 PR 6407
9980 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9981 calculation.
9982
62b01cb5
ILT
99832008-05-28 Caleb Howe <cshowe@google.com>
9984
9985 * reduced_debug_output.cc: New file.
9986 * reduced_debug_output.h: New file.
92de84a6 9987 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9988 * options.cc (General_options::finalize): Add strip_debug_non_line
9989 to the strip heirarchy.
9990 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9991 fields.
9992 * layout.cc: Include "reduced_debug_output.h".
9993 (Layout::Layout): Initialize new fields.
9994 (line_only_debug_sections): New static array.
9995 (is_lines_only_debug_sections): New static inline function.
9996 (Layout::include_section): Handle --strip-debug-non-line.
9997 (Layout::make_output_section): If --strip-debug-non-line, build
9998 new output sections for .debug_abbrev and .debug_info.
9999 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
10000 gold. Warn about possible overflow.
10001 (read_signed_LEB_128): Likewise.
10002 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
10003 (read_signed_LEB_128): Declare.
10004 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
10005 (HFILES): Add reduced_debug_output.h.
10006 * Makefile.in: Rebuild.
10007
7d9e3d98
ILT
100082008-05-21 Ian Lance Taylor <iant@google.com>
10009
10010 * mapfile.cc: New file.
10011 * mapfile.h: New file.
10012 * options.h (class General_options): Add -M/--print-map and -Map.
10013 * options.cc (General_options::finalize): Make -M equivalent to
10014 -Map -.
10015 * main.cc: Include <cstdio> and "mapfile.h".
10016 (main): Open mapfile if requested.
10017 * gold.cc (class Middle_runner): Add mapfile_ field. Update
10018 constructor. Change caller.
10019 (queue_initial_tasks): Add mapfile parameter. Change caller.
10020 (queue_middle_tasks): Likewise.
10021 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
10022 declarations.
10023 * archive.cc: Include "mapfile.h".
10024 (Archive::add_symbols): Add mapfile parameter. Change all
10025 callers. Pass mapfile, symbol, and reason to include_member.
10026 (Archive::include_all_members): Add mapfile parameter. Change all
10027 callers.
10028 (Archive::include_member): Add mapfile, sym, and why parameters.
10029 Change all callers. Report inclusion to map file.
10030 * archive.h: Include "fileread.h".
10031 (class Archive): Update declarations.
10032 (Archive::file): New const method.
10033 (class Add_archive_symbols): Add mapfile_ field. Update
10034 constructor. Change all callers.
10035 * readsyms.h (class Read_symbols): Likewise.
10036 (class Finish_group): Likewise.
10037 (class Read_script): Likewise.
10038 * common.cc: Include "mapfile.h".
10039 (Symbol_table::allocate_commons): Add mapfile parameter. Change
10040 all callers.
10041 (Symbol_table::do_allocate_commons): Likewise.
10042 (Symbol_table::do_allocate_commons_list): Likewise. Report common
10043 symbol allocation to mapfile.
10044 * common.h (class Allocate_commons_task): Add mapfile_ field.
10045 Update constructor. Change all callers.
10046 * symtab.h (class Symbol_table): Update declarations.
10047 * layout.cc: Include "mapfile.h".
10048 (Layout_task_runner::run): Print information to mapfile.
10049 (Layout::create_gold_note): Change Output_data_fixed_space to
10050 Output_data_zero_fill.
10051 (Layout::create_build_id): Likewise.
10052 (Layout::print_to_mapfile): New function.
10053 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
10054 constructor. Change caller.
10055 (class Layout): Declare print_to_mapfile.
10056 * output.cc (Output_section::Input_section::print_to_mapfile): New
10057 function.
10058 (Output_section::add_input_section): If producing a map, always
10059 add to input_sections_ list.
10060 (Output_section::do_print_to_mapfile): New function.
10061 (Output_segment::print_sections_to_mapfile): New function.
10062 (Output_segment::print_section_list_to_mapfile): New function.
10063 * output.h: Include "mapfile.h".
10064 (Output_data::print_to_mapfile): New function.
10065 (Output_data::do_print_to_mapfile): New virtual function.
10066 (Output_segment_headers::do_print_to_mapfile): New function.
10067 (Output_file_header::do_print_to_mapfile): New function.
10068 (Output_data_const::do_print_to_mapfile): New function.
10069 (class Output_data_const_buffer): Add map_name_ field. Update
10070 constructor. Change all callers. Add do_print_to_mapfile
10071 function.
10072 (class Output_data_fixed_space): Likewise.
10073 (class Output_data_space): Likewise.
10074 (class Output_data_zero_fill): New class.
10075 (Output_data_strtab::do_print_to_mapfile): New function.
10076 (Output_data_reloc_base::do_print_to_mapfile): New function.
10077 (Output_relocatable_relocs::do_print_to_mapfile): New function.
10078 (Output_data_group::do_print_to_mapfile): New function.
10079 (Output_data_got::do_print_to_mapfile): New function.
10080 (Output_data_dynamic::do_print_to_mapfile): New function.
10081 (Output_symtab_xindex::do_print_to_mapfile): New function.
10082 (class Output_section): Declare do_print_to_mapflie. Declare
10083 print_to_mapfile in Input_section.
10084 (class Output_segment): Declare new functions.
10085 * object.h (Sized_relobj::symbol_count): New function.
10086 * script-sections.cc
10087 (Output_section_element_dot_assignment::set_section_addresses):
10088 Change Output_data_fixed_space to Output_data_zero_fill.
10089 (Output_data_expression::do_print_to_mapfile): New function.
10090 * script.cc (read_input_script): Add mapfile parameter. Change
10091 all callers.
10092 * script.h (read_input_script): Update declaration.
10093 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10094 (Eh_frame::do_print_to_mapfile): New function.
10095 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10096 (Output_merge_string::do_print_to_mapfile): New function.
10097 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10098 function.
10099 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10100 function.
10101 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10102 function.
10103 * Makefile.am (CCFILES): Add mapfile.cc.
10104 (HFILES): Add mapfile.h.
10105 * Makefile.in: Rebuild.
10106
9f1d377b
ILT
101072008-05-19 Ian Lance Taylor <iant@google.com>
10108
10109 * options.h (class General_options): Add -z relro.
10110 * layout.cc (Layout::Layout): Initialize relro_segment_.
10111 (Layout::add_output_section_data): Return the output section.
10112 (Layout::make_output_section): Rcognize relro sections and mark
10113 them appropriately.
10114 (Layout::attach_allocated_section_to_segment): Put relro sections
10115 in a PT_GNU_RELRO segment.
10116 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10117 section as relro.
10118 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10119 PT_TLS segments.
10120 (Layout::linkonce_mapping): Map d.rel.ro.local to
10121 .data.rel.ro.local.
10122 (Layout::output_section_name): Us .data.rel.ro.local for any
10123 section which begins with that.
10124 * layout.h (class Layout): Update add_output_section_data
10125 declaration. Add relro_segment_ field.
10126 * output.cc (Output_section::Output_section): Initialize is_relro_
10127 and is_relro_local_ fields.
10128 (Output_segment::add_output_section): Group relro sections.
10129 (Output_segment::is_first_section_relro): New function.
10130 (Output_segment::maximum_alignment): If there is a relro section,
10131 align the segment to the common page size.
10132 (Output_segment::set_section_addresses): Track whether we are
10133 looking at relro sections. If the last section is a relro
10134 section, align to the common page size.
10135 (Output_segment::set_section_list_addresses): Add in_relro
10136 parameter. Change all callers. Align to the page size when
10137 moving from relro to non-relro section.
10138 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10139 segment.
10140 * output.h (class Output_section): Add is_relro_ and
10141 is_relro_local_ fields.
10142 (Output_section::is_relro): New function.
10143 (Output_section::set_is_relro): New function.
10144 (Output_section::is_relro_local): New function.
10145 (Output_section::set_is_relro_local): New function.
10146 (class Output_segment): Update declarations.
10147 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10148 * sparc.cc (Target_sparc::got_section): Likewise.
10149 * x86_64.cc (Target_x86_64::got_section): Likewise.
10150 * testsuite/relro_test_main.cc: New file.
10151 * testsuite/relro_test.cc: New file.
10152 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10153 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10154 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10155 (relro_test.so, relro_test_pic.o): New targets.
10156 * testsuite/Makefile.in: Rebuild.
10157
a984ee1d
ILT
101582008-05-16 Ian Lance Taylor <iant@google.com>
10159
01676dcd
ILT
10160 * output.cc (Output_segment::add_output_section): Remove front
10161 parameter.
10162 * output.h (class Output_segment): Remove
10163 add_initial_output_section and overloaded add_output_section.
10164 Update declaration of remaining add_output_section.
10165 * layout.cc (Layout::create_interp): Call add_output_section
10166 rather than add_initial_output_section.
10167 (Layout::finish_dynamic_section): Likewise.
10168
497897f9
ILT
10169 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10170 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10171 know the dynamic type.
10172 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10173 field. Initialize it in constructor.
10174 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10175 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10176 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10177 reloc.
10178
a984ee1d
ILT
10179 * output.cc (Output_reloc::get_address): Change return type to
10180 Elf_Addr.
10181 * output.h (class Output_reloc): Update get_address declaration.
10182 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10183 for section addresses.
10184
55ba0940
ILT
101852008-05-09 Ian Lance Taylor <iant@google.com>
10186
10187 PR 6493
10188 * gold.cc (gold_nomem): Use return value of write.
10189
75517b77
ILT
101902008-05-08 Ian Lance Taylor <iant@google.com>
10191
10192 * symtab.c (Symbol::init_base_output_data): Add version
10193 parameter. Change all callers.
10194 (Symbol::init_base_output_segment): Likewise.
10195 (Symbol::init_base_constant): Likewise.
10196 (Symbol::init_base_undefined): Likewise.
10197 (Sized_symbol::init_output_data): Likewise.
10198 (Sized_symbol::init_output_segment): Likewise.
10199 (Sized_symbol::init_constant): Likewise.
10200 (Sized_symbol::init_undefined): Likewise.
10201 (Symbol_table::do_define_in_output_data): If the new symbol has a
10202 version, mark it as the default.
10203 (Symbol_table::do_define_in_output_segment): Likewise.
10204 (Symbol_table::do_define_as_constant): Likewise.
10205 * symtab.h (class Symbol): Update declarations.
10206 (class Sized_symbol): Likewise.
10207 * resolve.cc (Symbol::override_version): New function.
c42e122e 10208 (Symbol::override_base): Call override_version.
75517b77
ILT
10209 (Symbol::override_base_with_special): Likewise.
10210 * testsuite/ver_script_8.script: New file.
10211 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10212 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10213 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10214 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10215
f1f70eae
ILT
102162008-05-06 Ian Lance Taylor <iant@google.com>
10217
f3e9c5c5
ILT
10218 PR 6049
10219 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10220 functions.
10221 (class General_options): Remove existing --undefined, and add
10222 --no-undefined instead. Add new --undefined as synonym for -u.
10223 * archive.cc (Archive::add_symbols): Check whether symbol was
10224 named with -u.
10225 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10226 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10227 all uses. Add IS_UNDEFINED. Update declarations to split
10228 different versions of init_base. Declare init_base_undefined.
10229 (Symbol::is_defined): Handle IS_UNDEFINED.
10230 (Symbol::is_undefined): Likewise.
10231 (Symbol::is_weak_undefined): Call is_undefined.
10232 (Symbol::is_absolute): Handle IS_CONSTANT.
10233 (class Sized_symbol): Update declarations to split different
10234 versions of init. Declare init_undefined.
10235 (class Symbol_table): Declare new functions.
10236 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10237 Change all callers.
10238 (Symbol::init_base_output_data): Likewise.
10239 (Symbol::init_base_output_segment): Likewise.
10240 (Symbol::init_base_constant): Likewise.
10241 (Symbol::init_base_undefined): New function.
10242 (Sized_symbol::init_object): Rename from init. Change all
10243 callers.
10244 (Sized_symbol::init_output_data): Likewise.
10245 (Sized_symbol::init_output_segment): Likewise.
10246 (Sized_symbol::init_constant): Likewise.
10247 (Sized_symbol::init_undefined): New function.
10248 (Symbol_table::add_undefined_symbols_from_command_line): New
10249 function.
10250 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10251 function.
10252 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10253 (Symbol::output_section): Likewise.
10254 (Symbol::set_output_section): Likewise.
10255 (Symbol_table::sized_finalize_symbol): Likewise.
10256 (Symbol_table::sized_write_globals): Likewise.
10257 * resolve.cc (Symbol_table::should_override): Likewise.
10258 (Symbol::override_base_with_special): Likewise.
10259
8bdcdf2c
ILT
10260 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10261 symbol, change it to have default visibility.
10262 * testsuite/protected_1.cc: New file.
10263 * testsuite/protected_2.cc: New file.
10264 * testsuite/protected_3.cc: New file.
10265 * testsuite/protected_main_1.cc: New file.
10266 * testsuite/protected_main_2.cc: New file.
10267 * testsuite/protected_main_3.cc: New file.
10268 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10269 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10270 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10271 (protected_1.so): New target.
10272 (protected_1_pic.o, protected_2_pic.o): New targets.
10273 (protected_3_pic.o): New target.
10274 (check_PROGRAMS): Add protected_2.
10275 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10276 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10277 * testsuite/Makefile.in: Rebuild.
10278
2b706932
ILT
10279 * options.h (DEFINE_var): Add set_user_set_##varname__.
10280 (DEFINE_bool_alias): New macro.
10281 (class General_options): Define -Bstatic using DEFINE_bool_alias
10282 rather than DEFINE_special. Add --undefined as an alias for -z
10283 defs.
10284 * options.cc (General_options::parse_Bstatic): Remove.
10285
d82a5bcc
ILT
10286 * options.h (class General_options): Add --fatal-warnings.
10287 * main.cc (main): Implement --fatal-warnings.
10288 * errors.h (Errors::warning_count): New function.
10289
f1f70eae
ILT
10290 * options.h (class General_options): Add -Bsymbolic-functions.
10291 * symtab.h (Symbol::is_preemptible): Check for
10292 -Bsymbolic-functions.
10293
8825ac63
ILT
102942008-05-05 Ian Lance Taylor <iant@google.com>
10295
d98bc257
ILT
10296 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10297 as noVARNAME rather than no-VARNAME.
10298 (class General_options): Add option -z combreloc.
10299 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10300 get_address.
10301 (Output_reloc::sort_before) [SHT_REL]: New function.
10302 (Output_reloc::sort_before) [SHT_RELA]: New function.
10303 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10304 Sort_relocs_comparison.
10305 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10306 parameter. Change all callers.
10307 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10308 sort_relocs parameter. Change all callers.
10309 * output.cc (Output_reloc::get_address): New function, broken out
10310 of write_rel.
10311 (Output_reloc::write_rel): Call it.
10312 (Output_reloc::compare): New function.
10313 (Output_data_reloc_base::do_write): Optionally sort relocs.
10314
60b2b4e7
ILT
10315 * configure.ac: If targ_extra_obj is set, link it in.
10316 * configure.tgt: Initialize all variables.
10317 (x86_64*): Set targ_extra_obj and targ_extra_size.
10318 * configure: Rebuild.
10319
8825ac63
ILT
10320 * object.cc (Sized_relobj::include_section_group): Adjust section
10321 indexes read from group data. Build vector to pass to
10322 layout_group.
10323 * layout.cc (Layout::layout_group): Add flags and shndxes
10324 parameters. Remove contents parameter. Change caller. Update
10325 explicit instantiations.
10326 * layout.h (class Layout): Update layout_group declaration.
10327 * output.cc (Output_data_group::Output_data_group): Add flags and
10328 input_shndxes parameters. Remove contents parameter. Change
10329 caller.
10330 (Output_data_group::do_write): Change input_sections_ to
10331 input_shndxes_.
10332 * output.h (class Output_data_group): Update constructor
10333 declaration. Rename input_sections_ to input_shndxes_.
10334 * testsuite/many_sections_test.cc: Add template.
10335
e94cf127
CC
103362008-04-30 Cary Coutant <ccoutant@google.com>
10337
4418b2d5
CC
10338 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10339
e94cf127
CC
10340 * layout.cc (Layout::include_section): Refactored check for debug
10341 info section.
10342 (Layout::add_comdat): Add new parameters. Change type
10343 of signature parameter. Add object and shndx to signatures table.
10344 (Layout::find_kept_object): New function.
10345 * layout.h: Include <cstring>.
10346 (Layout::is_debug_info_section): New function.
10347 (Layout::add_comdat): Add new parameters.
10348 (Layout::find_kept_object): New function.
10349 (Layout::Kept_section): New struct.
10350 (Layout::Signatures): Change type of map range.
10351 * object.cc (Relobj::output_section_address): New function.
10352 (Sized_relobj::include_section_group): Add new parameters. Change
10353 calls to Layout::add_comdat. Change to build table of kept comdat
10354 groups and table mapping discarded sections to kept sections.
10355 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
10356 (Sized_relobj::do_layout): Change calls to include_section_group and
10357 include_linkonce_section.
10358 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
10359 value to zero when section is discarded.
10360 (Sized_relobj::map_to_kept_section): New function.
10361 * object.h (Relobj::output_section_address): New function.
10362 (Relobj::Comdat_group): New type.
10363 (Relobj::find_comdat_group): New function.
10364 (Relobj::Comdat_group_table): New type.
10365 (Relobj::Kept_comdat_section): New type.
10366 (Relobj::Kept_comdat_section_table): New type.
10367 (Relobj::add_comdat_group): New function.
10368 (Relobj::set_kept_comdat_section): New function.
10369 (Relobj::get_kept_comdat_section): New function.
10370 (Relobj::comdat_groups_): New field.
10371 (Relobj::kept_comdat_sections_): New field.
10372 (Symbol_value::input_value): Update comment.
10373 (Sized_relobj::map_to_kept_section) New function.
10374 (Sized_relobj::include_linkonce_section): Add new parameter.
10375 * target-reloc.h (Comdat_behavior): New type.
10376 (get_comdat_behavior): New function.
10377 (relocate_section): Add code to map a discarded section to the
10378 corresponding kept section when applying a relocation.
10379
e4e5049b
CS
103802008-04-30 Craig Silverstein <csilvers@google.com>
10381
10382 * dwarf_reader.cc (next_generation_count): New static var.
10383 (Addr2line_cache_entry): New struct.
10384 (addr2line_cache): New static var.
10385 (Dwarf_line_info::one_addr2line): Added caching.
10386 (Dwarf_line_info::clear_addr2line_cache): New function.
10387 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
10388 cache-size parameter.
10389 (Dwarf_line_info::one_addr2line_cache): New function.
10390 * symtab.cc (Symbol_table::detect_odr_violations): Pass
10391 new cache-size argument to one_addr2line(), and clear cache.
10392
d09e9154
CC
103932008-04-28 Cary Coutant <ccoutant@google.com>
10394
10395 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
10396 R_386_PC8 relocations.
10397
7ef73768
ILT
103982008-04-23 Ian Lance Taylor <iant@google.com>
10399
55438702
ILT
10400 * object.cc (Sized_relobj::include_section_group): Check for
10401 invalid section group.
10402
c165fb93
ILT
10403 * object.cc (make_elf_object): Correct test for 64-bit ELF file
10404 header size.
10405
7ef73768
ILT
10406 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
10407 than read for file header.
10408 * archive.cc (Archive::include_member): Likewise.
10409
6194aaab
L
104102008-04-23 Paolo Bonzini <bonzini@gnu.org>
10411
10412 * aclocal.m4: Regenerate.
10413 * configure: Regenerate.
10414
d491d34e
ILT
104152008-04-19 Ian Lance Taylor <iant@google.com>
10416
5ea2bac6
ILT
10417 * version.cc (version_string): Bump to 1.6.
10418
7bc3e21a
ILT
10419 * testsuite/Makefile.am (many_sections_r_test): New target.
10420 (many_sections_r_test_SOURCES): Remove.
10421 (many_sections_r_test_DEPENDENCIES): Remove.
10422 (many_sections_r_test_LDFLAGS): Remove.
10423 (many_sections_r_test_LDADD): Remove.
10424
7fcd3aa9
ILT
10425 * object.cc (Sized_relobj::do_add_symbols): Always pass
10426 local_symbol_count_ to add_from_relobj.
10427
4c94d6ae
ILT
10428 * testsuite/Makefile.am (many_sections_check.h): Only check one in
10429 every thousand variables.
10430 * testsuite/Makefile.in: Rebuild.
10431
d491d34e
ILT
10432 * object.cc (Xindex::initialize_symtab_xindex): New function.
10433 (Xindex::read_symtab_xindex): New function.
10434 (Xindex::sym_xindex_to_shndx): New function.
10435 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
10436 available.
10437 (Sized_relobj::do_initialize_xindex): New function.
10438 (Sized_relobj::do_read_symbols): Adjust section links.
10439 (Sized_relobj::symbol_section_and_value): Add is_ordinary
10440 parameter. Change all callers.
10441 (Sized_relobj::include_section_group): Adjust section links and
10442 symbol section indexes.
10443 (Sized_relobj::do_layout): Adjust section links.
10444 (Sized_relobj::do_count_local_symbols): Adjust section links and
10445 symbol section indexes.
10446 (Sized_relobj::do_finalize_local_symbols): Distinguish between
10447 ordinary and special symbols.
10448 (Sized_relobj::write_local_symbols): Add symtab_xindex and
10449 dynsym_xindex parameters. Change all callers. Adjust section
10450 links. Use SHN_XINDEX when needed.
10451 (Sized_relobj::get_symbol_location_info): Adjust section links.
10452 Don't get fooled by special symbols.
10453 * object.h (class Xindex): Define.
10454 (class Object): Add xindex_ parameter. Declare virtual functoin
10455 do_initialize_xindex.
10456 (Object::adjust_sym_shndx): New function.
10457 (Object::set_xindex): New protected function.
10458 (class Symbol_value): Add is_ordinary_shndx_ field.
10459 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
10460 (Symbol_value::value): Assert ordinary section.
10461 (Symbol_value::initialize_input_to_output_map): Likewise.
10462 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
10463 Change all callers.
10464 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
10465 all callers.
10466 (class Sized_relobj): Update declarations.
10467 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
10468 parameter. Change all callers.
10469 (Sized_relobj::adjust_shndx): New function.
10470 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
10471 field.
10472 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
10473 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
10474 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
10475 (Sized_dynobj::read_dynsym_section): Adjust section links.
10476 (Sized_dynobj::read_dynamic): Likewise.
10477 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
10478 section links.
10479 (Sized_dynobj::do_initialize_xindex): New function.
10480 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
10481 do_initialize_xindex.
10482 (Sized_dynobj::adjust_shndx): New function.
10483 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
10484 dynsym_xindex_ fields.
10485 (Layout::finalize): Add a call to set_section_indexes before
10486 creating the symtab sections.
10487 (Layout::set_section_indexes): Don't do anything if the section
10488 already has a section index.
10489 (Layout::create_symtab_sections): Add shnum parameter. Change
10490 caller. Create .symtab_shndx section if needed.
10491 (Layout::create_shdrs): Add shstrtab_section parameter. Change
10492 caller.
10493 (Layout::allocated_output_section_count): New function.
10494 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
10495 needed.
10496 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
10497 fields. Update declarations.
10498 (Layout::symtab_xindex): New function.
10499 (Layout::dynsym_xindex): New function.
10500 (class Write_symbols_task): Add layout_ field.
10501 (Write_symbols_task::Write_symbols_task): Add layout parameter.
10502 Change caller.
10503 * output.cc (Output_section_headers::Output_section_headers): Add
10504 shstrtab_section parameter. Change all callers.
10505 (Output_section_headers::do_sized_write): Store overflow values
10506 for section count and section string table section index in
10507 section header zero.
10508 (Output_file_header::do_sized_write): Check for overflow of
10509 section count and section string table section index.
10510 (Output_symtab_xindex::do_write): New function.
10511 (Output_symtab_xindex::endian_do_write): New function.
10512 * output.h (class Output_section_headers): Add shstrtab_section_.
10513 Update declarations.
10514 (class Output_symtab_xindex): Define.
10515 (Output_section::has_out_shndx): New function.
10516 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
10517 field.
10518 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
10519 Change all callers.
10520 (Sized_symbol::init): Likewise.
10521 (Symbol::output_section): Check for ordinary symbol.
10522 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
10523 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
10524 callers.
10525 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
10526 Change all callers. Simplify handling of symbols from sections
10527 not included in the link.
10528 (Symbol_table::add_from_dynobj): Handle ordinary symbol
10529 distinction.
10530 (Weak_alias_sorter::operator()): Assert that symbols are
10531 ordinary.
10532 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
10533 distinction.
10534 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
10535 parameters. Change all callers.
10536 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
10537 symbol distinction. Use SHN_XINDEX when needed.
10538 (Symbol_table::write_section_symbol): Add symtab_xindex
10539 parameter. Change all callers.
10540 (Symbol_table::sized_write_section_symbol): Likewise. Use
10541 SHN_XINDEX when needed.
10542 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
10543 declarations.
10544 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
10545 (Symbol::is_defined): Check is_ordinary.
10546 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
10547 (Symbol::is_absolute, Symbol::is_common): Likewise.
10548 (class Sized_symbol): Update declarations.
10549 (class Symbol_table): Update declarations.
10550 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
10551 parameters. Change all callers.
10552 (Sized_symbol::override): Likewise.
10553 (Symbol_table::override): Likewise.
10554 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
10555 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
10556 is_ordinary, and orig_st_shndx parameters. Change all callers.
10557 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
10558 to be in an ordinary section.
10559 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
10560 object and is_ordinary parameters. Change all callers.
10561 (Sized_dwarf_line_info::read_relocs): Add object parameter.
10562 Change all callers. Don't add undefined or non-ordinary symbols
10563 to reloc_map_.
10564 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
10565 Change all callers.
10566 * dwarf_reader.h (class Sized_dwarf_line_info): Update
10567 declarations.
10568 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
10569 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
10570 (Sized_relobj::relocate_sections): Likewise.
10571 * target-reloc.h (scan_relocs): Adjust section symbol index.
10572 (scan_relocatable_relocs): Likewise.
10573 * i386.cc (Scan::local): Check for ordinary symbols.
10574 * sparc.cc (Scan::local): Likewise.
10575 * x86_64.cc (Scan::local): Likewise.
10576 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
10577 to symbol_section_and_value.
10578 * testsuite/many_sections_test.cc: New file.
10579 * testsuite/Makefile.am (BUILT_SOURCES): Define.
10580 (check_PROGRAMS): Add many_sections_test.
10581 (many_sections_test_SOURCES): Define.
10582 (many_sections_test_DEPENDENCIES): Define.
10583 (many_sections_test_LDFLAGS): Define.
10584 (BUILT_SOURCES): Add many_sections_define.h.
10585 (many_sections_define.h): New target.
10586 (BUILT_SOURCES): Add many_sections_check.h.
10587 (many_sections_check.h): New target.
10588 (check_PROGRAMS): Add many_sections_r_test.
10589 (many_sections_r_test_SOURCES): Define.
10590 (many_sections_r_test_DEPENDENCIES): Define.
10591 (many_sections_r_test_LDFLAGS): Define.
10592 (many_sections_r_test_LDADD): Define.
10593 (many_sections_r_test.o): New target.
10594 * testsuite/Makefile.in: Rebuild.
10595
c5818ff1
CC
105962008-04-17 Cary Coutant <ccoutant@google.com>
10597
10598 * errors.cc (Errors::info): New function.
10599 (gold_info): New function.
10600 * errors.h (Errors::info): New function.
10601 * gold.h (gold_info): New function.
10602 * object.cc (Input_objects::add_object): Print trace output.
10603 * options.cc (options::parse_set): New function.
10604 (General_options::parse_wrap): Deleted.
10605 (General_options::General_options): Deleted initializer.
10606 * options.h (options::String_set): New typedef.
10607 (options::parse_set): New function.
10608 (DEFINE_set): New macro.
10609 (General_options::wrap): Changed to use DEFINE_set. Changed
10610 callers of any_wrap_symbols and is_wrap_symbol.
10611 (General_options::trace, General_options::trace_symbol):
10612 New options.
10613 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10614 (General_options::wrap_symbols_): Deleted.
10615 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10616
b5be4a7c
DM
106172008-04-17 David S. Miller <davem@davemloft.net>
10618
10619 * options.cc (General_options::parse_V): New function.
10620 * options.h: Add entries for -V and -Qy.
10621
155a0dd7
ILT
106222008-04-17 Ian Lance Taylor <iant@google.com>
10623
10624 * common.cc (Symbol_table::allocate_commons): Remove options
10625 parameter. Change caller.
10626 (Symbol_table::do_allocate_commons): Remove options parameter.
10627 Change caller. Just call do_allocate_commons_list twice.
10628 (Symbol_table::do_allocate_commons_list): New function, broken out
10629 of do_allocate_commons.
10630 * common.h (class Allocate_commons_task): Remove options_ field.
10631 Update constructor.
10632 * symtab.cc (Symbol_table::Symbol_table): Initialize
10633 tls_commons_.
10634 (Symbol_table::add_from_object): Put TLS common symbols on
10635 tls_commons_ list.
10636 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10637 which are IN_OUTPUT_DATA.
10638 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10639 allocate_commons and do_allocate_commons declarations. Declare
10640 do_allocate_commons_list.
10641 * gold.cc (queue_middle_tasks): Update creation of
10642 Allocate_commons_task to not pass options.
10643 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10644 (TLS_TEST_C_FLAGS): New variable.
10645 (tls_test_c_pic.o): New target.
10646 (tls_test_shared.so): Link in tls_test_c_pic.o.
10647 (tls_test_c_pic_ie.o): New target.
10648 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10649 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10650 (tls_test_c.o): New target.
10651 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10652 (tls_pic_test_LDADD): Likewise.
10653 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10654 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10655 (tls_test_c_gnu2.o): New target.
10656 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10657 tls_test_c_gnu2.o.
10658 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10659 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10660 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10661 * testsuite/tls_test.cc: Include "config.h".
10662 (t_last): Call t11_last.
10663 * testsuite/tls_test.h (t11, t11_last): Declare.
10664 * testsuite/tls_test_c.c: New file.
10665 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10666 * configure.ac: Check for OpenMP support.
10667 * configure, config.in, Makefile.in: Rebuild.
10668 * testsuite/Makefile.in: Rebuild.
10669
edfbb029
CC
106702008-04-16 Cary Coutant <ccoutant@google.com>
10671
10672 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10673 (Target_i386::tls_base_symbol_defined_): New field.
10674 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10675 (Target_i386::Scan::global): Likewise.
10676 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10677 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10678 (Target_x86_64::tls_base_symbol_defined_): New field.
10679 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10680 (Target_x86_64::Scan::global): Likewise.
10681
f3c69fca
CC
106822008-04-16 Cary Coutant <ccoutant@google.com>
10683
10684 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
10685 (Symbol::needs_plt_entry): Allow weak undefined symbols.
10686 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
10687 building shared libraries.
10688 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
10689 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
10690 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
10691 * testsuite/Makefile.in: Rebuild.
10692 * testsuite/weak_undef.h: New file.
10693 * testsuite/weak_undef_file1.cc: Add extra test cases.
10694 * testsuite/weak_undef_file2.cc: Likewise.
10695 * testsuite/weak_undef_test.cc: Likewise.
10696
7c414435
DM
106972008-04-16 David S. Miller <davem@davemloft.net>
10698
32b769e1
DM
10699 * sparc.cc (Target_sparc::Scan): Change from struct to class.
10700 Add issued_non_pic_error_ field. Declare check_non_pic.
10701 (Target_sparc::Scan::check_non_pic): New function.
10702 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
10703 (Target_sparc::Scan::global): Likewise.
10704
11936fb1
DM
10705 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
10706 * configure: Rebuild.
10707
7c414435
DM
10708 * options.h (DEFINE_enable): New macro.
10709 (new_dtags): New enable option.
10710 (initfirst, interpose, loadfltr, nodefaultlib,
10711 nodelete, nodlopen, nodump): New -z options.
10712 * layout.cc (Layout:finish_dynamic_section): If new
10713 dtags enabled, emit DT_RUNPATH. Also, emit a
10714 DT_FLAGS_1 containing any specified -z flags.
10715
85c7bf8b
ILT
107162008-04-16 Ian Lance Taylor <iant@google.com>
10717
12c0daef
ILT
10718 * copy-relocs.cc: New file.
10719 * copy-relocs.h: New file.
10720 * reloc.cc: Remove Copy_relocs code.
10721 * reloc.h: Likewise.
10722 * reloc-types.h (struct Reloc_types) [both versions]: Add
10723 get_reloc_addend_noerror.
10724 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
10725 variants of add_global which take an addend which must be zero.
10726 * i386.cc: Include "copy-relocs.h".
10727 (class Target_i386): Change type of copy_relocs_ to variable,
10728 update initializer.
10729 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
10730 Change all callers.
10731 (Target_i386::do_finalize_sections): Change handling of
10732 copy_relocs_.
10733 * sparc.cc: Include "copy-relocs.h".
10734 (class Target_sparc): Change type of copy_relocs_ to variable,
10735 update initializer.
10736 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
10737 Change all callers.
10738 (Target_sparc::do_finalize_sections): Change handling of
10739 copy_relocs_.
10740 * x86_64.cc: Include "copy-relocs.h".
10741 (class Target_x86_64): Change type of copy_relocs_ to variable,
10742 update initializer.
10743 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
10744 class. Change all callers.
10745 (Target_x86_64::do_finalize_sections): Change handling of
10746 copy_relocs_.
10747 * Makefile.am (CCFILES): Add copy-relocs.cc.
10748 (HFILES): Add copy-relocs.h.
10749
4f4995b6
ILT
10750 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
10751
85c7bf8b
ILT
10752 * testsuite/script_test_4.sh: Permit leading zeroes.
10753
4f2a9edd
ILT
107542008-04-15 Ian Lance Taylor <iant@google.com>
10755
e6188289
ILT
10756 * script-sections.cc (Script_sections::create_segments): Use
10757 header_size_adjustment even when there is enough room for the
10758 headers.
10759 * testsuite/script_test_4.sh: New file.
10760 * testsuite/script_test_4.t: New file.
10761 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
10762 (check_DATA): Add script_test_4.stdout.
10763 (MOSTLYCLEANFILES): Likewise.
10764 (script_test_4): New target.
10765 (script_test_4.stdout): New target.
10766 * testsuite/Makefile.in: Rebuild.
10767
4f2a9edd
ILT
10768 * sparc.cc: Add definitions for Output_data_plt_sparc class
10769 constants.
10770
f5314dd5
DM
107712008-04-14 David S. Miller <davem@davemloft.net>
10772
10773 * sparc.cc: New file.
10774 * Makefile.am (TARGETSOURCES): Add sparc.cc
10775 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
10776 * configure.tgt: Document targ_extra_size and
10777 targ_extra_big_endian. Add entries for sparc-* and
10778 sparc64-*.
10779 * configure.ac: Handle targ_extra_size and
10780 targ_extra_big_endian.
10781 * Makefile.in: Rebuild.
10782 * configure: Likewise.
10783 * po/POTFILES.in: Likewise.
10784 * po/gold.pot: Likewise.
10785
154e0e9a
ILT
107862008-04-14 Ian Lance Taylor <iant@google.com>
10787
10788 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
10789 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
10790 in the name/type/flags to section mapping. Don't call
10791 allocate_output_section.
10792 (Layout::choose_output_section): Change parameter from adjust_name
10793 to is_input_section. Don't permit input sections after sections
10794 are attached to segments. Don't call allocate_output_section.
10795 (Layout::layout_eh_frame): Call update_flags_for_input_section,
10796 not write_enable_output_section.
10797 (Layout::make_output_section): Don't push to
10798 unattached_section_list_ nor call attach_to_segment. Call
10799 attach_section_to_segment if sections are attached.
10800 (Layout::attach_sections_to_segments): New function.
10801 (Layout::attach_section_to_segment): New function.
10802 (Layout::attach_allocated_section_to_segment): Rename from
10803 attach_to_segment. Remove flags parameter.
10804 (Layout::allocate_output_section): Remove function.
10805 (Layout::write_enable_output_section): Remove function.
10806 * layout.h (class Layout): Update for above changes. Add new
10807 field sections_are_attached_.
10808 * output.h (Output_section::update_flags_for_input_section): New
10809 function.
10810 * output.cc (Output_section::add_input_section): Call
10811 update_flags_for_input_section.
10812 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
10813
009a67a2
CC
108142008-04-11 Cary Coutant <ccoutant@google.com>
10815
10816 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
10817 thought unnecessary.
10818 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
10819
759b1a24
ILT
108202008-04-11 Ian Lance Taylor <iant@google.com>
10821
10822 * output.h (class Output_section_data): Remove inline definition
10823 of set_addralign.
10824 * output.cc (Output_section_data::set_addralign): New function.
10825
c2b45e22
CC
108262008-04-11 Cary Coutant <ccoutant@google.com>
10827
10828 Add support for TLS descriptors for i386 and x86_64.
10829 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
10830 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
10831 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
10832 GOT_TYPE_TLS_DESC.
10833 (Target_i386::got_mod_index_entry): Remove unnecessary code.
10834 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
10835 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
10836 relocations.
10837 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
10838 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
10839 Fix problem with initial-exec relocations.
10840 (Target_i386::Relocate::relocate_tls): Likewise.
10841 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
10842 relaxation.
10843 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
10844 support for section-plus-offset dynamic table entries.
10845 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
10846 (Output_data_dynamic::Dynamic_entry): Add support for
10847 section-plus-offset dynamic table entries.
10848 (Output_data_dynamic::Classification): Likewise.
10849 (Output_data_dynamic::classification_): Renamed offset_.
10850 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
10851 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
10852 (Target_x86_64::make_plt_section): New function.
10853 (Target_x86_64::reserve_tlsdesc_entries): New function.
10854 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
10855 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
10856 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
10857 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
10858 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
10859 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
10860 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
10861 add extra PLT entry for TLS descriptors.
10862 (Output_data_plt_x86_64::got_): New field.
10863 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
10864 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
10865 fields.
10866 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
10867 descriptors.
10868 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
10869 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
10870 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
10871 R_386_TLS_DESC_CALL relocations.
10872 (Target_x86_64::Scan::global): Likewise.
10873 (Target_x86_64::do_finalize_sections): Add dynamic table entries
10874 for TLS descriptors.
10875 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
10876 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
10877 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
10878 GD-to-IE relaxation.
10879 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
10880 and TLS_DESCRIPTORS.
10881 * Makefile.in: Rebuild.
10882 * configure: Rebuild.
10883 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
10884 (tls_test_shared2.so): New target.
10885 (tls_shared_gd_to_ie_test_SOURCES): New variable.
10886 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
10887 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
10888 (tls_shared_gd_to_ie_test_LDADD): New variable.
10889 (tls_shared_gnu2_gd_to_ie_test): New target.
10890 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
10891 New targets.
10892 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
10893 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
10894 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
10895 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
10896 (tls_shared_gnu2_test): New target.
10897 (tls_test_gnu2_shared.so): New target.
10898 (tls_shared_gnu2_test_SOURCES): New variable.
10899 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
10900 (tls_shared_gnu2_test_LDFLAGS): New variable.
10901 (tls_shared_gnu2_test_LDADD): New variable.
10902 * testsuite/Makefile.in: Rebuild.
10903 * testsuite/Makefile.
10904
83bfb6b7
ILT
109052008-04-11 Ian Lance Taylor <iant@google.com>
10906
10907 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
10908 justsyms.t.
10909 * testsuite/Makefile.in: Rebuild.
10910
10911 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
10912 long.
10913 * testsuite/script_test_2.cc (main): Adjust test.
10914
706e1f5e
ILT
109152008-04-11 David S. Miller <davem@davemloft.net>
10916 Ian Lance Taylor <iant@google.com>
10917
10918 * options.h (General_options): Add entries for '-Y' and
10919 '-relax'.
10920 * options.cc (General_options:finalize): If -Y was used, add those
10921 entries to the library path instead of the default "/lib" and
10922 "/usr/lib".
10923
7c98e6bb
DM
109242008-04-11 David S. Miller <davem@davemloft.net>
10925
10926 * testsuite/justsyms.t: Start at 0x100.
10927 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10928 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10929 long.
10930 * testsuite/script_test_2.cc: Adjust string and section length
10931 checks.
7c98e6bb 10932
99a37bfd
ILT
109332008-04-09 Ian Lance Taylor <iant@google.com>
10934
2cefc357
ILT
10935 PR gold/5996
10936 * script-sections.cc (Sections_element::allocate_to_segment): Add
10937 orphan parameter.
10938 (Output_section_definition::allocate_to_segment): Likewise.
10939 (Orphan_output_section::allocate_to_segment): Likewise.
10940 (Script_sections::attach_sections_using_phdrs_clause): Don't
10941 propagate non-PT_LOAD segments to orphan sections.
10942 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10943 readelf rather than objdump.
10944 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10945 .interp section and PT_INTERP segment are the same size.
10946 * testsuite/Makefile.in: Rebuild.
10947
99a37bfd
ILT
10948 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10949 aliases for symbols defined in the same object.
10950 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10951 (weak_alias_test_SOURCES): New variable.
10952 (weak_alias_test_DEPENDENCIES): New variable.
10953 (weak_alias_test_LDFLAGS): New variable.
10954 (weak_alias_test_LDADD): New variable.
10955 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10956 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10957 (weak_alias_test_3.o): New target.
10958 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10959 * testsuite/weak_alias_test_main.cc: New file.
10960 * testsuite/weak_alias_test_1.cc: New file.
10961 * testsuite/weak_alias_test_2.cc: New file.
10962 * testsuite/weak_alias_test_3.cc: New file.
10963
780e49c5
ILT
109642008-04-08 Ian Lance Taylor <iant@google.com>
10965
cdb0b8f5
ILT
10966 * options.h (class General_options): Add --noinhibit-exec option.
10967 * main.cc (main): Check --noinhibit-exec.
10968
0864d551
ILT
10969 * options.h (class General_options): Define --wrap as a special
10970 option. Add wrap_symbols_ field.
10971 (General_options::any_wrap_symbols): New function.
10972 (General_options::is_wrap_symbol): New function.
10973 * options.cc (General_options::parse_wrap): New function.
10974 (General_options::General_options): Initialize wrap_symbols_.
10975 * symtab.cc (Symbol_table::wrap_symbol): New function.
10976 (Symbol_table::add_from_object): Handle --wrap.
10977 * symtab.h (class Symbol_table): Declare wrap_symbol.
10978 * target.h (Target::wrap_char): New function.
10979 (Target::Target_info): Add wrap_char field.
10980 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10981 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10982 * testsuite/testfile.cc (Target_test::test_target_info):
10983 Likewise.
10984
789aa6de
ILT
10985 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10986 there is one.
10987
2c38906f
ILT
10988 * layout.h (class Layout): Add added_eh_frame_data_ field.
10989 * layout.cc (Layout::Layout): Initialize new field.
10990 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10991 output section until we find a section we merged successfully.
10992 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10993 that the size be non-zero.
10994
780e49c5
ILT
10995 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10996 qualifier.
10997
7fcd0256
ILT
109982008-04-08 Craig Silverstein <csilvers@google.com>
10999
11000 * configure.ac: Export new conditional variable HAVE_ZLIB.
11001 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
11002 on HAVE_ZLIB.
11003 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
11004 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11005
6835af53
ILT
110062008-04-07 Ian Lance Taylor <iant@google.com>
11007
e24f324c
ILT
11008 * version.cc (version_string): Set to "1.5".
11009
a036edd8
ILT
11010 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
11011 Add issued_non_pic_error_ field. Declare check_non_pic.
11012 (Target_x86_64::Scan::check_non_pic): New function.
11013 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
11014 (Target_x86_64::Scan::global): Likewise.
11015
624f8810
ILT
11016 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
11017 addend parameter. Change caller. Handle merge sections.
11018 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
11019 Address to Addend. Don't add in the result of
11020 local_section_offset, pass down the addend and use the returned
11021 value.
11022 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
11023 Update declarations of local_section_offset and symbol_value.
11024 * testsuite/two_file_test_1.cc (t18): New function.
11025 * testsuite/two_file_test_2.cc (f18): New function.
11026 * testsuite/two_file_test_main.cc (main): Call t18.
11027 * testsuite/two_file_test.h (t18, f18): Declare.
11028
6835af53
ILT
11029 * configure.ac: Don't test for objdump, c++filt, or readelf.
11030 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
11031 conditionals.
11032 (TEST_READELF): New variable.
11033 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
11034 (check_PROGRAMS): Add two_file_strip_test.
11035 (two_file_strip_test): New target.
11036 (check_PROGRAMS): Add two_file_same_shared_strip_test.
11037 (two_file_same_shared_strip_test_SOURCES): New variable.
11038 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
11039 (two_file_same_shared_strip_test_LDFLAGS): New variable.
11040 (two_file_same_shared_strip_test_LDADD): New variable.
11041 (two_file_shared_strip.so): New target.
11042 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
11043 (ver_test_5.syms, ver_test_7.syms): Likewise.
11044 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
11045 (strip_test_3.stdout): Use TEST_OBJDUMP.
11046 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11047
86925eef
CC
110482008-04-04 Cary Coutant <ccoutant@google.com>
11049
11050 * symtab.h (Symbol::is_weak_undefined): New function.
11051 (Symbol::is_strong_undefined): New function.
11052 (Symbol::is_absolute): New function.
11053 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
11054 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
11055 absolute symbols.
11056 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
11057 (weak_undef_test): New target.
11058 * testsuite/Makefile.in: Rebuild.
11059 * testsuite/weak_undef_file1.cc: New file.
11060 * testsuite/weak_undef_file2.cc: New file.
11061 * testsuite/weak_undef_test.cc: New file.
11062
126f3ece
ILT
110632008-04-03 Craig Silverstein <csilvers@google.com>
11064
11065 * compressed_output.h (class Output_compressed_section): Use
11066 unsigned buffer.
11067 * compressed_output.cc (zlib_compress): Use unsigned buffers,
11068 add zlib header.
11069 (zlib_compressed_suffix): Removed.
11070 (Output_compressed_section::set_final_data_size): Use unsigned
11071 buffers.
11072 * testsuite/Makefile.am (flagstest_compress_debug_sections):
11073 Fix linker invocation.
11074 (flagstest_o_specialfile_and_compress_debug_sections):
11075 Likewise.
11076 * testsuite/Makefile.in: Regenerated.
11077
deae2a14
DM
110782008-04-02 David S. Miller <davem@davemloft.net>
11079
11080 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11081 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11082
70752818
ILT
110832008-04-02 Craig Silverstein <csilvers@google.com>
11084
11085 * TODO: New file.
11086
39d0cb0e
ILT
110872008-04-02 Ian Lance Taylor <iant@google.com>
11088
11089 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11090 parameters. Update for new key type to views_. Change all
11091 callers.
11092 (File_read::read): Adjust for byteshift in returned view.
11093 (File_read::add_view): New function, broken out of
11094 find_and_make_view.
11095 (File_read::make_view): New function, broken out of
11096 find_and_make_view.
11097 (File_read::find_or_make_view): Add offset and aligned
11098 parameters. Rewrite accordingly. Change all callers.
11099 (File_read::get_view): Add offset and aligned parameters. Adjust
11100 for byteshift in return value.
11101 (File_read::get_lasting_view): Likewise.
11102 * fileread.h (class File_read): Update declarations.
11103 (class File_read::View): Add byteshift_ field. Add byteshift to
11104 constructor. Add byteshift method.
11105 * archive.h (Archive::clear_uncached_views): New function.
11106 (Archive::get_view): Add aligned parameter. Change all callers.
11107 * object.h (Object::get_view): Add aligned parameter. Change all
11108 callers.
11109 (Object::get_lasting_view): Likewise.
11110
11111 * fileread.cc (File_read::release): Don't call clear_views if
11112 there are multiple objects.
11113 * fileread.h (File_read::clear_uncached_views): New function.
11114 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11115 on the archive.
11116
a1207466
CC
111172008-03-31 Cary Coutant <ccoutant@google.com>
11118
11119 Add thin archive support.
11120 * archive.cc (Archive::armagt): New const.
11121 (Archive::setup): Remove task parameter and calls to unlock.
11122 (Archive::unlock_nested_archives): New function.
11123 (Archive::read_header): Add nested_off parameter. Change
11124 all callers.
11125 (Archive::interpret_header): Likewise.
11126 (Archive::include_all_members): Change to handle thin
11127 archives.
11128 (Archive::include_member): Likewise.
11129 * archive.h (Archive::Archive): Add new parameters and
11130 initializers.
11131 (Archive::armagt): New const.
11132 (Archive::setup): Remove task parameter.
11133 (Archive::unlock_nested_archives): New function.
11134 (Archive::read_header): Add nested_off parameter.
11135 (Archive::interpret_header): Likewise.
11136 (Archive::Nested_archive_table): New typedef.
11137 (Archive::is_thin_archive_): New field.
11138 (Archive::nested_archives_): New field.
11139 (Archive::options_): New field.
11140 (Archive::dirpath_): New field.
11141 (Archive::task_): New field.
11142 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11143 for thin archives. Pass additional parameters to
11144 Archive::Archive. Unlock the archive file after calling
11145 Archive::setup.
cd536b21 11146
479f6503
ILT
111472008-03-29 Ian Lance Taylor <iant@google.com>
11148
686c8caf
ILT
11149 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11150 version symbol to be local.
11151 * testsuite/ver_test_4.sh: New file.
11152 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11153 (check_DATA): Add ver_test_4.syms.
11154 (ver_test_4.syms): New target.
11155 * testsuite/Makefile.in: Rebuild.
11156
ab794b6b
ILT
11157 * output.cc
11158 (Output_section::Input_section_sort_entry::has_priority): New
11159 function.
11160 (Output_section::Input_section_sort_entry::match_file_name): New
11161 function.
11162 (Output_section::Input_section_sort_entry::match_section_name):
11163 Remove.
11164 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11165 Remove.
11166 (Output_section::Input_section_sort_entry::match_section_file):
11167 Remove.
11168 (Output_section::Input_section_sort_compare::operator()): Rewrite
11169 using new Input_section_sort_entry functions. Sort crtbegin and
11170 crtend first. Sort sections with no priority before sections with
11171 a priority.
11172 * testsuite/initpri1.c (d3): Check j != 4.
11173 (cd5): New constructor/destructor function.
11174 (main): Check j != 2.
11175
479f6503
ILT
11176 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11177 new symbol when resolving, don't call set_is_default.
11178 * testsuite/ver_test_7.cc: New file.
11179 * testsuite/ver_test_7.sh: New file.
11180 * testsuite/Makefile.am (ver_test_7.so): New target.
11181 (ver_test_7.o): New target.
11182 (check_SCRIPTS): Add ver_test_7.sh.
11183 (check_DATA): Add ver_test_7.syms.
11184 (ver_test_7.syms): New target.
11185
2fd32231
ILT
111862008-03-28 Ian Lance Taylor <iant@google.com>
11187
11188 * layout.cc (Layout::layout): If we see an input section with a
11189 name that needs sorting, set the must_sort flag for the output
11190 section.
11191 (Layout::make_output_section): If the name of the output section
11192 indicates that it might require sorting, set the may_sort flag.
11193 * output.h (Output_section::may_sort_attached_input_sections): New
11194 function.
11195 (Output_section::set_may_sort_attached_input_sections): New
11196 function.
11197 (Output_section::must_sort_attached_input_sections): New
11198 function.
11199 (Output_section::set_must_sort_attached_input_sections): New
11200 function.
11201 (class Output_section): Declare Input_section_sort_entry. Define
11202 Input_section_sort_compare. Declare
11203 sort_attached_input_sections. Add new fields:
11204 may_sort_attached_input_sections_,
11205 must_sort_attached_input_sections_,
11206 attached_input_sections_are_sorted_.
11207 * output.cc (Output_section::Output_section): Initialize new
11208 fields.
11209 (Output_section::add_input_section): Add an entry to
11210 input_sections_ if may_sort or must_sort are true.
11211 (Output_section::set_final_data_size): Call
11212 sort_attached_input_sections if necessary.
11213 (Output_section::Input_section_sort_entry): Define new class.
11214 (Output_section::Input_section_sort_compare::operator()): New
11215 function.
11216 (Output_section::sort_attached_input_sections): New function.
11217 * configure.ac: Check whether the compiler supports constructor
11218 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11219 * testsuite/initpri1.c: New file.
11220 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11221 CONSTRUCTOR_PRIORITY.
11222 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11223 (initpri1_LDFLAGS): New variable.
11224 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11225
18e6b24e
ILT
112262008-03-27 Ian Lance Taylor <iant@google.com>
11227
49bdd526
ILT
11228 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11229 * testsuite/common_test_1.c: New file.
11230 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11231 (common_test_1_SOURCES): New variable.
11232 (common_test_1_DEPENDENCIES): New variable.
11233 (common_test_1_LDFLAGS): New variable.
11234
18e6b24e
ILT
11235 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11236 and commons_ correctly when NAME/VERSION does not override
11237 NAME/NULL.
11238 * testsuite/ver_test_6.c: New file.
11239 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11240 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11241 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11242
04bf7072
ILT
112432008-03-26 Ian Lance Taylor <iant@google.com>
11244
5871526f
ILT
11245 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11246 of an undefined symbol from a version script.
11247 * testsuite/Makefile.am (ver_test_5.so): New target.
11248 (ver_test_5.o): New target.
11249 (check_SCRIPTS): Add ver_test_5.sh.
11250 (check_DATA): Add ver_test_5.syms.
11251 (ver_test_5.syms): New target.
11252 * testsuite/ver_test_5.cc: New file.
11253 * testsuite/ver_test_5.script: New file.
11254 * testsuite/ver_test_5.sh: New file.
11255 * Makefile.in, testsuite/Makefile.in: Rebuild.
11256
04bf7072
ILT
11257 PR gold/5986
11258 Fix problems building gold with gcc 4.3.0.
11259 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11260 (gold_error_at_location, gold_warning_at_location): Use it.
11261 * configure.ac: Check whether we can compile and use a template
11262 function with a printf attribute.
11263 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11264 when jumping over bytes.
11265 * object.cc: Instantiate Object::read_section_data.
11266 * debug.h: Include <cstring>
11267 * dwarf_reader.cc: Include <algorithm>
11268 * main.cc: Include <cstring>.
11269 * options.cc: Include <cstring>.
11270 * output.cc: Include <cstring>.
11271 * script.cc: Include <cstring>.
11272 * script.h: Include <string>.
11273 * symtab.cc: Include <cstring> and <algorithm>.
11274 * target-select.cc: Include <cstring>.
11275 * version.cc: Include <string>.
11276 * testsuite/testmain.cc: Include <cstdlib>.
11277 * configure, config.in: Rebuild.
11278
874c5b28
ILT
112792008-03-25 Ian Lance Taylor <iant@google.com>
11280
819d6c3a
ILT
11281 * options.cc: Include "../bfd/bfdver.h".
11282 (options::help): Print bug reporting address.
11283
f4b2c6f5
ILT
11284 * version.cc (print_version): Adjust output for current value of
11285 BFD_VERSION_STRING.
11286
11287 * NEWS: New file.
11288
e96caa79
ILT
11289 * options.cc (options::help): Print list of supported targets.
11290 * target-select.h: Include <vector>.
11291 (class Target_selector): Make machine_, size_, and is_big_endian_
11292 fields const. Add bfd_name_ and instantiated_target_ fields.
11293 (Target_selector::Target_selector): Add bfd_name parameter.
11294 (Target_selector::recognize): Make non-virtual, call
11295 do_recognize.
11296 (Target_selector::recognize_by_name): Make non-virtual, call
11297 do_recognize_by_name.
11298 (Target_selector::supported_names): New function.
11299 (Target_selector::bfd_name): New function.
11300 (Target_selector::do_instantiate_target): New pure virtual
11301 function.
11302 (Target_selector::do_recognize): New virtual function.
11303 (Target_selector::do_recognize_by_name): New virtual function.
11304 (Target_selector::instantiate_target): New private function.
11305 (supported_target_names): Declare.
11306 * target-select.cc (Target_selector::Target_selector): Update for
11307 new parameter and fields.
11308 (select_target_by_name): Check that the name matches before
11309 calling recognize_by_name.
11310 (supported_target_names): New function.
11311 * i386.cc (class Target_selector_i386): Update Target_selector
11312 constructor call. Remove recognize and recognize_by_name. Add
11313 do_instantiate_target.
11314 * x86_64.cc (class Target_selector_x86_64): Likewise.
11315 * testsuite/testfile.cc (class Target_selector_test): Update for
11316 changes to Target_selector.
11317
874c5b28
ILT
11318 * README: Rewrite, with some notes on unsupported features.
11319
0a65a3a7
CC
113202008-03-24 Cary Coutant <ccoutant@google.com>
11321
11322 * i386.cc (Target_i386::Got_type): New enum declaration.
11323 (Target_i386::Scan::local): Updated callers of Output_data_got
11324 member functions.
11325 (Target_i386::Scan::global): Likewise.
11326 (Target_i386::Relocate::relocate): Likewise.
11327 (Target_i386::Relocate::relocate_tls): Likewise.
11328 * object.h (Got_offset_list): New class.
11329 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11330 (Sized_relobj::local_got_offset): Likewise.
11331 (Sized_relobj::set_local_got_offset): Likewise.
11332 (Sized_relobj::local_has_tls_got_offset): Removed.
11333 (Sized_relobj::local_tls_got_offset): Removed.
11334 (Sized_relobj::set_local_tls_got_offset): Removed.
11335 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11336 * output.cc (Output_data_got::add_global): Added got_type parameter.
11337 (Output_data_got::add_global_with_rel): Likewise.
11338 (Output_data_got::add_global_with_rela): Likewise.
11339 (Output_data_got::add_global_pair_with_rel): New function.
11340 (Output_data_got::add_global_pair_with_rela): New function.
11341 (Output_data_got::add_local): Added got_type parameter.
11342 (Output_data_got::add_local_with_rel): Likewise.
11343 (Output_data_got::add_local_with_rela): Likewise.
11344 (Output_data_got::add_local_pair_with_rel): New function.
11345 (Output_data_got::add_local_pair_with_rela): New function.
11346 (Output_data_got::add_global_tls): Removed.
11347 (Output_data_got::add_global_tls_with_rel): Removed.
11348 (Output_data_got::add_global_tls_with_rela): Removed.
11349 (Output_data_got::add_local_tls): Removed.
11350 (Output_data_got::add_local_tls_with_rel): Removed.
11351 (Output_data_got::add_local_tls_with_rela): Removed.
11352 * output.h (Output_data_got::add_global): Added got_type parameter.
11353 (Output_data_got::add_global_with_rel): Likewise.
11354 (Output_data_got::add_global_with_rela): Likewise.
11355 (Output_data_got::add_global_pair_with_rel): New function.
11356 (Output_data_got::add_global_pair_with_rela): New function.
11357 (Output_data_got::add_local): Added got_type parameter.
11358 (Output_data_got::add_local_with_rel): Likewise.
11359 (Output_data_got::add_local_with_rela): Likewise.
11360 (Output_data_got::add_local_pair_with_rel): New function.
11361 (Output_data_got::add_local_pair_with_rela): New function.
11362 (Output_data_got::add_global_tls): Removed.
11363 (Output_data_got::add_global_tls_with_rel): Removed.
11364 (Output_data_got::add_global_tls_with_rela): Removed.
11365 (Output_data_got::add_local_tls): Removed.
11366 (Output_data_got::add_local_tls_with_rel): Removed.
11367 (Output_data_got::add_local_tls_with_rela): Removed.
11368 * resolve.cc (Symbol::override_base_with_special): Removed
11369 reference to has_got_offset_ field.
11370 * symtab.cc (Symbol::init_fields): Replaced initialization
11371 of got_offset_ with got_offsets_. Removed initialization
11372 of has_got_offset_
53fcba31 11373 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
11374 (Symbol::got_offset): Likewise.
11375 (Symbol::set_got_offset): Likewise.
11376 (Symbol::has_tls_got_offset): Removed.
11377 (Symbol::tls_got_offset): Removed.
11378 (Symbol::set_tls_got_offset): Removed.
11379 (Symbol::got_offset_): Removed.
11380 (Symbol::tls_mod_got_offset_): Removed.
11381 (Symbol::tls_pair_got_offset_): Removed.
11382 (Symbol::got_offsets_): New field.
11383 (Symbol::has_got_offset): Removed.
11384 (Symbol::has_tls_mod_got_offset): Removed.
11385 (Symbol::has_tls_pair_got_offset): Removed.
11386 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
11387 (Target_x86_64::Scan::local): Updated callers of Output_data_got
11388 member functions.
11389 (Target_x86_64::Scan::global): Likewise.
11390 (Target_x86_64::Relocate::relocate): Likewise.
11391 (Target_x86_64::Relocate::relocate_tls): Likewise.
11392
bd52eafb
BE
113932008-03-25 Ben Elliston <bje@au.ibm.com>
11394
11395 * yyscript.y: Fix spelling error in comment.
11396
8b105e34
ILT
113972008-03-24 Ian Lance Taylor <iant@google.com>
11398
8ed814a9
ILT
11399 * options.h (class General_options): Define build_id option.
11400 * layout.h (class Layout): Declare write_build_id, create_note,
11401 create_build_id. Add build_id_note_ member.
11402 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
11403 "libiberty.h", "md5.h", "sha1.h".
11404 (Layout::Layout): Initialize eh_frame_data_,
11405 eh_frame_hdr_section_, and build_id_note_.
11406 (Layout::finalize): Call create_build_id.
11407 (Layout::create_note): New function, broken out of
11408 Layout::create_gold_note.
11409 (Layout::create_gold_note): Call create_note.
11410 (Layout::create_build_id): New function.
11411 (Layout::write_build_id): New function.
11412 (Close_task_runner::run): Call write_build_id.
11413
8b105e34
ILT
11414 * x86_64.cc: Correct license to GPLv3.
11415
086a1841
ILT
114162008-03-23 Ian Lance Taylor <iant@google.com>
11417
11418 * options.cc: Include "demangle.h".
11419 (parse_optional_string): New function.
11420 (parse_long_option): Handle takes_optional_argument.
11421 (parse_short_option): Update dash_z initializer. Handle
11422 takes_optional_argument.
11423 (General_options::General_options): Initialize do_demangle_.
11424 (General_options::finalize): Set do_demangle_. Handle demangling
11425 style.
11426 * options.h (parse_optional_string): Declare.
11427 (struct One_option): Add optional_arg field. Update constructor.
11428 Update call constructor calls. Add takes_optional_argument
11429 function.
11430 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
11431 (DEFINE_optional_string): Define.
11432 (General_options::demangle): Change from DEFINE_bool to
11433 DEFINE_optional_string.
11434 (General_options::no_demangle): New function.
11435 (General_options::do_demangle): New function.
11436 (General_options::set_do_demangle): New function.
11437 (General_options::execstack_status_): Move definition to end of
11438 class definition.
11439 (General_options::static_): Likewise.
11440 (General_options::do_demangle_): New field.
11441 * object.cc (big_endian>::get_symbol_location_info): Call
11442 Options::do_demangle, not Options::demangle.
11443 * symtab.cc (demangle): Likewise.
11444
cbb93e63
ILT
114452008-03-22 Ian Lance Taylor <iant@google.com>
11446
11447 * gold.h: Include <cstddef> and <sys/types.h>
11448 * options.h: Include <cstring>.
11449
ec531623
ILT
114502008-03-21 Ian Lance Taylor <iant@google.com>
11451
11452 * Added source code to GNU binutils.
This page took 0.690497 seconds and 4 git commands to generate.