PR gold/12675
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
4d5e4e62
ILT
12011-06-29 Ian Lance Taylor <iant@google.com>
2
3 PR gold/12675
4 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5 SHT_X86_64_UNWIND.
6 * layout.cc (Layout::layout_eh_frame): Likewise.
7
886f533a
ILT
82011-06-29 Ian Lance Taylor <iant@google.com>
9
10 PR gold/12695
11 * layout.cc (Layout::symtab_section_shndx): New function.
12 * layout.h (class Layout): Declare symtab_section_shndx.
13 * output.cc (Output_section::write_header): Call it.
14
f3ae1b28
ILT
152011-06-29 Ian Lance Taylor <iant@google.com>
16
17 PR gold/12818
18 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
19 symbols which are not used in a relocation.
20
aecf301f
ILT
212011-06-28 Ian Lance Taylor <iant@google.com>
22
23 PR gold/12898
24 * layout.cc (Layout::segment_precedes): Don't crash if a linker
25 script create indistinguishable segments.
26 (Layout::set_segment_offsets): Use stable_sort when sorting
27 segments. Pass this to Compare_segments constructor.
28 * layout.h (class Layout): Make segment_precedes non-static.
29 (class Compare_segments): Change from struct to class. Add
30 layout_ field. Add constructor.
31 * script-sections.cc
32 (Script_sections::attach_sections_using_phdrs_clause): Rename
33 local orphan to is_orphan. Don't report failure to put empty
34 section in segment. On attachment failure, report name of
35 section, and attach to first PT_LOAD segment.
36
03ef7571
ILT
372011-06-28 Ian Lance Taylor <iant@google.com>
38
39 PR gold/12934
40 * target-select.cc (Target_selector::Target_selector): Add
41 emulation parameter. Change all callers.
42 (select_target_by_bfd_name): Rename from select_target_by_name.
43 Change all callers.
44 (select_target_by_emulation): New function.
45 (supported_emulation_names): New function.
46 * target-select.h (class Target_selector): Add emulation_ field.
47 Update declarations.
48 (Target_selector::recognize_by_bfd_name): Rename from
49 recognize_by_name. Change all callers.
50 (Target_selector::supported_bfd_names): Rename from
51 supported_names. Change all callers.
52 (Target_selector::recognize_by_emulation): New function.
53 (Target_selector::supported_emulations): New function.
54 (Target_selector::emulation): New function.
55 (Target_selector::do_recognize_by_bfd_name): Rename from
56 do_recognize_by_name. Change all callers.
57 (Target_selector::do_supported_bfd_names): Rename from
58 do_supported_names. Change all callers.
59 (Target_selector::do_recognize_by_emulation): New function.
60 (Target_selector::do_supported_emulations): New function.
61 (select_target_by_bfd_name): Change name in declaration.
62 (select_target_by_emulation): Declare.
63 (supported_emulation_names): Declare.
64 * parameters.cc (parameters_force_valid_target): Try to find
65 target based on emulation from -m option.
66 * options.h (class General_options): Change doc string for -m.
67 * options.cc (help): Print emulations.
68 (General_options::parse_V): Likewise.
69 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
70 Add emulation parameter. Change all callers.
71
200b2bb9
ILT
722011-06-28 Ian Lance Taylor <iant@google.com>
73
74 * target.h (class Target): Add osabi_ field.
75 (Target::osabi): New function.
76 (Target::set_osabi): New function.
77 (Target::Target): Initialize osabi_.
78 (Target::do_adjust_elf_header): Make pure virtual.
79 (Sized_target::do_adjust_elf_header): Declare.
80 * target.cc (Sized_target::do_adjust_elf_header): New function.
81 (class Sized_target): Instantiate all versions.
82 * freebsd.h (class Target_freebsd): Remove.
83 (Target_selector_freebsd::do_recognize): Call set_osabi on
84 Target.
85 (Target_selector_freebsd::do_recognize_by_name): Likewise.
86 (Target_selector_freebsd::set_osabi): Remove.
87 * i386.cc (class Target_i386): Inherit from Sized_target rather
88 than Target_freebsd.
89 * x86_64.cc (class Target_x86_64): Likewise.
90
b3ce541e
ILT
912011-06-28 Ian Lance Taylor <iant@google.com>
92
93 * target.h (Target::can_check_for_function_pointers): Rewrite.
94 Make non-virtual.
95 (Target::can_icf_inline_merge_sections): Likewise.
96 (Target::section_may_have_icf_unsafe_poineters): Likewise.
97 (Target::Target_info): Add can_icf_inline_merge_sections field.
98 (Target::do_can_check_for_function_pointers): New virtual
99 function.
100 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
101 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
102 from can_check_for_function_pointers, move in file.
103 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
104 section_may_have_icf_unsafe_poineters, move in file.
105 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
106 * i386.cc (Target_i386::do_can_check_for_function_pointers):
107 Rename from can_check_for_function_pointers, move in file.
108 (Target_i386::can_icf_inline_merge_sections): Remove.
109 (Target_i386::i386_info): Initialize
110 can_icf_inline_merge_sections.
111 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
112 Initialize can_icf_inline_merge_sections.
113 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
114 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
115 Rename from can_check_for_function_pointers, move in file.
116 (Target_x86_64::can_icf_inline_merge_sections): Remove.
117 (Target_x86_64::x86_64_info): Initialize
118 can_icf_inline_merge_sections.
119 * testsuite/testfile.cc (Target_test::test_target_info):
120 Likewise.
121 * icf.cc (get_section_contents): Correct formatting.
122
6d1c4efb
ILT
1232011-06-27 Ian Lance Taylor <iant@google.com>
124
125 * symtab.cc (Symbol::versioned_name): New function.
126 (Symbol_table::add_to_final_symtab): Use versioned_name when
127 appropriate.
128 (Symbol_table::sized_write_symbol): Likewise.
129 * symtab.h (class Symbol): Declare versioned_name.
130 * stringpool.h (class Stringpool_template): Add variant of add
131 which takes a std::basic_string.
132 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
133 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
134 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
135 (ver_test_12.o): New target.
136 * testsuite/Makefile.in: Rebuild.
137
57eb9b50
DK
1382011-06-27 Doug Kwan <dougkwan@google.com>
139
140 * arm.cc (Arm_relocate_functions::thm_jump8,
141 Arm_relocate_functions::thm_jump11): Use a wider signed
142 type to compute offset.
143 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
144 arm_thm_jump8.
145 * testsuite/Makefile.in: Regenerate.
146 * testsuite/arm_branch_in_range.sh: Check test results of
147 arm_thm_jump11 and arm_thm_jump8.
148 * testsuite/arm_thm_jump11.s: New test source file.
149 * testsuite/arm_thm_jump11.t: New linker script.
150 * testsuite/arm_thm_jump8.s: New test source file.
151 * testsuite/arm_thm_jump8.t: New linker script.
152
487b39df
ILT
1532011-06-24 Ian Lance Taylor <iant@google.com>
154
155 * layout.cc: Include "object.h".
156 (ctors_sections_in_init_array): New static variable.
157 (Layout::is_ctors_in_init_array): New function.
158 (Layout::layout): Add entry to ctors_sections_in_init_array if
159 appropriate.
160 * layout.h (class Layout): Declare is_ctors_in_init_array.
161 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
162 is_ctors_reverse_view is set.
163 (Sized_relobj_file::write_sections): Add layout parameter. Change
164 all callers. Set is_ctors_reverse_view field of View_size.
165 (Sized_relobj_file::reverse_words): New function.
166 * object.h (Sized_relobj_file::View_size): Add
167 is_ctors_reverse_view field.
168 (class Sized_relobj_file): Update declarations.
169 * testsuite/initpri3.c: New test.
170 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
171 initpri3b.
172 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
173 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
174 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
175 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
176 * testsuite/Makefile.in: Rebuild.
177
472076e4
CC
1782011-06-24 Cary Coutant <ccoutant@google.com>
179
180 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
181 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
182 (debug_msg_cdebug.err): New targets.
183 * testsuite/Makefile.in: Regenerate.
184 * testsuite/debug_msg.sh: Check output of link with compressed debug.
185 Fix checks for link with shared library.
186
a60af0db
DK
1872011-06-24 Doug Kwan <dougkwan@google.com>
188
189 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
190 skip empty text sections.
191 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
192
5393d741
ILT
1932011-06-22 Ian Lance Taylor <iant@google.com>
194
195 PR gold/12910
196 * options.h (class General_options): Add --ctors-in-init-array.
197 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
198 friends as SHT_PROGBITS for merging sections.
199 (Layout::layout): Remove special handling of .init_array and
200 friends. Don't sort if doing relocatable link. Sort for .ctors
201 and .dtors if ctors_in_init_array.
202 (Layout::make_output_section): Force correct section types for
203 .init_array and friends. Don't sort if doing relocatable link,
204 Don't sort .ctors and .dtors if ctors_in_init_array.
205 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
206 (Layout::output_section_name): Add relobj parameter. Change all
207 callers. Handle .ctors. and .dtors. in code rather than table.
208 Handle .ctors and .dtors if ctors_in_init_array.
209 (Layout::match_file_name): New function, moved from output.cc.
210 * layout.h (class Layout): Update declarations.
211 * output.cc: Include "layout.h".
212 (Input_section_sort_entry::get_priority): New function.
213 (Input_section_sort_entry::match_file_name): Just call
214 Layout::match_file_name.
215 (Output_section::Input_section_sort_init_fini_compare::operator()):
216 Handle .ctors and .dtors. Sort by explicit priority rather than
217 by name.
218 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
219 * testsuite/initpri2.c: New test.
220 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
221 (check_PROGRAMS): Add initpri2.
222 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
223 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
224 * configure, testsuite/Makefile.in: Rebuild.
225
e1f74f98
ILT
2262011-06-19 Ian Lance Taylor <iant@google.com>
227
228 PR gold/12880
229 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
230 .interp section to a PT_INTERP segment even if we have seen a
231 --dynamic-linker option. Don't do it if we have seen a PHDRS
232 clause in a linker script.
233 (Layout::finalize): Don't create a .interp section if we've
234 already create a PT_INTERP segment.
235 (Layout::create_interp): Always call choose_output_section (revert
236 patch of 2011-06-17). Don't create PT_INTERP segment.
237 * script-sections.cc
238 (Script_sections::create_note_and_tls_segments): Add a .interp
239 section to a PT_INTERP segment even if we have seen a
240 --dynamic-linker option.
241
766f91bb
ILT
2422011-06-18 Ian Lance Taylor <iant@google.com>
243
244 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
245 merely because a non-PT_LOAD segment has a dynamic reloc.
246
0d212c3a
ILT
2472011-06-18 Ian Lance Taylor <iant@google.com>
248
249 * layout.cc (Layout::finish_dynamic_section): Don't create
250 DT_FLAGS entry if not needed.
251
911a5072
ILT
2522011-06-18 Ian Lance Taylor <iant@google.com>
253
254 PR gold/12745
255 * layout.cc (Layout::layout_eh_frame): Correct handling of
256 writable .eh_frame section.
257
534b4e5f
ILT
2582011-06-17 Ian Lance Taylor <iant@google.com>
259
260 PR gold/12893
261 * resolve.cc (Symbol_table::resolve): Don't give an error if a
262 symbol is redefined with the exact same object and value.
263
10b4f102
ILT
2642011-06-17 Ian Lance Taylor <iant@google.com>
265
266 PR gold/12880
267 * layout.h (class Layout): Add interp_segment_ field.
268 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
269 (Layout::attach_allocated_section_to_segment): If making shared
270 library, put .interp section in PT_INTERP segment.
271 (Layout::finalize): Also call create_interp if -dynamic-linker
272 option was used.
273 (Layout::create_interp): Assert that there is no PT_INTERP
274 segment. If not using a SECTIONS clause, use make_output_section.
275 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
276 * script-sections.cc
277 (Script_sections::create_note_and_tls_segments): If making shared
278 library, put .interp section in PT_INTERP segment.
279
a29b0dad
ILT
2802011-06-17 Ian Lance Taylor <iant@google.com>
281
e588ea8d
ILT
282 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
283 when making a shared library.
284
2852011-06-17 Ian Lance Taylor <iant@google.com>
286
287 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
288 parameter. Change all callers. Don't issue warning about PC32
289 against locally defined symbol.
a29b0dad 290
9d3b0698
ILT
2912011-06-16 Ian Lance Taylor <iant@google.com>
292
293 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
294 occurs in same object.
295
85b0f90c
AM
2962011-06-14 Alan Modra <amodra@gmail.com>
297
298 * po/POTFILES.in: Regenerate.
299
a94907d9
ILT
3002011-06-09 Ian Lance Taylor <iant@google.com>
301
302 * script-sections.cc
303 (Orphan_output_section::set_section_addresses): For a relocatable
304 link set address to 0.
305
4fb3a1c3
CC
3062011-06-09 Cary Coutant <ccoutant@google.com>
307
308 PR gold/12804
309 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
310 used with --compress-debug-sections.
311 * gold/object.cc (Sized_relobj_file::do_layout): Report
312 uncompressed size of compressed input sections.
313
61220854
CC
3142011-06-08 Cary Coutant <ccoutant@google.com>
315
316 PR gold/12804
317 * testsuite/two_file_test_2_v1.cc: Change initialization of
318 v2 to keep it in .data.
319
e6455dfb
CC
3202011-06-07 Cary Coutant <ccoutant@google.com>
321
322 * common.cc (Symbol_table::do_allocate_commons_list): Call
323 gold_fallback.
324 * errors.cc (Errors::fatal): Adjust call to gold_exit.
325 (Errors::fallback): New function.
326 (gold_fallback): New function.
327 * errors.h (Errors::fallback): New function.
328 * gold.cc (gold_exit): Change status parameter to enum; adjust
329 all callers.
330 (queue_initial_tasks): Call gold_fallback.
331 * gold.h: Include cstdlib.
332 (Exit_status): New enum type.
333 (gold_exit): Change status parameter to enum.
334 (gold_fallback): New function.
335 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
336 (Layout::create_symtab_sections): Likewise.
337 (Layout::create_shdrs): Likewise.
338 * main.cc (main): Adjust call to gold_exit.
339 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
340 (Output_data_got::add_got_entry_pair): Likewise.
341 (Output_section::add_input_section): Likewise.
342 (Output_section::add_output_section_data): Likewise.
343 (Output_segment::set_section_list_addresses): Likewise.
344 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
345
fb0e076f
CC
3462011-06-07 Cary Coutant <ccoutant@google.com>
347
348 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
349 for incremental links.
350 * output.cc (Output_segment::set_section_list_addresses): Remove
351 FIXME and test for TLS or BSS.
352
a5ee4d5d
CC
3532011-06-07 Cary Coutant <ccoutant@google.com>
354
355 * testsuite/Makefile.am: Add incremental_copy_test,
356 incremental_common_test_1.
357 * testsuite/Makefile.in: Regenerate.
358 * testsuite/common_test_1_v1.c: New source file.
359 * testsuite/common_test_1_v2.c: New source file.
360 * testsuite/copy_test_v1.cc: New source file.
361
5146f448
CC
3622011-06-07 Cary Coutant <ccoutant@google.com>
363
364 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
365 update, allocate common from bss section's free list.
366 * incremental-dump.cc (dump_incremental_inputs): Print flag for
367 linker-defined symbols.
368 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
369 Skip GOT and PLT entries that are no longer referenced.
370 (Output_section_incremental_inputs::write_info_blocks): Mark
371 linker-defined symbols.
372 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
373 * output.cc (Output_section::allocate): New function.
374 * output.h (Output_section::allocate): New function.
375 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
376 linker-defined symbols.
377 (Symbol::override_base_with_special): Copy is_predefined_ flag.
378 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
379 (Symbol::init_base_output_data): Likewise.
380 (Symbol::init_base_output_segment): Likewise.
381 (Symbol::init_base_constant): Likewise.
382 (Sized_symbol::init_output_data): Likewise.
383 (Sized_symbol::init_output_segment): Likewise.
384 (Sized_symbol::init_constant): Likewise.
385 (Symbol_table::do_define_in_output_data): Likewise.
386 (Symbol_table::do_define_in_output_segment): Likewise.
387 (Symbol_table::do_define_as_constant): Likewise.
388 * symtab.h (Symbol::is_predefined): New function.
389 (Symbol::init_base_output_data): Add is_predefined parameter.
390 (Symbol::init_base_output_segment): Likewise.
391 (Symbol::init_base_constant): Likewise.
392 (Symbol::is_predefined_): New data member.
393 (Sized_symbol::init_output_data): Add is_predefined parameter.
394 (Sized_symbol::init_output_segment): Likewise.
395 (Sized_symbol::init_constant): Likewise.
396 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
397
26d3c67d
CC
3982011-06-07 Cary Coutant <ccoutant@google.com>
399
400 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
401 instead of emit_copy_reloc.
402 (Copy_relocs::emit_copy_reloc): Refactor.
403 (Copy_relocs::make_copy_reloc): New function.
404 (Copy_relocs::add_copy_reloc): Remove.
405 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
406 section.
407 (Copy_relocs::make_copy_reloc): New function.
408 (Copy_relocs::add_copy_reloc): Remove.
409 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
410 unchanged input files.
411 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
412 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
413 Reserve BSS space for COPY relocations.
414 (Sized_incremental_binary::do_emit_copy_relocs): New function.
415 (Output_section_incremental_inputs::write_info_blocks): Record
416 whether a symbol is copied from a shared object.
417 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
418 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
419 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
420 (Incremental_input_entry_reader::get_output_symbol_index): Add
421 is_copy parameter.
422 (Incremental_binary::emit_copy_relocs): New function.
423 (Incremental_binary::do_emit_copy_relocs): New function.
424 (Sized_incremental_binary::Sized_incremental_binary): Initialize
425 new data member.
426 (Sized_incremental_binary::add_copy_reloc): New function.
427 (Sized_incremental_binary::do_emit_copy_relocs): New function.
428 (Sized_incremental_binary::Copy_reloc): New struct.
429 (Sized_incremental_binary::Copy_relocs): New typedef.
430 (Sized_incremental_binary::copy_relocs_): New data member.
431 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
432 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
433 * target.h (Sized_target::emit_copy_reloc): New function.
434 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
435
7cdb37d9
CC
4362011-06-02 Cary Coutant <ccoutant@google.com>
437
438 PR gold/12163
439 * gold/archive.cc (Archive::Archive): Initialize new data member.
440 (Archive::include_all_members): Return if archive has already been
441 included.
442 * gold/archive.h (Archive::include_all_members_): New data member.
443
cc643b88
NC
4442011-06-02 Nick Clifton <nickc@redhat.com>
445
446 * dynobj.h: Fix spelling mistake in comment.
447 * output.cc: Likewise.
448
f62a3ca7
DK
4492011-05-31 Doug Kwan <dougkwan@google.com>
450 Asier Llano
451
452 PR gold/12826
cc643b88 453 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
454 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
455 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
456 redundant arm_exidx_test.so.
457 * testsuite/Makefile.in: Regenerate.
458 (check_SCRIPTS): Add pr12826.sh
459 (check_DATA): Add pr12826.stdout
460 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
461 * testsuite/pr12826.sh: New file.
462 * testsuite/pr12826_1.s: Ditto.
463 * testsuite/pr12826_1.s: Ditto.
464
8dbe1edc
ILT
4652011-05-30 Ian Lance Taylor <iant@google.com>
466
467 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
468 sections.
469
c49875be
ILT
4702011-05-29 Ian Lance Taylor <iant@google.com>
471
472 PR gold/12804
473 * testsuite/Makefile.am: Use different file name for two_file_test
474 temporary file for each incremental test.
475 * testsuite/Makefile.in: Rebuild.
476
69d53f7a
ILT
4772011-05-29 Ian Lance Taylor <iant@google.com>
478
479 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
480 binary input file is empty.
481
41d0ab5f
ILT
4822011-05-27 Ian Lance Taylor <iant@google.com>
483
484 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
485 (ver_test_9.so): Likewise.
486 * testsuite/Makefile.in: Rebuild.
487
89d8a36b
CC
4882011-05-26 Cary Coutant <ccoutant@google.com>
489
490 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
491 * incremental.cc (Incremental_inputs::report_input_section): Fix
492 comment, indentation.
493 (Incremental_inputs::report_comdat_group): New function.
494 (Output_section_incremental_inputs::set_final_data_size): Adjust size
495 of data for incremental input file entry.
496 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
497 group count, COMDAT group signatures.
498 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
499 an unchanged input file.
500 * incremental.h (Incremental_object_entry::Incremental_object_entry):
501 Initialize new data member.
502 (Incremental_object_entry::add_comdat_group): New function.
503 (Incremental_object_entry::get_comdat_group_count): New function.
504 (Incremental_object_entry::get_comdat_signature_key): New function.
505 (Incremental_object_entry::groups_): New data member.
506 (Incremental_inputs::report_comdat_group): New function.
507 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
508 data for incremental input file entry.
509 (Incremental_input_entry_reader::get_comdat_group_count): New function.
510 (Incremental_input_entry_reader::get_input_section): Adjust size of
511 data for incremental input file entry.
512 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
513 (Incremental_input_entry_reader::get_comdat_group_signature): New
514 function.
515 * object.cc (Sized_relobj::include_section_group): Report kept
516 COMDAT groups for incremental links.
517
1706a06f
ILT
5182011-05-24 David Meyer <pdox@google.com>
519
520 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
521 with name parameter. Add found_name parameter.
522 * fileread.cc (Input_file::find_file): Adjust code accordingly.
523 * dirsearch.h (class Dirsearch): Update declaration.
524
a10ae760
ILT
5252011-05-24 Ian Lance Taylor <iant@google.com>
526
527 * archive.cc (Library_base::should_include_member): Pull in object
528 from archive if it defines the entry symbol.
529 * parameters.cc (Parameters::entry): New function.
530 * parameters.h (class Parameters): Declare entry.
531 * output.h (class Output_file_header): Remove entry_ field.
532 * output.cc (Output_file_header::Output_file_header): Remove entry
533 parameter. Change all callers.
534 (Output_file_header::entry): Use parameters->entry.
535 * gold.cc (queue_middle_tasks): Likewise.
536 * plugin.cc (Plugin_hook::run): Likewise.
537
aa92d6ed
CC
5382011-05-24 Cary Coutant <ccoutant@google.com>
539
540 * gold.cc (queue_initial_tasks): Pass incremental base filename
541 to Output_file::open_base_file; don't print error message.
542 * incremental-dump.cc (main): Adjust call to
543 Output_file::open_for_modification.
544 * incremental-dump.cc (main): Likewise.
545 * incremental.cc (Incremental_inputs::report_command_line):
546 Ignore --incremental-base option when comparing command lines.
547 Ignore parameter when given as separate argument.
548 * options.h (class General_options): Add --incremental-base.
549 * output.cc (Output_file::Output_file):
550 (Output_file::open_base_file): Add base_name and writable parameters;
551 read base file into new file; print error message here.
552 (Output_file::map_no_anonymous): Add writable parameter; adjust all
553 callers.
554 * output.h (Output_file::open_for_modification): Rename to...
555 (Output_file::open_base_file): ...this; add base_name and
556 writable parameters; adjust all callers.
557 (Output_file::map_no_anonymous): Add writable parameter; adjust all
558 callers.
559 * testsuite/Makefile.am (incremental_test_4): Test
560 --incremental-base.
561 * testsuite/Makefile.in: Regenerate.
562
2eedd706
CC
5632011-05-24 Cary Coutant <ccoutant@google.com>
564
565 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
566 incremental_test_4.
567 * testsuite/Makefile.in: Regenerate.
568 * testsuite/two_file_test_1_v1.cc: New test source file.
569 * testsuite/two_file_test_1b_v1.cc: New test source file.
570 * testsuite/two_file_test_2_v1.cc: New test source file.
571
0f1c85a6
CC
5722011-05-24 Cary Coutant <ccoutant@google.com>
573
574 * dynobj.h (Dynobj::do_dynobj): New function.
575 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
576 flag and soname for shared objects.
577 * incremental.cc (Incremental_inputs::report_object): Make
578 either Incremental_object_entry or Incremental_dynobj_entry; add
579 soname to string table.
580 (Incremental_inputs::report_input_section): Add assertion.
581 (Output_section_incremental_inputs::set_final_data_size): Adjust
582 type of input file entry for shared libraries; adjust size of
583 shared library info entry.
584 (Output_section_incremental_inputs::write_input_files): Write
585 as_needed flag for shared libraries.
586 (Output_section_incremental_inputs::write_info_blocks): Adjust type
587 of input file entry for shared libraries; write soname.
588 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
589 soname from incremental info.
590 * incremental.h (enum Incremental_input_flags): Add
591 INCREMENTAL_INPUT_AS_NEEDED.
592 (Incremental_input_entry::Incremental_input_entry): Initialize new
593 data member.
594 (Incremental_input_entry::set_as_needed): New function.
595 (Incremental_input_entry::as_needed): New function.
596 (Incremental_input_entry::do_dynobj_entry): New function.
597 (Incremental_input_entry::as_needed_): New data member.
598 (Incremental_object_entry::Incremental_object_entry): Don't check
599 for shared library.
600 (Incremental_object_entry::do_type): Likewise.
601 (class Incremental_dynobj_entry): New class.
602 (Incremental_input_entry_reader::as_needed): New function.
603 (Incremental_input_entry_reader::get_soname): New function.
604 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
605 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
606 size of shared library info entry.
607 * layout.cc (Layout::finish_dynamic_section): Don't test for
608 incremental link when adding DT_NEEDED entries.
609 * object.h (Object::Object): Initialize new data member.
610 (Object::dynobj): New function.
611 (Object::set_as_needed): New function.
612 (Object::as_needed): New function.
613 (Object::do_dynobj): New function.
614 (Object::as_needed_): New data member.
615
6fa2a40b
CC
6162011-05-24 Cary Coutant <ccoutant@google.com>
617
618 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
619 info; adjust display of GOT entries.
620 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
621 vector of input objects; remove file_status_.
622 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
623 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
624 got_plt reader; call target hooks to reserve GOT entries.
625 (Output_section_incremental_inputs::set_final_data_size): Adjust size
626 of input file info header and GOT info entry.
627 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
628 relocation info.
629 (Got_plt_view_info::got_descriptor): Remove.
630 (Got_plt_view_info::sym_index): New data member.
631 (Got_plt_view_info::input_index): New data member.
632 (Local_got_offset_visitor::visit): Write input file index.
633 (Global_got_offset_visitor::visit): Write 0 for input file index.
634 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
635 with sym_index and input_index.
636 (Output_section_incremental_inputs::write_got_plt): Adjust size of
637 incremental info GOT entry; replace got_descriptor with input_index.
638 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
639 map from input file index to object.
640 (Sized_relobj_incr::do_layout): Replace direct data member reference
641 with accessor function.
642 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
643 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
644 Adjust size of input file info header.
645 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
646 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
647 (Incremental_input_entry_reader::get_input_section): Adjust size of
648 input file info header.
649 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
650 of incremental info GOT entry.
651 (Incremental_got_plt_reader::get_got_desc): Remove.
652 (Incremental_got_plt_reader::get_got_symndx): New function.
653 (Incremental_got_plt_reader::get_got_input_index): New function.
654 (Sized_incremental_binary::Sized_incremental_binary): Remove
655 file_status_; add input_objects_.
656 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
657 (Sized_incremental_binary::set_file_is_unchanged): Remove.
658 (Sized_incremental_binary::file_is_unchanged): Remove.
659 (Sized_incremental_binary::set_input_object): New function.
660 (Sized_incremental_binary::input_object): New function.
661 (Sized_incremental_binary::file_status_): Remove.
662 (Sized_incremental_binary::input_objects_): New data member.
663 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
664 references.
665 (Sized_relobj_incr::invalid_address): Move to base class.
666 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
667 class.
668 (Sized_relobj_incr::do_output_section_offset): Likewise.
669 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
670 (Sized_relobj_incr::section_offsets_): Likewise.
671 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
672 function.
673 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
674 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
675 with accessor function.
676 (Sized_relobj_file::do_layout): Likewise.
677 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
678 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
679 (Sized_relobj_file::compute_final_local_value): Replace refs to
680 section_offsets_ with accessor function.
681 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
682 * object.h (Relobj::Relobj): Initialize new data members.
683 (Relobj::add_dyn_reloc): New function.
684 (Relobj::first_dyn_reloc): New function.
685 (Relobj::dyn_reloc_count): New function.
686 (Relobj::first_dyn_reloc_): New data member.
687 (Relobj::dyn_reloc_count_): New data member.
688 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
689 references.
690 (Sized_relobj::Address): New typedef.
691 (Sized_relobj::invalid_address): Move here from child class.
692 (Sized_relobj::Sized_relobj): Initialize new data members.
693 (Sized_relobj::sized_relobj): New function.
694 (Sized_relobj::is_output_section_offset_invalid): Move here from
695 child class.
696 (Sized_relobj::get_output_section_offset): Likewise.
697 (Sized_relobj::local_has_got_offset): Likewise.
698 (Sized_relobj::local_got_offset): Likewise.
699 (Sized_relobj::set_local_got_offset): Likewise.
700 (Sized_relobj::do_for_all_local_got_entries): Likewise.
701 (Sized_relobj::clear_got_offsets): New function.
702 (Sized_relobj::section_offsets): Move here from child class.
703 (Sized_relobj::do_output_section_offset): Likewise.
704 (Sized_relobj::do_set_section_offset): Likewise.
705 (Sized_relobj::Local_got_offsets): Likewise.
706 (Sized_relobj::local_got_offsets_): Likewise.
707 (Sized_relobj::section_offsets_): Likewise.
708 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
709 references.
710 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
711 class.
712 (Sized_relobj_file::sized_relobj): New function
713 (Sized_relobj_file::local_has_got_offset): Move to base class.
714 (Sized_relobj_file::local_got_offset): Likewise.
715 (Sized_relobj_file::set_local_got_offset): Likewise.
716 (Sized_relobj_file::get_output_section_offset): Likewise.
717 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
718 (Sized_relobj_file::do_output_section_offset): Likewise.
719 (Sized_relobj_file::do_set_section_offset): Likewise.
720 (Sized_relobj_file::Local_got_offsets): Likewise.
721 (Sized_relobj_file::local_got_offsets_): Likewise.
722 (Sized_relobj_file::section_offsets_): Likewise.
723 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
724 (all constructors).
725 (set_needs_dynsym_index): Convert relobj to derived class pointer.
726 (Output_reloc::get_symbol_index): Likewise.
727 (Output_reloc::local_section_offset): Likewise.
728 (Output_reloc::get_address): Likewise.
729 (Output_reloc::symbol_value): Likewise.
730 (Output_data_got::reserve_slot): Move to class definition.
731 (Output_data_got::reserve_local): New function.
732 (Output_data_got::reserve_slot_for_global): Remove.
733 (Output_data_got::reserve_global): New function.
734 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
735 (all constructors, two instantiations).
736 (Output_reloc::get_relobj): New function (two instantiations).
737 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
738 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
739 (Output_data_reloc::add_global): Adjust type of relobj.
740 (Output_data_reloc::add_global_relative): Likewise.
741 (Output_data_reloc::add_symbolless_global_addend): Likewise.
742 (Output_data_reloc::add_local): Likewise.
743 (Output_data_reloc::add_local_relative): Likewise.
744 (Output_data_reloc::add_symbolless_local_addend): Likewise.
745 (Output_data_reloc::add_local_section): Likewise.
746 (Output_data_reloc::add_output_section): Likewise.
747 (Output_data_reloc::add_absolute): Likewise.
748 (Output_data_reloc::add_target_specific): Likewise.
749 (Output_data_got::reserve_slot): Move definition here.
750 (Output_data_got::reserve_local): New function.
751 (Output_data_got::reserve_global): New function.
752 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
753 section_offsets_ with accessor function.
754 (Sized_relobj_file::write_sections): Likewise.
755 (Sized_relobj_file::do_relocate_sections): Likewise.
756 * target.h (Sized_target::reserve_local_got_entry): New function.
757 (Sized_target::reserve_global_got_entry): New function.
758 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
759 (Target_x86_64::reserve_global_got_entry): New function.
760 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
761
4829d394
CC
7622011-05-23 Cary Coutant <ccoutant@google.com>
763
764 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
765 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
766 bit when checking got_type.
767 * incremental.cc (Sized_incremental_binary::setup_readers):
768 Store symbol table and string table locations; initialize bit vector
769 of file status flags.
770 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
771 unchanged files.
772 (Sized_incremental_binary::do_process_got_plt): New function.
773 (Sized_incremental_binary::get_symtab_view): Use stored locations.
774 (Output_section_incremental_inputs::set_final_data_size): Record
775 file index for each input file.
776 (Output_section_incremental_inputs::write_got_plt): Store file index
777 instead of input entry offset for each GOT entry.
778 * incremental.h
779 (Incremental_input_entry::Incremental_input_entry): Initialize new
780 data member.
781 (Incremental_input_entry::set_offset): Store file index.
782 (Incremental_input_entry::get_file_index): New function.
783 (Incremental_input_entry::file_index_): New data member.
784 (Incremental_binary::process_got_plt): New function.
785 (Incremental_binary::do_process_got_plt): New function.
786 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
787 data members.
788 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
789 (Sized_incremental_binary::set_file_is_unchanged): New function.
790 (Sized_incremental_binary::file_is_unchanged): New function.
791 (Sized_incremental_binary::do_process_got_plt): New function.
792 (Sized_incremental_binary::file_status_): New data member.
793 (Sized_incremental_binary::main_symtab_loc_): New data member.
794 (Sized_incremental_binary::main_strtab_loc_): New data member.
795 * output.cc (Output_data_got::Got_entry::write): Add case
796 RESERVED_CODE.
797 (Output_data_got::add_global): Call add_got_entry.
798 (Output_data_got::add_global_plt): Likewise.
799 (Output_data_got::add_global_with_rel): Likewise.
800 (Output_data_got::add_global_with_rela): Likewise.
801 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
802 (Output_data_got::add_global_pair_with_rela): Likewise.
803 (Output_data_got::add_local): Call add_got_entry.
804 (Output_data_got::add_local_plt): Likewise.
805 (Output_data_got::add_local_with_rel): Likewise.
806 (Output_data_got::add_local_with_rela): Likewise.
807 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
808 (Output_data_got::add_local_pair_with_rela): Likewise.
809 (Output_data_got::reserve_slot): New function.
810 (Output_data_got::reserve_slot_for_global): New function.
811 (Output_data_got::add_got_entry): New function.
812 (Output_data_got::add_got_entry_pair): New function.
813 (Output_section::add_output_section_data): Edit FIXME.
814 * output.h
815 (Output_section_data_build::Output_section_data_build): New
816 constructor with size parameter.
817 (Output_data_space::Output_data_space): Likewise.
818 (Output_data_got::Output_data_got): Initialize new data member; new
819 constructor with size parameter.
820 (Output_data_got::add_constant): Call add_got_entry.
821 (Output_data_got::reserve_slot): New function.
822 (Output_data_got::reserve_slot_for_global): New function.
823 (class Output_data_got::Got_entry): Add RESERVED_CODE.
824 (Output_data_got::add_got_entry): New function.
825 (Output_data_got::add_got_entry_pair): New function.
826 (Output_data_got::free_list_): New data member.
827 * target.h (Sized_target::init_got_plt_for_update): New function.
828 (Sized_target::register_global_plt_entry): New function.
829 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
830 Initialize new data member; call init; add constructor with PLT count.
831 (Output_data_plt_x86_64::init): New function.
832 (Output_data_plt_x86_64::add_relocation): New function.
833 (Output_data_plt_x86_64::reserve_slot): New function.
834 (Output_data_plt_x86_64::free_list_): New data member.
835 (Target_x86_64::init_got_plt_for_update): New function.
836 (Target_x86_64::register_global_plt_entry): New function.
837 (Output_data_plt_x86_64::add_entry): Allocate from free list for
838 incremental updates.
839 (Output_data_plt_x86_64::add_relocation): New function.
840 * testsuite/object_unittest.cc (Object_test): Set default options.
841
ec69d6da
ILT
8422011-05-16 Ian Lance Taylor <iant@google.com>
843
844 * options.h (class General_options): Make -i a synonym for -r.
845
732e31de
ILT
8462011-05-16 Ian Lance Taylor <iant@google.com>
847
848 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
849
403676b5
CC
8502011-05-10 Cary Coutant <ccoutant@google.com>
851
852 * object.cc (Sized_relobj::do_count_local_symbols): Check for
853 strip_all (-s).
854
5b7b7d6e
ILT
8552011-05-06 Ian Lance Taylor <iant@google.com>
856
857 * layout.cc (Layout::layout): If the output section flags change,
858 update the ordering.
859
f0f9babf
CC
8602011-04-25 Cary Coutant <ccoutant@google.com>
861
862 * incremental-dump.cc (dump_incremental_inputs): Print local
863 symbol info for each input file.
864 * incremental.cc
865 (Output_section_incremental_inputs::set_final_data_size): Add local
866 symbol info to input file entries in incremental info.
867 (Output_section_incremental_inputs::write_info_blocks): Likewise.
868 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
869 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
870 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
871 implementation.
872 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
873 (Sized_incr_relobj::do_relocate): Write the local symbols.
874 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
875 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
876 Adjust size of input file header.
877 (Incremental_inputs_reader::get_local_symbol_offset): New function.
878 (Incremental_inputs_reader::get_local_symbol_count): New function.
879 (Incremental_inputs_reader::get_input_section): Adjust size of input
880 file header.
881 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
882 (Sized_incr_relobj::This): New typedef.
883 (Sized_incr_relobj::sym_size): New const data member.
884 (Sized_incr_relobj::Local_symbol): New struct.
885 (Sized_incr_relobj::do_output_local_symbol_count): New function.
886 (Sized_incr_relobj::do_local_symbol_offset): New function.
887 (Sized_incr_relobj::local_symbol_count_): New data member.
888 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
889 (Sized_incr_relobj::local_symbol_index_): New data member.
890 (Sized_incr_relobj::local_symbol_offset_): New data member.
891 (Sized_incr_relobj::local_dynsym_offset_): New data member.
892 (Sized_incr_relobj::local_symbols_): New data member.
893 * object.h (Relobj::output_local_symbol_count): New function.
894 (Relobj::local_symbol_offset): New function.
895 (Relobj::do_output_local_symbol_count): New function.
896 (Relobj::do_local_symbol_offset): New function.
897 (Sized_relobj::do_output_local_symbol_count): New function.
898 (Sized_relobj::do_local_symbol_offset): New function.
899
d0a9ace3
ILT
9002011-04-22 Vladimir Simonov <sv@sw.ru>
901
902 * descriptors.cc (set_close_on_exec): New function.
903 (Descriptors::open): Use set_close_on_exec.
904 * output.cc (S_ISLNK): Define if not defined.
905
94a3fc8b
CC
9062011-04-22 Cary Coutant <ccoutant@google.com>
907
908 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
909 global symbol map.
910 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
911 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
912 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
913 relocations.
914 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
915 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
916 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
917 * incremental.h
918 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
919 function.
920 (Incremental_binary::apply_incremental_relocs): New function.
921 (Incremental_binary::do_apply_incremental_relocs): New function.
922 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
923 data member.
924 (Sized_incremental_binary::add_global_symbol): New function.
925 (Sized_incremental_binary::global_symbol): New function.
926 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
927 (Sized_incremental_binary::symbol_map_): New data member.
928 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
929 * target.h (Sized_target::apply_relocation): New function.
930 * target-reloc.h (apply_relocation): New function.
931 * x86_64.cc (Target_x86_64::apply_relocation): New function.
932
c87e4302
DK
9332011-04-22 Doug Kwan <dougkwan@google.com>
934
935 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
936 flag of a SHT_ARM_EXIDX section.
937 * testsuite/Makefile.am (arm_exidx_test): New test rules.
938 * testsuite/Makefile.in: Regenerate.
939 * testsuite/arm_exidx_test.s: New file.
940 * testsuite/arm_exidx_test.sh: Same.
941
e7782cf6
CC
9422011-04-20 Cary Coutant <ccoutant@google.com>
943
944 PR gold/12689
945 * archive.h (Incremental_archive_entry::Archive_member):
946 Initialize arg_serial_ (second constructor).
947
308ecdc7
ILT
9482011-04-17 Ian Lance Taylor <iant@google.com>
949
950 * object.cc (Relocate_info::location): Simplify location string.
951 * errors.cc (Errors::error_at_location): Don't print program
952 name.
953 (Errors::warning_at_location): Likewise.
954 (Errors::undefined_symbol): Likewise.
955 * testsuite/debug_msg.sh: Update accordingly.
956
bec5b579
CC
9572011-04-14 Cary Coutant <ccoutant@google.com>
958
959 * gold/layout.cc (Layout::symtab_section_offset): New function.
960 * gold/layout.h (Layout::symtab_section_offset): New function.
961 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
962
88597d34
ILT
9632011-04-12 Ian Lance Taylor <iant@google.com>
964
965 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
966 with MREMAP_MAYMOVE.
967 * output.h (class Output_file): Add map_is_allocated_ field.
968 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
969 not available, provide stubs. If mremap is not available, #define
970 it to gold_mremap.
971 (MREMAP_MAYMOVE): Define if not defined.
972 (Output_file::Output_file): Initialize map_is_allocated_.
973 (Output_file::resize): Check map_is_allocated_.
974 (Output_file::map_anonymous): If mmap fails, use malloc.
975 (Output_file::unmap): Don't do anything for an anonymous map.
976 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
977 is not available, provide stubs.
978 (File_read::View::~View): Use free rather than delete[].
979 (File_read::make_view): Use malloc rather than new[]. If mmap
980 fails, use malloc.
981 (File_read::find_or_make_view): Use malloc rather than new[].
982 * gold.h: Remove HAVE_REMAP code.
983 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
984 exists. Rename mremap to gold_mremap. If mmap is not available
985 don't do anything.
986 * configure, config.in: Rebuild.
987
11e361bc
ILT
9882011-04-11 Ian Lance Taylor <iant@google.com>
989
990 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
991 initialize local variable v.
992
cdc29364
CC
9932011-04-11 Cary Coutant <ccoutant@google.com>
994
995 * archive.cc (Archive::include_member): Adjust call to
996 report_object.
997 (Add_archive_symbols::run): Track argument serial numbers.
998 (Lib_group::include_member): Likewise.
999 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1000 * archive.h (Incremental_archive_entry::Archive_member):
1001 Initialize arg_serial_.
1002 (Archive_member::arg_serial_): New data member.
1003 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1004 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1005 incremental link.
1006 (Sized_dynobj::do_for_all_local_got_entries): New function.
1007 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1008 function.
1009 * fileread.cc (get_mtime): New function.
1010 * fileread.h (get_mtime): New function.
1011 * gold.cc (queue_initial_tasks): Check for incremental update.
1012 (process_incremental_input): New function.
1013 (queue_middle_tasks): Don't force valid target for incremental
1014 update.
1015 * incremental-dump.cc (find_input_containing_global): Adjust
1016 size of symbol info entry.
1017 (dump_incremental_inputs): Dump argument serial number and
1018 in_system_directory flag; bias shndx by 1; print symbol names
1019 when dumping per-file symbol lists; use new symbol info readers.
1020 * incremental.cc
1021 (Output_section_incremental_inputs:update_data_size): New function.
1022 (Sized_incremental_binary::setup_readers): Setup input readers
1023 for each input file; build maps for files added from libraries
1024 and scripts.
1025 (Sized_incremental_binary::check_input_args): New function.
1026 (Sized_incremental_binary::do_check_inputs): Build map of argument
1027 serial numbers to input arguments.
1028 (Sized_incremental_binary::do_file_has_changed): Rename
1029 do_file_is_unchanged to this; compare file modification times.
1030 (Sized_incremental_binary::do_init_layout): New function.
1031 (Sized_incremental_binary::do_reserve_layout): New function.
1032 (Sized_incremental_binary::do_get_input_reader): Remove.
1033 (Sized_incremental_binary::get_symtab_view): New function.
1034 (Incremental_checker::can_incrementally_link_output_file): Remove.
1035 (Incremental_inputs::report_command_line): Exclude --debug options.
1036 (Incremental_inputs::report_archive_begin): Add parameter; track
1037 argument serial numbers; don't put input file entry for archive
1038 before archive members.
1039 (Incremental_inputs::report_archive_end): Put input file entry
1040 for archive after archive members.
1041 (Incremental_inputs::report_object): Add parameter; track argument
1042 serial numbers and in_system_directory flag.
1043 (Incremental_inputs::report_script): Add parameter; track argument
1044 serial numbers.
1045 (Output_section_incremental_inputs::set_final_data_size): Adjust
1046 size of symbol info entry; check for forwarding symbols.
1047 (Output_section_incremental_inputs::write_input_files): Write
1048 in_system_directory flag and argument serial number.
1049 (Output_section_incremental_inputs::write_info_blocks): Map section
1050 indices between incremental info and original input file; store
1051 input section index for each symbol.
1052 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1053 change operator() to visit().
1054 (class Global_got_offset_visitor): Likewise.
1055 (class Global_symbol_visitor_got_plt):
1056 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1057 classes.
1058 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1059 (Sized_incr_relobj::do_read_symbols): New function.
1060 (Sized_incr_relobj::do_layout): New function.
1061 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1062 (Sized_incr_relobj::do_add_symbols): New function.
1063 (Sized_incr_relobj::do_should_include_member): New function.
1064 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1065 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1066 (Sized_incr_relobj::do_section_size): New function.
1067 (Sized_incr_relobj::do_section_name): New function.
1068 (Sized_incr_relobj::do_section_contents): New function.
1069 (Sized_incr_relobj::do_section_flags): New function.
1070 (Sized_incr_relobj::do_section_entsize): New function.
1071 (Sized_incr_relobj::do_section_address): New function.
1072 (Sized_incr_relobj::do_section_type): New function.
1073 (Sized_incr_relobj::do_section_link): New function.
1074 (Sized_incr_relobj::do_section_info): New function.
1075 (Sized_incr_relobj::do_section_addralign): New function.
1076 (Sized_incr_relobj::do_initialize_xindex): New function.
1077 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1078 (Sized_incr_relobj::do_read_relocs): New function.
1079 (Sized_incr_relobj::do_gc_process_relocs): New function.
1080 (Sized_incr_relobj::do_scan_relocs): New function.
1081 (Sized_incr_relobj::do_count_local_symbols): New function.
1082 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1083 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1084 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1085 (Sized_incr_relobj::do_relocate): New function.
1086 (Sized_incr_relobj::do_set_section_offset): New function.
1087 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1088 (Sized_incr_dynobj::do_read_symbols): New function.
1089 (Sized_incr_dynobj::do_layout): New function.
1090 (Sized_incr_dynobj::do_add_symbols): New function.
1091 (Sized_incr_dynobj::do_should_include_member): New function.
1092 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1093 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1094 (Sized_incr_dynobj::do_section_size): New function.
1095 (Sized_incr_dynobj::do_section_name): New function.
1096 (Sized_incr_dynobj::do_section_contents): New function.
1097 (Sized_incr_dynobj::do_section_flags): New function.
1098 (Sized_incr_dynobj::do_section_entsize): New function.
1099 (Sized_incr_dynobj::do_section_address): New function.
1100 (Sized_incr_dynobj::do_section_type): New function.
1101 (Sized_incr_dynobj::do_section_link): New function.
1102 (Sized_incr_dynobj::do_section_info): New function.
1103 (Sized_incr_dynobj::do_section_addralign): New function.
1104 (Sized_incr_dynobj::do_initialize_xindex): New function.
1105 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1106 (make_sized_incremental_object): New function.
1107 (Incremental_library::copy_unused_symbols): New function.
1108 (Incremental_library::do_for_all_unused_symbols): New function.
1109 * incremental.h (enum Incremental_input_flags): New type.
1110 (class Incremental_checker): Remove.
1111 (Incremental_input_entry::Incremental_input_entry): Add argument
1112 serial number.
1113 (Incremental_input_entry::arg_serial): New function.
1114 (Incremental_input_entry::set_is_in_system_directory): New function.
1115 (Incremental_input_entry::is_in_system_directory): New function.
1116 (Incremental_input_entry::arg_serial_): New data member.
1117 (Incremental_input_entry::is_in_system_directory_): New data member.
1118 (class Script_info): Move here from script.h.
1119 (Script_info::Script_info): Add filename parameter.
1120 (Script_info::filename): New function.
1121 (Script_info::filename_): New data member.
1122 (Incremental_script_entry::Incremental_script_entry): Add argument
1123 serial number.
1124 (Incremental_object_entry::Incremental_object_entry): Likewise.
1125 (Incremental_object_entry::add_input_section): Build list of input
1126 sections with map to original shndx.
1127 (Incremental_object_entry::get_input_section_index): New function.
1128 (Incremental_object_entry::shndx_): New data member.
1129 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1130 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1131 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1132 serial number.
1133 (Incremental_inputs::report_archive_begin): Likewise.
1134 (Incremental_inputs::report_object): Likewise.
1135 (Incremental_inputs::report_script): Likewise.
1136 (class Incremental_global_symbol_reader): New class.
1137 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1138 and store flags and input file type.
1139 (Incremental_input_entry_reader::arg_serial): New function.
1140 (Incremental_input_entry_reader::type): Extract type from flags.
1141 (Incremental_input_entry_reader::is_in_system_directory): New function.
1142 (Incremental_input_entry_reader::get_input_section_count): Call
1143 accessor function for type.
1144 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1145 function for type; adjust size of global symbol entry.
1146 (Incremental_input_entry_reader::get_global_symbol_count): Call
1147 accessor function for type.
1148 (Incremental_input_entry_reader::get_object_count): Likewise.
1149 (Incremental_input_entry_reader::get_object_offset): Likewise.
1150 (Incremental_input_entry_reader::get_member_count): Likewise.
1151 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1152 (Incremental_input_entry_reader::get_member_offset): Likewise.
1153 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1154 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1155 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1156 (Incremental_input_entry_reader::get_global_symbol_reader): New
1157 function.
1158 (Incremental_input_entry_reader::get_output_symbol_index): New
1159 function.
1160 (Incremental_input_entry_reader::type_): Remove.
1161 (Incremental_input_entry_reader::flags_): New data member.
1162 (Incremental_inputs_reader::input_file_offset): New function.
1163 (Incremental_inputs_reader::input_file_index): New function.
1164 (Incremental_inputs_reader::input_file): Call input_file_offset.
1165 (Incremental_inputs_reader::input_file_at_offset): New function.
1166 (Incremental_relocs_reader::get_r_type): Reformat.
1167 (Incremental_relocs_reader::get_r_shndx): Reformat.
1168 (Incremental_relocs_reader::get_r_offset): Reformat.
1169 (Incremental_relocs_reader::data): New function.
1170 (Incremental_binary::Incremental_binary): Initialize new data members.
1171 (Incremental_binary::check_inputs): Add cmdline parameter.
1172 (Incremental_binary::file_is_unchanged): Remove.
1173 (Input_reader::arg_serial): New function.
1174 (Input_reader::get_unused_symbol_count): New function.
1175 (Input_reader::get_unused_symbol): New function.
1176 (Input_reader::do_arg_serial): New function.
1177 (Input_reader::do_get_unused_symbol_count): New function.
1178 (Input_reader::do_get_unused_symbol): New function.
1179 (Incremental_binary::input_file_count): New function.
1180 (Incremental_binary::get_input_reader): Change signature to use
1181 index instead of filename.
1182 (Incremental_binary::file_has_changed): New function.
1183 (Incremental_binary::get_input_argument): New function.
1184 (Incremental_binary::get_library): New function.
1185 (Incremental_binary::get_script_info): New function.
1186 (Incremental_binary::init_layout): New function.
1187 (Incremental_binary::reserve_layout): New function.
1188 (Incremental_binary::output_file): New function.
1189 (Incremental_binary::do_check_inputs): New function.
1190 (Incremental_binary::do_file_is_unchanged): Remove.
1191 (Incremental_binary::do_file_has_changed): New function.
1192 (Incremental_binary::do_init_layout): New function.
1193 (Incremental_binary::do_reserve_layout): New function.
1194 (Incremental_binary::do_input_file_count): New function.
1195 (Incremental_binary::do_get_input_reader): Change signature.
1196 (Incremental_binary::input_args_map_): New data member.
1197 (Incremental_binary::library_map_): New data member.
1198 (Incremental_binary::script_map_): New data member.
1199 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1200 new data members.
1201 (Sized_incremental_binary::output_section): New function.
1202 (Sized_incremental_binary::inputs_reader): Add const.
1203 (Sized_incremental_binary::symtab_reader): Add const.
1204 (Sized_incremental_binary::relocs_reader): Add const.
1205 (Sized_incremental_binary::got_plt_reader): Add const.
1206 (Sized_incremental_binary::get_symtab_view): New function.
1207 (Sized_incremental_binary::Inputs_reader): New typedef.
1208 (Sized_incremental_binary::Input_entry_reader): New typedef.
1209 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1210 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1211 (Sized_incremental_binary::do_file_has_changed): New function.
1212 (Sized_incremental_binary::do_init_layout): New function.
1213 (Sized_incremental_binary::do_reserve_layout): New function.
1214 (Sized_input_reader::Inputs_reader): Remove.
1215 (Sized_input_reader::Input_entry_reader): Remove.
1216 (Sized_input_reader::do_arg_serial): New function.
1217 (Sized_input_reader::do_get_unused_symbol_count): New function.
1218 (Sized_input_reader::do_get_unused_symbol): New function.
1219 (Sized_incremental_binary::do_input_file_count): New function.
1220 (Sized_incremental_binary::do_get_input_reader): Change signature;
1221 use index instead of filename.
1222 (Sized_incremental_binary::section_map_): New data member.
1223 (Sized_incremental_binary::input_entry_readers_): New data member.
1224 (class Sized_incr_relobj): New class.
1225 (class Sized_incr_dynobj): New class.
1226 (make_sized_incremental_object): New function.
1227 (class Incremental_library): New class.
1228 * layout.cc (Free_list::num_lists): New static data member.
1229 (Free_list::num_nodes): New static data member.
1230 (Free_list::num_removes): New static data member.
1231 (Free_list::num_remove_visits): New static data member.
1232 (Free_list::num_allocates): New static data member.
1233 (Free_list::num_allocate_visits): New static data member.
1234 (Free_list::init): New function.
1235 (Free_list::remove): New function.
1236 (Free_list::allocate): New function.
1237 (Free_list::dump): New function.
1238 (Free_list::print_stats): New function.
1239 (Layout_task_runner::run): Resize output file for incremental updates.
1240 (Layout::Layout): Initialize new data members.
1241 (Layout::set_incremental_base): New function.
1242 (Layout::init_fixed_output_section): New function.
1243 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1244 incremental updates.
1245 (Layout::create_gold_note): Do not create gold note section for
1246 incremental updates.
1247 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1248 for incremental updates.
1249 (Layout::set_section_offsets): For incremental updates, allocate space
1250 from free list.
1251 (Layout::create_symtab_sections): Layout with offsets relative to
1252 start of section; for incremental updates, allocate space from free
1253 list.
1254 (Layout::create_shdrs): For incremental updates, allocate space from
1255 free list.
1256 (Layout::finish_dynamic_section): For incremental updates, do not
1257 check --as-needed (fixed in subsequent patch).
1258 * layout.h (class Free_list): New class.
1259 (Layout::set_incremental_base): New function.
1260 (Layout::incremental_base): New function.
1261 (Layout::init_fixed_output_section): New function.
1262 (Layout::allocate): New function.
1263 (Layout::incremental_base_): New data member.
1264 (Layout::free_list_): New data member.
1265 * main.cc (main): Print Free_list statistics.
1266 * object.cc (Relobj::finalize_incremental_relocs): Add
1267 clear_counts parameter; clear counts only when clear_counts is set.
1268 (Sized_relobj::Sized_relobj): Initialize new base class.
1269 (Sized_relobj::do_layout): Don't report special sections.
1270 (Sized_relobj::do_for_all_local_got_entries): New function.
1271 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
1272 symtab_off to all symbol table offsets.
1273 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
1274 * object.h (class Got_offset_list): Move to top of file.
1275 (Object::Object): Allow case where input_file == NULL.
1276 (Object::~Object): Likewise.
1277 (Object::input_file): Assert that input_file != NULL.
1278 (Object::lock): Allow case where input_file == NULL.
1279 (Object::unlock): Likewise.
1280 (Object::is_locked): Likewise.
1281 (Object::token): Likewise.
1282 (Object::release): Likewise.
1283 (Object::is_incremental): New function.
1284 (Object::get_mtime): New function.
1285 (Object::for_all_local_got_entries): New function.
1286 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1287 (Object::set_is_in_system_directory): New function.
1288 (Object::is_in_system_directory): New function.
1289 (Object::do_is_incremental): New function.
1290 (Object::do_get_mtime): New function.
1291 (Object::do_for_all_local_got_entries): New function.
1292 (Object::is_in_system_directory_): New data member.
1293 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1294 (class Sized_relobj_base): New class.
1295 (class Sized_relobj): Derive from Sized_relobj_base.
1296 (class Sized_relobj::Symbols): Redeclare from base class.
1297 (class Sized_relobj::local_got_offset_list): Remove.
1298 (class Sized_relobj::Output_sections): Redeclare from base class.
1299 (class Sized_relobj::do_for_all_local_got_entries): New function.
1300 (class Sized_relobj::write_local_symbols): Add offset parameter.
1301 (class Sized_relobj::local_symbol_offset_): Update comment.
1302 (class Sized_relobj::local_dynsym_offset_): Update comment.
1303 * options.cc (Input_arguments::add_file): Remove const.
1304 * options.h (Input_file_argument::Input_file_argument):
1305 Initialize arg_serial_ (all constructors).
1306 (Input_file_argument::set_arg_serial): New function.
1307 (Input_file_argument::arg_serial): New function.
1308 (Input_file_argument::arg_serial_): New data member.
1309 (Input_arguments::Input_arguments): Initialize file_count_.
1310 (Input_arguments::add_file): Remove const.
1311 (Input_arguments::number_of_input_files): New function.
1312 (Input_arguments::file_count_): New data member.
1313 (Command_line::number_of_input_files): Call
1314 Input_arguments::number_of_input_files.
1315 * output.cc (Output_segment_headers::Output_segment_headers):
1316 Set current size.
1317 (Output_section::Input_section::current_data_size): New function.
1318 (Output_section::Output_section): Initialize new data members.
1319 (Output_section::add_input_section): Don't do merge sections for
1320 an incremental link; allocate space from free list for an
1321 incremental update.
1322 (Output_section::add_output_section_data): Allocate space from
1323 free list for an incremental update.
1324 (Output_section::update_data_size): New function.
1325 (Output_section::set_fixed_layout): New function.
1326 (Output_section::reserve): New function.
1327 (Output_segment::set_section_addresses): Remove const.
1328 (Output_segment::set_section_list_addresses): Remove const; allocate
1329 space from free list for an incremental update.
1330 (Output_segment::set_offset): Adjust size of RELRO segment for an
1331 incremental update.
1332 * output.h (Output_data::current_data_size): Move here from
1333 child classes.
1334 (Output_data::pre_finalize_data_size): New function.
1335 (Output_data::update_data_size): New function.
1336 (Output_section_headers::update_data_size): new function.
1337 (Output_section_data_build::current_data_size): Move to Output_data.
1338 (Output_data_strtab::update_data_size): New function.
1339 (Output_section::current_data_size): Move to Output_data.
1340 (Output_section::set_fixed_layout): New function.
1341 (Output_section::has_fixed_layout): New function.
1342 (Output_section::reserve): New function.
1343 (Output_section::update_data_size): New function.
1344 (Output_section::has_fixed_layout_): New data member.
1345 (Output_section::free_list_): New data member.
1346 (Output_segment::set_section_addresses): Remove const.
1347 (Output_segment::set_section_list_addresses): Remove const.
1348 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
1349 New function.
1350 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
1351 New function.
1352 * readsyms.cc (Read_symbols::do_read_symbols): Add library
1353 parameter when calling Add_symbols constructor; store argument
1354 serial number for members of a lib group.
1355 (Add_symbols::locks): Allow case where token == NULL.
1356 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
1357 (Read_member::~Read_member): New function.
1358 (Read_member::is_runnable): New function.
1359 (Read_member::locks): New function.
1360 (Read_member::run): New function.
1361 (Check_script::~Check_script): New function.
1362 (Check_script::is_runnable): New function.
1363 (Check_script::locks): New function.
1364 (Check_script::run): New function.
1365 (Check_library::~Check_library): New function.
1366 (Check_library::is_runnable): New function.
1367 (Check_library::locks): New function.
1368 (Check_library::run): New function.
1369 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
1370 (Add_symbols::library_): New data member.
1371 (class Read_member): New class.
1372 (class Check_script): New class.
1373 (class Check_library): New class.
1374 * reloc.cc (Read_relocs::is_runnable): Allow case where
1375 token == NULL.
1376 (Read_relocs::locks): Likewise.
1377 (Scan_relocs::locks): Likewise.
1378 (Relocate_task::locks): Likewise.
1379 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
1380 to clear counters.
1381 (Sized_relobj::incremental_relocs_scan): Fix comment.
1382 (Sized_relobj::do_relocate): Pass output file offset to
1383 write_local_symbols.
1384 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
1385 from class declaration.
1386 * script.cc (read_input_script): Allocate Script_info; pass
1387 argument serial number to report_script.
1388 * script.h (class Script_info): Move to incremental.h.
1389 * symtab.cc (Symbol_table::add_from_incrobj): New function.
1390 * symtab.h (Symbol_table::add_from_incrobj): New function.
1391 (Symbol_table::set_file_offset): New function.
1392
b961d0d7
CC
13932011-04-05 Cary Coutant <ccoutant@google.com>
1394
1395 * incremental-dump.cc (dump_incremental_inputs): Change signature
1396 to take a Sized_incremental_binary; change caller. Use readers
1397 in Sized_incremental_binary.
1398 * incremental.cc
1399 (Sized_incremental_binary::find_incremental_inputs_sections):
1400 Rename do_find_incremental_inputs_sections to this.
1401 (Sized_incremental_binary::setup_readers): New function.
1402 (Sized_incremental_binary::do_check_inputs): Check
1403 has_incremental_info_ flag; move setup code to setup_readers;
1404 use input readers.
1405 (Sized_incremental_binary::do_file_is_unchanged): New function.
1406 (Sized_incremental_binary::do_get_input_reader): New function.
1407 * incremental.h (class Incremental_binary): Move to end of file.
1408 (Incremental_binary::file_is_unchanged): New function.
1409 (Incremental_binary::do_file_is_unchanged): New function.
1410 (Incremental_binary::Input_reader): New class.
1411 (Incremental_binary::get_input_reader): New function.
1412 (class Sized_incremental_binary): Move to end of file.
1413 (Sized_incremental_binary::Sized_incremental_binary): Setup the
1414 input section reader classes.
1415 (Sized_incremental_binary::has_incremental_info): New function.
1416 (Sized_incremental_binary::inputs_reader): New function.
1417 (Sized_incremental_binary::symtab_reader): New function.
1418 (Sized_incremental_binary::relocs_reader): New function.
1419 (Sized_incremental_binary::got_plt_reader): New function.
1420 (Sized_incremental_binary::do_file_is_unchanged): New function.
1421 (Sized_incremental_binary::Sized_input_reader): New class.
1422 (Sized_incremental_binary::get_input_reader): New function.
1423 (Sized_incremental_binary::find_incremental_inputs_sections):
1424 Rename do_find_incremental_inputs_sections to this.
1425 (Sized_incremental_binary::setup_readers): New function.
1426 (Sized_incremental_binary::has_incremental_info_): New data member.
1427 (Sized_incremental_binary::inputs_reader_): New data member.
1428 (Sized_incremental_binary::symtab_reader_): New data member.
1429 (Sized_incremental_binary::relocs_reader_): New data member.
1430 (Sized_incremental_binary::got_plt_reader_): New data member.
1431 (Sized_incremental_binary::current_input_file_): New data member.
1432
a869183f
PP
14332011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
1434
1435 PR gold/12640
1436 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
1437 violation.
1438
14392011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
1440
1441 * archive.cc (Archive::include_member): Adjust call to report_object.
1442 (Add_archive_symbols::run): Add script_info to call to
1443 report_archive_begin.
1444 (Lib_group::include_member): Adjust call to report_object.
1445 (Add_lib_group_symbols::run): Adjust call to report_object.
1446 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
1447 blocks. Add object count for script input files.
1448 * incremental.cc (Incremental_inputs::report_archive_begin): Add
1449 script_info parameter; change all callers.
1450 (Incremental_inputs::report_object): Add script_info parameter;
1451 change all callers.
1452 (Incremental_inputs::report_script): Store backpointer to
1453 incremental info entry.
1454 (Output_section_incremental_inputs::set_final_data_size): Record
1455 additional information for scripts.
1456 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1457 * incremental.h (Incremental_script_entry::add_object): New function.
1458 (Incremental_script_entry::get_object_count): New function.
1459 (Incremental_script_entry::get_object): New function.
1460 (Incremental_script_entry::objects_): New data member; adjust
1461 constructor.
1462 (Incremental_inputs::report_archive_begin): Add script_info parameter.
1463 (Incremental_inputs::report_object): Add script_info parameter.
1464 (Incremental_inputs_reader::get_object_count): New function.
1465 (Incremental_inputs_reader::get_object_offset): New function.
1466 * options.cc (Input_arguments::add_file): Return reference to
1467 new input argument.
1468 * options.h (Input_argument::set_script_info): New function.
1469 (Input_argument::script_info): New function.
1470 (Input_argument::script_info_): New data member; adjust all
1471 constructors.
1472 (Input_file_group::add_file): Return reference to new input argument.
1473 (Input_file_lib::add_file): Likewise.
1474 (Input_arguments::add_file): Likewise.
1475 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
1476 * script.cc (Parser_closure::Parser_closure): Add script_info
1477 parameter; adjust all callers.
1478 (Parser_closure::script_info): New function.
1479 (Parser_closure::script_info_): New data member.
1480 (read_input_script): Report scripts earlier to incremental info.
1481 (script_add_file): Set script_info in Input_argument.
1482 (script_add_library): Likewise.
1483 * script.h (Script_options::Script_info): Rewrite class.
1484
a869183f 14852011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
1486
1487 * archive.cc (Library_base::should_include_member): Move
1488 method here from class Archive.
1489 (Archive::Archive): Initialize base class.
1490 (Archive::should_include_member): Move to base class.
1491 (Archive::do_for_all_unused_symbols): New function.
1492 (Add_archive_symbols::run): Remove redundant access to
1493 incremental_inputs.
1494 (Lib_group::Lib_group): Initialize base class.
1495 (Lib_group::do_filename): New function.
1496 (Lib_group::include_member): Pass pointer to Lib_group to
1497 report_object.
1498 (Lib_group::do_for_all_unused_symbols): New function.
1499 (Add_lib_group_symbols::run): Report archive information for
1500 incremental links.
1501 * archive.h (class Library_base): New base class.
1502 (class Archive): Derive from Library_base.
1503 (Archive::filename): Move to base class.
1504 (Archive::set_incremental_info): Likewise.
1505 (Archive::incremental_info): Likewise.
1506 (Archive::Should_include): Likewise.
1507 (Archive::should_include_member): Likewise.
1508 (Archive::Armap_entry): Remove.
1509 (Archive::Unused_symbol_iterator): Remove.
1510 (Archive::unused_symbols_begin): Remove.
1511 (Archive::unused_symbols_end): Remove.
1512 (Archive::do_filename): New function.
1513 (Archive::do_get_mtime): New function.
1514 (Archive::do_for_all_unused_symbols): New function.
1515 (Archive::task_): Move to base class.
1516 (Archive::incremental_info_): Likewise.
1517 (class Lib_group): Derive from Library_base.
1518 (Lib_group::do_filename): New function.
1519 (Lib_group::do_get_mtime): New function.
1520 (Lib_group::do_for_all_unused_symbols): New function.
1521 (Lib_group::task_): Move to base class.
1522 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
1523 function.
1524 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1525 function.
1526 * incremental.cc (Incremental_inputs::report_archive_begin):
1527 Use Library_base; call library's get_mtime; add incremental inputs
1528 entry before members.
1529 (class Unused_symbol_visitor): New class.
1530 (Incremental_inputs::report_archive_end): Use Library_base; use
1531 visitor class to record unused symbols; don't add incremental inputs
1532 entry after members.
1533 (Incremental_inputs::report_object): Use Library_base.
1534 * incremental.h
1535 (Incremental_archive_entry::Incremental_archive_entry): Remove
1536 unused Archive parameter.
1537 (Incremental_inputs::report_archive_begin): Use Library_base.
1538 (Incremental_inputs::report_archive_end): Likewise.
1539 (Incremental_inputs::report_object): Likewise.
1540 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1541 function.
1542 * object.h (Object::for_all_global_symbols): New function.
1543 (Object::do_for_all_global_symbols): New function.
1544 (Sized_relobj::do_for_all_global_symbols): New function.
1545 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1546 function.
1547 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1548 function.
1549
61ab3e40
ILT
15502011-03-27 Ian Lance Taylor <iant@google.com>
1551
1552 * archive.cc (Archive::interpret_header): Return -1 if something
1553 goes wrong. Change callers accordingly.
1554
30e1f9e6
CC
15552011-03-25 Cary Coutant <ccoutant@google.com>
1556
1557 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1558 * testsuite/Makefile.in: Regenerate.
1559
9c793f14
RÁE
15602010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1561
1562 * plugin.cc (get_view): New.
1563 (Plugin::load): Pass get_view to the plugin.
1564 (Plugin_manager::get_view): New.
1565
9312bb0a
ILT
15662011-03-21 Ian Lance Taylor <iant@google.com>
1567
1568 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1569 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1570
7e12ba9e
ST
15712011-03-21 Sriraman Tallam <tmsriram@google.com>
1572
1573 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1574 Change == to -eq.
1575 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1576 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1577 Change == to -eq.
1578 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1579 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1580
fd7a005d
ILT
15812011-03-14 Ian Lance Taylor <iant@google.com>
1582
1583 * script-sections.cc (Sort_output_sections::script_compare):
1584 Rename from is_before, change return type.
1585 (Sort_output_sections::operator()): Adjust accordingly.
1586
ed16fd1b
ILT
15872011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1588
1589 PR gold/12572
1590 * testsuite/odr_violation2.cc: Add comment to make all error line
1591 numbers double digits.
1592 * testsuite/debug_msg.sh: Adjust expected errors.
1593
71ff8986
ILT
15942011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1595
1596 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1597 but mark earlier ones as non-canonical
1598 (offset_to_iterator): Update search target and example
1599 (do_addr2line): Return extra lines in a vector*
1600 (format_file_lineno): Extract from do_addr2line
1601 (one_addr2line): Add vector* out-param
1602 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
1603 when a lineno entry appeared last for its instruction
1604 (Dwarf_line_info): Add vector* out-param
1605 * object.cc (Relocate_info): Pass NULL for the vector* out-param
1606 * symtab.cc (Odr_violation_compare): Include the lineno in the
1607 comparison again.
1608 (linenos_from_loc): New. Combine the canonical line for an
1609 address with its other lines.
1610 (True_if_intersect): New. Helper functor to make
1611 std::set_intersection a query.
1612 (detect_odr_violations): Compare sets of lines instead of just
1613 one line for each function. This became less deterministic, but
1614 has fewer false positives.
1615 * symtab.h: Declarations.
1616 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
1617 mix an optimized and non-optimized object in the same binary
1618 (odr_violation2.so): Same.
1619 * testsuite/Makefile.in: Regenerate from Makefile.am.
1620 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
1621 * testsuite/debug_msg.sh: Update line numbers and add
1622 assertions.
1623 * testsuite/odr_violation1.cc: Use OdrDerived, in a
1624 non-optimized context.
1625 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
1626 isn't inlined, and use OdrDerived in an optimized context.
1627 * testsuite/odr_header1.h: Defines OdrDerived, where
1628 optimization will change the
1629 first-instruction-in-the-destructor's file and line number.
1630 * testsuite/odr_header2.h: Defines OdrBase.
1631
a19fefdc
ILT
16322011-03-09 Ian Lance Taylor <iant@google.com>
1633
1634 * fileread.cc (File_read::clear_views): Don't delete the whole
1635 file view.
1636
ecb351e9
ILT
16372011-03-08 Ian Lance Taylor <iant@google.com>
1638
1639 PR gold/12525
1640 * fileread.cc: #include <climits>.
1641 (GOLD_IOV_MAX): Define.
1642 (File_read::read_multiple): Limit number of entries by iov_max.
1643 * fileread.h (class File_read): Always set max_readv_entries to
1644 128.
1645
b821d13c
ILT
16462011-03-07 Ian Lance Taylor <iant@google.com>
1647
1648 PR gold/12525
1649 * options.h (class General_options): Add -dy and -dn.
1650
89243142
CC
16512011-03-02 Cary Coutant <ccoutant@google.com>
1652
1653 * testsuite/script_test_9.t: Add TLS segment.
1654
d0773f31
ILT
16552011-03-02 Simon Baldwin <simonb@google.com>
1656
1657 * configure.ac: Add check for gnu_indirect_function support in
1658 the toolchain building binutils.
1659 * configure: Rebuild.
1660
badc8139
RÁE
16612010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
1662
1663 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
1664 plugin only symbols.
1665 (Symbol_table::sized_finalize_symbol) Mark symbol only present
1666 in plugin files as not needed in the symbol table.
1667
4cf7a849
ST
16682011-02-11 Sriraman Tallam <tmsriram@google.com>
1669
1670 * output.cc (Output_section::add_input_section): Delay fill
1671 generation for section ordering.
1672
b578bd7d
ILT
16732011-02-09 Ian Lance Taylor <iant@google.com>
1674
1675 PR gold/12316
1676 * object.h (class Sized_relobj): Remove clear_local_symbols.
1677 * reloc.cc (Sized_relobj::do_relocate): Don't call
1678 clear_local_symbols.
1679
84ced98a
RÁE
16802010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
1681
1682 * plugin.cc (is_visible_from_outside): Return true for symbols
1683 in the -u option.
1684
55382fb7
ILT
16852011-02-04 Jeffrey Yasskin <jyasskin@google.com>
1686
1687 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
1688 filename.
1689
4e271fff
ST
16902011-02-02 Sriraman Tallam <tmsriram@google.com>
1691
1692 * icf.h (is_section_foldable_candidate): Change type of parameter
1693 to std::string.
1694 * icf.cc (Icf::find_identical_sections): Change type of local variable
1695 section_name to be std::string.
1696 (is_function_ctor_or_dtor): Change type of parameter to std::string.
1697
d433c3ac
ILT
16982011-01-25 Ian Lance Taylor <iant@google.com>
1699
1700 * script.cc (script_add_extern): Rewrite to use
1701 add_symbol_reference.
1702
880473a6
DK
17032011-01-25 Doug Kwan <dougkwan@google.com>
1704
d433c3ac 1705 * icf.cc (get_section_contents): Always lock section's object.
880473a6 1706
f30f86fa
ILT
17072011-01-24 Ian Lance Taylor <iant@google.com>
1708
1709 * options.h (class General_options): Accept
1710 --no-detect-odr-violations.
1711
8e51a0b9
ILT
17122011-01-24 Ian Lance Taylor <iant@google.com>
1713
1714 * version.cc (version_string): Bump to 1.11.
1715
0f3b89d8
ILT
17162011-01-24 Ian Lance Taylor <iant@google.com>
1717
1718 * plugin.cc (class Plugin_rescan): Define new class.
1719 (Plugin_manager::claim_file): Set any_claimed_.
1720 (Plugin_manager::save_archive): New function.
1721 (Plugin_manager::save_input_group): New function.
1722 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
1723 necessary.
1724 (Plugin_manager::new_undefined_symbol): New function.
1725 (Plugin_manager::rescan): New function.
1726 (Plugin_manager::rescannable_defines): New function.
1727 (Plugin_manager::add_input_file): Set any_added_.
1728 * plugin.h (class Plugin_manager): define new fields rescannable_,
1729 undefined_symbols_, any_claimed_, and any_added_. Declare
1730 Plugin_rescan as friend. Declare new functions.
1731 (Plugin_manager::Rescannable): Define type.
1732 (Plugin_manager::Rescannable_list): Define type.
1733 (Plugin_manager::Undefined_symbol_list): Define type.
1734 (Plugin_manager::Plugin_manager): Initialize new fields.
1735 * archive.cc (Archive::defines_symbol): New function.
1736 (Add_archive_symbols::run): Pass archive to plugins if any.
1737 * archive.h (class Archive): Declare defines_symbol.
1738 * readsyms.cc (Input_group::~Input_group): New function.
1739 (Finish_group::run): Pass input_group to plugins if any.
1740 * readsyms.h (class Input_group): Declare destructor.
1741 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
1742 any.
1743
3bb951e5
ILT
17442011-01-10 Ian Lance Taylor <iant@google.com>
1745
1746 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
1747 section as relro.
1748 (Layout::set_segment_offsets): Reset increase_relro before calling
1749 set_section_addresses a second time.
1750
0aa45fac
CC
17512011-01-04 Cary Coutant <ccoutant@google.com>
1752
1753 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
1754 sections before NOBITS sections.
1755
0db46eb4
L
17562011-01-01 H.J. Lu <hongjiu.lu@intel.com>
1757
1758 * version.cc (print_version): Update copyright to 2011.
1759
829c9745
CC
17602010-12-23 Cary Coutant <ccoutant@google.com>
1761
1762 * output.h (Output_data_reloc::add_output_section): Pass OD instead
1763 of OS to this->add. Add OD parameter to second form of the function.
1764
7500420b
ILT
17652010-12-20 Ian Lance Taylor <iant@google.com>
1766
1767 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
1768 second of two consecutive entries with same offset.
1769
f8e9a930
RW
17702010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1771
1772 * testsuite/Makefile.am (ifuncmain2static_LDADD)
1773 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
1774 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
1775 to avoid unneeded links against $(LDADD).
1776 * testsuite/Makefile.in: Regenerate.
1777
2fbb4320
ILT
17782010-12-15 Ian Lance Taylor <iant@google.com>
1779
1780 PR gold/12324
1781 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
1782 for R_X86_64_32 and R_X86_64_PC32.
1783 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
1784 ver_matching_def_pic.o.
1785 (ver_matching_def_pic.o): New target.
1786
fedb228d
RW
17872010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1788
1789 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
1790 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
1791 Move definition before File_read::View member definitions.
1792 (File_read::View::~View): Initialize and hold lock before
1793 updating current_mapped_bytes.
1794
9b547ce6
RW
17952010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1796
1797 * dwarf_reader.cc: Remove outdated comment.
1798 * gold-threads.cc: Fix typo in error message.
1799 * archive.cc: Fix typos in comments.
1800 * archive.h: Likewise.
1801 * arm-reloc-property.cc: Likewise.
1802 * arm-reloc-property.h: Likewise.
1803 * arm-reloc.def: Likewise.
1804 * arm.cc: Likewise.
1805 * attributes.h: Likewise.
1806 * cref.cc: Likewise.
1807 * ehframe.cc: Likewise.
1808 * fileread.h: Likewise.
1809 * gold.h: Likewise.
1810 * i386.cc: Likewise.
1811 * icf.cc: Likewise.
1812 * incremental.h: Likewise.
1813 * int_encoding.cc: Likewise.
1814 * layout.h: Likewise.
1815 * main.cc: Likewise.
1816 * merge.h: Likewise.
1817 * object.cc: Likewise.
1818 * object.h: Likewise.
1819 * options.cc: Likewise.
1820 * readsyms.cc: Likewise.
1821 * reduced_debug_output.cc: Likewise.
1822 * reloc.cc: Likewise.
1823 * script-sections.cc: Likewise.
1824 * sparc.cc: Likewise.
1825 * symtab.h: Likewise.
1826 * target-reloc.h: Likewise.
1827 * target.cc: Likewise.
1828 * target.h: Likewise.
1829 * timer.cc: Likewise.
1830 * timer.h: Likewise.
1831 * x86_64.cc: Likewise.
1832
83e17bd5
CC
18332010-12-09 Cary Coutant <ccoutant@google.com>
1834
1835 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
1836 stack.
1837 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
1838 parameter; change all callers.
1839 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
1840 * options.h (warn_execstack): New option.
1841
017257f8
DK
18422010-12-07 Doug Kwan <dougkwan@google.com>
1843
1844 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1845 like function call relocations.
1846
c20cbc06
ILT
18472010-12-07 Ian Lance Taylor <iant@google.com>
1848
1849 * archive.cc (Archive::get_elf_object_for_member): Permit
1850 punconfigured to be NULL.
1851 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1852 (Archive::include_member): Pass NULL to get_elf_object_for_member
1853 if we searched for the archive and this is the first included
1854 object.
1855
4dbfafcc
ILT
18562010-12-01 Ian Lance Taylor <iant@google.com>
1857
1858 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1859 track_relocs_type_ field.
1860 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1861 Set track_relocs_type_.
1862 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1863 contents when using RELA relocs.
1864 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1865 reloc_map_.
1866 * reloc.cc (Track_relocs::next_addend): New function.
1867 * reloc.h (class Track_relocs): Declare next_addend.
1868
e5e19edd
ILT
18692010-12-01 Ian Lance Taylor <iant@google.com>
1870
1871 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1872 virtual destructor.
1873
9a5ce24c
ILT
18742010-12-01 Ian Lance Taylor <iant@google.com>
1875
1876 * README: Update compilers known to work and fail.
1877
c7791212
NC
18782010-11-23 Matthias Klose <doko@ubuntu.com>
1879
1880 * configure.in: For --enable-gold, handle value `default' instead of
1881 `both*'. Always install ld as ld.bfd, install as ld if gold is
1882 not the default.
1883 * configure: Regenerate.
1884
0ad220c9
DK
18852010-11-18 Doug Kwan <dougkwan@google.com>
1886
1887 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1888 and right_alignment to be zero. Store result alignment only if it is
1889 greater than existing alignment.
1890
ab8056e0
CC
18912010-11-16 Cary Coutant <ccoutant@google.com>
1892
1893 PR gold/12220
1894 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1895 Check for ".zdebug_line".
1896
fd064a5b
CC
18972010-11-16 Doug Kwan <dougkwan@google.com>
1898 Cary Coutant <ccoutant@google.com>
1899
1900 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1901 by reference; adjust all callers.
1902 * output.cc (Output_segment::set_section_addresses): Adjust references
1903 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1904 list is empty.
1905 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1906 end at page boundary.
1907
6fc6ea19
CC
19082010-11-16 Cary Coutant <ccoutant@google.com>
1909
1910 PR gold/12220
1911 * layout.cc (Layout::choose_output_section): Transform names of
1912 compressed sections even when using a script with a SECTIONS clause.
1913 (Layout::output_section_name): Remove code to transform
1914 compressed debug section names.
1915 * output.cc (Output_section::add_input_section): Use uncompressed
1916 section size when tracking input sections.
1917
95a2c8d6
RS
19182010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1919
1920 * symtab.h (Symbol::NON_PIC_REF): Remove.
1921 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1922 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1923 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1924 (Symbol::use_plt_offset): Take a flags argument and pass it
1925 directly to needs_dynamic_reloc. Restrict check for undefined
1926 weak symbols to function calls.
1927 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1928 (Target_arm::Scan::global): Use it.
1929 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1930 (Target_arm::Relocate::relocate): Likewise.
1931 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1932 parameter with an r_type parameter. Use get_reference_flags
1933 to get the flags.
1934 (Target_arm::Relocate::relocate): Update accordingly.
1935 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1936 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1937 (Target_i386::Scan::global): Likewise.
1938 (Target_i386::Relocate::relocate): Likewise.
1939 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1940 parameter with an r_type parameter. Use get_reference_flags
1941 to get the flags.
1942 (Target_i386::Relocate::relocate): Update accordingly.
1943 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1944 (Target_powerpc::Scan::global): Use it.
1945 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1946 (Target_powerpc::Relocate::relocate): Likewise.
1947 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1948 (Target_sparc::Scan::global): Use it.
1949 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1950 (Target_sparc::Relocate::relocate): Likewise.
1951 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1952 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1953 (Target_x86_64::Scan::global): Likewise.
1954 (Target_x86_64::Relocate::relocate): Likewise.
1955
f625ae50
DK
19562010-11-08 Doug Kwan <dougkwan@google.com>
1957 Cary Coutant <ccoutant@google.com>
1958
1959 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1960 (Arm_exidx_merge_section::section_contents_): New data member.
1961 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1962 (Arm_input_section::~Arm_input_section): De-allocate memory.
1963 (Arm_input_section::original_contents_): New data member.
1964 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1965 in parameters instead of calling Object::section_contents without
1966 locking.
1967 (Arm_output_section::group_section): New parameter TASK. Pass it
1968 to callees that need locking objects.
1969 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1970 to lock EXIDX input sections. Fix a formatting issue. Call
1971 Arm_exidx_merged_section::build_contents to create merged section
1972 contents.
1973 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1974 to lock object of stub table owner.
1975 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1976 TEXT_SIZE to initialize data member TEXT_SIZE_.
1977 (Arm_exidx_input_section::addralign): Fix typo in comment.
1978 (Arm_exidx_input_section::text_size): New method.
1979 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1980 that require locking objects. Lock objects before scanning for stubs
1981 and updating local symbols.
1982 (Arm_input_section<big_endian>::init): Copy contents of original
1983 input section.
1984 (Arm_input_section<big_endian>::do_write): Use saved contents of
1985 original input section instead of calling Object::section_contents
1986 without locking.
1987 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1988 size without calling Object::section_size().
1989 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1990 for size. Allocate a buffer for merged EXIDX entries.
1991 (Arm_exidx_merged_section::build_contents): New method.
1992 (Arm_exidx_merged_section::do_write): Move merge section contents
1993 building code to Arm_exidx_merged_section::build_contetns. Write
1994 out contetns in buffer instead of building it on the fly.
1995 (Arm_relobj::make_exidx_input_section): Also pass text section size
1996 to Arm_exidx_input_section constructor.
1997 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1998 (Arm_dynobj::do_read_symbols): Fix memory leak.
1999 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2000 * target.h: (class Task): Add forward declaration.
2001 (Target::relax): Add new parameter TASK and pass it to
2002 Target::do_relax().
2003 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2004
5f9bcf58
CC
20052010-11-05 Cary Coutant <ccoutant@google.com>
2006
2007 PR gold/10708
2008 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2009 object when reading from the file.
2010 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2011 second layout pass.
2012 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2013 when reading section contents.
2014 (get_section_contents): Likewise.
2015 (icf::find_identical_sections): Likewise.
2016 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2017 object when reading from the file.
2018 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2019 the object when doing deferred section layout.
2020
e597fa08
NC
20212010-11-03 Nick Clifton <nickc@redhat.com>
2022
2023 PR gold/12001
2024 * script.h (class Symbol_assignment: name): New member. Returns
2025 the name of the symbol.
2026 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2027 Returns true if the given symbol name is on the list of
2028 assignments wating to be processed.
2029 * archive.cc (should_incldue_member): If the symbol is undefined,
2030 check to see if it is on the list of symbols pending assignment.
2031
3f9a3278
ILT
20322010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2033
2034 * script-sections.cc (Script_sections::find_memory_region): Check
2035 for a NULL output section pointer.
2036
d06fb4d1
DK
20372010-10-29 Doug Kwan <dougkwan@google.com>
2038
2039 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2040 Output_section::add_relaxed_input_section.
2041 * output.cc (Output_section::add_relaxed_input_section): Add new
2042 arguments LAYOUT and NAME. Set section order index.
2043 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2044 Copy section order index.
2045 * output.h (Output_section::add_relaxed_input_section): Add new
2046 arguments LAYOUT and NAME.
2047
90e24de5
ILT
20482010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2049
2050 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2051 NATIVE_OR_CROSS_LINKER.
2052 * testsuite/Makefile.in: Regenerate.
2053
c9484ea5
DK
20542010-10-20 Doug Kwan <dougkwan@google.com>
2055
2056 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2057 without SHF_LINK_ORDER flags.
2058 * layout.cc (Layout::choose_output_section): Do not filter
2059 SHF_LINK_ORDER flag in a relocatable link.
2060
5bc2f5be
CC
20612010-10-17 Cary Coutant <ccoutant@google.com>
2062
2063 * output.h (Output_segment::set_section_addresses): Change function
2064 signature. Update all callers.
2065 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2066 sections.
2067 (Output_segment::set_section_addresses): Align after last TLS
2068 section. Add padding before last relro section instead of after.
2069
0c91cf04
DK
20702010-10-17 Doug Kwan <dougkwan@google.com>
2071
2072 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2073 GOT output section to be writable.
2074
8c21d9d3
CC
20752010-10-14 Cary Coutant <ccoutant@google.com>
2076
2077 * debug.h (DEBUG_INCREMENTAL): New flag.
2078 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2079 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2080 mode.
2081 * incremental.cc (report_command_line): Ignore all forms of
2082 --incremental.
2083 * layout.cc (Layout::Layout): Check parameters for incremental link
2084 mode.
2085 * options.cc (General_options::parse_incremental): New function.
2086 (General_options::parse_no_incremental): New function.
2087 (General_options::parse_incremental_full): New function.
2088 (General_options::parse_incremental_update): New function.
2089 (General_options::incremental_mode_): New data member.
2090 (General_options::finalize): Check incremental_mode_.
2091 * options.h (General_options): Update help text for --incremental.
2092 Add --no-incremental, --incremental-full, --incremental-update.
2093 (General_options::Incremental_mode): New enum type.
2094 (General_options::incremental_mode): New function.
2095 (General_options::incremental_mode_): New data member.
2096 * parameters.cc (Parameters::incremental_mode_): New data member.
2097 (Parameters::set_options): Set incremental_mode_.
2098 (Parameters::set_incremental_full): New function.
2099 (Parameters::incremental): New function.
2100 (Parameters::incremental_update): New function.
2101 (set_parameters_incremental_full): New function.
2102 * parameters.h (Parameters::set_incremental_full): New function.
2103 (Parameters::incremental): New function.
2104 (Parameters::incremental_update): New function.
2105 (Parameters::incremental_mode_): New data member.
2106 (set_parameters_incremental_full): New function.
2107 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2108 incremental link mode.
2109 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2110 (Sized_relobj::do_relocate_sections): Likewise.
2111 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2112 option.
2113 * testsuite/Makefile.in: Regenerate.
2114 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2115
bb32aa18 21162010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
2117
2118 * script-sections.h (class Script_sections): Make
2119 Sections_elements typedef public.
2120 * script-sections.cc (class Sort_output_sections): Add elements_
2121 field. Add constructor which sets it; change all callers.
2122 (Sort_output_sections::is_before): New function.
2123 (Sort_output_sections::operator()): Call is_before.
2124 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2125 conditional.
2126 * testsuite/script_test_10.sh: New test. Test script section
2127 order.
2128 * testsuite/script_test_10.t: Likewise.
2129 * testsuite/script_test_10.s: Likewise.
2130 * testsuite/Makefile.am: Wrap the cross linker tests and the
2131 common tests into NATIVE_OR_CROSS_LINKER.
2132 (check_SCRIPTS): Add script_test_10.sh.
2133 (check_DATA): Add script_test_10.stdout.
2134 (script_test_10.o, script_test_10): New targets.
2135 (script_test_10.stdout): New target.
2136 * configure, testsuite/Makefile.in: Regenerate.
2137
3cef7179
ILT
21382010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2139
2140 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2141 error for the deprecated relocations.
2142 (Target_arm::Scan::global): Likewise.
2143 (Target_arm::Relocate::relocate): Likewise.
2144
7411e9a8
RS
21452010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2146
2147 * fileread.cc (Input_file::find_file): Initialize *found_name
2148 and *namep when using the fallback search for case 4.
2149
6a9da32a
CC
21502010-10-11 Cary Coutant <ccoutant@google.com>
2151
2152 * options.h (class General_options): Redefine -z lazy as an alias for
2153 the negation of -z now.
2154
ac897c20
ILT
21552010-10-11 Ian Lance Taylor <iant@google.com>
2156
2157 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2158 binding.
2159
ea5cae92
NC
21602010-10-06 Nick Clifton <nickc@redhat.com>
2161
2162 * script-sections.cc(class Memory_region): Remove
2163 current_lma_offset_ field. Rename current_vma_offset_ to
2164 current_offset_. Add last_section_ field.
2165 (Memory_region::get_current_vma_address): Rename to
2166 get_current_address.
2167 (Memory_region::get_current_lma_address): Delete.
2168 (Memory_region::increment_vma_offset): Rename to
2169 increment_offset.
2170 (Memory_region::increment_lma_offset): Delete.
2171 (Memory_region::attributes_compatible): New method. Returns
2172 true if the provided section is compatible with the region.
2173 (Memory_region::get_last_section): New method. Returns the last
2174 section to use the region.
2175 (Memory_region::set_last_section): New method. Stores the last
2176 section to use the region.
2177 (Script_sections::block_in_region): New method. Returns true if
2178 a block of memory is contained within a region.
2179 (Script_sections::find_memory_region): New method. Locates a
2180 memory region to be used to set a VMA or LMA address.
2181 (Output_section_definition::set_section_addresses): Add code to
2182 check for addresses set by memory regions.
2183 (Output_segment::set_section_addresses): Remove memory region
2184 walking code.
2185 (Script_sections::create_segment): Add a warning if a header
2186 segment is created outside of any region.
2187 * script-sections.h (class Script_sections): Add prototypes for
2188 find_memory_region and block_in_region methods.
2189 * testsuite/memory_test.s: Use .long instead of .word.
2190 * testsuite/memory_test.t: Add some more output sections.
2191 * testsuite/memory_test.sh: Update expected output.
2192
a9bfd952
DK
21932010-10-02 Doug Kwan <dougkwan@google.com>
2194
2195 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2196 defintion to symtab.h
2197 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2198 declaration to defintion.
2199
bacff3ab
NC
22002010-10-01 Nick Clifton <nickc@redhat.com>
2201
2202 * expression.cc (eval): Replace dummy argument with NULL.
2203 (eval_maybe_dot): Check for a NULL result section pointer.
2204 (Symbol_expression::value): Likewise.
2205 (Dot_expression::value): Likewise.
2206 (BINARY_EXPRESSION): Likewise.
2207 (Max_expression::value): Likewise.
2208 (Min_expression::value): Likewise.
2209 (Absolute_expression::value): Likewise.
2210 (Addr_expression::value_from_output_section): Likewise.
2211 (Loaddddr_expression::value_from_output_section): Likewise.
2212 (Segment_start_expression::value): Likewise.
2213 * script-sections.cc
2214 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2215 argument with NULL.
2216 (Sections_elememt_dot_assignment::set_section_addresses):
2217 Likewise.
2218 (Output_data_expression::do_write_to_buffer): Likewise.
2219 (Output_section_definition::finalize_symbols): Likewise.
2220 (Output_section_definition::set_section_addresses): Likewise.
2221
f81bc8b5
DK
22222010-09-30 Doug Kwan <dougkwan@google.com>
2223
2224 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2225
c95e9f27
ST
22262010-09-28 Sriraman Tallam <tmsriram@google.com>
2227
2228 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 2229 function.
c95e9f27
ST
2230 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2231 virtual function.
2232 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2233 virtual function.
2234 * icf.cc (get_section_contents): Inline merge sections only when
2235 target allows it.
2236
3cac54d2
RW
22372010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2238
2239 * configure: Regenerate.
2240
2904037a
ILT
22412010-09-17 Ian Lance Taylor <iant@google.com>
2242
2243 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
2244 * testsuite/Makefile.am (memory_test.o): New target.
2245 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2246 memory_test.t.
2247 * testsuite/Makefile.in: Rebuild.
2904037a 2248
bca7fb63
DK
22492010-09-17 Doug Kwan <dougkwan@google.com>
2250
2251 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2252 defintion if relocation uses GOT entries of the symbol.
2253 * testsuite/icf_safe_test.sh: Fix test.
2254 * testsuite/icf_safe_so_test.sh: Fix test.
2255
4ef28648
CC
22562010-09-16 Cary Coutant <ccoutant@google.com>
2257
2258 * script_sections.cc (class Memory_region): Remove "NULL" from
2259 vector initializations.
2260
793990de
CC
22612010-09-15 Cary Coutant <ccoutant@google.com>
2262
2263 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2264 Resolve forwarding symbols.
2265
81e015e2
DK
22662010-09-15 Doug Kwan <dougkwan@google.com>
2267
2268 * gold/testsuite/script_test_3.t: Add ARM special sections.
2269 * gold/testsuite/script_test_4.t: Same.
2270 * gold/testsuite/script_test_5.t: Same.
2271 * gold/testsuite/script_test_6.t: Same.
2272 * gold/testsuite/script_test_7.t: Same.
2273 * gold/testsuite/script_test_7.t: Same.
2274 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2275
36171d64
CC
22762010-09-14 Cary Coutant <ccoutant@google.com>
2277
2278 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
2279 (Target_x86_64::Relocate::relocate_tls): Replace check for
2280 saw_tls_block_reloc_ with test for executable section.
2281
d89051bd
CC
22822010-09-12 Cary Coutant <ccoutant@google.com>
2283
2284 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2285 position-independent executables to shared libraries need dynamic
2286 relocations.
2287 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2288 position-independent executables.
2289 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2290 * testsuite/Makefile.in: Regenerate.
2291
fca41f0f
NC
22922010-09-10 Nick Clifton <nickc@redhat.com>
2293
2294 PR gold/11997
2295 * testsuite/memory_test.t: Discard any sections that are not
2296 needed.
2297
6695e4b3
L
22982010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2299
2300 PR gold/11996
2301 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2302 "This::" to work around a bug in gcc 4.2.
2303
2304 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2305
0f72bf6f
RÁE
23062010-09-09 Rafael Espindola <espindola@google.com>
2307
2308 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
2309 sections with different PF_X flags in the same segment.
2310 (Layout::find_first_load_seg): Search all segments to find the first
2311 one.
2312 * options.h (rosegment): New.
2313
23142010-09-08 Rafael Espindola <espindola@google.com>
a6577478 2315
05a79166 2316 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 2317
aa98ff75
DK
23182010-09-08 Doug Kwan <dougkwan@google.com>
2319
2320 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
2321 (Arm_relobj::do_relocate_sections): Add new parameter for output
2322 file to match the parent.
2323 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
2324 of local symbols instead of input values. Update code to track
2325 changes in gold::relocate_section.
2326 * object.cc (Sized_relobj::compute_final_local_value): New methods.
2327 (Sized_relobj::compute_final_local_value_internal): New methods.
2328 (Sized_relobj::do_finalize_local_symbols): Move code from loop
2329 body into private version of Sized_relobj::compute_final_local_value.
2330 Call the inline method.
2331 * object.h (Symbol_value::Symbol_value): Define destructor. Free
2332 merged symbol value if there is one.
2333 (Symbol_value::has_output_value): New method defintiion.
2334 (Sized_relobj::Compute_final_local_value_status): New enum type.
2335 (Sized_relobj::compute_final_local_value): New methods.
2336 (Sized_relobj::compute_final_local_value_internal): New methods.
2337 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
2338 and arm_cortex_a8.sh.
2339 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
2340 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
2341 New tests.
2342 * Makefile.in: Regenerate.
2343 * testsuite/arm_bl_out_of_range.s: Update test.
2344 * testsuite/thumb_bl_out_of_range.s: Ditto.
2345 * testsuite/thumb_blx_out_of_range.s: Ditto.
2346 * testsuite/arm_branch_out_of_range.sh: New file.
2347 * testsuite/arm_cortex_a8.sh: Ditto.
2348 * testsuite/arm_cortex_a8_b.s: Ditto.
2349 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
2350 * testsuite/arm_cortex_a8_b_local.s: Ditto.
2351 * testsuite/arm_cortex_a8_bl.s: Ditto.
2352 * testsuite/arm_cortex_a8_blx.s: Ditto.
2353 * testsuite/arm_cortex_a8_local.s: Ditto.
2354 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
2355 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2356
05a79166
L
23572010-09-08 Rafael Espindola <espindola@google.com>
2358
2359 * Makefile.am (memory_test.stdout): Run readelf with -W.
2360 * Makefile.in: Regenerate.
2361 * testsuite/memory_test.sh: Make the regexps accept both 32 and
2362 64 bit output.
2363
33dbc701
RÁE
23642010-09-08 Rafael Espindola <espindola@google.com>
2365
2366 * script-sections.cc (Script_sections::add_memory_region): Convert
2367 field precision to int.
2368 * script.cc (script_set_section_region, script_set_section_region):
2369 Convert field precision to int.
2370
731ca54a
RÁE
23712010-09-08 Rafael Espindola <espindola@google.com>
2372
2373 * arm.cc (do_finalize_sections): Create the __exidx_start and
2374 __exdix_end symbols even when the section is missing.
2375
7f8cd844
NC
23762010-09-08 Nick Clifton <nickc@redhat.com>
2377
2378 * README: Remove claim that MEMORY is not supported.
2379 * expression.cc (script_exp_function_origin)
2380 (script_exp_function_length): Move from here to ...
2381 * script.cc: ... here.
2382 (script_set_section_region, script_add_memory)
2383 (script_parse_memory_attr, script_include_directive): New
2384 functions.
2385 * script-sections.cc
2386 (class Memory_region): New class.
2387 (class Output_section_definition): Add set_memory_region,
2388 set_section_vma, set_section_lma and get_section_name methods.
2389 (class Script_Sections): Add add_memory_region,
2390 find_memory_region, find_memory_region_origin,
2391 find_memory_region_length and set_memory_region methods.
2392 Have set_section_addresses method walk the list of set memory
2393 regions.
2394 Extend the print methos to display memory regions.
2395 * script-sections.h: Add prototypes for new methods.
2396 Add enum for MEMORY region attributes.
2397 * yyscript.y: Add support for parsing MEMORY regions.
2398 * script-c.h: Add prototypes for new functions.
2399 * testsuite/Makefile.am: Add test of MEMORY region functionality.
2400 * testsuite/Makefile.in: Regenerate.
2401 * testsuite/memory_test.sh: New script.
2402 * testsuite/memory_test.s: New assembler source file.
2403 * testsuite/memory_test.t: New linker script.
2404
a4649286
DK
24052010-08-27 Doug Kwan <dougkwan@google.com>
2406
2407 * gold/resolve.cc (Symbol_table::should_override): Let a weak
2408 reference override an existing dynamic weak reference.
2409 * testsuite/Makefile.am: Add new test dyn_weak_ref.
2410 * testsuite/Makefile.in: Regenerate.
2411 * testsuite/dyn_weak_ref.sh: New file.
2412 * testsuite/dyn_weak_ref_1.c: Ditto.
2413 * testsuite/dyn_weak_ref_2.c: Ditto.
2414
b56648ad
ILT
24152010-08-27 Ian Lance Taylor <iant@google.com>
2416
2417 * incremental.h (class Incremental_input_entry): Add virtual
2418 destructor.
2419
809313cb
ILT
24202010-08-27 Ian Lance Taylor <iant@google.com>
2421
2422 * testsuite/start_lib_test_3.c: Mark t3 as used.
2423
11e32464
NC
24242010-08-27 Nick Clifton <nickc@redhat.com>
2425
2426 * options.cc (version_script): Fix small typo in previous
2427 whitespace tidyup.
2428
ca09d69a
NC
24292010-08-25 Nick Clifton <nickc@redhat.com>
2430
2431 * archive.cc: Formatting fixes: Remove whitespace between
2432 typename and following asterisk. Remove whitespace between
2433 function name and opening parenthesis.
2434 * archive.h: Likewise.
2435 * arm.cc: Likewise.
2436 * attributes.cc: Likewise.
2437 * attributes.h: Likewise.
2438 * common.cc: Likewise.
2439 * copy-relocs.cc: Likewise.
2440 * dirsearch.h: Likewise.
2441 * dynobj.cc: Likewise.
2442 * ehframe.cc: Likewise.
2443 * ehframe.h: Likewise.
2444 * expression.cc: Likewise.
2445 * fileread.cc: Likewise.
2446 * fileread.h: Likewise.
2447 * gc.h: Likewise.
2448 * gold-threads.cc: Likewise.
2449 * gold.cc: Likewise.
2450 * i386.cc: Likewise.
2451 * icf.h: Likewise.
2452 * incremental-dump.cc: Likewise.
2453 * incremental.cc: Likewise.
2454 * layout.cc: Likewise.
2455 * layout.h: Likewise.
2456 * main.cc: Likewise.
2457 * merge.cc: Likewise.
2458 * merge.h: Likewise.
2459 * object.cc: Likewise.
2460 * object.h: Likewise.
2461 * options.cc: Likewise.
2462 * options.h: Likewise.
2463 * output.cc: Likewise.
2464 * output.h: Likewise.
2465 * plugin.cc: Likewise.
2466 * plugin.h: Likewise.
2467 * powerpc.cc: Likewise.
2468 * reloc.cc: Likewise.
2469 * script-c.h: Likewise.
2470 * script-sections.cc: Likewise.
2471 * script.cc: Likewise.
2472 * stringpool.cc: Likewise.
2473 * symtab.cc: Likewise.
2474 * symtab.h: Likewise.
2475 * target.cc: Likewise.
2476 * timer.cc: Likewise.
2477 * timer.h: Likewise.
2478 * version.cc: Likewise.
2479 * x86_64.cc: Likewise.
2480
b8fa8750
NC
24812010-08-24 Nick Clifton <nickc@redhat.com>
2482
2483 PR 11899
2484 * layout.cc (segment_precedes): Sort segments by their physical
2485 addresses, if they have been set.
2486
9919d93b
CC
24872010-08-23 Cary Coutant <ccoutant@google.com>
2488
2489 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
2490 symbols data.
2491 (Lib_group::include_member): Unlock object after deleting its
2492 symbols data.
2493 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
2494 the bug fixed here.
2495
97b4be1c
CC
24962010-08-19 Neil Vachharajani <nvachhar@google.com>
2497 Cary Coutant <ccoutant@google.com>
2498
2499 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
2500 constructor, and set_blocker.
2501 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
2502 readsyms_blocker_.
2503 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
2504 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
2505 * testsuite/Makefile.am (start_lib_test): New test case.
2506 * testsuite/Makefile.in: Regenerate.
2507 * testsuite/start_lib_test_main.c: New file.
2508 * testsuite/start_lib_test_1.c: New file.
2509 * testsuite/start_lib_test_2.c: New file.
2510 * testsuite/start_lib_test_3.c: New file.
2511
dd0b1884
ILT
25122010-08-19 Ian Lance Taylor <iant@google.com>
2513
2514 * Makefile.in: Rebuild with automake 1.11.1.
2515 * aclocal.m4: Likewise.
2516 * testsuite/Makefile.in: Likewise.
2517
7223e9ca
ILT
25182010-08-19 Ian Lance Taylor <iant@google.com>
2519
2520 PR 10893
2521 * i386.cc (class Output_data_plt_i386): Update declarations.
2522 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
2523 local_ifuncs_ fields.
2524 (Target_i386::do_plt_section_for_global): New function.
2525 (Target_i386::do_plt_section_for_local): New function.
2526 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2527 parameter; change all callers. Initialize global_ifuncs_ and
2528 local_ifuncs_. If doing a static link define __rel_iplt_start and
2529 __rel_iplt_end.
2530 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2531 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2532 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2533 symbols.
2534 (Target_i386::make_plt_section): New function, broken out of
2535 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2536 (Target_i386::make_plt_entry): Call make_plt_section.
2537 (Target_i386::make_local_ifunc_plt_entry): New function.
2538 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2539 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2540 R_386_IRELATIVE to switch.
2541 (Target_i386::Scan::global): Likewise.
2542 (Target_i386::Relocate::relocate): Likewise.
2543 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2544 switch.
2545 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2546 (Target_x86_64::do_plt_section_for_global): New function.
2547 (Target_x86_64::do_plt_section_for_local): New function.
2548 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2549 parameter; change all callers. If doing a static link define
2550 __rela_iplt_start and __rela_iplt_end.
2551 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2552 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2553 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2554 to point to .plt.
2555 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2556 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2557 switch.
2558 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2559 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2560 R_X86_64_IRELATIVE to switch.
2561 (Target_x86_64::Scan::global): Likewise.
2562 (Target_x86_64::Relocate::relocate): Likewise.
2563 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2564 switch.
2565 * target.h (class Target): Add plt_section_for_global and
2566 plt_section_for_local functions. Add do_plt_section_for_global
2567 and do_plt_section_for_local virtual functions.
2568 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2569 clarifying comments.
2570 (Symbol::use_plt_offset): Handle IFUNC symbol.
2571 * object.cc (Sized_relobj::Sized_relobj): Initialize
2572 local_plt_offsets_.
2573 (Sized_relobj::local_has_plt_offset): New function.
2574 (Sized_relobj::local_plt_offset): New function.
2575 (Sized_relobj::set_local_plt_offset): New function.
2576 (Sized_relobj::do_count): Handle IFUNC symbol.
2577 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2578 a bit away from input_shndx_ field. Add set_is_func_symbol and
2579 is_ifunc_symbol functions.
2580 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2581 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2582 local_plt_offsets_ field.
2583 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2584 * output.h (class Output_section_data): Add non-const
2585 output_section function.
2586 (class Output_data_got): Update declarations.
2587 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2588 Add use_plt_offset parameter to global and local constructors.
2589 Change all callers. Change local_sym_index_ field to 31 bits.
2590 Change GSYM_CODE and CONSTANT_CODE accordingly.
2591 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2592 doing a static link don't set sh_link field.
2593 (Output_data_got::Got_entry::write): Use PLT offset if
2594 appropriate.
2595 (Output_data_got::add_global_plt): New function.
2596 (Output_data_got::add_local_plt): New function.
2597 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2598 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2599 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2600 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
2601 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
2602 IFUNC conditional.
2603 * testsuite/ifunc-sel.h: New file.
2604 * testsuite/ifuncmain1.c: New file.
2605 * testsuite/ifuncmain1vis.c: New file.
2606 * testsuite/ifuncmod1.c: New file.
2607 * testsuite/ifuncdep2.c: New file.
2608 * testsuite/ifuncmain2.c: New file.
2609 * testsuite/ifuncmain3.c: New file.
2610 * testsuite/ifuncmod3.c: New file.
2611 * testsuite/ifuncmain4.c: New file.
2612 * testsuite/ifuncmain5.c: New file.
2613 * testsuite/ifuncmod5.c: New file.
2614 * testsuite/ifuncmain6pie.c: New file.
2615 * testsuite/ifuncmod6.c: New file.
2616 * testsuite/ifuncmain7.c: New file.
2617 * configure, testsuite/Makefile.in: Rebuild.
2618
56f75c03
ILT
26192010-08-18 Ian Lance Taylor <iant@google.com>
2620
2621 * incremental.cc
2622 (Output_section_incremental_inputs::write_input_files): Add cast
2623 to avoid signed/unsigned comparison warning.
2624 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2625
55455f89
CC
26262010-08-12 Cary Coutant <ccoutant@google.com>
2627
2628 * common.cc (Sort_commons::operator()): Remove unnecessary code.
2629
e2054bcb
ILT
26302010-08-13 Ian Lance Taylor <iant@google.com>
2631
2632 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2633
74f67560
DK
26342010-08-12 Cary Coutant <ccoutant@google.com>
2635 Doug Kwan <dougkwan@google.com>
2636
2637 * resolve.cc (Symbol_table::should_override): When a weak dynamic
2638 defintion overrides non-weak undef, remember that the original undef
2639 is not weak.
2640 * symtab.cc (Symbol_table::sized_write_global): For undef without
2641 an original weak binding, set binding to global in output.
2642 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
2643 * testsuite/Makefile.in: Regenerate.
2644 * testsuite/strong_ref_weak_def.sh: New file.
2645 * testsuite/strong_ref_weak_def_1.c: Ditto.
2646 * testsuite/strong_ref_weak_def_2.c: Ditto.
2647
d1238d12
CC
26482010-08-12 Cary Coutant <ccoutant@google.com>
2649
2650 * testsuite/incremental_test.sh: Rewrite.
2651 * testsuite/incremental_test_1.c: Rewrite.
2652 * testsuite/incremental_test_2.c: Rewrite.
2653
0e70b911
CC
26542010-08-12 Cary Coutant <ccoutant@google.com>
2655
2656 * arm.cc (Target_arm::got_size): Add const.
2657 (Target_arm::got_entry_count): New function.
2658 (Target_arm::plt_entry_count): New function.
2659 (Target_arm::first_plt_entry_offset): New function.
2660 (Target_arm::plt_entry_size): New function.
2661 (Output_data_plt_arm::entry_count): New function.
2662 (Output_data_plt_arm::first_plt_entry_offset): New function.
2663 (Output_data_plt_arm::get_plt_entry_size): New function.
2664 * i386.cc (Target_i386::got_size): Add const.
2665 (Target_i386::got_entry_count): New function.
2666 (Target_i386::plt_entry_count): New function.
2667 (Target_i386::first_plt_entry_offset): New function.
2668 (Target_i386::plt_entry_size): New function.
2669 (Output_data_plt_i386::entry_count): New function.
2670 (Output_data_plt_i386::first_plt_entry_offset): New function.
2671 (Output_data_plt_i386::get_plt_entry_size): New function.
2672 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
2673 find_incremental_inputs_sections. Dump incremental_got_plt section.
2674 * incremental.cc: Include target.h.
2675 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
2676 parameter. Adjust all callers. Find incremental_got_plt section.
2677 (Incremental_inputs::create_data_sections): Create incremental_got_plt
2678 section.
2679 (Output_section_incremental_inputs::set_final_data_size): Calculate
2680 size of incremental_got_plt section.
2681 (Output_section_incremental_inputs::do_write): Write the
2682 incremental_got_plt section.
2683 (Got_plt_view_info): New struct.
2684 (Local_got_offset_visitor): New class.
2685 (Global_got_offset_visitor): New class.
2686 (Global_symbol_visitor_got_plt): New class.
2687 (Output_section_incremental_inputs::write_got_plt): New function.
2688 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
2689 Add parameter. Adjust all callers.
2690 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2691 (Incremental_inputs::got_plt_section): New function.
2692 (Incremental_inputs::got_plt_section_): New data member.
2693 (Incremental_got_plt_reader): New class.
2694 * layout.cc (Layout::create_incremental_info_sections): Add the
2695 incremental_got_plt section.
2696 * object.h (Got_offset_list::get_list): New function.
2697 (Got offset_list::for_all_got_offsets): New function.
2698 (Sized_relobj::local_got_offset_list): New function.
2699 * powerpc.cc (Target_powerpc::got_size): Add const.
2700 (Target_powerpc::got_entry_count): New function.
2701 (Target_powerpc::plt_entry_count): New function.
2702 (Target_powerpc::first_plt_entry_offset): New function.
2703 (Target_powerpc::plt_entry_size): New function.
2704 (Output_data_plt_powerpc::entry_count): New function.
2705 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
2706 (Output_data_plt_powerpc::get_plt_entry_size): New function.
2707 * sparc.cc (Target_sparc::got_size): Add const.
2708 (Target_sparc::got_entry_count): New function.
2709 (Target_sparc::plt_entry_count): New function.
2710 (Target_sparc::first_plt_entry_offset): New function.
2711 (Target_sparc::plt_entry_size): New function.
2712 (Output_data_plt_sparc::entry_count): New function.
2713 (Output_data_plt_sparc::first_plt_entry_offset): New function.
2714 (Output_data_plt_sparc::get_plt_entry_size): New function.
2715 * symtab.h (Symbol::got_offset_list): New function.
2716 (Symbol_table::for_all_symbols): New function.
2717 * target.h (Sized_target::got_entry_count): New function.
2718 (Sized_target::plt_entry_count): New function.
2719 (Sized_target::plt_entry_size): New function.
2720 * x86_64.cc (Target_x86_64::got_size): Add const.
2721 (Target_x86_64::got_entry_count): New function.
2722 (Target_x86_64::plt_entry_count): New function.
2723 (Target_x86_64::first_plt_entry_offset): New function.
2724 (Target_x86_64::plt_entry_size): New function.
2725 (Output_data_plt_x86_64::entry_count): New function.
2726 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
2727 (Output_data_plt_x86_64::get_plt_entry_size): New function.
2728
09ec0418
CC
27292010-08-12 Cary Coutant <ccoutant@google.com>
2730
2731 * archive.cc: Include incremental.h.
2732 (Archive::Archive): Initialize incremental_info_.
2733 (Archive::include_member): Record archive members in incremental info.
2734 (Add_archive_symbols::run): Record begin and end of an archive in
2735 incremental info.
2736 (Lib_group::include_member): Record objects in incremental info.
2737 * archive.h (Incremental_archive_entry): Forward declaration.
2738 (Archive::set_incremental_info): New member function.
2739 (Archive::incremental_info): New member function.
2740 (Archive::Unused_symbol_iterator): New class.
2741 (Archive::unused_symbols_begin): New member function.
2742 (Archive::unused_symbols_end): New member function.
2743 (Archive::incremental_info_): New data member.
2744 * incremental-dump.cc (find_input_containing_global): New function.
2745 (dump_incremental_inputs): Dump new incremental info sections.
2746 * incremental.cc: Include symtab.h.
2747 (Output_section_incremental_inputs): New class.
2748 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
2749 new incremental info sections.
2750 (Sized_incremental_binary::do_check_inputs): Likewise.
2751 (Incremental_inputs::report_archive): Remove.
2752 (Incremental_inputs::report_archive_begin): New function.
2753 (Incremental_inputs::report_archive_end): New function.
2754 (Incremental_inputs::report_object): New function.
2755 (Incremental_inputs::finalize_inputs): Remove.
2756 (Incremental_inputs::report_input_section): New function.
2757 (Incremental_inputs::report_script): Rewrite.
2758 (Incremental_inputs::finalize): Do nothing but finalize string table.
2759 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2760 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2761 (Incremental_inputs::create_data_sections): New function.
2762 (Incremental_inputs::relocs_entsize): New function.
2763 (Output_section_incremental_inputs::set_final_data_size): New function.
2764 (Output_section_incremental_inputs::do_write): New function.
2765 (Output_section_incremental_inputs::write_header): New function.
2766 (Output_section_incremental_inputs::write_input_files): New function.
2767 (Output_section_incremental_inputs::write_info_blocks): New function.
2768 (Output_section_incremental_inputs::write_symtab): New function.
2769 * incremental.h (Incremental_script_entry): Forward declaration.
2770 (Incremental_object_entry): Forward declaration.
2771 (Incremental_archive_entry): Forward declaration.
2772 (Incremental_inputs): Forward declaration.
2773 (Incremental_inputs_header_data): Remove.
2774 (Incremental_inputs_header): Remove.
2775 (Incremental_inputs_header_write): Remove.
2776 (Incremental_inputs_entry_data): Remove.
2777 (Incremental_inputs_entry): Remove.
2778 (Incremental_inputs_entry_write): Remove.
2779 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
2780 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
2781 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2782 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
2783 Likewise.
2784 (Incremental_input_entry): New class.
2785 (Incremental_script_entry): New class.
2786 (Incremental_object_entry): New class.
2787 (Incremental_archive_entry): New class.
2788 (Incremental_inputs::Incremental_inputs): Initialize new data members.
2789 (Incremental_inputs::report_inputs): Remove.
2790 (Incremental_inputs::report_archive): Remove.
2791 (Incremental_inputs::report_archive_begin): New function.
2792 (Incremental_inputs::report_archive_end): New function.
2793 (Incremental_inputs::report_object): Change prototype.
2794 (Incremental_inputs::report_input_section): New function.
2795 (Incremental_inputs::report_script): Change prototype.
2796 (Incremental_inputs::get_reloc_count): New function.
2797 (Incremental_inputs::set_reloc_count): New function.
2798 (Incremental_inputs::create_data_sections): New function.
2799 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2800 (Incremental_inputs::inputs_section): New function.
2801 (Incremental_inputs::symtab_section): New function.
2802 (Incremental_inputs::relocs_section): New function.
2803 (Incremental_inputs::get_stringpool): Add const.
2804 (Incremental_inputs::command_line): Add const.
2805 (Incremental_inputs::inputs): Remove.
2806 (Incremental_inputs::command_line_key): New function.
2807 (Incremental_inputs::input_file_count): New function.
2808 (Incremental_inputs::input_files): New function.
2809 (Incremental_inputs::relocs_entsize): New function.
2810 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2811 (Incremental_inputs::finalize_inputs): Remove.
2812 (Incremental_inputs::Input_info): Remove.
2813 (Incremental_inputs::lock_): Remove.
2814 (Incremental_inputs::inputs_): Change type.
2815 (Incremental_inputs::inputs_map_): Remove.
2816 (Incremental_inputs::current_object_entry_): New data member.
2817 (Incremental_inputs::inputs_section_): New data member.
2818 (Incremental_inputs::symtab_section_): New data member.
2819 (Incremental_inputs::relocs_section_): New data member.
2820 (Incremental_inputs::reloc_count_): New data member.
2821 (Incremental_inputs_reader): New class.
2822 (Incremental_symtab_reader): New class.
2823 (Incremental_relocs_reader): New class.
2824 * layout.cc (Layout::finalize): Move finalization of incremental info
2825 and creation of incremental info sections to follow finalization of
2826 symbol table. Set offsets for postprocessing sections.
2827 (Layout::create_incremental_info_sections): Call
2828 Incremental_inputs::create_data_sections. Add incremental symtab
2829 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
2830 sections to layout after input sections.
2831 * layout.h (struct Timespec): Forward declaration.
2832 (Layout::incremental_inputs): Add const.
2833 (Layout::create_incremental_info_sections): Add parameter.
2834 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
2835 * object.cc: Include incremental.h.
2836 (Relobj::finalize_incremental_relocs): New function.
2837 (Sized_relobj::do_layout): Record input sections in incremental info.
2838 * object.h (Object::output_section): New function.
2839 (Object::output_section_offset): Moved from Relobj.
2840 (Object::get_incremental_reloc_base): New function.
2841 (Object::get_incremental_reloc_count): New function.
2842 (Object::do_output_section): New function.
2843 (Object::do_output_section_offset): Moved from Relobj.
2844 (Object::do_get_incremental_reloc_base): New function.
2845 (Object::do_get_incremental_reloc_count): New function.
2846 (Object::Object): Initialize new data members.
2847 (Relobj::output_section): Renamed do_output_section and moved to
2848 protected.
2849 (Relobj::output_section_offset): Moved to Object.
2850 (Relobj::do_get_incremental_reloc_base): New function.
2851 (Relobj::do_get_incremental_reloc_count): New function.
2852 (Relobj::allocate_incremental_reloc_counts): New function.
2853 (Relobj::count_incremental_reloc): New function.
2854 (Relobj::finalize_incremental_relocs): New function.
2855 (Relobj::next_incremental_reloc_index): New function.
2856 (Relobj::reloc_counts_): New data member.
2857 (Relobj::reloc_bases_): New data member.
2858 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2859 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2860 (Sized_relobj::incremental_relocs_scan): New function.
2861 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2862 (Sized_relobj::incremental_relocs_write): New function.
2863 (Sized_relobj::incremental_relocs_write_reltype): New function.
2864 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2865 incremental link.
2866 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2867 archives and object files elsewhere.
2868 (Add_symbols::run): Report object files here.
2869 (Finish_group::run): Report end of archive at end of group.
2870 * reloc.cc: Include layout.h, incremental.h.
2871 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2872 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2873 (Sized_relobj::incremental_relocs_scan): New function.
2874 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2875 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2876 (Sized_relobj::incremental_relocs_write): New function.
2877 (Sized_relobj::incremental_relocs_write_reltype): New function.
2878 * script.cc (read_input_script): Rewrite test for incremental link.
2879 Change call to Incremental_inputs::report_script.
2880 * symtab.h (Symbol_table::first_global_index): New function.
2881 (Symbol_table::output_count): New function.
2882
ce0d1972
DK
28832010-08-12 Doug Kwan <dougkwan@google.com>
2884
2885 * arm.cc (Target_arm::merge_object_attributes): Check command line
2886 options --no-wchar-size-warning and --no-enum-size-warning.
2887 * options.h (General_options): Add ld-compatible options
2888 --no-enum-size-warning and --no-wchar-size-warning.
2889
6e5710ce
ILT
28902010-08-04 Ian Lance Taylor <iant@google.com>
2891
2892 * x86_64.cc (Target_x86_64::Scan::local): Use
2893 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2894 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2895 (Target_x86_64::Scan::global): Likewise.
2896 (Target_x86_64::Relocate::relocate): Likewise.
2897 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2898 Likewise.
2899
fef830db
CC
29002010-08-03 Cary Coutant <ccoutant@google.com>
2901
2902 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2903 to reserve space in merged_strings vector. Keep total input size
2904 for stats.
2905 (Output_merge_string::do_print_merge_stats): Print total input size.
2906 * merge.h (Output_merge_string): Add input_size_ field.
2907 * stringpool.cc (Stringpool_template::string_length): Move
2908 implementations out of Stringpool_template class and place in
2909 stringpool.h.
2910 * stringpool.h (string_length): Move out of Stringpool_template.
2911
1e3811b0
ILT
29122010-08-03 Ian Lance Taylor <iant@google.com>
2913
2914 PR 11712
2915 * layout.cc (relaxation_loop_body): If address of load segment is
2916 set, adjust address to include headers if possible.
2917
7af0c620
ILT
29182010-08-03 Ian Lance Taylor <iant@google.com>
2919
2920 * version.cc (version_string): Bump to 1.10.
2921
22f0da72
ILT
29222010-08-03 Ian Lance Taylor <iant@google.com>
2923
2924 PR 11805
2925 * layout.h (enum Output_section_order): Define.
2926 (class Layout): Update declarations.
2927 * layout.cc (Layout::get_output_section): Add order parameter.
2928 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2929 is_first_non_relro parameters. Change all callers.
2930 (Layout::choose_output_section): Likewise.
2931 (Layout::add_output_section_data): Likewise.
2932 (Layout::make_output_section): Likewise. Set order.
2933 (Layout::default_section_order): New function.
2934 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2935 * output.cc (Output_section::Output_section): Initialize order_.
2936 Don't initialize deleted fields.
2937 (Output_segment::Output_segment): Don't initialize deleted
2938 fields.
2939 (Output_segment::add_output_section_to_load): New function
2940 replacing add_output_section. Change all callers to call this or
2941 add_output_section_to_nonload.
2942 (Output_segment::add_output_section_to_nonload): New function.
2943 (Output_segment::remove_output_section): Rewrite.
2944 (Output_segment::add_initial_output_data): Likewise.
2945 (Output_segment::has_any_data_sections): Likewise.
2946 (Output_segment::is_first_section_relro): Likewise.
2947 (Output_segment::maximum_alignment): Likewise.
2948 (Output_segment::has_dynamic_reloc): New function replacing
2949 dynamic_reloc_count. Change all callers.
2950 (Output_segment::has_dynamic_reloc_list): New function replacing
2951 dynamic_reloc_count_list. Change all callers.
2952 (Output_segment::set_section_addresses): Rewrite.
2953 (Output_segment::set_offset): Rewrite.
2954 (Output_segment::find_first_and_last_list): Remove.
2955 (Output_segment::set_tls_offsets): Rewrite.
2956 (Output_segment::first_section_load_address): Likewise.
2957 (Output_segment::output_section_count): Likewise.
2958 (Output_segment::section_with_lowest_load_address): Likewise.
2959 (Output_segment::write_section_headers): Likewise.
2960 (Output_segment::print_sections_to_map): Likewise.
2961 * output.h (class Output_data): Remove dynamic_reloc_count_
2962 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2963 (Output_data::add_dynamic_reloc): Rewrite.
2964 (Output_data::has_dynamic_reloc): New function.
2965 (Output_data::dynamic_reloc_count): Remove.
2966 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2967 is_last_relro_, is_first_non_relro_, is_interp_,
2968 is_dynamic_linker_section_ fields. Add order and set_order
2969 functions. Remove is_relro_local, set_is_relro_local,
2970 is_last_relro, set_is_last_relro, is_first_non_relro,
2971 set_is_first_non_relro functions, is_interp, set_is_interp,
2972 is_dynamic_linker_section, and set_is_dynamic_linker_section
2973 functions.
2974 (class Output_segment): Change Output_data_list from std::list to
2975 std:;vector. Add output_lists_ field. Remove output_data_ and
2976 output_bss_ fields. Update declarations.
2977
3ff2ccb0
ILT
29782010-08-02 Ian Lance Taylor <iant@google.com>
2979
2980 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2981 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2982 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2983
88a4108b
ILT
29842010-08-02 Ian Lance Taylor <iant@google.com>
2985
2986 PR 11855
2987 * script.cc (Script_options::Script_options): Initialize
2988 symbol_definitions_ and symbol_references_.
2989 (Script_options::add_symbol_assignment): Update
2990 symbol_definitions_ and symbol_references_.
2991 (Script_options::add_symbol_reference): New function.
2992 (script_symbol): New function.
2993 * script.h (class Script_options): Add symbol_definitions_ and
2994 symbol_references_ fields.
2995 (Script_options::referenced_const_iterator): New type.
2996 (Script_options::referenced_begin): New function.
2997 (Script_options::referenced_end): New function.
2998 (Script_options::is_referenced): New function.
2999 (Script_options::any_unreferenced): New function.
3000 * script-c.h (script_symbol): Declare.
3001 * yyscript.y (exp): Call script_symbol.
3002 * symtab.cc: Include "script.h".
3003 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3004 Change all callers. Check symbols referenced by scripts.
3005 (Symbol_table::add_undefined_symbols_from_command_line): Add
3006 layout parameter. Change all callers.
3007 (Symbol_table::do_add_undefined_symbols_from_command_line):
3008 Likewise. Break out loop body. Check symbols referenced by
3009 scripts.
3010 (Symbol_table::add_undefined_symbol_from_command_line): New
3011 function broken out of
3012 do_add_undefined_symbols_from_command_line.
3013 * symtab.h (class Symbol_table): Update declarations.
3014 * archive.cc: Include "layout.h".
3015 (Archive::should_include_member): Add layout parameter. Change
3016 all callers. Check for symbol mentioned in expression.
3017 * archive.h (class Archive): Update declaration.
3018 * object.cc (Sized_relobj::do_should_include_member): Add layout
3019 parameter.
3020 * object.h (Object::should_include_member): Add layout parameter.
3021 Change all callers.
3022 (Object::do_should_include_member): Add layout parameter.
3023 (class Sized_relobj): Update declaration.
3024 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3025 parameter.
3026 * dynobj.h (class Sized_dynobj): Update declaration.
3027 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3028 layout parameter.
3029 * plugin.h (class Sized_pluginobj): Update declaration.
3030
5f1ab67a
ILT
30312010-08-02 Ian Lance Taylor <iant@google.com>
3032
3033 PR 11866
3034 * output.cc (Output_segment::set_offset): Search for the first and
3035 last sections rather than assuming that the list is in order.
3036 (Output_segment::find_first_and_last_list): New function.
3037 * output.h (class Output_segment): Update declarations.
3038 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3039 (relro_strip_test_SOURCES): New variable.
3040 (relro_strip_test_DEPENDENCIES): New variable.
3041 (relro_strip_test_LDFLAGS): New variable.
3042 (relro_strip_test_LDADD): New variable.
3043 (relro_strip_test.so): New target.
3044
a8df5856
ILT
30452010-08-02 Ian Lance Taylor <iant@google.com>
3046
3047 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3048 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3049 (Target_i386::got_tlsdesc_section): New function.
3050 (Target_i386::got_section): Create space for GOT entries for
3051 TLSDESC relocations.
3052 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3053 R_386_TLS_GOTDESC.
3054 (Target_i386::Scan::global): Likewise.
3055 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3056 using TLSDESC GOT.
3057 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3058 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3059 (Target_x86_64::got_tlsdesc_section): New function.
3060 (Target_x86_64::got_section): Create space for GOT entries for
3061 TLSDESC relocations.
3062 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3063 R_386_TLS_GOTDESC.
3064 (Target_x86_64::Scan::global): Likewise.
3065 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3066 using TLSDESC GOT.
3067
0c10a0a6
ILT
30682010-08-02 Ian Lance Taylor <iant@google.com>
3069
3070 * testsuite/final_layout.sh: Use dc to convert from hex to
3071 decimal.
3072
41cbeecc
ST
30732010-07-29 Sriraman Tallam <tmsriram@google.com>
3074
3075 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3076 paramter to the call to gold::gc_process_relocs.
3077 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3078 paramter to the call to gold::gc_process_relocs.
3079 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3080 parameter to the call to gold::gc_process_relocs.
3081 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3082 template parameter to the call to gold::gc_process_relocs.
3083 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3084 paramter to the call to gold::gc_process_relocs.
3085 * gc.h (get_embedded_addend_size): New function.
3086 (gc_process_relocs): Save the size of the reloc for use by ICF.
3087 * icf.cc (get_section_contents): Get the addend from the text section
3088 for SHT_REL relocation sections.
3089 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3090 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3091 * int_encoding.h (read_from_pointer): New overloaded function.
3092 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3093 * testsuite/icf_sht_rel_addend_test.sh: New file.
3094 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3095 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3096
6ea55b82
RW
30972010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3098
3099 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3100 * Makefile.in: Regenerate.
3101 * testsuite/Makefile.in: Regenerate.
3102
9691462b
ILT
31032010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3104
3105 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3106 * gold/testsuite/debug_msg.cc: Likewise.
3107 * gold/testsuite/odr_violation1.cc
3108 * gold/testsuite/odr_violation2.cc
3109
76897331
CC
31102010-07-21 Cary Coutant <ccoutant@google.com>
3111
3112 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3113 string, and length fields.
3114 (Output_merge_string::Merged_strings_list): New type.
3115 (Output_merge_string::Merged_strings_lists): New typedef.
3116 (Output_merge_string): Replace merged_strings_ with
3117 merged_strings_lists_.
3118 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3119 Merged_strings_list per input object and section. Don't store pointer
3120 to the string. Don't store length with each merged string entry.
3121 (Output_merge_string::finalize_merged_data): Loop over list of merged
3122 strings lists. Recompute length of each merged string.
3123
78384e8f
CC
31242010-07-15 Cary Coutant <ccoutant@google.com>
3125
3126 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3127 here.
3128
783659f9
ILT
31292010-07-14 Ian Lance Taylor <iant@google.com>
3130
3131 * descriptors.cc (Descriptors::open): Report correct name in error
3132 message.
3133
131687b4
DK
31342010-07-13 Doug Kwan <dougkwan@google.com>
3135
3136 * arm.cc (Arm_input_section::Arm_input_section): For a
3137 SHT_ARM_EXIDX section, always keeps the input sections.
3138 (Arm_input_section::set_exidx_section_link): New method.
3139 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3140 has_errors_ to false.
3141 (Arm_exidx_input_section::has_errors,
3142 Arm_exidx_input_section::set_has_errors): New methods.
3143 (Arm_exidx_input_section::has_errors_): New data member.
3144 (Arm_relobj::get_exidx_shndx_list): New method.
3145 (Arm_output_section::append_text_sections_to_list): Do not skip
3146 section without SHF_EXECINSTR.
3147 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3148 errors.
3149 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3150 section header. Make error messages more verbose. Check for
3151 a non-executable section linked to an EXIDX section.
3152 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3153 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3154 check that there is no deferred EXIDX section if we exit early.
3155 Instead of not making an EXIDX section in case of an error, make one
3156 and set the has_errors flag of it.
3157 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3158 in a relocatable link.
3159 (Target_arm::do_relax): Look for the EXIDX output section instead of
3160 assuming that it is called .ARM.exidx.
3161 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3162 section list. Do not check for SHF_EXECINSTR section flags but
3163 skip any input section with errors.
3164 * output.cc (Output_section::Output_section): Initialize
3165 always_keeps_input_sections_ to false.
3166 (Output_section::add_input_section): Check for
3167 always_keeps_input_sections_.
3168 * output.h (Output_section::always_keeps_input_sections,
3169 Output_section::set_always_keeps_input_sections): New methods.
3170 (Output_section::always_keeps_input_sections): New data member.
3171
69517287
RÁE
31722010-07-13 Rafael Espindola <espindola@google.com>
3173
3174 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3175 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3176
82742395
ILT
31772010-07-13 Philip Herron <herron.philip@googlemail.com>
3178 Ian Lance Taylor <iant@google.com>
3179
3180 * output.h (Output_section_lookup_maps::add_merge_section):
3181 Correct check of whether value was inserted.
3182 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3183 (Output_section_lookup_maps::add_relaxed_input_section):
3184 Likewise.
3185 * arm.cc (Target_arm::got_section): Remove used local os.
3186 * i386.cc (Target_i386::got_section): Likewise.
3187 * x86_64.cc (Target_x86_64::got_section): Likewise.
3188 * sparc.cc (Target_sparc::got_section): Likewise.
3189 (Target_sparc::relocate): Remove unused local have_got_offset.
3190 * powerpc.cc (Target_powerpc::relocate): Likewise.
3191
f2d707b5
ILT
31922010-07-13 Ian Lance Taylor <iant@google.com>
3193
241531d6
ILT
3194 * compressed_output.cc (zlib_decompress): Fix signature in
3195 !HAVE_ZLIB_H case.
3196
f2d707b5
ILT
3197 * archive.cc (Archive::include_member): Unlock an external member
3198 of a thin archive. Don't bother to delete an object we know is
3199 NULL.
3200
a2e47362
CC
32012010-07-12 Cary Coutant <ccoutant@google.com>
3202
3203 * compressed_output.cc (zlib_decompress): New function.
3204 (get_uncompressed_size): New function.
3205 (decompress_input_section): New function.
3206 * compressed_output.h (get_uncompressed_size): New function.
3207 (decompress_input_section): New function.
3208 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3209 Handle compressed debug sections.
3210 * layout.cc (is_compressed_debug_section): New function.
3211 (Layout::output_section_name): Map compressed section names to
3212 canonical names.
3213 * layout.h (is_compressed_debug_section): New function.
3214 (is_debug_info_section): Recognize compressed debug sections.
3215 * merge.cc: Include compressed_output.h.
3216 (Output_merge_data::do_add_input_section): Handle compressed
3217 debug sections.
3218 (Output_merge_string::do_add_input_section): Handle compressed
3219 debug sections.
3220 * object.cc: Include compressed_output.h.
3221 (Sized_relobj::Sized_relobj): Initialize new data members.
3222 (build_compressed_section_map): New function.
3223 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3224 * object.h (Object::section_is_compressed): New method.
3225 (Object::do_section_is_compressed): New method.
3226 (Sized_relobj::Compressed_section_map): New type.
3227 (Sized_relobj::do_section_is_compressed): New method.
3228 (Sized_relobj::compressed_sections_): New data member.
3229 * output.cc (Output_section::add_input_section): Handle compressed
3230 debug sections.
3231 * reloc.cc: Include compressed_output.h.
3232 (Sized_relobj::write_sections): Handle compressed debug sections.
3233
ce279a62
CC
32342010-07-08 Cary Coutant <ccoutant@google.com>
3235
3236 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3237 weak when resolving to a dynamic def.
3238 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3239 for weak undef/dynamic def cases. Adjust callers.
3240 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3241 undef_binding_weak_.
3242 (Symbol_table::sized_write_globals): Adjust symbol binding.
3243 (Symbol_table::sized_write_symbol): Add binding parameter.
3244 * symtab.h (Symbol::set_undef_binding): New method.
3245 (Symbol::is_undef_binding_weak): New method.
3246 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3247 (Symbol_table::should_override): Add new parameter.
3248 (Symbol_table::sized_write_symbol): Add new parameter.
3249
3250 * testsuite/weak_undef_file1.cc: Add new test case.
3251 * testsuite/weak_undef_file2.cc: Fix header comment.
3252 * testsuite/weak_undef_test.cc: Add new test case.
3253
b2286c10
DK
32542010-06-29 Doug Kwan <dougkwan@google.com>
3255
3256 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3257 Initialize USE_SYMBOL_.
3258 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3259 definition.
3260 (Arm_reloc_property::uses_symbol_): New data member declaration.
3261 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3262 uses symbol value and symbol is undefined but not weakly undefined.
3263
4802450a
RÁE
32642010-06-28 Rafael Espindola <espindola@google.com>
3265
3266 * plugin.cc (Plugin::load): Use dlerror.
3267
e5ca47ba
ILT
32682010-06-26 Jeffrey Yaskin <jyasskin@google.com>
3269
3270 * symtab.cc (detect_odr_violations): When reporting an ODR
3271 violation, report an object where the symbol is defined.
3272
8a75a161
DK
32732010-06-25 Doug Kwan <dougkwan@google.com>
3274
3275 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
3276 (Target_arm::section_may_have_icf_unsafe_pointers): New method
3277 definition.
3278 (Target_arm::Scan::local_reloc_may_be_function_pointer,
3279 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
3280 target hook to detect function points.
3281 (Target_arm::Scan::possible_function_pointer_reloc): New method.
3282 * icf.h (Icf::check_section_for_function_pointers): Change type of
3283 parameter SECTION_NAME to const reference to std::string. Use
3284 target hook to determine if section may have unsafe pointers.
3285 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3286 method definition.
3287
42218b9f
RÁE
32882010-06-21 Rafael Espindola <espindola@google.com>
3289
3290 * fileread.cc (Input_file::find_fie): New
3291 (Input_file::open): Use Input_file::find_fie.
3292 * fileread.h (Input_file::find_fie): New
3293 * plugin.cc (set_extra_library_path): New.
3294 (Plugin::load): Add set_extra_library_path to the transfer vector.
3295 (Plugin_manager::set_extra_library_path): New.
3296 (Plugin_manager::add_input_file): Use the extra search path if set.
3297 (set_extra_library_path(): New.
3298 * plugin.h (Plugin_manager): Add set_extra_library_path and
3299 extra_search_path_.
3300
a0506cca
CC
33012010-06-19 Cary Coutant <ccoutant@google.com>
3302
3303 * layout.cc (gdb_sections): Add .debug_types.
3304 (lines_only_debug_sections): Likewise.
3305
6508b958
RÁE
33062010-06-18 Rafael Espindola <espindola@google.com>
3307
3308 * plugin.cc (add_input_file,add_input_library)
3309 (Plugin_manager::add_input_file): Make filename arguments const.
3310 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
3311 const.
3312
3e235302
DK
33132010-06-16 Doug Kwan <dougkwan@google.com>
3314
3315 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
3316 .ARM.attributes section if we have not merged any input
3317 attributes sections.
3318
106e8a6c
DK
33192010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3320
3321 * arm.cc: Allow combining objects with no EABI version
3322 information.
3323
91ff43fe
RÁE
33242010-06-15 Rafael Espindola <espindola@google.com>
3325
3326 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
3327
68ed838c
ILT
33282010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3329
3330 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
3331 (struct iovec): Correct !HAVE_READV definition.
3332
f3a2388f
CC
33332010-06-10 Cary Coutant <ccoutant@google.com>
3334
3335 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
3336 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
3337 reloc sections.
3338 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
3339
3340 PR 11683
3341 * symtab.h (Symbol::is_placeholder): New member function.
3342 * target-reloc.h (relocate_section): Check for placeholder symbols.
3343
3344 * testsuite/Makefile.am (plugin_test_8): New test.
3345 (plugin_test_9): New test.
3346 * testsuite/Makefile.in: Regenerate.
3347
e1df38aa
NC
33482010-06-09 Nick Clifton <nickc@redhat.com>
3349
3350 * yyscript.y (input_list_element): Allow strings prefixed with
3351 the '-' character. Treat these as libraries.
3352 * script.cc (script_add_library): New function. Adds a library
3353 specified by "-l<name>" found in an input script.
3354 * script-c.h: Add prototype for script_add_library.
3355
25bbe950
DK
33562010-06-07 Doug Kwan <dougkwan@google.com>
3357
3358 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
3359 Restrict stub-group size to be within long conditional branch
3360 range when working around cortex-A8 erratum.
3361
0f32ea4c
ILT
33622010-06-07 Damien Diederen <dd@crosstwine.com>
3363
3364 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
3365 #ifdef typo.
3366
8fe2a369
ST
33672010-06-03 Sriraman Tallam <tmsriram@google.com>
3368
3369 PR gold/11658
3370 * output.cc
3371 (Output_section::Input_section_sort_entry::compare_section_ordering):
3372 Change to return non-zero correctly.
3373 (Output_section::Input_section_sort_section_order_index_compare
3374 ::operator()): Change to fix ambiguity in comparisons.
3375
6e9ba2ca
ST
33762010-06-01 Sriraman Tallam <tmsriram@google.com>
3377
3378 * gold.h (is_wildcard_string): New function.
3379 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
3380 (Layout::layout_eh_frame): Ditto.
3381 (Layout::find_section_order_index): New method.
3382 (Layout::read_layout_from_file): New method.
3383 * layout.h (Layout::find_section_order_index): New method.
3384 (Layout::read_layout_from_file): New method.
3385 (Layout::input_section_position_): New private member.
3386 (Layout::input_section_glob_): New private member.
3387 * main.cc (main): Call read_layout_from_file here.
3388 * options.h (--section-ordering-file): New option.
3389 * output.cc (Output_section::input_section_order_specified_): New
3390 member.
3391 (Output_section::Output_section): Initialize new member.
3392 (Output_section::add_input_section): Add new parameter.
3393 Keep input sections when --section-ordering-file is used.
3394 (Output_section::set_final_data_size): Sort input sections when
3395 section ordering file is specified.
3396 (Output_section::Input_section_sort_entry): Add new parameter.
3397 Check sorting type.
3398 (Output_section::Input_section_sort_entry::compare_section_ordering):
3399 New method.
3400 (Output_section::Input_section_sort_compare::operator()): Change to
3401 consider section_order_index.
3402 (Output_section::Input_section_sort_init_fini_compare::operator()):
3403 Change to consider section_order_index.
3404 (Output_section::Input_section_sort_section_order_index_compare
3405 ::operator()): New method.
3406 (Output_section::sort_attached_input_sections): Change to sort
3407 according to section order when specified.
e1df38aa
NC
3408 (Output_section::add_input_section<32, true>): Add new parameter.
3409 (Output_section::add_input_section<64, true>): Add new parameter.
3410 (Output_section::add_input_section<32, false>): Add new parameter.
3411 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
3412 * output.h (Output_section::add_input_section): Add new parameter.
3413 (Output_section::input_section_order_specified): New
3414 method.
3415 (Output_section::set_input_section_order_specified): New method.
3416 (Input_section::Input_section): Initialize section_order_index_.
3417 (Input_section::section_order_index): New method.
3418 (Input_section::set_section_order_index): New method.
3419 (Input_section::section_order_index_): New member.
3420 (Input_section::Input_section_sort_section_order_index_compare): New
3421 struct.
3422 (Output_section::input_section_order_specified_): New member.
3423 * script-sections.cc (is_wildcard_string): Delete and move modified
3424 method to gold.h.
3425 (Output_section_element_input::Output_section_element_input): Modify
3426 call to is_wildcard_string.
3427 (Output_section_element_input::Input_section_pattern
3428 ::Input_section_pattern): Ditto.
3429 (Output_section_element_input::Output_section_element_input): Ditto.
3430 * testsuite/Makefile.am (final_layout): New test case.
3431 * testsuite/Makefile.in: Regenerate.
3432 * testsuite/final_layout.cc: New file.
3433 * testsuite/final_layout.sh: New file.
3434
3537c84b
RÁE
34352010-06-01 Rafael Espindola <espindola@google.com>
3436
3437 * plugin.cc (Plugin::load): Pass the output name to the plugin.
3438
105b6afd
RÁE
34392010-06-01 Rafael Espindola <espindola@google.com>
3440
3441 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
3442 visibility of symbols.
3443
29e11421
DK
34442010-05-27 Doug Kwan <dougkwan@google.com>
3445
3446 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
3447 from start of output section instead of address for a local symbol
3448 in a merged or relaxed section when doing a relocatable link.
3449
5e0f337e
RÁE
34502010-05-26 Rafael Espindola <espindola@google.com>
3451
3452 PR 11604
3453 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
3454 adding sections the garbage collector removed.
3455 * gold/testsuite/Makefile.am: Add test.
3456 * gold/testsuite/Makefile.in: Regenerate.
3457 * gold/testsuite/plugin_test_7.sh: New.
3458 * gold/testsuite/plugin_test_7_1.c: New.
3459 * gold/testsuite/plugin_test_7_2.c: New.
3460
f4187277
RÁE
34612010-05-26 Rafael Espindola <espindola@google.com>
3462
3463 * script-sections.cc (Output_section_definition::set_section_addresses):
3464 Check for --section-start.
3465
5c388529
DK
34662010-05-26 Doug Kwan <dougkwan@google.com>
3467
3468 * arm.cc (Arm_scan_relocatable_relocs): New class.
3469 (Target_arm::relocate_special_relocatable): New method.
3470 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
3471 (Arm_relocate_functions::thumb_branch_common): Same.
3472 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
3473 instead of Default_scan_relocatable_relocs.
3474 * target-reloc.h (relocate_for_relocatable): Let target handle
3475 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
3476 * target.h (Sized_target::relocate_special_relocatable): New method.
3477
bca1c3ae
ILT
34782010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3479
3480 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
3481
0439c796
DK
34822010-05-23 Doug Kwan <dougkwan@google.com>
3483
3484 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
3485 instead of a cast.
3486 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
3487 with a direct branch, not a conditional branch, to a stub.
3488 * merge.cc (Output_merge_base::record_input_section): New method
3489 defintion.
3490 (Output_merge_data::do_add_input_section): Record input section if
3491 keeps-input-sections flag is set.
3492 (Output_merge_string::do_add_input_section): Ditto.
3493 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
3494 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
3495 INPUT_SECTIONS_.
3496 (Output_merge_base::keeps_input_sections,
3497 Output_merge_base::set_keeps_input_sections,
3498 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
3499 method definitions.
3500 (Output_merge_base::Input_sections): New type declaration.
3501 (Output_merge_base::input_sections_begin,
3502 Output_merge_base::input_sections_end,
3503 Output_merge_base::do_set_keeps_input_sections): New method definitions.
3504 (Output_merge_base::bool keeps_input_sections_,
3505 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
3506 Output_merge_base::input_sections_): New data members.
3507 (Output_merge_data::do_set_keeps_input_sections): New method
3508 defintion.
3509 (Output_merge_string::do_set_keeps_input_sections): Ditto.
3510 * output.cc (Output_section::Input_section::relobj): Move method
3511 defintion from class declaration to here and handle merge sections.
3512 (Output_section::Input_section::shndx): Ditto.
3513 (Output_section::Output_section): Remove initializations of removed
3514 data members and initialize new data member LOOKUP_MAPS_.
3515 (Output_section::add_input_section): Set keeps-input-sections flag
3516 for a newly created merge output section as appropriate. Adjust code
3517 to use Output_section_lookup_maps class.
3518 (Output_section::add_relaxed_input_section): Adjst code for lookup
3519 maps code refactoring.
3520 (Output_section::add_merge_input_section): Add a new parameter
3521 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
3522 class. If adding input section to a newly created merge output
3523 section fails, remove the new merge section.
3524 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3525 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3526 (Output_section::find_merge_section): Ditto.
3527 (Output_section::build_lookup_maps): New method defintion.
3528 (Output_section::find_relaxed_input_section): Adjust code to use
3529 Output_section_lookup_maps class.
3530 (Output_section::get_input_sections): Export merge sections. Adjust
3531 code to use Output_section_lookup_maps class.
3532 (Output_section:::add_script_input_section): Adjust code to use
3533 Output_section_lookup_maps class. Update lookup maps for merge
3534 sections also.
3535 (Output_section::discard_states): Use Output_section_lookup_maps.
3536 (Output_section::restore_states): Same.
3537 * output.h (Merge_section_properties): Move class defintion out of
3538 Output_section.
3539 (Output_section_lookup_maps): New class.
3540 (Output_section::Input_section::is_merge_section): New method
3541 defintion.
3542 (Output_section::Input_section::relobj): Move defintion out of class
3543 defintion. Declare method only.
3544 (Output_section::Input_section::shndx): Ditto.
3545 (Output_section::Input_section::output_merge_base): New method defintion.
3546 (Output_section::Input_section::u2_.pomb): New union field.
3547 (Output_section::Merge_section_by_properties_map,
3548 Output_section::Output_section_data_by_input_section_map,
3549 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3550 Remove types.
3551 (Output_section::add_merge_input_section): Add new parameter
3552 KEEPS_INPUT_SECTIONS.
3553 (Output_section::build_lookup_maps): New method declaration.
3554 (Output_section::merge_section_map_,
3555 Output_section::merge_section_by_properties_map_,
3556 Output_section::relaxed_input_section_map_,
3557 Output_section::is_relaxed_input_section_map_valid_): Remove data
3558 members.
3559 (Output_section::lookup_maps_): New data member.
3560
76295588
L
35612010-05-21 Doug Kwan <dougkwan@google.com>
3562
3563 PR gold/11619
3564 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3565 avoid a compilation error.
3566
d103a984
RÁE
35672010-05-19 Rafael Espindola <espindola@google.com>
3568
3569 * script-sections.cc (Output_section_definition::allocate_to_segment):
3570 Update the phdrs_list even when the output section is NULL.
3571 * testsuite/Makefile.am: Add test.
3572 * testsuite/Makefile.in: Regenerate.
3573 * testsuite/script_test_9.cc: New.
3574 * testsuite/script_test_9.sh: New.
3575 * testsuite/script_test_9.t: New.
3576
6625d24e
DK
35772010-05-19 Doug Kwan <dougkwan@google.com>
3578
3579 * arm.cc (Arm_input_section::original_size): New method.
3580 (Arm_input_section::do_addralign): Add a cast.
3581 (Arm_input_section::do_output_offset): Remove static cast.
3582 (Arm_input_section::original_addralign,
3583 Arm_input_section::original_size_): Change type to uint32_t.
3584 (Arm_input_section::init): Add safe casts for section alignment
3585 and size.
3586 (Arm_input_section::set_final_data_size): Do not set address and
3587 offset of stub table.
3588 (Arm_output_section::fix_exidx_coverage): Change use of of
3589 Output_section::Simple_input_section to that of
3590 Output_section::Input_section.
3591 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3592 except for the first pass.
3593 * output.cc (Output_section::get_input_sections): Change type of
3594 input_sections to std::list<Input_section>.
3595 (Output_section::add_script_input_section): Rename from
3596 Output_section::add_simple_input_section. Change type of SIS
3597 parameter from Simple_input_section to Input_section.
3598 * output.h (Output_section::Simple_input_section): Remove class.
3599 (Output_section::Input_section): Change class visibility to public.
3600 (Output_section::Input_section::addralign): Use stored alignments
3601 for special input sections if set.
3602 (Output_section::Input_section::set_addralign): New method.
3603 (Output_section::get_input_sections): Change parameter type from
3604 list of Simple_input_section to list of Input_section.
3605 (Output_section::add_script_input_section): Rename from
3606 Output_section::add_simple_input_section. Change first parameter's
3607 type from Simple_input_section to Input_section and remove the
3608 second and third parameters.
3609 * script-sections.cc (Input_section::Input_section_list): Change
3610 type to list of Output_section::Input_section/
3611 (Input_section_info::Input_section_info): Change parameter type of
3612 INPUT_SECTION to Output_section::Input_section.
3613 (Input_section_info::input_section): Change return type.
3614 (Input_section_info::input_section_): Change type to
3615 Output_section::Input_section.
3616 (Output_section_element_input::set_section_addresses): Adjust code
3617 to use Output_section::Input_section instead of
3618 Output_section::Simple_input_section. Adjust code for renaming
3619 of Output_section::add_simple_input_section.
3620 (Orphan_output_section::set_section_addresses): Ditto.
3621
e1e82ea4
RW
36222010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3623
3624 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
3625 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
3626
91e75c8a
RÁE
36272010-05-18 Rafael Espindola <espindola@google.com>
3628
3629 * options.cc (General_options::finalize): Handle -nostdlib.
3630 * options.h (nostdlib): New option.
3631 * script.cc (script_add_search_dir): Handle -nostdlib.
3632
da59ad79
DK
36332010-05-12 Doug Kwan <dougkwan@google.com>
3634
3635 * arm.cc (Target_arm::do_finalize_sections): Create an empty
3636 attributes section only if there no attributes section after merging.
3637 (Target_arm::merge_object_attributes): Move value of
e1df38aa 3638 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
3639 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
3640 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
3641 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
3642 and arm_attr_merge_7.stdout.
3643 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
3644 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
3645 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
3646 arm_attr_merge_7b.o): New rules.
3647 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
3648 arm_attr_merge_7
3649 * testsuite/Makefile.in: Regenerate.
3650 * testsuite/arm_attr_merge.sh: New file.
3651 * testsuite/arm_attr_merge_[67][ab].s: Same.
3652
3e01a7fd
NC
36532010-05-05 Nick Clifton <nickc@redhat.com>
3654
3655 * po/es.po: Updated Spanish translation.
3656
7ad2014a
L
36572010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3658
3659 * Makefile.am (install-exec-local): Properly install gold as
3660 default cross linker.
3661 * Makefile.in: Regenerated.
3662
4fda8867
NC
36632010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3664 Nick Clifton <nickc@redhat.com>
3665
3666 * configure.ac (install_as_default): Define and set to false
3667 unless --enable-gold or --enable-gold=both/gold has been
3668 specified.
3669 * configure: Regenerate.
3670
3671 * Makefile.am (install-exec-local): Install the executable as
3672 'ld.gold'. If install_as_default is true then also install it as
3673 'ld'.
3674 * Makefile.in: Regenerated.
3675
bd288ea2
ILT
36762010-04-24 Ian Lance Taylor <iant@google.com>
3677
3678 * layout.cc (Layout::layout_reloc): In relocatable link don't
3679 combine reloc sections for grouped sections.
3680
ef38fd8a
ST
36812010-04-23 Sriraman Tallam <tmsriram@google.com>
3682
3683 * gc.h (gc_process_relocs): Pass information on relocs pointing to
3684 sections that are not ordinary to icf.
3685 * icf.cc (get_section_contents): Handle relocation pointing to section
3686 with no object or shndx information.
3687 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
3688 * testsuite/Makefile.in: Regenerate.
3689 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
3690 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
3691
f6973bdc
ILT
36922010-04-22 Ian Lance Taylor <iant@google.com>
3693
3694 * expression.cc (Expression::Expression_eval_info): Add
3695 result_alignment_pointer field.
3696 (Expression::eval_with_dot): Add result_alignment_pointer
3697 parameter. Change all callers.
3698 (Expression::eval_maybe_dot): Likewise.
3699 (class Binary_expression): Add alignment_pointer parameter to
3700 left_value and right_value. Change all callers.
3701 (BINARY_EXPRESSION): Set result alignment.
3702 (class Trinary_expression): Add alignment_pointer parameter to
3703 arg2_value and arg3_value. Change all callers.
3704 (Trinary_cond::value): Set result alignment.
3705 (Max_expression::value, Min_expression::value): Likewise.
3706 (Align_expression::value): Likewise.
3707 * script-sections.cc (class Sections_element): Add dot_alignment
3708 parameter to set_section_addresses virtual function. Update
3709 instantiations.
3710 (class Output_section_element): Likewise.
3711 (Script_sections::create_segments): Add dot_alignment parameter.
3712 Change all callers.
3713 (Script_sections::create_segments_from_phdrs_clause): Likewise.
3714 (Script_sections::set_phdrs_clause_addresses): Likewise.
3715 * script-sections.h: Update declarations.
3716 * script.h: Update declarations.
3717 * output.h (Output_segment::set_minimum_p_align): Don't decrease
3718 min_p_align.
3719 * testsuite/script_test_3.t: Set large alignment.
3720 * testsuite/script_test_3.sh: Make sure that at least one LOAD
3721 segment has expected alignment.
3722
9c9c98a5
NC
37232010-04-22 Nick Clifton <nickc@redhat.com>
3724
3725 * po/gold.pot: Updated by the Translation project.
3726 * po/vi.po: Updated Vietnamese translation.
3727
2253bfba
L
37282010-04-22 H.J. Lu <hongjiu.lu@intel.com>
3729
3730 * testsuite/Makefile.am (check_PROGRAMS): Add
3731 icf_virtual_function_folding_test.
3732 * testsuite/Makefile.in: Regenerated.
3733
85fdf906
AH
37342010-04-15 Andrew Haley <aph@redhat.com>
3735
3736 * options.h (merge_exidx_entries): New option.
3737 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
3738 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
3739 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
3740 (Target_arm::merge_exidx_entries): New function.
3741 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
3742 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
3743 to Arm_exidx_fixup constructor.
3744 Add new arg, merge_exidx_entries.
3745 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
3746 Arm_output_section::fix_exidx_coverage.
3747
ce97fa81
ST
37482010-04-18 Sriraman Tallam <tmsriram@google.com>
3749
3750 * icf.cc (get_section_contents): Check for preemptible functions.
3751 Ignore addend when appropriate.
3752 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
3753 section folded.
3754 (add_from_relobj): Check for section folded.
3755 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
3756 * symtab.h (should_add_dynsym_entry): Add new parameter.
3757 * target-reloc.h (scan_relocs): Check for section folded.
3758 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
3759 Check reloc types for function pointers in shared objects.
3760 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
3761 case.
3762 (icf_preemptible_functions_test): New test case.
3763 (icf_string_merge_test): New test case.
3764 * testsuite.Makefile.in: Regenerate.
3765 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
3766 bar_glob. Refactor code.
3767 * testsuite/icf_preemptible_functions_test.cc: New file.
3768 * testsuite/icf_preemptible_functions_test.sh: New file.
3769 * testsuite/icf_string_merge_test.cc: New file.
3770 * testsuite/icf_string_merge_test.sh: New file.
3771 * testsuite/icf_virtual_function_folding_test.cc: New file.
3772 * testsuite/icf_virtual_function_folding_test.sh: New file.
3773
04ceb17c
DK
37742010-04-14 Doug Kwan <dougkwan@google.com>
3775
3776 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
3777 for local symbol recounting if we remove a section due to ICF.
3778 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
3779 there are no regular objects in input.
3780
153e7da4
DK
37812010-04-13 Doug Kwan <dougkwan@google.com>
3782
3783 * arm.cc (Arm_input_section::set_final_data_size): Compute
3784 accurate final data size instead of using current data size.
3785
4dbd9faf
DK
37862010-04-09 Doug Kwan <dougkwan@google.com>
3787
3788 * layout.cc (Layout::choose_output_section): Handle script section
3789 types.
3790 (Layout::make_output_section_for_script): Add section type parameter.
3791 Handle script section types.
3792 * layout.h (Layout::make_output_section_for_script): Add section
3793 type parameter.
3794 * output.cc (Output_section::Output_section): Initialize data member
3795 is_noload_.
3796 (Output_section::do_reset_address_and_file_offset): Do not set address
3797 to 0 if section is a NOLOAD section.
3798 * output.h (Output_section::is_noload): New method.
3799 (Output_section::set_is_noload): Ditto.
3800 (Output_section::is_noload_): New data member.
3801 * script-c.h (Script_section_type): New enum type.
3802 (struct Parser_output_section_header): Add new file section_type.
3803 * script-sections.cc (Sections_element::output_section_name): Add
3804 parameter for returning script section type.
3805 (Output_section_definition::output_section_name): Ditto.
3806 (Output_section_definition::section_type)P; New method.
3807 (Output_section_definiton::script_section_type_name): Ditto.
3808 (Output_section_definition::script_section_type_): New data member.
3809 (Output_section_definition::Output_section_definition): Initialize
3810 data member Output_section_definition::script_section_type_.
3811 (Output_section_definition::create_sections): Pass script section type
3812 to Layout::make_output_section_for_script.
3813 (Output_section_definition::output_section_name): Return script
3814 section type to caller.
3815 (Output_section_definition::set_section_address): Do not advance
3816 dot value and load address if section type is NOLOAD. Set address
3817 of NOLOAD sections regardless of section flags.
3818 (Output_section_definition::print): Print section type if it is
3819 not SCRIPT_SECTION_TYPE_NONE.
3820 (Output_section_definition::section_type): New method.
3821 (Output_section_definition::script_section_type_name): Ditto.
3822 (Script_sections::output_section_name): Add new parameter
3823 PSECTION_TYPE for returning script section type. Pass it to
3824 section elements. Handle discard sections.
3825 (Sort_output_sections::operator()): Handle NOLOAD sections.
3826 * script-sections.h (Script_sections::Section_type): New enum type.
3827 (Script_sections::output_section_name): Add a new parameter for
3828 returning script section type.
3829 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
3830 INFO and NOLOAD.
3831 * yyscript.y (union): Add new field SECTION_TYPE.
3832 (COPY, DSECT, INFO, NOLOAD): New tokens.
3833 (opt_address_and_section_type): Change type to output_section_header.
3834 (section_type): New non-terminal
3835 (section_header): Handle section type.
2253bfba 3836 (opt_address_and_section_type): Return section type value.
4dbd9faf 3837
721ea635
L
38382010-04-09 H.J. Lu <hongjiu.lu@intel.com>
3839
3840 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3841 * testsuite/plugin_common_test_2.c (foo): Likewise.
3842
6bf924b0
DK
38432010-04-08 Doug Kwan <dougkwan@google.com>
3844
3845 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3846 Output_merge_data.
3847 * output.cc (Output_section::add_merge_input_section): Simplify
3848 code and return status of Output_merge_base::add_input_section.
e1df38aa 3849 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3850 returns true.
3851
24af6f92
DK
38522010-04-07 Doug Kwan <dougkwan@google.com>
3853
3854 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3855 if section is marked as containing instructions but has no mapping
3856 symbols.
3857 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3858 correct section index.
3859 (Arm_relobj::find_linked_text_section): Ditto.
3860
00698fc5
CC
38612010-04-07 Cary Coutant <ccoutant@google.com>
3862
3863 * archive.cc (include_member): Destroy Read_symbols_data object before
3864 releasing file.
3865 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3866 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3867 (Read_symbols_data::~Read_symbols_data) New destructor.
3868 (Section_relocs::Section_relocs) New constructor.
3869 (Section_relocs::~Section_relocs) New destructor.
3870 (Read_relocs_data::Read_relocs_data) New constructor.
3871 (Read_relocs_data::~Read_relocs_data) New destructor.
3872 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3873 pointers to NULL after deleting.
3874
7296d933
DK
38752010-04-07 Doug Kwan <dougkwan@google.com>
3876
3877 * arm.cc: Replace "endianity" with "endianness" in comments.
3878 (Arm_exidx_cantunwind): Ditto.
3879 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3880 (Arm_relobj::merge_flags_and_attributes): New method.
3881 (Arm_relobj::merge_flags_and_attributes_): New data member.
3882 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3883 (Arm_relobj::scan_sections_for_stubs): Ditto.
3884 (Arm_relobj::do_read_symbols): Check to see if we really want to
3885 merge processor-specific flags and attributes. Exit early if
3886 an object is empty except for section names and the undefined symbol.
3887 (Target_arm::do_finalize_sections): Move check for ELF format to
3888 Arm_relobj::do_read_symbols. Merge processor specific flags and
3889 attributes from a regular object only when we have determined that
3890 it is aapropriate. Do not create an .ARM.attributes section in
3891 output if there is no regular input object.
3892 (Target_arm::merge_processor_specific_flags): Check
3893 --warn-mismatch before printing any error.
3894 (Target_arm::merge_object_attributes): Ditto.
3895 * gold.cc (queue_middle_tasks): Handle the case in which there is
3896 no regular object in input.
3897 * options.cc (General_options::parse_EB): New method.
3898 (General_options::parse_EL): Same.
3899 (General_options::General_options): Initialize endianness_.
3900 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3901 New options.
3902 (General_options::Endianness): New enum.
3903 (General_options::endianness): New method.
3904 (General_options::endianness_): New data member.
3905 * parameters.cc (Parameters::set_options): Check target endianness.
3906 (Parameters::set_target_once): Ditto.
3907 (Parameters::check_target_endianness): New method.
3908 (parameters_force_valid_target): If either -EL or -EB is specified,
3909 use it to define endianness of default target.
3910 * parameters.h (Parameters::check_target_endianness): New method
3911 declaration.
3912 * target.h (class Target): Change "endianity" to "endianness"
3913 in comments.
3914
efc8d4f2
RW
39152010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3916
3917 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3918 * configure: Regenerate.
3919 * Makefile.in: Regenerate.
3920 * testsuite/Makefile.in: Regenerate.
3921
be234d88
CC
39222010-04-06 Cary Coutant <ccoutant@google.com>
3923
3924 gcc PR lto/42757
3925 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3926 prevailing definitions of common symbols.
3927 * testsuite/plugin_test_6.sh: New test case.
3928 * testsuite/plugin_common_test_1.c: New test case.
3929 * testsuite/plugin_common_test_2.c: New test case.
3930 * testsuite/Makefile.am (plugin_test_6): New test case.
3931 * testsuite/Makefile.in: Regenerate.
3932
bd32c6bd
NC
39332010-04-06 Nick Clifton <nickc@redhat.com>
3934
3935 * po/vi.po: New Vietnamese translation.
3936
323c532f
DK
39372010-03-30 Doug Kwan <dougkwan@google.com>
3938
3939 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3940
4fcd97eb
DK
39412010-03-25 Doug Kwan <dougkwan@google.com>
3942
3943 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3944 to avoid a conversion warning on a 32-bit host.
3945
4ebf39db
ILT
39462010-03-24 Ian Lance Taylor <iant@google.com>
3947
3948 * testsuite/script_test_3.t: Add a TLS segment.
3949 * testsuite/Makefile.am (check_PROGRAMS): Add
3950 tls_phdrs_script_test.
3951 (tls_phdrs_script_test_SOURCES): Define.
3952 (tls_phdrs_script_test_DEPENDENCIES): Define.
3953 (tls_phdrs_script_test_LDFLAGS): Define.
3954 (tls_phdrs_script_test_LDADD): Define.
3955 * testsuite/Makefile.in: Rebuild.
3956
4a599bdd
CC
39572010-03-23 Cary Coutant <ccoutant@google.com>
3958
3959 * fileread.cc (find_or_make_view): Fix comment.
3960
6c93b22c
ILT
39612010-03-23 Ian Lance Taylor <iant@google.com>
3962
3963 * script-sections.cc (class Orphan_section_placement): Define
3964 PLACE_TLS and PLACE_TLS_BSS.
3965 (Orphan_section_placement::Orphan_section_placement): Initialize
3966 new places.
3967 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3968 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3969 (tls_script_test_SOURCES): Define.
3970 (tls_script_test_DEPENDENCIES): Define.
3971 (tls_script_test_LDFLAGS): Define.
3972 (tls_script_test_LDADD): Define.
3973 * testsuite/Makefile.in: Rebuild.
3974
a2c7281b
DK
39752010-03-22 Doug Kwan <dougkwan@google.com>
3976
3977 * arm.cc (Arm_relocate_functions::abs8,
3978 Arm_relocate_functions::abs16): Use correct check for overflow
3979 specified in the ARM ELF specs.
3980 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3981 target of a BLX instruction specially.
3982 (Reloc_stub::stub_type_for_reloc): Ditto.
3983 (Relocate::relocate): Use symbolic names instead of numeric relocation
3984 codes to report error.
3985 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3986 workaround.
3987 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3988 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3989 thumb2_blx_out_of_range.stdout
3990 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3991 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3992 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3993 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3994 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3995 thumb2_blx_in_range, thumb2_blx_in_range.o,
3996 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3997 thumb2_blx_out_of_range.o): New rules.
3998 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3999 thumb2_blx_in_range and thumb2_blx_out_of_range.
4000 * testsuite/Makefile.in: Regenerate.
4001 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4002 * testsuite/thumb_blx_in_range.s: New file.
4003 * testsuite/thumb_blx_out_of_range.s: New file.
4004
b0193076
RÁE
40052010-03-22 Rafael Espindola <espindola@google.com>
4006
4007 * archive.cc (Should_include): Move to archive.h.
4008 (should_include_member): Make it a member of Archive.
4009 (Lib_group): New.
4010 (Add_lib_group_symbols): New.
4011 * archive.h: Include options.h.
4012 (Archive_member): Moved from Archive.
4013 (Should_include): Moved from archive.cc.
4014 (Lib_group): New.
4015 (Add_lib_group_symbols): New.
4016 * dynobj.cc (do_should_include_member): New.
4017 * dynobj.h (do_should_include_member): New.
4018 * gold.cc (queue_initial_tasks): Update call to queue.
4019 * main.cc (main): Print lib group stats.
4020 * object.cc (do_should_include_member): New.
4021 * object.h: Include archive.h.
4022 (Object::should_include_member): New.
4023 (Object::do_should_include_member): New.
4024 (Sized_relobj::do_should_include_member): New.
4025 * options.cc (General_options::parse_start_lib): New.
4026 (General_options::parse_end_lib): New.
4027 (Input_arguments::add_file): Handle lib groups.
4028 (Input_arguments::start_group): Check we are not in a lib.
4029 (Input_arguments::start_lib): New.
4030 (Input_arguments::end_lib): New.
4031 * options.h (General_options): Add start_lib and end_lib.
4032 (Input_argument::lib_): New.
4033 (Input_argument::lib): New.
4034 (Input_argument::is_lib): New.
4035 (Input_file_lib): New.
4036 (Input_arguments::in_lib_): New.
4037 (Input_arguments::in_lib): New.
4038 (Input_arguments::start_lib): New.
4039 (Input_arguments::end_lib_): New.
4040 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4041 in unused members as preempted.
4042 (Sized_pluginobj::do_should_include_member): New.
4043 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4044 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4045 return the blocker.
4046 (Read_symbols::do_whole_lib_group): New.
4047 (Read_symbols::do_lib_group): New.
4048 (Read_symbols::do_read_symbols): Handle lib groups.
4049 (Read_symbols::get_name): Handle lib groups.
4050 * readsyms.h (Read_symbols): Add an archive member pointer.
4051 (Read_symbols::do_whole_lib_group): New.
4052 (Read_symbols::do_lib_group): New.
4053 (Read_symbols::member_): New.
4054 * script.cc (read_input_script): Update call to queue_soon.
4055
d099120c
DK
40562010-03-19 Doug Kwan <dougkwan@google.com>
4057
4058 * arm.cc (Stub_table::Stub_table): Initialize new data members
4059 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4060 (Stub_table::add_reloc_stub): Assign stub offset and update
4061 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4062 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4063 New data members.
4064 (Stub_table::update_data_size_and_addralign): Use
4065 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4066 instead of going over all reloc stubs.
4067 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4068 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4069 Stringpool_template::offset_ to size of Stringpool_char.
4070 (Stringpool_template::new_key_offset): Remove code to initialize
4071 Stringpool_template::offset_.
4072 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4073 Stringpool_template::offset_ to zero.
4074
1aa37384
DK
40752010-03-15 Doug Kwan <dougkwan@google.com>
4076
4077 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4078 offset_.
4079 (Stringpool_template::new_key_offset): New method.
4080 (Stringpool_template::add_string): Assign offsets when adding new
4081 strings.
4082 (Stringpool_template::set_string_offsets): Do not set string offsets
4083 when not optimizing.
4084 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4085 member size_.
4086 (Chunked_vector::clear): Clear size_.
4087 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4088 (Chunked_vector::size): Return size_.
4089 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 4090 (Chunked_vector::size_): New data member.
1aa37384
DK
4091 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4092 (Stringpool_template::new_key_offset): New method declaration.
4093 (Stringpool_template::offset_): New data member.
4094
b672b057
RÁE
40952010-03-15 Rafael Espindola <espindola@google.com>
4096
4097 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4098 Add_symbols' constructor.
4099 * readsyms.h (Add_symbols): Remove the input_group member.
4100
b6848d3c
ILT
41012010-03-10 Ian Lance Taylor <iant@google.com>
4102
4103 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4104 target to ask whether a reference to a symbol requires a stack
4105 split.
4106 * target.h (Target::is_call_to_non_split): New function.
4107 (Target::do_is_call_to_non_split): Declare virtual function.
4108 * target.cc: Include "symtab.h".
4109 (Target::do_is_call_to_non_split): New function.
4110 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4111
a2a5469e
CC
41122010-03-10 Cary Coutant <ccoutant@google.com>
4113
4114 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4115 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4116 (File_read::open[2]): Add whole_file_view_ to list of views.
4117 (File_read::make_view): Remove test of whole_file_view_.
4118 (File_read::find_or_make_view): Create whole_file_view_ if
4119 necessary.
4120 (File_read::clear_views): Replace bool parameter with enum;
4121 adjust all callers. Don't delete views with permanent data;
4122 do delete cached views and views from archives if
4123 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4124 if clearing the corresponding view.
4125 * fileread.h (File_read::Clear_views_mode): New enum.
4126 (File_read::View::is_permanent_view): New method.
4127 (File_read::clear_views): Replace bool parameter
4128 with enum; adjust all callers.
4129 * options.h (General_options): Change keep_files_mapped option;
4130 add map_whole_files.
4131 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4132 releasing the file.
4133 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4134 the file.
4135
8861f32b
DM
41362010-03-10 David S. Miller <davem@davemloft.net>
4137
4138 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4139
d62d0f5f
ST
41402010-03-09 Sriraman Tallam <tmsriram@google.com>
4141
4142 * icf.cc (get_section_contents): Add '@' marker after processing the
4143 merge reloc.
4144
9177756d
DK
41452010-03-08 Doug Kwan <dougkwan@google.com>
4146
4147 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4148 due to a conversion warning.
4149 (Arm_relobj::update_output_local_symbol_count): Check for local
4150 symbol with unset output index.
4151
9e9e071b
ILT
41522010-03-05 Ian Lance Taylor <iant@google.com>
4153
4154 * options.h (class General_options): Add --spare-dynamic-tags.
4155 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4156 --spare-dynamic-tags.
4157
a81ee015
ILT
41582010-03-05 Ian Lance Taylor <iant@google.com>
4159
4160 * incremental.cc: Include "libiberty.h".
4161
44ec90b9
RO
41622010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4163
4164 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4165 function, is_info_ member.
4166 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4167 (Versions::Versions): Update caller.
4168 (Versions::define_base_version): Likewise.
4169 (Versions::add_def): Likewise.
4170
0897ed3b
ST
41712010-03-03 Sriraman Tallam <tmsriram@google.com>
4172
4173 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4174 (Scan::possible_function_pointer_reloc): New function.
4175 (Scan::local_reloc_may_be_function_pointer): Change to call
4176 possible_function_pointer_reloc.
4177 (Scan::global_reloc_may_be_function_pointer): Ditto.
4178 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4179 relocations in ".data.rel.ro._ZTV" section.
4180 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4181 * testsuite/icf_safe_so_test.cc: Ditto.
4182 * testsuite/icf_safe_test.cc: Ditto.
4183 * testsuite/icf_safe_test.sh: Ditto.
4184
d3bbad62
ILT
41852010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4186 Ian Lance Taylor <iant@google.com>
4187
4188 * target-reloc.h (relocate_section): Check the symbol table index
4189 for -1U before setting the local symbol index.
4190 (scan_relocatable_relocs): If copying the relocation, record that
4191 the local symbol is required.
4192 * object.h (Symbol_value::is_output_symtab_index_set): New
4193 function.
4194 (Symbol_value::may_be_discarded_from_output_symtab): New
4195 function.
4196 (Symbol_value::has_output_symtab_entry): New function.
4197 (Symbol_value::needs_output_symtab_entry): Remove.
4198 (Symbol_value::output_symtab_index): Make sure the symbol index is
4199 set.
4200 (Symbol_value::set_output_symtab_index): Make sure the symbol
4201 index is not set. Make sure the new index is valid.
4202 (Symbol_value::set_must_have_output_symtab_entry): New function.
4203 (Symbol_value::has_output_dynsym_entry): New function.
4204 (Symbol_value::set_output_dynsym_index): Make sure the new index
4205 is valid.
4206 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4207 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4208 local symbol if permitted.
4209 (Sized_relobj::do_finalize_local_symbols): Call
4210 is_output_symtab_index_set rather than needs_output_symtab_entry.
4211 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4212 rather than needs_output_symtab_entry. Call
4213 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4214 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4215 is_output_symtab_index_set rather than needs_output_symtab_entry.
4216 * testsuite/discard_locals_relocatable_test.c: New file.
4217 * testsuite/discard_locals_test.sh: Test -r.
4218 * testsuite/Makefile.am (check_DATA): Add
4219 discard_locals_relocatable_test1.syms,
4220 discard_local_relocatable_test2.syms.
4221 (MOSTLYCLEANFILES): Likewise. Also add
4222 discard_locals_relocatable_test1.lout and
4223 discard_locals_relocatable_test2.out.
4224 (discard_locals_relocatable_test1.syms): New target.
4225 (discard_locals_relocatable_test.o): New target.
4226 (discard_locals_relocatable_test1.out): New target.
4227 (discard_locals_relocatable_test2.syms): New target.
4228 (discard_locals_relocatable_test2.out): New target.
4229 (various): Add missing ../ld-new dependencies.
4230 * testsuite/Makefile.in: Rebuild.
4231
7e8ccf26
NC
42322010-03-03 Nick Clifton <nickc@redhat.com>
4233
4234 * po/fi.po: New Finnish translation.
4235
2a0ff005
DK
42362010-03-01 Doug Kwan <dougkwan@google.com>
4237
4238 * layout.cc (Layout::Layout): Force section types of .init_array*,
4239 .preinit_array* and .fini_array* sections.
4240 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4241 Fix check of return value of std::string::find.().
4242 (Output_section::Input_section_sort_compare::operator()): Remove
4243 comment about .init_array.
4244 (Output_section::Input_section_sort_init_fini_compare::operator()):
4245 New method.
4246 (Output_section::sort_attached_input_sections): Handle .init_array
4247 and .fini_array specially.
4248 * output.h (Output_section::Inut_section_sort_compare): Update
4249 comment.
4250 (Output_section::Input_section_sort_init_fini_compare): New struct.
4251
c3e4ae29
DK
42522010-02-26 Doug Kwan <dougkwan@google.com>
4253
4254 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4255 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4256 * testsuite/debug_msg.sh: Avoid matching source line number for
4257 use of global variable undef_int.
4258
2fd9ae7a
DK
42592010-02-26 Doug Kwan <dougkwan@google.com>
4260
4261 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4262 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4263 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4264 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4265 * options.cc (General_options::General_options): Initialize member
4266 fix_v4bx_.
4267 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
4268 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
4269 and rm_no_fix_v4bx.stdout
4270 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
4271 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
4272 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
4273 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
4274 and arm_no_fix_v4bx.
4275 * Makefile.in: Regenerate.
4276 * testsuite/arm_fix_v4bx.s: New file.
4277 * testsuite/arm_fix_v4bx.sh: Ditto.
4278
67ec7d0b
DK
42792010-02-24 Doug Kwan <dougkwan@google.com>
4280
4281 * arm.cc (Target_arm::got_section): Make the .got section the first
4282 non RELRO section in the data segment.
4283 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4284 suffixes of section names.
4285
10165461
DK
42862010-02-24 Doug Kwan <dougkwan@google.com>
4287
4288 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4289 flags and attributes merging if an input file is a binary file.
4290 * fileread.cc (Input_file::open): Record format of original file.
4291 * fileread.h (Input_file::Format): New enum type.
4292 (Input_file::Input_file): Initialize data member format_.
4293 (Input_file::format): New method definition.
4294 (Input_file::format_):: New data member.
4295
4a54abbb
DK
42962010-02-24 Doug Kwan <dougkwan@google.com>
4297
4298 * arm.cc (Arm_output_data_got): New class.
4299 (ARM_TCB_SIZE): New constant
4300 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4301 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4302 If user uses a script with a SECTIONS clause, issue only a warning
4303 for a misplaced EXIDX input section. Otherwise, issue an error.
4304 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4305 garbage collection.
4306 (Target_arm::got_mode_index_entry): Handle static linking.
4307 (Target_arm::Scan::local): Ditto.
4308 (Target_arm::Scan::global): Ditto.
4309 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
4310 all incorrectly implemented relocations.
e1df38aa 4311 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
4312 Arm_output_section::fix_exidx_coverage.
4313 * layout.cc (Layout::section_name_mapping): Remove trailing dots
4314 from ".ARM.exidx." and ".ARM.extab.".
4315
ca419a6f
ILT
43162010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4317
4318 * arm.cc (Target_arm::do_finalize_sections): Create attribute
4319 section if it does not already exist.
4320 * attributes.cc (Attributes_section_data::Attributes_section_data):
4321 Don't crash if size is zero.
4322
135b9c78
ILT
43232010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4324 Ian Lance Taylor <iant@google.com>
4325
4326 * gold.cc (queue_middle_tasks): If no input files were opened,
4327 exit.
4328 * workqueue.h (Task_function::Task_function): Assert that there is
4329 a blocker.
4330
bb0bfe4f
DK
43312010-02-22 Doug Kwan <dougkwan@google.com>
4332
4333 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
4334 * icf.cc (get_section_contents): Cast snprintf arguments to long long
4335 types to avoid warnings due to different uint64_t implementations
4336 on different hosts.
4337
2a2b6d42
DK
43382010-02-21 Doug Kwan <dougkwan@google.com>
4339
4340 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
4341 handling of the maximum backward branch offset.
4342 (Arm_relocate_functions::thumb_branch_common): Ditto.
4343 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
4344 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 4345 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
4346 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
4347 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
4348 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
4349 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
4350 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
4351 thumb_bl_out_of_range thumb_bl_out_of_range.o,
4352 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
4353 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
4354 thumb2_bl_out_of_range.o): New rules.
4355 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
4356 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
4357 thumb2_bl_out_of_range
4358 * testsuite/Makefile.in: Regenerate.
4359 * testsuite/arm_bl_in_range.s: New file.
4360 * testsuite/arm_bl_out_of_range.s: Ditto.
4361 * testsuite/arm_branch_in_range.sh: Ditto.
4362 * testsuite/arm_branch_range.t: Ditto.
4363 * testsuite/thumb2_branch_range.t: Ditto.
4364 * testsuite/thumb_bl_in_range.s: Ditto.
4365 * testsuite/thumb_bl_out_of_range.s: Ditto.
4366 * testsuite/thumb_branch_range.t: Ditto.
4367
b487ad64
ST
43682010-02-20 Sriraman Tallam <tmsriram@google.com>
4369
4370 * gc.h (gc_process_relocs): Change vectors to point to the new list.
4371 Add reloc offset information.
4372 * icf.cc (get_section_contents): Change iterators to point to the new
4373 vectors. Add reloc offset information to the contents.
4374 * icf.h (Icf::Sections_reachable_info): New typedef.
4375 (Icf::Sections_reachable_list): New typedef.
4376 (Icf::Offset_info): New typedef.
4377 (Icf::Reloc_info): New struct typedef.
4378 (Icf::Reloc_info_list): New typedef.
4379 (Icf::symbol_reloc_list): Delete method.
4380 (Icf::addend_reloc_list): Delete method.
4381 (Icf::section_reloc_list): Delete method.
4382 (Icf::reloc_info_list): New method.
4383 (Icf::reloc_info_list_): New member.
4384
f96accdf
DK
43852010-02-19 Doug Kwan <dougkwan@google.com>
4386
4387 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
4388 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
4389 * arm.cc (Arm_relocation_functions): New forward declaration.
4390 (Target_arm::Target_arm): Initialize new data members
4391 got_mod_index_offset_ and tls_base_symbol_defined_.
4392 (Target_arm::Relocate::relocate_tls): New method.
4393 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
4394 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
4395 New methods.
4396 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
4397 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
4398 (Target_arm::got_mod_index_offset_,
4399 Target_arm::tls_base_symbol_defined_): New data members.
4400 (Target_arm::Scan::local, Target::Scan::global,
4401 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
4402 relocations.
4403
c8761b9a
DK
44042010-02-18 Doug Kwan <dougkwan@google.com>
4405
4406 * arm.cc (Arm_relobj::find_linked_text_section): New method.
4407 (Arm_relobj::make_exidx_input_section): Pass section index of linked
4408 text section as a parameter becuase some broken tools may not set
4409 the link in section header.
4410 (Target_arm::has_got_section): New method.
4411 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
4412 without any mapping symbol as data only. Remove warning.
4413 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
4414 link in its section header, try to discover the link by inspecting the
4415 REL31 relocation at the beginning of the section.
4416 (Target_arm::Scan::check_non_pic): Report name of offending relocation
4417 in error message.
4418 (Target_arm::Scan::global): Treat any reference to the symbol
4419 _GLOBAL_OFFSET_TABLE_ as a GOT access.
4420
21bb3914
ST
44212010-02-12 Sriraman Tallam <tmsriram@google.com>
4422
4423 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
4424 (Scan::global_reloc_may_be_function_pointer): New function.
4425 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4426 (Scan::global_reloc_may_be_function_pointer): New function.
4427 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4428 (Scan::global_reloc_may_be_function_pointer): New function.
4429 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
4430 (Scan::global_reloc_may_be_function_pointer): New function.
4431 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
4432 (Scan::global_reloc_may_be_function_pointer): New function.
4433 (Scan::possible_function_pointer_reloc): New function.
4434 (Target_x86_64::can_check_for_function_pointers): New function.
4435 * gc.h (gc_process_relocs): Scan relocation types to determine if
4436 function pointers were taken for targets that support it.
4437 * icf.cc (Icf::find_identical_sections): Include functions for
4438 folding in safe ICF whose pointer is not taken.
4439 * icf.h (Secn_fptr_taken_set): New typedef.
4440 (fptr_section_id_): New member.
4441 (section_has_function_pointers): New function.
4442 (set_section_has_function_pointers): New function.
4443 (check_section_for_function_pointers): New function.
4444 * options.h: Fix comment for safe ICF option.
4445 * target.h (can_check_for_function_pointers): New function.
4446 * testsuite/Makefile.am: Add icf_safe_so_test test case.
4447 Modify icf_safe_test for X86-64.
4448 * testsuite/Makefile.in: Regenerate.
4449 * testsuite/icf_safe_so_test.cc: New file.
4450 * testsuite/icf_safe_so_test.sh: New file.
4451 * testsuite/icf_safe_test.cc (kept_func_3): New function.
4452 (main): Change to take pointer to function kept_func_3.
4453 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
4454 folding is done correctly for X86-64.
4455
0da6fa6c
DM
44562010-02-12 David S. Miller <davem@davemloft.net>
4457
4458 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
4459 is_symbolless parameter.
4460 (Output_reloc<SHT_REL>::is_symbolless): New.
4461 (Output_reloc<SHT_REL>::is_symbolless_): New.
4462 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
4463 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
4464 (Output_reloc<SHT_RELA>::is_symbolless): New.
4465 (Output_data_reloc::add_global): Handle is_symbolless.
4466 (Output_data_reloc::add_global_relative): Likewise.
4467 (Output_data_reloc::add_local): Likewise.
4468 (Output_data_reloc::add_local_relative): Likewise.
4469 (Output_data_reloc::add_symbolless_global_addend): New.
4470 (Output_data_reloc::add_symbolless_local_addend): New.
4471 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
4472 is_symbolless.
4473 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
4474 instead of ->is_relative_
4475 (Output_reloc::write): Likewise.
4476 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
4477 (Output_reloc::write_rel): Simplify.
4478
4479 * sparc.cc (Target_sparc::Scan::local): Use
4480 ->add_symbolless_local_addend as needed.
4481 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
4482 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
4483 based upon relocation offset.
4484
e4782e83
DK
44852010-02-11 Doug Kwan <dougkwan@google.com>
4486
4487 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
4488 (Target_arm::Scan::global): Ditto. Also remove a comment before the
4489 beginning of function.
4490 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
4491 and MOVT_ABS relocations. Those are non issued in scanning. Fix
4492 parameter is_32bit in calls to should_apply_static_reloc.
4493 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
4494 (check_DATA): Add arm_abs_global.stdout.
4495 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
4496 arm_abs_global.stdout): New rules.
4497 (MOSTLLYCLEANFILES): Add arm_abs_global
4498 * Makefile.in: Regenerate.
4499 * testsuite/arm_abs_global.s: New file.
4500 * testsuite/arm_abs_global.sh: Ditto.
4501 * testsuite/arm_abs_lib.s: Ditto.
4502
93ceb764
ILT
45032010-02-11 Ian Lance Taylor <iant@google.com>
4504
4505 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
4506 Read_relocs task.
4507 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
4508 Allocate_commons_task first.
4509 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
4510 task, rather than symtab_lock_.
4511 (Gc_process_relocs::~Gc_process_relocs): New function.
4512 (Gc_process_relocs::is_runnable): Check this_blocker_.
4513 (Gc_process_relocs::locks): Use next_blocker_ rather than
4514 blocker_.
4515 (Scan_relocs::~Scan_relocs): New function.
4516 (Scan_relocs::is_runnable): Check this_blocker_ rather than
4517 symtab_lock_.
4518 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
4519 next_blocker_.
4520 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
4521 fields. Add this_blocker_ and next_blocker_ fields. Adjust
4522 constructor accordingly.
4523 (class Gc_process_relocs): Likewise.
4524 (class Scan_relocs): Likewise.
4525 * common.h (class Allocate_commons_task): Remove symtab_lock_
4526 field, and corresponding constructor parameter.
4527 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4528 symtab_lock_.
4529 (Allocate_commons_task::locks): Likewise.
4530
114dfbe1
ILT
45312010-02-11 Ian Lance Taylor <iant@google.com>
4532
4533 * gold-threads.h (class Once): Define.
4534 (class Initialize_lock): Rewrite as child of Once.
4535 * gold-threads.cc (class Once_initialize): Define.
4536 (once_pointer_control): New static variable.
4537 (once_pointer, once_arg): New static variables.
4538 (c_run_once): New static function.
4539 (Once::Once, Once::run_once, Once::internal_run): New functions.
4540 (class Initialize_lock_once): Remove.
4541 (initialize_lock_control): Remove.
4542 (initialize_lock_pointer): Remove.
4543 (initialize_lock_once): Remove.
4544 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4545 (Initialize_lock::initialize): Rewrite.
4546 (Initialize_lock::do_run_once): New function.
4547 * archive.cc (Archive::interpret_header): Only clear name if it is
4548 not already empty.
4549 * fileread.cc: Include "gold-threads.h"
4550 (file_counts_lock): New static variable.
4551 (file_counts_initialize_lock): Likewise.
4552 (File_read::release): Only increment counts when using --stats.
4553 Use a lock around the increment.
4554 * parameters.cc (class Set_parameters_target_once): Define.
4555 (set_parameters_target_once): New static variable.
4556 (Parameters::Parameters): Move here from parameters.h.
4557 (Parameters::set_target): Rewrite.
4558 (Parameters::set_target_once): New function.
4559 (Parameters::clear_target): Move here and rewrite.
4560 * parameters.h (class Parameters): Update declarations. Add
4561 set_parameters_target_once_ field.
4562 (Parameters::Parameters): Move to parameters.cc.
4563 (Parameters::clear_target): Likewise.
4564 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4565 task.
4566 (Start_group::~Start_group): New function.
4567 (Start_group::is_runnable): New function.
4568 (Start_group::locks, Start_group::run): New functions.
4569 (Finish_group::run): Change saw_undefined to size_t.
4570 * readsyms.h (class Start_group): Define.
4571 (class Finish_group): Change saw_undefined_ field to size_t.
4572 (Finish_group::Finish_group): Remove saw_undefined and
4573 this_blocker parameters. Change all callers.
4574 (Finish_group::set_saw_undefined): New function.
4575 (Finish_group::set_blocker): New function.
4576 * symtab.h (class Symbol_table): Change saw_undefined to return
4577 size_t. Change saw_undefined_ field to size_t.
4578 * target-select.cc (Set_target_once::do_run_once): New function.
4579 (Target_selector::Target_selector): Initialize set_target_once_
4580 field. Don't initialize lock_ and initialize_lock_ fields.
4581 (Target_selector::instantiate_target): Rewrite.
4582 (Target_selector::set_target): New function.
4583 * target-select.h (class Set_target_once): Define.
4584 (class Target_selector): Update declarations. Make
4585 Set_target_once a friend. Remove lock_ and initialize_lock_
4586 fields. Add set_target_once_ field.
4587
fa17a3f4
ILT
45882010-02-10 Ian Lance Taylor <iant@google.com>
4589
4590 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4591 queueing any tasks.
4592 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4593 (queue_middle_tasks): Add all blockers before queueing any tasks.
4594 (queue_final_tasks): Likewise.
4595 * token.h (Task_token::add_blockers): New function.
4596 * object.h (Input_objects::number_of_relobjs): New function.
4597
c7177d31
ILT
45982010-02-10 Ian Lance Taylor <iant@google.com>
4599
5de0e392
ILT
4600 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
4601 shared, not if not position independent.
4602 * x86_64.cc (Relocate::relocate_tls): Likewise.
4603 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
4604 (tls_pie_pic_test): New target.
4605 * testsuite/Makefile.in: Rebuild.
4606
c7177d31
ILT
4607 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
4608 (tls_test_main_pie.o, tls_test_pie.o): New targets.
4609 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
4610 * testsuite/Makefile.in: Rebuild.
4611
684b268a
DM
46122010-02-09 David S. Miller <davem@davemloft.net>
4613
4614 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4615 R_SPARC_RELATIVE using ->add_local_relative().
4616 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
4617
612a8d3d
DM
4618 * output.h (Output_data_dynamic::add_section_size): New method
4619 that takes two Output_data objects.
4620 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
4621 entry param. Handle it in initializers.
4622 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
4623 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
4624 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
4625 arg.
4626 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
4627 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
4628 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
4629 for dynrel_includes_plt.
4630 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4631 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4632 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
4633 before .rela.plt
4634 (Target_sparc::do_finalize_sections): Update to pass true for
4635 dynrel_includes_plt.
4636 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
4637 output before .rela.plt
4638 (Target_powerpc::do_finalize_sections): Update to pass true for
4639 dynrel_includes_plt when 32-bit.
4640
cb1be87e
DK
46412010-02-08 Doug Kwan <dougkwan@google.com>
4642
4643 * arm.cc (Arm_relobj::simple_input_section_output_address): New
4644 method.
4645 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
4646 Arm_relobj::scan_section_for_cortex_a8_stubs,
4647 Arm_relobj::do_relocation_section): Instead of calling
4648 Output_section::output_address, use faster
4649 Arm_relobj::simple_input_section_output_address.
4650
705b5121
DM
46512010-02-08 David S. Miller <davem@davemloft.net>
4652
4653 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
4654 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
4655 relocation helper function.
4656
024c4466
DM
4657 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
4658 just like R_SPARC_GOT{10,13,22}.
4659 (Target_sparc::Scan::local): Likewise.
4660 (Target_sparc::Relocate:relocate): Likewise.
4661
9109c078
ILT
46622010-02-06 Ian Lance Taylor <iant@google.com>
4663
4664 * configure.ac: Rewrite targetobjs duplicate removal code to use
4665 only shell constructs.
4666 * configure: Rebuild.
4667
cf846138
DK
46682010-02-05 Doug Kwan <dougkwan@google.com>
4669
4670 PR 11247
4671 * arm.cc (Arm_relobj::section_is_scannable): New method.
4672 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
4673 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
4674
6cfaf60b
DK
46752010-02-04 Doug Kwan <dougkwan@google.com>
4676
4677 PR 11247
4678 * arm-reloc-property.cc (cstdio): Include.
4679 * configure.ac (targetobjs): Remove duplicates.
4680 * configure: Regenerate.
4681 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
4682 big and little endian version for a given address size.
4683
5c57f1be
DK
46842010-02-03 Doug Kwan <dougkwan@google.com>
4685
4686 * arm-reloc-property.cc
4687 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4688 definition.
4689 * arm-reloc-property.h
4690 (Arm_reloc_property_table::get_implemented_static_reloc_property):
4691 New method definition.
4692 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4693 declaration.
4694 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
4695 overflow to N.
4696 (GOT_PREL): Change implemented to Y.
4697 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
4698 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
4699 (Arm_relocate_functions::movw_abs_nc): Remove method.
4700 (Arm_relocate_functions::movt_abs): Ditto.
4701 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
4702 (Arm_relocate_functions::thm_movt_abs): Ditto.
4703 (Arm_relocate_functions::movw_rel_nc): Ditto.
4704 (Arm_relocate_functions::movw_rel): Ditto.
4705 (Arm_relocate_functions::movt_rel): Ditto.
4706 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
4707 (Arm_relocate_functions:thm_movw_rel): Ditto.
4708 (Arm_relocate_functions:thm_movt_rel): Ditto.
4709 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
4710 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
4711 New method definitions.
4712 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
4713 (Arm_relocation_functions::arm_grp_ldr): Ditto.
4714 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
4715 (Arm_relocation_functions::arm_grp_ldc): Ditto.
4716 (Target_arm::Relocate::relocate): Check for non-static or
4717 unimplemented relocation code and exit early. Change calls to
4718 Target_arm::reloc_uses_thumb_bit and
4719 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
4720 instead. Refactor code to handle similar relocations to increase
4721 code sharing. Remove check for unsupported relocation code in switch
4722 statement.
4723 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
4724 relocation property table to find out size. Change error message to
4725 print out the name of a relocation code instead of the numeric value.
4726 (Target_arm::scan_reloc_for_stub): Use relocation property table
4727 instead of calling Target_arm::reloc_uses_thumb_bit().
4728
218c5831
DK
47292010-02-02 Doug Kwan <dougkwan@google.com>
4730
4731 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
4732 types of relaxed input section.
4733
0d31c79d
DK
47342010-02-02 Doug Kwan <dougkwan@google.com>
4735
4736 * Makefile.am (HFILES): Add arm-reloc-property.h.
4737 (DEFFILES): New.
4738 (TARGETSOURCES): Add arm-reloc-property.cc
4739 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
4740 (libgold_a_SOURCES): $(DEFFILES)
4741 * Makefile.in: Regenerate.
4742 * arm-reloc-property.cc: New file.
4743 * arm-reloc-property.h: New file.
4744 * arm-reloc.def: New file.
4745 * arm.cc: Update comments.
4746 (arm-reloc-property.h): New included header.
4747 (arm_reloc_property_table): New global variable.
4748 (Target_arm::do_select_as_default_target): New method definition.
4749 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
4750 arm-reloc-property to targ_extra_obj.
4751 * parameters.cc (set_parameters_target): Call
4752 Target::select_as_default_target().
4753 * target.h (Target::select_as_default_target): New method definition.
4754 (Target::do_select_as_default_target): Same.
4755
546c7457
DK
47562010-02-01 Doug Kwan <dougkwan@google.com>
4757
4758 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
4759 first_output_text_section_.
4760 (Arm_exidx_fixup::first_output_text_section): New method definition.
4761 (Arm_exidx_fixup::first_output_text_section_): New data member.
4762 (Arm_exidx_fixup::process_exidx_section): Record the first text
4763 output section seen.
4764 (Arm_output_section::fix_exidx_coverage): Set correct linked section
4765 and entsize in output section header.
4766
11b861d5
DK
47672010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4768
4769 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
4770 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
4771 (Arm_relocate_functions::thm_alu11): New Method.
4772 (Arm_relocate_functions::thm_pc8): New Method.
4773 (Arm_relocate_functions::thm_pc12): New Method.
4774 (Target_arm::Scan::local): Handle the relocations.
4775 (Target_arm::Scan::global): Likewise.
4776 (Target_arm::Relocate::relocate): Likewise.
4777 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4778
c9a2c125
DK
47792010-01-29 Doug Kwan <dougkwan@google.com>
4780
4781 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
4782 of relocation types as ld.
4783
1521477a
DK
47842010-01-29 Doug Kwan <dougkwan@google.com>
4785
4786 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
4787 to public.
4788 (Arm_relocate_functions::thumb_branch_common): Ditto.
4789 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
4790 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
4791 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
4792 Arm_relocate_functions::jump24): Remove.
4793 (Target_arm::Relocate::relocate): Adjust code to call
4794 Arm_relocation_functions::arm_branch_common and
4795 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 4796 wrappers. Merge switch-cases together to reduce source code size.
1521477a 4797
e7eca48c
DK
47982010-01-29 Doug Kwan <dougkwan@google.com>
4799
4800 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
4801 output_local_symbol_count_needs_update_.
4802 (Arm_relobj::output_local_symbol_count_needs_update,
4803 Arm_relobj::set_output_local_symbol_count_needs_update,
4804 Arm_relobj::update_output_local_symbol_count): New methods.
4805 (Arm_relobj::output_local_symbol_count_needs_update_): New data
4806 member.
4807 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
4808 of pointed function as in a R_ARM_PREL31 relocation.
4809 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
4810 for output local symbol count updating.
4811 (Target_arm::do_relax): Update output local symbol counts in objects
4812 if necessary.
4813 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
4814
02961d7e
ILT
48152010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4816
4817 * arm.cc: Added support for the ARM relocations:
4818 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
4819 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
4820 (Arm_relocate_functions::movw_rel_nc): Renamed (was
4821 movw_prel_nc).
4822 (Arm_relocate_functions::movw_rel): New method.
4823 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
4824 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
4825 thm_movw_prel_nc).
4826 (Arm_relocate_functions::thm_movw_rel): New method.
4827 (Arm_relocate_functions::thm_movt_rel): Renamed (was
4828 thm_movt_prel).
4829 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
4830 relocations.
4831 (Target_arm::Scan::global): Likewise.
4832 (Target_arm::Relocate::relocate): Likewise.
4833 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4834 Likewise.
4835
b10d2873
ILT
48362010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4837
4838 * arm.cc: Added support for ARM group relocations.
4839 (Target_arm::reloc_needs_sym_origin): New method.
4840 (Arm_relocate_functions::calc_grp_kn): New method.
4841 (Arm_relocate_functions::calc_grp_residual): New method.
4842 (Arm_relocate_functions::calc_grp_gn): New method.
4843 (Arm_relocate_functions::arm_grp_alu): New Method.
4844 (Arm_relocate_functions::arm_grp_ldr): New Method.
4845 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4846 (Arm_relocate_functions::arm_grp_ldc): New Method.
4847 (Target_arm::Scan::local): Handle the ARM group relocations.
4848 (Target_arm::Scan::global): Likewise.
4849 (Target_arm::Relocate::relocate): Likewise.
4850 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4851 Likewise.
4852
2b328d4e
DK
48532010-01-26 Doug Kwan <dougkwan@google.com>
4854
4855 * arm.cc (set): Include.
4856 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4857 pointer type.
4858 (Arm_output_section::Text_section_list): New type.
4859 (Arm_output_section::append_text_sections_to_list): New method.
4860 (Arm_output_section::fix_exidx_coverage): Ditto.
4861 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4862 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4863 Relobj::set_section_offset() instead of
4864 Sized_relobj::invalidate_section_offset().
4865 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4866 parameter for section headers. Ignore relocation sections for
4867 unallocated sections and EXIDX sections.
4868 (Target_arm::fix_exidx_coverage): New method.
4869 (Target_arm::output_section_address_less_than): New type.
4870 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4871 linked text section instead of the EXIDX section.
4872 (Arm_output_section::create_stub_group): Add an assertion to check
4873 that this is not an EXIDX output section.
4874 (Arm_output_section::append_text_sections_to_list): New method.
4875 (Arm_output_section::fix_exidx_coverage): Ditto.
4876 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4877 Arm_relobj::section_needs_reloc_stub_scanning.
4878 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4879 first pass.
4880 (Target_arm::fix_exidx_coverage): New method.
4881 * object.h (Relobj::set_output_section): New method.
4882 (Sized_relobj::invalidate_section_offset): Remove method.
4883 (Sized_relobj::do_invalidate_section_offset): Remove method.
4884 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4885
c7f3c371
DK
48862010-01-25 Doug Kwan <dougkwan@google.com>
4887
4888 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4889 Fix warning due to signed and unsigned comparison on a 32-bit host.
4890
8923b24c
DK
48912010-01-22 Doug Kwan <dougkwan@google.com>
4892
4893 * arm.cc (Target_arm::do_relax): Record an output section for section
4894 offset adjustment it contains any stub table that has changed.
4895 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4896 offsets in an output section if necessary.
4897 * output.cc (Output_section::Output_section): Initialize
4898 section_offsets_need_adjustments_.
4899 (Output_section::add_input_section_for_script): Renamed to
4900 Output_section::add_simple_input_section.
4901 (Output_section::save_states): Add a comment.
4902 (Output_section::discard_states): New method defintion.
4903 (Output_section::adjust_section_offsets): Same.
4904 * output.h (Output_section::add_input_section_for_script): Renamed to
4905 Output_section::add_simple_input_section.
4906 (Output_section::discard_states): New method declaration.
4907 (Output_section::adjust_section_offsets): Same.
4908 (Output_section::section_offsets_need_adjustment,
4909 Output_section::set_section_offsets_need_adjustment): New method
4910 definitions.
4911 (Output_section::section_offsets_need_adjustment_): New data member.
4912 * script-sections.cc
4913 (Output_section_element_input::set_section_address): Adjust code for
4914 renaming of Output_section::add_input_section_for_script.
4915 (Orphan_output_section::set_section_address): Same.
4916
9b2fd367
DK
49172010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4918
4919 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4920 Fix_v4bx enum values .
4921 * gold/options.h (General_options): New option definitions.
4922 (General_options::fix_v4bx): New method.
4923 (General_options::Fix_v4bx): New enum.
4924 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4925 (General_options::parse_fix_v4bx_interworking): New method.
4926
80d0d023
DK
49272010-01-22 Doug Kwan <dougkwan@google.com>
4928
4929 * arm.cc (Arm_exidx_fixup): New class.
4930
af2cdeae
DK
49312010-01-21 Doug Kwan <dougkwan@google.com>
4932
4933 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4934 classes.
4935 (Arm_exidx_section_offset_map): New type.
4936
993d07c1
DK
49372010-01-21 Doug Kwan <dougkwan@google.com>
4938
4939 * arm.cc (Arm_exidx_input_section): New class.
4940 (Arm_relobj::exidx_input_section_by_link,
4941 Arm_relobj::exidx_input_section_by_shndx,
4942 Arm_relobj::make_exidx_input_section): New methods.
4943 (read_arm_attributes_section): Remove.
4944 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4945 information about them.
4946 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4947 to here.
4948
5ac169d4
DK
49492010-01-20 Doug Kwan <dougkwan@google.com>
4950
4951 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4952 Input_section_specifier to Section_id.
4953 (Target_arm::new_arm_input_section: Adjust code for change of key
4954 type.
4955 (Target_arm::find_arm_input_section): Ditto.
4956 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4957 (Section_id): Remove.
4958 (Garbage_collection::Section_id_hash): Remove.
4959 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4960 (Section_id): Remove.
4961 (Icf::Section_id_hash): Remove.
4962 * object.h (Section_id, Const_section_id, Section_id_hash,
4963 Const_section_id_hash): New type definitions.
4964 * output.cc (Output_section::add_relaxed_input_section): Change to
4965 use Const_section_id instead of Input_section_specifier as key type.
4966 (Output_section::add_merge_input_section): Ditto.
4967 (Output_section::build_relaxation_map): Change to use Section_id
4968 instead of Input_section_specifier as key type.
4969 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4970 Ditto.
4971 (Output_section::convert_input_sections_to_relaxed_sections): Change
4972 to use Const_section_id instead of Input_section_specifier as key type.
4973 (Output_section::find_merge_section): Ditto.
4974 (Output_section::find_relaxed_input_section): Ditto.
4975 * output.h (Input_section_specifier): Remove class.
4976 (Output_section::Output_section_data_by_input_section_map): Change
4977 key type to Const_section_id.
4978 (Output_section::Output_relaxed_input_section_by_input_section_map):
4979 Ditto.
4980 (Output_section::Relaxation_map): Change key type to Section_id.
4981
a2162063
ILT
49822010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4983
4984 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4985 (class Arm_v4bx_stub): New class.
4986 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4987 (Stub_factory::make_arm_v4bx_stub): New method.
4988 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4989 (Stub_table::empty): Handle v4bx stubs.
4990 (Stub_table::add_arm_v4bx_stub): New method.
4991 (Stub_table::find_arm_v4bx_stub): New method.
4992 (Arm_relocate_functions::v4bx): New method.
4993 (Target_arm::fix_v4bx): New method.
4994 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4995 (Stub_table::relocate_stubs): Likewise.
4996 (Stub_table::do_write): Likewise.
4997 (Stub_table::update_data_size_and_addralign): Likewise.
4998 (Stub_table::finalize_stubs): Likewise.
4999 (Target_arm::Scan::local): Likewise.
5000 (Target_arm::Scan::global): Likewise.
5001 (Target_arm::do_finalize_sections): Likewise.
5002 (Target_arm::Relocate::relocate): Likewise.
5003 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5004 Likewise.
5005 (Target_arm::scan_reloc_for_stub): Likewise.
5006 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5007
5696ab0b
ILT
50082010-01-19 Ian Lance Taylor <iant@google.com>
5009
5010 * output.cc (Output_section_headers::do_sized_write): Write large
5011 segment count to sh_info field.
5012 (Output_file_header::do_sized_write): For large segment count,
5013 write PN_XNUM to e_phnum field.
5014
800d0f56
ILT
50152010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5016
5017 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5018 (Arm_relocate_functions::thm_jump8): New function.
5019 (Arm_relocate_functions::thm_jump11): New function.
5020 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5021 R_ARM_THM_JUMP11.
5022 (Target_arm::Scan::global): Likewise.
5023 (Target_arm::Relocate::relocate): Likewise.
5024 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5025 Likewise.
5026
41263c05
DK
50272010-01-14 Doug Kwan <dougkwan@google.com>
5028
5029 * arm.cc (map, utility): Include headers.
5030 (Target_arm::apply_cortex_a8_workaround): New method.
5031 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5032 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5033 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5034 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5035 the --[no-]fix-cortex-a8 command line options.
5036 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5037 (Target_arm::relocate_stub): Use addend in instruction template.
5038 * options.h (DEFINE_bool): Set the user-set flag.
5039 (General_options): Add --[no-]-fix-cortex options.
5040 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 5041 : Update fast look-up map after conversion.
41263c05 5042
459e9b03
ST
50432010-01-14 Sriraman Tallam <tmsriram@google.com>
5044
5045 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5046 in the first pass of do_layout.
5047
b521dfe4
DK
50482010-01-13 Doug Kwan <dougkwan@google.com>
5049
5050 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5051 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5052 apparent compiler problem of not folding static constant integral
5053 data members of elfcpp::Elf_sizes<32>.
5054
44272192
DK
50552010-01-13 Doug Kwan <dougkwan@google.com>
5056
5057 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5058 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5059 Arm_relobj::scan_section_for_cortex_a8_erratum,
5060 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5061 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5062 sections to scan for relocation stubs into a new method
5063 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5064 relocation and Cortex-A8 stub scanning.
5065 (Target_arm::do_relax): Force stubs to be after stubbed sections
5066 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 5067 the beginning of a new relaxation pass. Update a comment.
44272192
DK
5068 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5069
44b71ece
ILT
50702010-01-12 Ian Lance Taylor <iant@google.com>
5071
5072 * target-reloc.h (visibility_error): New inline function.
5073 (relocate_section): Call visibility_error.
5074 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5075 (MOSTLYCLEANFILES): Likewise.
5076 (protected_4_pic.o, protected_3.err): New targets.
5077 * testsuite/protected_4.cc: New file.
5078
a120bc7f
DK
50792010-01-12 Doug Kwan <dougkwan@google.com>
5080
5081 * arm.cc (Cortex_a8_reloc): New class.
5082 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5083 and cortex_a8_relocs_info_.
5084 (Target_arm::fix_cortex_a8): New method definition.
5085 (Target_arm::Cortex_a8_relocs_info): New type.
5086 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5087 New data member declarations.
5088 (Target_arm::scan_reloc_for_stub): Record information about
5089 relocations for THUMB branches that might be exempted from the
5090 Cortex-A8 workaround.
5091 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5092 at the beginning of a relaxation pass.
5093
20138696
DK
50942010-01-12 Doug Kwan <dougkwan@google.com>
5095
5096 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5097 (Arm_relobj::Mapping_symbol_position,
5098 Arm_reloj::Mapping_symbol_position_less,
5099 Arm_relobj::Mapping_symbols_info): New types.
5100 (Target_arm::is_mapping_symbol_name): New method definition.
5101 (Arm_relobj::do_count_local_symbols): Save information about mapping
5102 symbols.
5103
089d69dc
DK
51042010-01-11 Doug Kwan <dougkwan@google.com>
5105
5106 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5107 Arm_relocate_functions::thumb32_branch_upper,
5108 Arm_relocate_functions::thumb32_branch_lower,
5109 Arm_relocate_functions::thumb32_cond_branch_offset,
5110 Arm_relocate_functions::thumb32_cond_branch_upper,
5111 Arm_relocate_functions::thumb32_cond_branch_lower,
5112 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5113 branch offset encoding.
5114 (Arm_relocate_functions::thumb_branch_common): Use new branch
5115 offset encoding methods to avoid code duplication.
5116 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5117 (Stub_addend_reader::operator()): Use new branch encoding method
5118 to avoid code duplication.
5119
99e5bff2
DK
51202010-01-11 Doug Kwan <dougkwan@google.com>
5121
5122 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5123 (Target_arm::do_finalize_sections): Define special EXIDX section
5124 symbols only if referenced.
5125 * gc.h (Garbage_collection::add_reference): New method.
5126 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5127 code duplication.
5128
98e090bd
ILT
51292010-01-11 Ian Lance Taylor <iant@google.com>
5130
d0a91bd8
ILT
5131 * script.cc (Version_script_info::build_expression_list_lookup):
5132 Change complaing about duplicate wildcard match from error to
5133 warning.
5134
98e090bd
ILT
5135 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5136 of 2009-12-30.
5137 (Version_script_info::Version_script_info): Initialize globs_,
5138 default_version_, default_is_global_, and exact_. Don't
5139 initialize globals_ or locals_.
5140 (Version_script_info::build_lookup_tables): Build local symbols
5141 first.
5142 (Version_script_info::unquote): New function.
5143 (Version_script_info::add_exact_match): New function.
5144 (Version_script_info::build_expression_list_lookup): Remove lookup
5145 parameter. Add is_global parameter. Change all callers. Handle
5146 wildcard pattern specially. Unquote pattern. Call
5147 add_exact_match.
5148 (Version_script_info::get_name_to_match): New function.
5149 (Version_script_info::get_symbol_version): New function.
5150 (Version_script_info::get_symbol_version_helper): Remove.
5151 (Version_script_info::check_unmatched_names): Call unquote.
5152 * script.h (class Version_script_info): Change get_symbol_version
5153 to be non-inline and add is_global parameter; change all callers.
5154 Rewrite symbol_is_local. Update declarations. Define struct
5155 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5156 Remove globals_ and locals_ members. Add exact_, globs_,
5157 default_version_, is_global_.
5158 (Version_script_info::Glob): Remove pattern, add expression and
5159 is_global. Update constructor. Change all callers.
5160 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5161 default version.
5162 (Versions::symbol_section_contents): If a symbol is undefined, or
5163 defined in a dynamic object, set the version index to
5164 VER_NDX_LOCAL.
5165 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5166 symbol_is_local.
5167 (Symbol_table::add_from_pluginobj): Likewise.
5168 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5169
d56962d3
DK
51702010-01-11 Doug Kwan <dougkwan@google.com>
5171
5172 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5173 (incremental_dump_LDADD): Add linking option for libintl.
5174 * Makefile.in: Regenerate.
5175
94e6ee91
L
51762010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5177
5178 PR gold/11144
5179 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5180 instead of -Ds.
5181 * testsuite/Makefile.in: Regenerated.
5182
e96c574b
DK
51832010-01-10 Doug Kwan <dougkwan@google.com>
5184
5185 * options.h (DEFINE_var): Use parentheses around argument varname__
5186 in macro body to avoid any unintended subsequent substitutions.
5187
7198066b
ILT
51882010-01-10 Ian Lance Taylor <iant@google.com>
5189
ba4d53bf
ILT
5190 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5191 candidates before doing symbol resolution.
5192
7198066b
ILT
5193 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5194 ODR candidates if only one is weak.
5195
a2beed37
ILT
51962010-01-08 Ian Lance Taylor <iant@google.com>
5197
5198 * script.cc (Version_script_info::build_expression_list_lookup):
5199 Don't warn about ambiguous version, just record the ambiguity.
5200 (Version_script_info::get_symbol_version_helper): Give error if
5201 version is ambiguous.
5202
2fb7225c
DK
52032010-01-08 Doug Kwan <dougkwan@google.com>
5204
5205 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5206 prev_data_size_ and prev_addralign_. Remove initializer for
5207 deleted data member has_been_changed_.
5208 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5209 to determine if the table is empty.
5210 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5211 Remove.
5212 (Stub_table::add_reloc_stub): Define method in class definition
5213 instead of just declaring it there.
5214 (Stub_table::add_cortex_a8_stub): New method definition.
5215 (Stub_table::update_data_size_and_addralign): Ditto.
5216 (Stub_table::finalize_stubs): Ditto.
5217 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5218 (Stub_table::do_addralign_): Return address alignment in the
5219 (Stub_table::do_reset_address_and_file_offset): Define method in
5220 class definition instead of declaring it there. Set current data
5221 size to be the data size of the previous pass.
5222 (Stub_table::set_final_data_size): Use current data size as the
5223 final data size.
5224 (Stub_table::relocate_stub): Change parameter type of stub from
5225 Reloc_stub pointer to Stub pointer.
5226 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5227 (Stub_table::Cortex_a8_stub_list): New typedef.
5228 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5229 Stub_table::prev_addralign_): New data member.
5230 (Arm_relobj::Arm_relobj): Initialize data member
5231 section_has_cortex_a8_workaround_.
5232 (Arm_relobj::section_has_cortex_a8_workaround,
5233 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5234 definitions.
5235 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5236 declarations.
5237 (Target_arm::relocate_stub): Change parameter type of stub from
5238 Reloc_stub pointer to Stub pointer.
5239 (Insn_template::size, Insn_template::alignment): Handle
5240 THUMB16_SPECIAL_TYPE.
5241 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5242 Stub_table::update_data_size_and_addralign,
5243 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5244 definitions.
5245 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5246 (Stub_table::do_write): Ditto.
5247 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5248
880cd20d
ILT
52492010-01-08 Ian Lance Taylor <iant@google.com>
5250
5251 PR 11108
5252 * symtab.h (class Symbol): Remove fields is_target_special_ and
5253 has_plt_offset_. Add field is_defined_in_discarded_section_.
5254 (Symbol::is_defined_in_discarded_section): New function.
5255 (Symbol::set_is_defined_in_discarded_section): New function.
5256 (Symbol::has_plt_offset): Rewrite.
5257 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5258 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5259 Don't initialize is_target_special_ or has_plt_offset_.
5260 Initialize is_defined_in_discarded_section_.
5261 (Symbol_table::add_from_relobj): If appropriate, set
5262 is_defined_in_discarded_section.
5263 * resolve.cc (Symbol::override_base_with_special): Don't test
5264 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5265 * target-reloc.h (relocate_section): Do special handling for
5266 symbols defined in discarded sections for global symbols as well
5267 as local symbols.
5268
2703e3eb
ILT
52692010-01-08 Ian Lance Taylor <iant@google.com>
5270
5271 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
5272 the SHT_SYMTAB case.
5273
339d40a3
ILT
52742010-01-08 Ian Lance Taylor <iant@google.com>
5275
5276 * object.cc (Sized_relobj::do_layout): Don't get confused if
5277 layout_eh_frame returns NULL.
5278
abecea76
ILT
52792010-01-08 Ian Lance Taylor <iant@google.com>
5280
5281 PR 11084
5282 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
5283 dynamic symbol table, use the normal symbol table.
5284 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5285 symbol table.
5286
6b7dd3f3
ILT
52872010-01-08 Ian Lance Taylor <iant@google.com>
5288
5289 PR 11072
5290 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5291 sections.
5292
36c50e63
L
52932010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5294
5295 * version.cc (print_version): Change to "Copyright 2010".
5296
e291e7b9
ILT
52972010-01-08 Ian Lance Taylor <iant@google.com>
5298
5299 PR 10287
5300 PR 11063
5301 * i386.cc (class Target_i386): Change return type of plt_section
5302 to be non-const.
5303 (class Output_data_plt_i386): Add tls_desc_rel_ field.
5304 (Output_data_plt_i386::Output_data_plt_i386): Initialize
5305 tls_desc_rel_ field.
5306 (Output_data_plt_i386::rel_tls_desc): New function.
5307 (Target_i386::rel_tls_desc_section): New function.
5308 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
5309 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
5310 R_386_TLS_DESC reloc in rel_tls_desc_section.
5311 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
5312 Define struct Tlsdesc_info.
5313 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
5314 (Target_x86_64::do_reloc_symbol_index): New function.
5315 (Target_x86_64::add_tlsdesc_info): New function.
5316 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
5317 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
5318 tlsdesc_rel_ field.
5319 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
5320 all callers.
5321 (Output_data_plt_x86_64::rela_tlsdesc): New function.
5322 (Target_x86_64::rela_tlsdesc_section): New function.
5323 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
5324 handling.
5325 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
5326 (Target_x86_64::do_reloc_addend): New function.
5327 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
5328 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
5329 declarations. Define TARGET_CODE. Add arg field to u1_ union.
5330 (Output_reloc::type): New function.
5331 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
5332 (Output_reloc::is_target_specific): New function.
5333 (Output_reloc::target_arg): New function.
5334 (class Output_reloc) [SHT_RELA]: Add four new constructors for
5335 absolute relocs and target specific relocs.
5336 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
5337 add_target_specific.
5338 (class Output_data_reloc) [SHT_RELA]: Likewise.
5339 * output.cc (Output_reloc::Output_reloc): Add four new versions
5340 for absolute relocs and target specific relocs.
5341 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
5342 (Output_reloc::get_symbol_index): Likewise.
5343 (Output_reloc::local_section_offset): Check that local_sym_index_
5344 is not TARGET_CODE or 0.
5345 (Output_reloc::symbol_value): Likewise.
5346 (Output_reloc::write) [SHT_RELA]: Call target for target specific
5347 reloc.
5348 * target.h (class Target): Add reloc_symbol_index and reloc_addend
5349 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
5350 functions.
5351 * layout.cc (add_target_dynamic_tags): Use output section for
5352 DT_PLTRELSZ and DT_JMPREL.
5353
3a44184e
ILT
53542010-01-07 Ian Lance Taylor <iant@google.com>
5355
5356 PR 11061
5357 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
5358 function.
5359 (class Output_data_reloc_generic): Define.
5360 (class Output_data_reloc_base): Change base class to
5361 Output_data_reloc_generic. Change add() method to call
5362 bump_relative_reloc_count for a relative reloc. Remove
5363 sort_relocs_ field.
5364 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
5365 to sort_relocs().
5366 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
5367 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
5368 appropriate.
5369 * layout.h (class Layout): Update declaration.
5370
ea715a34
ILT
53712010-01-07 Ian Lance Taylor <iant@google.com>
5372
5373 * output.h (class Output_data): Add const version of
5374 output_section and do_output_section.
5375 (class Output_section_data): Add const version of
5376 do_output_section.
5377 (class Output_section): Likewise.
5378 * layout.cc (Layout::add_target_dynamic_tags): New function.
5379 * layout.h (class Layout): Update declarations.
5380 * arm.cc (Target_arm::do_finalize_sections): Use
5381 add_target_dynamic_tags.
5382 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5383 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5384 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5385 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5386
659948a4
ILT
53872010-01-07 Ian Lance Taylor <iant@google.com>
5388
5389 PR 11042
5390 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
5391 object as needed.
5392
9d3b86f6
ILT
53932010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
5394 Ian Lance Taylor <iant@google.com>
5395
5396 PR 11019
5397 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
5398 Xindex::read_symtab_xindex.
5399
bb0d3eb0
DK
54002010-01-07 Doug Kwan <dougkwan@google.com>
5401
5402 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
5403 (Insn_template::thumb16_bcond_insn): New method declaration.
5404 (Insn_template): Fix spelling.
5405 (Stub::thumb16_special): New method declaration.
5406 (Stub::do_write): Define virtual method which was previously pure
5407 virtual.
5408 (Stub::do_thumb16_special): New method declaration.
5409 (Stub::do_fixed_endian_write): New template member.
5410 (Reloc_stub::do_write): Remove.
5411 (Reloc_stub::do_fixed_endian_write): Remove.
5412 (Cortex_a8_stub): New class definition.
5413 (Stub_factory::make_cortex_a8_stub): New method definition.
5414 (Stub_factory::Stub_factory): Add missing static storage class
5415 qualifier for elf32_arm_stub_a8_veneer_blx.
5416
ffeef7df
ILT
54172010-01-07 Ian Lance Taylor <iant@google.com>
5418
dc3f80fe
ILT
5419 PR 10980
5420 * options.h (class General_options): Add --warn-unresolved-symbols
5421 and --error-unresolved-symbols.
5422 * errors.cc (Errors::undefined_symbol): Implement
5423 --warn-unresolved-symbols.
5424
ffeef7df
ILT
5425 * options.h (class General_options): Add -z text and -z textoff.
5426 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
5427
f1ec9ded
ST
54282010-01-06 Sriraman Tallam <tmsriram@google.com>
5429
5430 * gc.h (Garbage_collection::Cident_section_map): New typedef.
5431 (Garbage_collection::cident_sections): New function.
5432 (Garbage_collection::add_cident_section): New function.
5433 (Garbage_collection::cident_sections_): New member.
5434 (gc_process_relocs): Add references to sections whose names are C
5435 identifiers.
5436 * gold.h (cident_section_start_prefix): New constant.
5437 (cident_section_stop_prefix): New constant.
5438 (is_cident): New function.
5439 * layout.cc (Layout::define_section_symbols): Replace string constants
5440 with the newly defined constants.
5441 * object.cc (Sized_relobj::do_layout): Track sections whose names are
5442 C identifiers.
5443 * testsuite/Makefile.am: Add gc_orphan_section_test.
5444 * testsuite/Makefile.in: Regenerate.
5445 * testsuite/gc_orphan_section_test.cc: New file.
5446 * testsuite/gc_orphan_section_test.sh: New file.
5447
6eda8c29
ILT
54482010-01-06 Ian Lance Taylor <iant@google.com>
5449
b9674e17
ILT
5450 PR 10980
5451 * options.h (class General_options): Add --warn-shared-textrel.
5452 * layout.cc (Layout::finish_dynamic_section): Implement
5453 --warn-shared-textrel.
5454
6eda8c29
ILT
5455 PR 10980
5456 * options.h (class General_options): Add --warn-multiple-gp.
5457
32dcd44e
ILT
54582010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5459
5460 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
5461 $(THREADSLIB) and $(LIBDL).
5462 * Makefile.in: Rebuild.
5463
a192ba05
ILT
54642010-01-06 Ian Lance Taylor <iant@google.com>
5465
5466 PR 10980
5467 * options.cc (General_options::parse_section_start): New function.
5468 (General_options::section_start): New function.
5469 (General_options::General_options): Initialize all members.
5470 * options.h: Include <map>
5471 (class General_options): Add --section-start. Add section_starts_
5472 member.
5473 * layout.cc (Layout::attach_allocated_section_to_segment): If
5474 --section-start was used, set the address of the segment. Remove
5475 local sort_sections.
5476 (Layout::relaxation_loop_body): If the address of the load segment
5477 has been set by --section-start, don't use it.
5478 * output.h (Output_segment::update_flags_for_output_section): New
5479 function.
5480 * output.cc (Output_segment::add_output_section): Call
5481 update_flags_for_output_section.
5482
dde3f402
ILT
54832010-01-05 Ian Lance Taylor <iant@google.com>
5484
62dfdd4d
ILT
5485 PR 10980
5486 * options.h (class General_options): Add --undefined-version.
5487 * script.cc (struct Version_expression): Add was_matched_by_symbol
5488 field.
5489 (Version_script_info::matched_symbol): New function.
5490 (Version_script_info::get_symbol_version_helper): Call
5491 matched_symbol.
5492 (Version_script_info::check_unmatched_names): New function.
5493 * script.h (class Version_script_info): Update declarations.
5494 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
5495
9c4ae156
ILT
5496 * options.h (class General_options): Use DEFINE_bool_alias for
5497 allow_multiple_definition.
5498 * resolve.cc (Symbol_table::should_override): Don't test
5499 allow_multiple_definition.
5500
dde3f402
ILT
5501 PR 10980
5502 * options.h (class General_options): Add --cref.
5503 * main.cc (main): Print cref table if --cref. Don't close mapfile
5504 until after printing cref table.
5505 * cref.cc: Include "symtab.h".
5506 (class Cref_inputs): Define Cref_table_compare and Cref_table.
5507 (Cref_table_compare::operator()): New function.
5508 (Cref_inputs::gather_cref): New function.
5509 (filecol): New static const.
5510 (Cref_inputs::print_cref): New function.
5511 (Cref::print_cref): New function.
5512 * cref.h: Include <cstdio>.
5513 (class Cref): Update declarations.
5514 * mapfile.h (Mapfile::file): New function.
5515 * object.h (class Object): Define Symbols. Declare virtual
5516 do_get_global_symbols.
5517 (Object::get_global_symbols): New function.
5518 * object.cc (Input_objects::add_object): Pass object to cref_ if
5519 --cref.
5520 (Input_objects::archive_start): Likewise.
5521 (Input_objects::archive_stop): Likewise.
5522 (Input_objects::print_cref): New function.
5523 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5524 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5525 --cref.
5526 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5527 function.
5528 * plugin.h (class Sized_pluginobj): Update declarations.
5529
8781f709
ILT
55302010-01-05 Ian Lance Taylor <iant@google.com>
5531
5532 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5533 to is_default_version. Rename insdef to insdefault.
5534 (Symbol_table::add_from_relobj): Rename def to is_default_version
5535 and local to is_forced_local.
5536 (Symbol_table::add_from_pluginobj): Likewise.
5537 (Symbol_table::add_from_dynobj): Likewise.
5538 (Symbol_table::define_special_symbol): Rename insdef to
5539 insdefault.
5540
fe35d28d
ILT
55412010-01-04 Ian Lance Taylor <iant@google.com>
5542
30bc8c46
ILT
5543 PR 10980
5544 * options.h (class General_options): Add
5545 --allow-multiple-definition and -z muldefs.
5546 * resolve.cc (Symbol_table::should_override): Don't warn about a
5547 multiple symbol definition if --allow-multiple-definition or -z
5548 muldefs.
5549
7eaea549
ILT
5550 PR 10980
5551 * options.h (class General_options): Add --add-needed and
5552 --copy-dt-needed-entries. Tweak --as-needed help entry.
5553 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5554 error if --copy-dt-needed-entries aka --add-needed is used and
5555 would cause a change in behaviour.
5556
fe35d28d
ILT
5557 PR 10980
5558 * options.h (class General_options): Add -G as a short version of
5559 --shared. Add no-op options -assert, -g, and -i.
5560
55a2bb35
ST
55612010-01-04 Sriraman Tallam <tmsriram@google.com>
5562
5563 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5564 check for .text or .gnu.linkonce.t sections.
5565 * icf.cc (Icf::find_identical_sections): Ditto.
5566 Change the detection for mangled function name within the section
5567 name.
5568 * icf.h (is_section_foldable_candidate): New function.
5569
719328e1
ILT
55702009-12-30 Ian Lance Taylor <iant@google.com>
5571
5572 PR 10980
5573 * options.h (class General_options): Permit two dashes with
5574 --retain-symbols-file.
5575
d7bb5745
ILT
55762009-12-30 Ian Lance Taylor <iant@google.com>
5577
403a15dd
ILT
5578 PR 10979
5579 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5580 don't put the file header and segment headers in the text
5581 segment.
5582
eda294df
ILT
5583 PR 10979
5584 * common.cc (Sort_commons::operator()): Stabilize sort when both
5585 entries are NULL.
5586 (Symbol_table::do_allocate_commons_list): When allocating common
5587 symbols, skip a symbol which is no longer common.
5588 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5589 an object before checking its type.
5590 * testsuite/common_test_2.c: New file.
5591 * testsuite/common_test_3.c: New file.
5592 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5593 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5594 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5595 (common_test_2_pic.o, common_test_2.so): New targets.
5596 (common_test_3_pic.o, common_test_3.so): New targets.
5597 * testsuite/Makefile.in: Rebuild.
5598
d7bb5745
ILT
5599 PR 10979
5600 * script.cc (read_input_script): If we see a new SECTIONS clause,
5601 and we have added an input section, give an error.
5602 * layout.h (class Layout): Add have_added_input_section function.
5603 Add have_added_input_section_ field.
5604 * layout.cc (Layout::Layout): Initialize
5605 have_added_input_section_.
5606 (Layout::layout): Set have_added_input_section_.
5607 (Layout::layout_eh_frame): Likewise.
5608
fc59c572
ILT
56092009-12-30 Ian Lance Taylor <iant@google.com>
5610
5611 PR 10931
5612 * options.h (class General_options): Add --sort-common option.
5613 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
5614 * common.cc (Sort_common): Add sort_order parameter to
5615 constructor. Add sort_order_ field.
5616 (Sort_commons::operator): Check sort_order_.
5617 (Symbol_table::allocate_commons): Determine the sort order.
5618 (Symbol_table::do_allocate_commons): Add sort_order parameter.
5619 Change all callers.
5620 (Symbol_table::do_allocate_commons_list): Likewise.
5621
1c74fab0
ILT
56222009-12-30 Ian Lance Taylor <iant@google.com>
5623
5624 PR 10916
5625 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
5626 symbols from this object, don't change the visibility of an
5627 undefined symbol.
5628 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
5629
6affe781
ILT
56302009-12-30 Ian Lance Taylor <iant@google.com>
5631
5632 PR 10861
5633 * script.h (class Version_script_info): Define Language enum.
5634 Update declarations. Define Glob, Exact, and Lookup types. Add
5635 new fields globals_, locals_, and is_finalized_.
5636 * script.cc: Various formatting fixes.
5637 (class Parser_closure): Change language_stack_ from a vector of
5638 std::string to one of Version_script_info::Language. Adjust all
5639 uses accordingly.
5640 (class Lazy_demangler): Remove.
5641 (struct Version_expression): Change language from std::string to
5642 Version_script_info::Language.
5643 (Version_script_info::Version_script_info): New function.
5644 (Version_script_info::~Version_script_info): Don't call clear.
5645 (Version_script_info::finalize): New function.
5646 (Version_script_info::build_lookup_tables): New function.
5647 (Version_script_info::build_expression_list_lookup): New
5648 function.
5649 (Version_script_info::get_symbol_version_helper): Rewrite to use
5650 lookup tables.
5651 (Version_script_info::print_expression_list): Adjust to use
5652 Version_script_info::Language.
5653 (script_push_lex_into_version_mode): Check that the version script
5654 has not been finalized.
5655 (version_script_push_lang): Change language string to
5656 Version_script_info::Language.
5657 * options.cc (Command_line::version_script): New function.
5658 * options.h (class General_options): Add finalize_dynamic_list
5659 function. Change version_script from declaration to definition.
5660 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
5661 * testsuite/version_script.map: Remove duplicate def of foo.
5662 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
5663 version_script.map.
5664 * testsuite/Makefile.in: Rebuild.
5665
818bf354
ILT
56662009-12-30 Ian Lance Taylor <iant@google.com>
5667
5668 PR 10843
5669 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
5670 if the input symbol index is 0, make the output symbol index 0.
5671
ebcc8304
ILT
56722009-12-30 Ian Lance Taylor <iant@google.com>
5673
5674 PR 10670
5675 * options.h (class General_options): Add -x/--discard-all.
5676 * object.cc (Sized_relobj::do_count_local_symbols): Handle
5677 --discard-all. If the local symbol needs a dynamic entry, check
5678 that before handling --discard-locals.
5679
176fe33f
ILT
56802009-12-30 Ian Lance Taylor <iant@google.com>
5681
bb321bb1
ILT
5682 PR 10450
5683 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
5684 flags to PF_R.
5685 (Output_segment::add_output_section): Don't change the flags if
5686 the type is PT_TLS.
5687
176fe33f
ILT
5688 PR 10450
5689 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
5690 GNU hash table if they need a dynamic value. Otherwise, don't add
5691 them if they are defined in a dynamic object or are forced local.
5692
e8cd95c7
ILT
56932009-12-29 Ian Lance Taylor <iant@google.com>
5694
1b81fb71
ILT
5695 PR 10450
5696 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
5697 .gnu.hash table for a 32-bit target.
5698
8d6d383d
ILT
5699 PR 10450
5700 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
5701 regular and a dynamic object only needs a dynamic symbol table
5702 entry if it is externally visible.
5703
e785ec03
ILT
5704 PR 10450
5705 * i386.cc (class Target_i386): Initialize global_offset_table_ in
5706 constructor. Add global_offset_table_ field.
5707 (Target_i386::got_section): Set global_offset_table_.
5708 (Target_i386::do_finalize_sections): Set global_offset_table_
5709 size.
5710 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
5711 in constructor. Add global_offset_table_ field.
5712 (Target_x86_64::got_section): Set global_offset_table_.
5713 (Target_x86_64::do_finalize_sections): Set global_offset_table_
5714 size.
5715
1a2dff53
ILT
5716 * layout.cc (Layout::Layout): Initialize increase_relro_.
5717 (Layout::get_output_section): Add is_relro, is_last_relro, and
5718 is_first_non_relro parameters. Change all callers.
5719 (Layout::choose_output_section): Likewise.
5720 (Layout::add_output_section_data): Likewise.
5721 (Layout::make_output_section): Likewise.
5722 (Layout::set_segment_offsets): Clear increase_relro when using a
5723 linker script.
5724 * layout.h (class Layout): Add increase_relro method. Add
5725 increase_relro_ field. Update declarations.
5726 * output.cc (Output_section::Output_section): Initialize
5727 is_last_relro_ and is_first_non_relro_.
5728 (Output_segment::add_output_section): Group relro sections is
5729 do_sort is true. Handle is_last_relro and is_first_non_relro.
5730 (Output_segment::maximum_alignment): Remove relro handling.
5731 (Output_segment::set_section_addresses): Add increase_relro
5732 parameter. Change all callers. Add initial alignment to align
5733 relro sections on separate page. Remove old relro handling.
5734 (Output_segment::set_section_list_addresses): Remove in_relro
5735 parameter. Change all callers.
5736 (Output_segment::set_offset): Add increase parameter. Change all
5737 callers. Remove old relro handling.
5738 * output.h (class Output_section): Add new methods: is_last_relro,
5739 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
5740 Add is_last_relro_ and is_first_non_relro_ fields.
5741 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
5742 Create separate .got.plt section. Call increase_relro.
5743 * x86_64.cc (Target_x86_64::got_section): Likewise.
5744 * testsuite/relro_script_test.t: Add .got.plt.
5745
f0ba79e2
ILT
5746 PR 10450
5747 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
5748 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
5749 (Layout::finalize): Call set_dynamic_symbol_size.
5750 (Layout::set_dynamic_symbol_size): New function.
5751 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
5752 set_dynamic_symbol_size.
5753
e8cd95c7
ILT
5754 PR 10450
5755 * output.h (class Output_section): Add is_entsize_zero_ field.
5756 * output.cc (Output_section::Output_section): Initialize
5757 is_entsize_zero_.
5758 (Output_section::set_entsize): If two different entsizes are
5759 requested, force it to zero.
5760 (Output_section::add_input_section): Set flags for .debug_str
5761 before updating section flags. Set entsize.
5762 (Output_section::update_flags_for_input_section): Set SHF_MERGE
5763 and SHF_STRING if all input sections have those flags.
5764
3e1b9a8a
RÁE
57652009-12-29 Rafael Espindola <espindola@google.com>
5766
5767 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
5768 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
5769 reporting.
3e1b9a8a 5770
3dcad376
ST
57712009-12-29 Sriraman Tallam <tmsriram@google.com>
5772
5773 * options.cc (General_options::parse_version): Allow -v to exit
5774 without an error if there is nothing to link.
5775
084e2665
ILT
57762009-12-29 Ian Lance Taylor <iant@google.com>
5777
5778 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
5779 using a version of gcc before 4.1.
5780 * configure: Rebuild.
5781
250acde3
CD
57822009-12-28 Chris Demetriou <cgd@google.com>
5783
5784 * attributes.cc (Output_attributes_section_data::do_write): Use
5785 std::vector::front rather than std::vector::data.
5786
99fff23b
ILT
57872009-12-28 Ian Lance Taylor <iant@google.com>
5788
5789 * symtab.h (class Symbol_table): Add enum Defined.
5790 * resolve.cc (Symbol_table::should_override): Add defined
5791 parameter. Change all callers. Test whether object is NULL
5792 before calling a method on it.
5793 (Symbol_table::report_resolve_problem): Add defined parameter.
5794 Change all callers.
5795 (Symbol_table::should_override_with_special): Likewise.
5796 * symtab.cc (Symbol_table::define_in_output_data): Add defined
5797 parameter. Change all callers.
5798 (Symbol_table::do_define_in_output_data): Likewise.
5799 (Symbol_table::define_in_output_segment): Likewise.
5800 (Symbol_table::do_define_in_output_segment): Likewise.
5801 (Symbol_table::define_as_constant): Likewise.
5802 (Symbol_table::do_define_as_constant): Likewise.
5803 * script.h (class Symbol_assignment): Add is_defsym parameter to
5804 constructor; change all callers.
5805 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
5806 parameter. Change all callers. Add is_defsym_ field.
5807 (class Parser_closure): Add parsing_defsym parameter to
5808 constructor; change all callers. Add parsing_defsym accessor
5809 function. Add parsing_defsym_ field.
5810
556bd683
ILT
58112009-12-28 Ian Lance Taylor <iant@google.com>
5812
5813 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 5814 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 5815
1782c879
ILT
58162009-12-23 Ian Lance Taylor <iant@google.com>
5817
5818 * i386.cc (Target_i386::do_calls_non_split): Recognize
5819 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
5820 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
5821 -fsplit-stack prologue when using %r11.
1782c879 5822
329ca2b1
ST
58232009-12-21 Sriraman Tallam <tmsriram@google.com>
5824
5825 * options.cc (General_options::parse_version): Make -v continue and do
5826 the link like GNU ld does.
5827
d675ff46
RÁE
58282009-12-17 Rafael Avila de Espindola <espindola@google.com>
5829
5830 * Makefile.am (CCFILES): Add timer.cc.
5831 (HFILES): Add timer.h.
5832 * configure.ac: Check for sysconf and times.
5833 * main.cc: include timer.h.
5834 (main): Use Timer instead of get_run_time.
5835 * timer.cc: New.
5836 * timer.h: New.
5837 * workqueue.cc: include timer.h.
5838 (Workqueue::find_and_run_task):
5839 Report user, sys and wall time.
5840 * Makefile.in: Regenerate.
5841 * config.in: Regenerate.
5842 * configure: Regenerate.
5843
d6344fb5
DK
58442009-12-16 Doug Kwan <dougkwan@google.com>
5845
5846 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5847 sections.
5848 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5849 relaxed input sections.
5850 * output.cc (Output_section::find_relaxed_input_section): Change
5851 return type to Output_relaxed_input_section pointer. Adjust code
5852 for new type of relaxed_input_section_map_.
5853 * output.h (Output_section::find_relaxed_input_section): Change
5854 return type to Output_relaxed_input_section pointer.
5855 (Output_section::Output_relaxed_input_section_by_input_section_map):
5856 New type.
5857 (Output_section::relaxed_input_section_map_): Change type to
5858 Output_section::Output_relaxed_input_section_by_input_section_map.
5859 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5860 input section.
5861
0e0d5469
ILT
58622009-12-15 Ian Lance Taylor <iant@google.com>
5863
5864 * layout.cc (Layout::create_shstrtab): Only write out after input
5865 sections if we are compressing debug sections.
5866
0649a889
ILT
58672009-12-15 Ian Lance Taylor <iant@google.com>
5868
5869 * archive.cc (Archive::add_symbols): Only look up a symbol without
5870 a version if there is, in fact, a version.
5871
2ea97941
ILT
58722009-12-14 Ian Lance Taylor <iant@google.com>
5873
5874 Revert -Wshadow changes, all changes from:
5875 2009-12-11 Doug Kwan <dougkwan@google.com>
5876 2009-12-11 Nick Clifton <nickc@redhat.com>
5877 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5878
b0eec2cc
DK
58792009-12-11 Doug Kwan <dougkwan@google.com>
5880
5881 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5882 due to -Wshadow.
5883 * attributes.cc (Object_attribute::size): Ditto.
5884 (Attributes_section_data::size): Ditto.
5885 (Attributes_section_data::Attributes_section_data): Ditto.
5886 (Output_attributes_section_data::do_write): Ditto.
5887 * attributes.h (Object_attribute::set_type): Ditto.
5888 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5889
91d6fa6a
NC
58902009-12-11 Nick Clifton <nickc@redhat.com>
5891
5892 * archive.cc: Fix shadowed variable warnings.
5893 * arm.cc: Likewise.
5894 * compressed_output.cc: Likewise.
5895 * compressed_output.h: Likewise.
5896 * configure: Likewise.
5897 * dwarf_reader.cc: Likewise.
5898 * dynobj.cc: Likewise.
5899 * dynobj.h: Likewise.
5900 * ehframe.cc: Likewise.
5901 * ehframe.h: Likewise.
5902 * errors.cc: Likewise.
5903 * expression.cc: Likewise.
5904 * fileread.cc: Likewise.
5905 * fileread.h: Likewise.
5906 * freebsd.h: Likewise.
5907 * i386.cc: Likewise.
5908 * icf.cc: Likewise.
5909 * incremental.h: Likewise.
5910 * layout.cc: Likewise.
5911 * layout.h: Likewise.
5912 * mapfile.cc: Likewise.
5913 * merge.cc: Likewise.
5914 * merge.h: Likewise.
5915 * object.cc: Likewise.
5916 * object.h: Likewise.
5917 * options.h: Likewise.
5918 * output.cc: Likewise.
5919 * output.h: Likewise.
5920 * parameters.cc: Likewise.
5921 * plugin.cc: Likewise.
5922 * powerpc.cc: Likewise.
5923 * reduced_debug_output.cc: Likewise.
5924 * reduced_debug_output.h: Likewise.
5925 * reloc.cc: Likewise.
5926 * reloc.h: Likewise.
5927 * resolve.cc: Likewise.
5928 * script-sections.cc: Likewise.
5929 * script.cc: Likewise.
5930 * script.h: Likewise.
5931 * sparc.cc: Likewise.
5932 * symtab.cc: Likewise.
5933 * symtab.h: Likewise.
5934 * target-select.cc: Likewise.
5935 * target-select.h: Likewise.
5936 * token.h: Likewise.
5937 * workqueue.cc: Likewise.
5938 * workqueue.h: Likewise.
5939 * x86_64.cc: Likewise.
5940
a0351a69
DK
59412009-12-10 Doug Kwan <dougkwan@google.com>
5942
5943 * arm.cc (attributes.h): New include.
5944 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5945 (Arm_relobj::~Arm_relobj): Delete object pointed by
5946 attributes_section_data_.
5947 (Arm_relobj::attributes_section_data): New method definition.
5948 (Arm_relobj::attributes_section_data_): New data member declaration.
5949 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5950 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5951 attributes_section_data_.
5952 (Arm_dynobj::attributes_section_data): New method definition.
5953 (Arm_dynobj::attributes_section_data_): New data member declaration.
5954 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5955 initialization value of may_use_blx_ to false.
5956 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5957 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5958 object attributes to compute results instead of hard-coding.
5959 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5960 Target_arm::get_secondary_compatible_arch,
5961 Target_arm::set_secondary_compatible_arch
5962 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5963 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5964 New method declarations.
5965 (Target_arm::get_aeabi_object_attribute): New method definition.
5966 (Target_arm::attributes_section_data_): New data member declaration.
5967 (read_arm_attributes_section): New template definition.
5968 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5969 (Arm_dynobj::do_read_symbols): Ditto.
5970 (Target_arm::do_finalize_sections): Merge attributes sections from
5971 input. Check for BLX use after attributes section merging.
5972 Fix __exidx_start and __exidx_end visibility. Create an
5973 .ARM.attributes section if necessary.
5974 (Target_arm::get_secondary_compatible_arch,
5975 Target_arm::set_secondary_compatible_arch,
5976 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5977 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5978 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5979 New method definitions.
5980
b59befec
ILT
59812009-12-09 Ian Lance Taylor <iant@google.com>
5982
5983 * plugin.cc (Plugin::load): Don't cast from void* to a function
5984 pointer.
5985
1276bc89
ILT
59862009-12-09 Ian Lance Taylor <iant@google.com>
5987
5988 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5989 information fields.
5990
2f2de248
L
59912009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5992
5993 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5994 Replace two_file_shared_1.so with two_file_shared_2.so.
5995 * testsuite/Makefile.in: Regenerated.
5996
4f787271
DK
59972009-12-08 Doug Kwan <dougkwan@google.com>
5998
5999 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6000 (HFILES): Add attributes.h and int_encoding.h.
6001 * Makefile.in: Regenerate.
6002 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6003 function definitions to int_encoding.cc
6004 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6005 prototypes to int_encoding.h
6006 * reduced_debug_output.cc (int_encoding.h): New include.
6007 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6008 function definitions to int_encoding.cc
6009 (insert_into_vector, read_from_pointer): Move template definitions to
6010 int_encoding.h
6011 * attributes.cc: New file.
6012 * attributes.h: New file.
6013 * int_encoding.cc: New file.
6014 * int_encoding.h: New file.
6015
20b52f1a
RÁE
60162009-12-07 Rafael Avila de Espindola <espindola@google.com>
6017
6018 PR gold/11055
6019 * incremental-dump.cc (dump_incremental_inputs): New.
6020 (main): Use dump_incremental_inputs.
6021
53d7974c
L
60222009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6023
6024 PR gold/10893
6025 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6026 checking elfcpp::STT_FUNC.
6027 (Target_i386::Relocate::relocate): Likewise.
6028 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6029
6030 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6031 symbols from shared libraries into normal FUNC symbols.
6032
6033 * symtab.h (Symbol): Add is_func and use it.
6034
05a352e6
DK
60352009-12-05 Doug Kwan <dougkwan@google.com>
6036
6037 * arm.cc (Target_arm::arm_info): Initialize new fields
6038 attributes_section and attributes_vendor.
6039 * i386.cc (Target_i386::i386_info): Same.
6040 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6041 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6042 fields attributes_section and attributes_vendor.
53d7974c 6043 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
6044 * target.h (Target::attributes_section, Target::attributes_vendor,
6045 Target::is_attributes_section, Target::attribute_arg_type,
6046 Target::attributes_order): New method definitions.
6047 (Target::Target_info::attributes_section,
6048 Target::Target_info::attributes_vendor): New fields.
6049 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6050 virtual method definitions.
6051 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6052 attributes_section and attributes_vendor.
6053 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6054
f4e5969c
DK
60552009-12-05 Doug Kwan <dougkwan@google.com>
6056
6057 * arm.cc: Update comments about interworking and stub generation.
6058 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6059 considered as non-PIC.
6060 (Arm_relocate_functions::base_abs): Fix formatting.
6061 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6062 of function to use GOT entry address instead of offset.
6063 (Target_arm::Scan::global): Issue an error if a symbol would need a
6064 PLT does not get one because it is untyped. Remove code to create
6065 dynamic symbols for relative branches.
6066 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6067 takes unsigned integer instead of boolean.
6068
1abce4a6
L
60692009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6070
6071 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6072 (two_file_test_LDADD): Likewise.
6073 (common_test_1_LDADD): Likewise.
6074 (exception_test_LDADD) Likewise.
6075 (weak_test_LDADD): Likewise.
6076 (many_sections_test_LDADD): Likewise.
6077 (initpri1_LDADD): Likewise.
6078 (script_test_1_LDADD): Likewise.
6079 (script_test_2_LDADD): Likewise.
6080 (justsyms_LDADD): Likewise.
6081 (binary_test_LDADD): Likewise.
6082 (large_LDADD): Likewise.
6083 * testsuite/Makefile.in: Regenerated.
6084
adcf2816 60852009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 6086
adcf2816
L
6087 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6088 (Symbol_table::override_with_special): Likewise.
6089 (Symbol_table::add_from_object): Likewise.
6090
28e67f5d
RÁE
60912009-12-04 Rafael Avila de Espindola <espindola@google.com>
6092
6093 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6094 Don't set the data_offset twice.
6095
ae10a101
RÁE
60962009-12-04 Rafael Avila de Espindola <espindola@google.com>
6097
6098 * testsuite/Makefile.in: Regenerate.
6099
f59f41f3
DK
61002009-12-03 Doug Kwan <dougkwan@google.com>
6101
6102 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6103 (Target_arm::do_finalize_sections): Add parameter for symbol table
6104 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6105 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6106 parameter for symbol table pointer.
6107 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6108 an additional parameter for a pointer to symbol table.
6109 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6110 parameter for a symbol table pointer.
6111 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6112 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6113 Ditto.
6114 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6115 parameter for a symbol table pointer.
6116
ca55d848
RÁE
61172009-12-03 Rafael Avila de Espindola <espindola@google.com>
6118
6119 * incremental.cc (Incremental_inputs_header)
6120 (Incremental_inputs_header_write, Incremental_inputs_entry)
6121 (Incremental_inputs_entry_write): Move ...
6122 * incremental.h (Incremental_inputs_header)
6123 (Incremental_inputs_header_write, Incremental_inputs_entry)
6124 (Incremental_inputs_entry_write): here.
6125
3aec4f9c
RÁE
61262009-12-02 Rafael Avila de Espindola <espindola@google.com>
6127
6128 * incremental.cc (make_sized_incremental_binary): Set the target.
6129 Error if it is incompatible.
6130 * output.h (Output_file): Add filename method.
6131
9c0ae74d
RÁE
61322009-12-02 Rafael Avila de Espindola <espindola@google.com>
6133
6134 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6135 from the get_* methods.
6136
a45500ae
RÁE
61372009-12-02 Rafael Avila de Espindola <espindola@google.com>
6138
6139 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6140 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6141 Write 0 for the data_offset of scripts.
6142
325e6408
RÁE
61432009-12-02 Rafael Avila de Espindola <espindola@google.com>
6144
6145 * testsuite/Makefile.am: Add the incremental_test.sh test.
6146 * testsuite/incremental_test.sh: New.
6147 * testsuite/incremental_test_1.c: New.
6148 * testsuite/incremental_test_2.c: New.
6149
954c3e2e
RÁE
61502009-12-01 Rafael Avila de Espindola <espindola@google.com>
6151
6152 * incremental-dump.cc (main): Fix typos.
6153
f8086623
RÁE
61542009-11-27 Rafael Avila de Espindola <espindola@google.com>
6155
6156 PR gold/11025
6157 * incremental-dump.cc (main): Use llu to print 64 bit values.
6158
3b0dd6ac
L
61592009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6160 H.J. Lu <hongjiu.lu@intel.com>
6161
6162 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6163 $(LIBDL).
6164 (incremental_dump_LDADD): Likewise.
6165 * Makefile.in: Regenerated.
6166
a6d1ef57 61672009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 6168
a6d1ef57
DK
6169 Revert:
6170
6171 2009-11-25 Doug Kwan <dougkwan@google.com>
6172
6173 * arm.cc (Target_arm::Target_arm): Move method definition
6174 outside of class definition. Add code to handle
6175 --target1-rel, --target1-abs and --target2= options.
6176 (Target_arm::get_reloc_reloc_type): Change method to be
6177 non-static and const.
6178 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6179 New data member declaration.
6180 (Target_arm::Scan::local, Target_arm::Scan::global,
6181 Target_arm::Relocate::relocate,
6182 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6183 Adjust call to Target_arm::get_real_reloc_type.
6184 (Target_arm::get_real_reloc_type): Use command line options
6185 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6186 * options.h (--target1-rel, --target1-abs, --target2): New
6187 ARM-only options.
6188
50aeb7d4
DK
61892009-11-25 Doug Kwan <dougkwan@google.com>
6190
6191 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6192 class definition. Add code to handle --target1-rel, --target1-abs
6193 and --target2= options.
6194 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6195 and const.
6196 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6197 member declaration.
6198 (Target_arm::Scan::local, Target_arm::Scan::global,
6199 Target_arm::Relocate::relocate,
6200 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6201 call to Target_arm::get_real_reloc_type.
6202 (Target_arm::get_real_reloc_type): Use command line options to
6203 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6204 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6205 options.
6206
51938283
DK
62072009-11-25 Doug Kwan <dougkwan@google.com>
6208
6209 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6210 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6211 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6212 formatting.
6213 (Arm_relocate_functions::thm_call): Replace body with a call to
6214 Arm_relocate_functions::thumb_branch_common.
6215 (Arm_relocate_functions::thm_jump24,
6216 Arm_relocate_functions::thm_xpc22): New method definitions.
6217 (Arm_relocate_functions::thumb_branch_common): New method definition.
6218 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6219 operator.
6220 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6221 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6222
e2b8f3c4
RÁE
62232009-11-24 Rafael Avila de Espindola <espindola@google.com>
6224
6225 * Makefile.am: Build incremental-dump
6226 * Makefile.in: Regenerate.
6227 * incremental-dump.cc: New.
6228 * incremental.cc (Incremental_inputs_header_data,
6229 Incremental_inputs_entry_data): Move to incremental.h
6230 * incremental.h: (Incremental_inputs_header_data,
6231 Incremental_inputs_entry_data): Move from incremental.cc
6232
bcba9aec
RÁE
62332009-11-24 Rafael Avila de Espindola <espindola@google.com>
6234
6235 * incremental.cc (Incremental_inputs_header,
6236 Incremental_inputs_header_write, Incremental_inputs_entry,
6237 Incremental_inputs_entry_write): Add a typedef with the data type.
6238
7c3afe08
RÁE
62392009-11-24 Rafael Avila de Espindola <espindola@google.com>
6240
6241 * incremental.cc (Incremental_inputs_header,
6242 Incremental_inputs_header_write, Incremental_inputs_entry,
6243 Incremental_inputs_entry_write): Update comment about which
6244 type has the filed descriptions.
6245
d204b6e9
DK
62462009-11-15 Doug Kwan <dougkwan@google.com>
6247
6248 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6249 (Arm_relocate_functions::arm_branch_common): Change method defintion
6250 in class definition to a method declaration and update list of formal
6251 parameters.
6252 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6253 Arm_relocation_functions::jump24): Adjust call to
6254 Arm_relocate_functions::arm_branch_common. Update list of formal
6255 parameters.
6256 (Arm_relocate_functions::xpc25): New method definition.
6257 (Arm_relocate_functions::arm_branch_common): Move method defintion
6258 out from class definition. Use stubs for mode-switching and extending
6259 branch ranges.
6260 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6261 specially. Change code to enable use of stubs in ARM branches.
6262
43d12afe
DK
62632009-11-10 Doug Kwan <dougkwan@google.com>
6264
6265 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6266 in method declaration.
6267 (Target_arm::relocate_stub): New method declaration.
6268 (Target_arm::default_target): Change to return a pointer instead of
6269 a const reference.
6270 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
6271 Target_arm::default_target.
6272 (Arm_Relobj::do_relocate_sections): Remove options paramater in
6273 method definition.
6274 (Target_arm::relocate_section): Adjust view.
6275 (Target_arm::relocate_stub): New method definition.
6276
ac33a407
DK
62772009-11-10 Doug Kwan <dougkwan@google.com>
6278
6279 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
6280 a format warning.
6281 * incremental.cc (open_incremental_binary): Initialized local
6282 variables to avoid warnings.
6283 * object.cc (make_elf_object): Ditto.
6284 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6285 a format warning.
e1df38aa 6286
88ee28e9
L
6287009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6288
6289 PR gold/10930
6290 * testsuite/plugin_test.c: Include "config.h".
6291
2daedcd6
DK
62922009-11-09 Doug Kwan <dougkwan@google.com>
6293
6294 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6295 (arm_symbol_value): Remove.
6296 (Arm_relocate_functions::arm_branch_common,
6297 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6298 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6299 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6300 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6301 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6302 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
6303 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
6304 Arm_relocate_functions::thm_mobw_abs_nc,
6305 Arm_relocate_functions::thm_mov_abs,
6306 Arm_relocate_functions::movw_prel_nc,
6307 Arm_relocate_functions::thm_movt_abs,
6308 Arm_relocate_functions::movt_prel,
6309 Arm_relocate_functions::thm_movw_prel_nc,
6310 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
6311 (Target_arm::Relocate::relocate): Only decompose address into two
6312 parts if relocation type uses the thumb-bit and pass the actual
6313 bit instead of a flag indicating that the thumb-bit is used. Adjust
6314 calls to methods in Arm_relocate_functions for this change.
6315
1276bc89 63162009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
6317
6318 PR 10925
6319 * reloc.cc: Instantiate
6320 Sized_relobj::initialize_input_to_output_maps and
6321 Sized_relobj:free_input_to_output_maps.
6322
e53ad1b5
ILT
63232009-11-06 Ian Lance Taylor <iant@google.com>
6324
6325 PR 10876
6326 * defstd.cc (in_segment): Set only_if_ref true for "end".
6327
eb44217c
DK
63282009-11-06 Doug Kwan <dougkwan@google.com>
6329
6330 * arm.cc (class Reloc_stub): Correct a comment.
6331 (Target_arm::Target_arm): Initialize arm_input_section_map_.
6332 (Target_arm::scan_section_for_stubs): New method declaration.
6333 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
6334 Change methods from private to protected.
6335 (Target_arm::do_may_relax): New method definition.
6336 (Target_arm::do_relax, Target_arm::group_sections,
6337 Target_arm::scan_reloc_for_stub,
6338 Target_arm::scan_reloc_section_for_stubs): New method declarations.
6339 (Target_arm::arm_input_section_map_): New data member declaration.
6340 (Target_arm::scan_reloc_for_stub,
6341 Target_arm::scan_reloc_section_for_stubs,
6342 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
6343 Target_arm::do_relax): New method definitions.
6344
5d329b7d
ILT
63452009-11-06 Mikolaj Zalewski <mikolaj@google.com>
6346
6347 * configure.ac: Check for (struct stat)::st_mtim
6348 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
6349 * config.in: Regenerate.
6350 * configure: Regenerate.
6351
96a0d71b
ILT
63522009-11-05 Ian Lance Taylor <iant@google.com>
6353
6354 PR 10910
6355 * output.cc (Output_segment::add_output_section): Add missing
6356 return statement.
6357
594c8e5e
ILT
63582009-11-04 Ian Lance Taylor <iant@google.com>
6359
6360 PR 10880
6361 * object.h (class Object): Add is_needed and set_is_needed
6362 methods. Add is_needed_ field. Make bool fields into bitfields.
6363 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
6364 defined in a dynamic object and referenced by a regular object,
6365 set is_needed for the dynamic object.
6366 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
6367 if the file is marked with as_needed and it is not needed.
6368
22b127cc
ILT
63692009-11-04 Ian Lance Taylor <iant@google.com>
6370
6371 PR 10887
6372 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
6373 tags if data is discarded by linker script.
6374 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6375 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6376 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6377 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6378
f5c870d2
ILT
63792009-11-04 Ian Lance Taylor <iant@google.com>
6380
6381 * layout.cc (Layout::get_output_section): Add is_interp and
6382 is_dynamic_linker_section parameters. Change all callers.
6383 (Layout::choose_output_section): Likewise.
6384 (Layout::make_output_section): Likewise.
6385 (Layout::add_output_section_data): Add is_dynamic_linker_section
6386 parameter. Change all callers.
6387 * layout.h (class Layout): Update declarations.
6388 * output.h (class Output_section): Add is_interp, set_is_interp,
6389 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
6390 Add is_interp_, is_dynamic_linker_section_ fields. Change
6391 generate_code_fills_at_write_ to a bitfield.
6392 * output.cc (Output_section::Output_sections): Initialize new
6393 fields.
6394 (Output_segment::add_output_section): Add do_sort parameter.
6395 Change all callers.
6396
1ae4d23b
ILT
63972009-11-03 Ian Lance Taylor <iant@google.com>
6398
6399 PR 10860
6400 * options.h (class General_options): Add --warn-common.
6401 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
6402 merging two common symbols.
6403 (Symbol_table::should_override): Handle --warn-common when merging
6404 a common symbol with a defined symbol. Use report_resolve_problem
6405 for multiple definitions.
6406 (Symbol_table::report_resolve_problem): New function.
6407 * symtab.h (class Symbol_table): Declare report_resolve_problem.
6408
55da9579
DK
64092009-11-03 Doug Kwan <dougkwan@google.com>
6410
6411 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
6412 stub_factory_.
6413 (Target_arm::stub_factory): New method definition.
6414 (Target_arm::new_arm_input_section,
6415 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
6416 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 6417 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
6418 New type definitions.
6419 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
6420 member declarations.
6421 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
6422 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
6423 New method definitions.
6424
37a9ac43
ILT
64252009-11-03 Ian Lance Taylor <iant@google.com>
6426
6427 * options.h (class General_options): Add --warn_constructors.
6428
b3d6a3d4
ILT
64292009-11-03 Ian Lance Taylor <iant@google.com>
6430
6431 PR 10893
6432 * defstd.cc (in_section): Add entries for __rel_iplt_start,
6433 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
6434
934b01dd
ILT
64352009-11-03 Ian Lance Taylor <iant@google.com>
6436
6437 PR 10895
6438 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
6439 --msgid-bugs-address.
6440 (install-pdf): New target.
6441 (install-data_yes): Look up one directory to find mkinstalldirs.
6442
03c1939b
L
64432009-11-03 H.J. Lu <hongjiu.lu@intel.com>
6444
6445 * po/Make-in (.po.gmo): Don't generate .gmo files in source
6446 tree.
6447
ebd95253
DK
64482009-10-30 Doug Kwan <dougkwan@google.com>
6449
6450 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
6451
e9bbb538
DK
64522009-10-30 Doug Kwan <dougkwan@google.com>
6453
6454 * arm.cc (Stub_addend_reader): New struct template definition
6455 and partial specializations.
6456 (Stub_addend_reader::operator()): New method definition for a
6457 partially specialized template.
6458
d5b40221
DK
64592009-10-30 Doug Kwan <dougkwan@google.com>
6460
6461 * arm.cc (Arm_relobj::processor_specific_flags): New method
6462 definition.
6463 (Arm_relobj::do_read_symbols): New method declaration.
6464 (Arm_relobj::processor_specific_flags_): New data member declaration.
6465 (Arm_dynobj): New class definition.
6466 (Target_arm::do_finalize_sections): Add input_objects parameter.
6467 (Target_arm::do_adjust_elf_header): New method declaration.
6468 (Target_arm::are_eabi_versions_compatible,
6469 (Target_arm::merge_processor_specific_flags): New method declaration.
6470 (Target_arm::do_make_elf_object): New overloaded method definitions
6471 and declaration.
6472 (Arm_relobj::do_read_symbols): New method definition.
6473 (Arm_dynobj::do_read_symbols): Ditto.
6474 (Target_arm::do_finalize_sections): Add input_objects parameters.
6475 Merge processor-specific flags from all input objects.
6476 (Target_arm::are_eabi_versions_compatible,
6477 Target_arm::merge_processor_specific_flags,
6478 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
6479 New method definitions.
6480 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
6481 Input_objects pointer type parameter.
6482 * layout.cc (Layout::finalize): Pass input objects to target's.
6483 finalize_sections function.
6484 * output.cc (Output_file_header::do_sized_write): Set ELF file
6485 header's processor-specific flags.
6486 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
6487 Input_objects pointer type parameter.
6488 * sparc.cc (Target_sparc::do_finalize_sections): Same.
6489 * target.h (Input_objects): New forward class declaration.
6490 (Target::processor_specific_flags,
6491 Target::are_processor_specific_flags_sect): New method definitions.
6492 (Target::finalize_sections): Add input_objects parameter.
6493 (Target::Target): Initialize processor_specific_flags_ and
6494 are_processor_specific_flags_set_.
6495 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
6496 parameter.
6497 (Target::set_processor_specific_flags): New method definition.
6498 (Target::processor_specific_flags_,
6499 Target::are_processor_specific_flags_set_): New data member
6500 declarations.
6501 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
6502 Input_objects pointer type parameter.
6503
ebabffbd
DK
65042009-10-30 Doug Kwan <dougkwan@google.com>
6505
6506 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
6507
ad0f2072
ILT
65082009-10-28 Ian Lance Taylor <iant@google.com>
6509
6510 * object.h (class Relobj): Drop options parameter from
6511 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
6512 do_scan_relocs, do_relocate. Change all callers.
6513 (class Sized_relobj): Drop options parameters from
6514 do_gc_process_relocs, do_scan_relocs, do_relocate,
6515 do_relocate_sections, relocate_sections, emit_relocs_scan,
6516 emit_relocs_scan_reltype. Change all callers.
6517 (struct Relocate_info): Remove options field and all references to
6518 it.
6519 * reloc.h (class Read_relocs): Remove options constructor
6520 parameter and options_ field. Change all callers.
6521 (class Gc_process_relocs, class Scan_relocs): Likewise.
6522 (class Relocate_task): Likewise.
6523 * target-reloc.h (scan_relocs): Remove options parameter. Change
6524 all callers.
6525 (scan_relocatable_relocs): Likewise.
6526 * target.h (class Sized_target): Remove options parameter from
6527 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6528 all callers.
6529 * gc.h (gc_process_relocs): Remove options parameter. Change all
6530 callers.
6531 * arm.cc: Update functions to remove options parameters.
6532 * i386.cc: Likewise.
6533 * powerpc.cc: Likewise.
6534 * sparc.cc: Likewise.
6535 * x86_64.cc: Likewise.
6536 * testsuite/testfile.cc: Likewise.
6537
8ffa3667
DK
65382009-10-28 Doug Kwan <dougkwan@google.com>
6539
6540 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6541 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6542 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6543 New method definitions.
6544
40f36857
CC
65452009-10-28 Cary Coutant <ccoutant@google.com>
6546
6547 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6548 (Plugin::cleanup_done_): New member.
6549 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6550 (Plugin_manager::cleanup_done_): Remove.
6551 (Plugin_manager::add_input_file): Edit error message.
6552 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6553 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6554
2c849493
ILT
65552009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6556
6557 * fileread.cc: (File_read::View::~View): Use the new
6558 data_ownership_ filed.
6559 (File_read::~File_read): Dispose the new whole_file_view_.
6560 (File_read::open): Mmap the whole file if needed.
6561 (File_read::open): Use whole_file_view_ instead of contents_.
6562 (File_read::find_view): Use whole_file_view_ if applicable.
6563 (File_read::do_read): Use whole_file_view_ instead of contents_.
6564 (File_read::make_view): Use whole_file_view_ instead of contents_,
6565 update File_read::View::View call.
6566 (File_read::find_or_make_view): Update File_read::View::View
6567 call.
6568 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6569 remove contents_
6570 (File_read::View::Data_ownership): New enum.
6571 (File_read::View::View): Replace bool mapped_ with Data_ownership
6572 argument.
6573 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6574 (File_read::View::data_ownership_): New field.
6575 (File_read::contents_): Remove (replaced by whole_file_view_).
6576 (File_read::whole_file_view_): New field.
6577 * options.h (class General_options): Add --keep-files-mapped.
6578
24998053
CC
65792009-10-27 Cary Coutant <ccoutant@google.com>
6580
6581 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6582 * testsuite/Makefile.am (plugin_test_5): New test case.
6583 * testsuite/Makefile.in: Regenerate.
6584
72adc4fa
DK
65852009-10-25 Doug Kwan <dougkwan@google.com>
6586
6587 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6588 from private to protected to allow access by child class.
6589 (Sized_relobj::do_relocate_sections): New method declaration.
6590 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6591 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6592 Sized_relobj::relocate_sections. Instantiate template explicitly
6593 for different target sizes and endianity.
6594
07f508a2
DK
65952009-10-24 Doug Kwan <dougkwan@google.com>
6596
6597 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6598 (Arm_input_section::as_arm_input_section): New method.
6599 (Arm_output_section): New class definition.
6600 (Arm_output_section::create_stub_group,
6601 Arm_output_section::group_sections): New method definitions.
6602
10ad9fe5
DK
66032009-10-22 Doug Kwan <dougkwan@google.com>
6604
6605 * arm.cc (Arm_input_section): New class definition.
6606 (Arm_input_section::init, Arm_input_section:do_write,
6607 Arm_input_section::set_final_data_size,
6608 Arm_input_section::do_reset_address_and_file_offset): New method
6609 definitions.
6610
56ee5e00
DK
66112009-10-21 Doug Kwan <dougkwan@google.com>
6612
6613 * arm.cc (Stub_table, Arm_input_section): New forward class
6614 declarations.
6615 (Stub_table): New class defintion.
6616 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
6617 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
6618 New method definition.
6619
b569affa
DK
66202009-10-21 Doug Kwan <dougkwan@google.com>
6621
6622 * arm.cc: Update copyright comments.
6623 (Target_arm): New forward class template declaration.
6624 (Arm_address): New type.
6625 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
6626 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
6627 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
6628 constants.
6629 (Insn_template): Same.
6630 (DEF_STUBS): New macro.
6631 (Stub_type): New enum type.
6632 (Stub_template): New class definition.
6633 (Stub): Same.
6634 (Reloc_stub): Same.
6635 (Stub_factory): Same.
6636 (Target_arm::Target_arm): Initialize may_use_blx_ and
6637 should_force_pic_veneer_.
6638 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
6639 Target_arm::should_force_pic_veneer,
6640 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
6641 Target_arm::using_thumb_only, Target_arm:;default_target): New
6642 method defintions.
6643 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
6644 New data member declarations.
6645 (Insn_template::size, Insn_template::alignment): New method defintions.
6646 (Stub_template::Stub_template): New method definition.
6647 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
6648 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
6649 (Stub_factory::Stub_factory): New method definition.
6650 * gold.h (string_hash): New template.
6651 * output.h (Input_section_specifier::hash_value): Use
6652 gold::string_hash.
6653 (Input_section_specifier::string_hash): Remove.
6654 * stringpool.cc (Stringpool_template::string_hash): Use
6655 gold::string_hash.
6656
6c172549
DK
66572009-10-20 Doug Kwan <dougkwan@google.com>
6658
6659 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
6660 symbols of relaxed input sections.
6661 * output.h (Output_section::find_relaxed_input_section): Make
6662 method public.
6663
c5617f2f
DK
66642009-10-16 Doug Kwan <dougkwan@google.com>
6665
6666 * dynobj.cc (Versions::Versions): Initialize version_script_.
6667 Only insert base version symbol definition for a shared object
6668 if version script defines any version versions.
6669 (Versions::define_base_version): New method definition.
6670 (Versions::add_def): Check that base version is not needed.
6671 (Versions::add_need): Define base version lazily.
6672 * dynobj.h (Versions::define_base_version): New method declaration.
6673 (Versions::needs_base_version_): New data member declaration.
6674 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
6675 (check_DATA): Add no_version_test.stdout.
6676 (libno_version_test.so, no_version_test.o no_version_test.stdout):
6677 New make rules.
6678 * testsuite/Makefile.in: Regenerate.
6679 * testsuite/no_version_test.c: New file.
6680 * testsuite/no_version_test.sh: Ditto.
6681
3c12dcdb
DK
66822009-10-16 Doug Kwan <dougkwan@google.com>
6683
6684 * expression.cc (class Segment_start_expression): New class definition.
6685 (Segment_start_expression::value): New method definition.
6686 (script_exp_function_segment_start): Return a new
6687 Segment_start_expression.
6688 * gold/script-c.h (script_saw_segment_start_expression): New function
6689 prototype.
6690 * script-sections.cc (Script_sections::Script_sections): Initialize
6691 SAW_SEGMENT_START_EXPRESSION_ to false.
6692 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
6693 and -Tbbs options to specify section addresses if given in
6694 command line and no SEGMENT_START expression is seen in a script.
6695 * script-sections.h (Script_sections::saw_segment_start_expression,
6696 Script_sections::set_saw_segment_start_expression): New method
6697 definition.
6698 (Script_sections::saw_segment_start_expression_): New data member
6699 declaration.
6700 * script.cc (script_saw_segment_start_expression): New function.
6701 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
6702 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
6703 script_test_7.sh and script_test_8.sh.
6704 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
6705 script_test_8.stdout.
6706 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
6707 (script_test_6, script_test_6.stdout, script_test_7,
6708 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
6709 * Makefile.in: Regenerate.
6710 * testsuite/script_test_6.sh: New file.
6711 * testsuite/script_test_6.t: Same.
6712 * testsuite/script_test_7.sh: Same.
6713 * testsuite/script_test_7.t: Same.
6714 * testsuite/script_test_8.sh: Same.
6715
64b1ae37
DK
67162009-10-16 Doug Kwan <dougkwan@google.com>
6717
6718 * output.cc (Output_segment::set_section_list_address): Cast
6719 expressions to unsigned long long type to avoid format warnings.
6720
661be1e2
ILT
67212009-10-15 Ian Lance Taylor <iant@google.com>
6722
12edd763 6723 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 6724 dot assignment to script_sections_.
12edd763
ILT
6725 * script-sections.cc (Script_sections::add_dot_assignment):
6726 Initialize if necessary.
6727
68b6574b
ILT
6728 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
6729 program headers with no load segment if there is a linker script.
6730
661be1e2
ILT
6731 * layout.cc (Layout::set_segment_offsets): Align the file offset
6732 to the segment aligment for -N or -n with no load segment.
6733 * output.cc (Output_segment::add_output_section): Don't crash if
6734 the first section is a TLS section.
6735 (Output_segment::set_section_list_addresses): Print an error
6736 message if the address moves backward in a linker script.
6737 * script-sections.cc
6738 (Output_section_element_input::set_section_addresses): Don't
6739 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
6740 (Orphan_output_section::set_section_addresses): Likewise.
6741
f15f61a7
DK
67422009-10-15 Doug Kwan <dougkwan@google.com>
6743
6744 * layout.cc (Layout::finish_dynamic_section): Generate tags
6745 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
6746 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
6747 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
6748
82bb573a
ILT
67492009-10-14 Ian Lance Taylor <iant@google.com>
6750
6751 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
6752 fields.
6753 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
6754 data_shdr fields of relinfo.
6755 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
6756 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
6757 R_386_TLS_LDO_32, adjust based on section flags.
6758 (Target_i386::Relocate::fix_up_ldo): Remove.
6759
374ad285
ILT
67602009-10-13 Ian Lance Taylor <iant@google.com>
6761
6762 Add support for -pie.
6763 * options.h (class General_options): Add -pie and
6764 --pic-executable.
6765 (General_options::output_is_position_independent): Test -pie.
6766 (General_options::output_is_executable): Return true if not shared
6767 and not relocatable.
6768 (General_options::output_is_pie): Remove.
6769 * options.cc (General_options::finalize): Reject incompatible uses
6770 of -pie.
6771 * gold.cc (queue_middle_tasks): A -pie link is not static.
6772 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
6773 * symtab.cc (Symbol::final_value_is_known): Return false if
6774 output_is_position_independent.
6775 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
6776 output_is_position_independent.
6777 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
6778 output_is_position_independent.
6779 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
6780 output_is_position_independent.
6781 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
6782 two_file_pie_test.
6783 (basic_pie_test.o, basic_pie_test): New targets.
6784 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
6785 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
6786 (two_file_pie_test): New target.
6787 * testsuite/Makefile.in: Rebuild.
6788 * README: Remove note saying that -pie is not supported.
6789
c6585162
ILT
67902009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
6791
6792 * options.h (class General_options): Add -init and -fini.
6793 * layout.cc (Layout::finish_dynamic_section): Emit
6794 given init and fini functions.
6795
032ce4e9
ST
67962009-10-13 Sriraman Tallam <tmsriram@google.com>
6797
6798 * gc.h (gc_process_relocs): Check if icf is enabled using new
6799 function.
6800 * gold.cc (queue_initial_tasks): Likewise.
6801 (queue_middle_tasks): Likewise.
6802 * object.cc (do_layout): Likewise.
6803 * symtab.cc (is_section_folded): Likewise.
6804 * main.cc (main): Likewise.
6805 * reloc.cc (Read_relocs::run): Likewise.
6806 (Sized_relobj::do_scan_relocs): Likewise.
6807 * icf.cc (is_function_ctor_or_dtor): New function.
6808 (Icf::find_identical_sections): Check if function is ctor or dtor when
6809 safe icf is chosen.
6810 * options.h (General_options::icf): Change option to be an enum.
6811 (Icf_status): New enum.
6812 (icf_enabled): New method.
6813 (icf_safe_folding): New method.
6814 (set_icf_status): New method.
6815 (icf_status_): New variable.
6816 * (options.cc) (General_options::finalize): Set icf_status_.
6817 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
6818 icf_test and icf_keep_unique_test to use the --icf enum flag.
6819 * testsuite/icf_safe_test.sh: New file.
e1df38aa 6820 * testsuite/icf_safe_test.cc: New file.
032ce4e9 6821
f345227a
ST
68222009-10-12 Sriraman Tallam <tmsriram@google.com>
6823
6824 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
6825 includes to gc.h and icf.h.
6826 * arm.cc: Include gc.h.
6827 * gold.cc: Likewise.
6828 * i386.cc: Likewise.
6829 * powerpc.cc: Likewise.
6830 * sparc.cc: Likewise.
6831 * x86_64.cc: Likewise.
6832 * gc.h: Include icf.h.
6833
1c7814ed
ILT
68342009-10-11 Ian Lance Taylor <iant@google.com>
6835
6836 * plugin.cc: Include "gold.h" before other header files.
6837
ae3b5189
CD
68382009-10-10 Chris Demetriou <cgd@google.com>
6839
6840 * options.h (Input_file_argument::Input_file_type): New enum.
6841 (Input_file_argument::is_lib_): Replace with...
6842 (Input_file_argument::type_): New member.
6843 (Input_file_argument::Input_file_argument): Take Input_file_type
6844 'type' rather than boolean 'is_lib' as second argument.
6845 (Input_file_argument::is_lib): Use type_.
6846 (Input_file_argument::is_searched_file): New function.
6847 (Input_file_argument::may_need_search): Handle is_searched_file.
6848 * options.cc (General_options::parse_library): Support -l:filename.
6849 (General_options::parse_just_symbols): Update for Input_file_argument
6850 changes.
6851 (Command_line::process): Likewise.
6852 * archive.cc (Archive::get_file_and_offset): Likewise.
6853 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6854 * script.cc (read_script_file, script_add_file): Likewise.
6855 * fileread.cc (Input_file::Input_file): Likewise.
6856 (Input_file::will_search_for): Handle is_searched_file.
6857 (Input_file::open): Likewise.
6858 * readsyms.cc (Read_symbols::get_name): Likewise.
6859 * testsuite/Makefile.am (searched_file_test): New test.
6860 * testsuite/Makefile.in: Regenerate.
6861 * testsuite/searched_file_test.cc: New file.
6862 * testsuite/searched_file_test_lib.cc: New file.
6863
f3048a1d
ILT
68642009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6865 Ian Lance Taylor <iant@google.com>
6866
6867 * descriptor.cc: Include <cstdio> and "binary-io.h".
6868 (Descriptors::open): Open the files in binary mode always.
6869 * script.cc (Lex::get_token): Treat \r as whitespace.
6870
d4780e57
ILT
68712009-10-09 Ian Lance Taylor <iant@google.com>
6872
6873 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6874
d9a893b8
ILT
68752009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6876 Ian Lance Taylor <iant@google.com>
6877
6878 * configure.ac: Check for readv function also.
6879 * fileread.cc (readv): Define if not HAVE_READV.
6880 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6881 does not exist.
6882 * config.in: Regenerate.
6883 * configure: Regenerate.
6884
c0a62865
DK
68852009-10-09 Doug Kwan <dougkwan@google.com>
6886
6887 * layout.cc (Layout::make_output_section): Call target hook to make
6888 ordinary output section.
6889 (Layout::finalize): Adjust parameter list of call the
6890 Target::may_relax().
6891 * layout.h (class Layout::section_list): New method.
6892 * merge.h (Output_merge_base::entsize): Change visibility to public.
6893 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6894 New methods.
6895 (Output_merge_string::do_is_string): New method.
6896 * object.cc (Sized_relobj::do_setup): renamed from
6897 Sized_relobj::set_up.
6898 * object.h (Sized_relobj::adjust_shndx,
6899 Sized_relobj::initializ_input_to_output_maps,
6900 Sized_relobj::free_input_to_output_maps): Change visibilities to
6901 protected.
6902 (Sized_relobj::setup): Virtualize.
6903 (Sized_relobj::do_setup): New method declaration.
6904 (Sized_relobj::invalidate_section_offset,
6905 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6906 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6907 * options.cc (parse_int): New function.
6908 * options.h (parse_int): New declaration.
6909 (DEFINE_int): New macro.
6910 (stub_group_size): New option.
6911 * output.cc (Output_section::Output_section): Initialize memebers
6912 merge_section_map_, merge_section_by_properties_map_,
6913 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6914 (Output_section::add_input_section): Handled deferred code-fill
6915 generation and remove an old comment.
6916 (Output_section::add_relaxed_input_section): New method definition.
6917 (Output_section::add_merge_input_section): Use merge section by
6918 properties map to speed to search. Update merge section maps
6919 as appropriate.
6920 (Output_section::build_relaxation_map): New method definition.
6921 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6922 Same.
6923 (Output_section::relax_input_section): Renamed to
6924 Output_section::convert_input_sections_to_relaxed_sections and change
6925 interface to take a vector of pointers to relaxed sections.
6926 (Output_section::find_merge_section,
6927 Output_section::find_relaxed_input_section): New method definitions.
6928 (Output_section::is_input_address_mapped,
6929 Output_section::output_offset, Output_section::output_address):
6930 Use output section data maps to speed up searching.
6931 (Output_section::find_starting_output_address): Add comments.
6932 (Output_section::do_write,
6933 Output_section::write_to_postprocessing_buffer): Do code-fill
6934 generation as appropriate.
6935 (Output_section::get_input_sections): Invalidate relaxed input section
6936 map.
6937 (Output_section::restore_states): Adjust type of checkpoint .
6938 Invalidate relaxed input section map.
6939 * output.h (Output_merge_base): New class declaration.
6940 (Input_section_specifier): New class defintion.
6941 (class Output_relaxed_input_section) Change base class to
6942 Output_section_data_build.
6943 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6944 base class initializer.
6945 (Output_section::add_relaxed_input_section): New method declaration.
6946 (Output_section::Input_section): Change visibility to protected.
6947 (Output_section::Input_section::relobj,
6948 Output_section::Input_section::shndx): Handle relaxed input sections.
6949 Output_section::input_sections) Change visibility to protected. Also
6950 define overload to return a non-const pointer.
6951 (Output_section::Merge_section_properties): New class defintion.
6952 (Output_section::Merge_section_by_properties_map,
6953 Output_section::Output_section_data_by_input_section_map,
6954 Output_section::Relaxation_map): New types.
6955 (Output_section::relax_input_section): Rename method to
6956 Output_section::convert_input_sections_to_relaxed_sections and change
6957 interface to take a vector of relaxed section pointers.
6958 (Output_section::find_merge_section,
6959 Output_section::find_relaxed_input_section,
6960 Output_section::build_relaxation_map,
6961 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6962 New method declarations.
6963 (Output_section::merge_section_map_
6964 Output_section::merge_section_by_properties_map_,
6965 Output_section::relaxed_input_section_map_,
6966 Output_section::is_relaxed_input_section_map_valid_,
6967 Output_section::generate_code_fills_at_write_): New data members.
6968 * script-sections.cc
6969 (Output_section_element_input::set_section_addresses): Call
6970 current_data_size and addralign methods of relaxed input sections.
6971 (Orphan_output_section::set_section_addresses): Call current_data_size
6972 and addralign methods of relaxed input sections.
6973 * symtab.cc (Symbol_table::compute_final_value): Extract template
6974 from the body of Symbol_table::sized_finalize_symbol.
6975 (Symbol_table::sized_finalized_symbol): Call
6976 Symbol_table::compute_final_value.
6977 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6978 (Symbol_table::compute_final_value): New templated method declaration.
6979 * target.cc (Target::do_make_output_section): New method defintion.
6980 * target.h (Target::make_output_section): New method declaration.
6981 (Target::relax): Add more parameters for input objects, symbol table
6982 and layout. Adjust call to do_relax.
6983 (Target::do_make_output_section): New method declaration.
6984 (Target::do_relax): Add parameters for input objects, symbol table
6985 and layout.
6986
d446d6c4
ILT
69872009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6988
6989 * pread.c: Include stdio.h.
6990
bc06c745
ILT
69912009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6992
6993 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6994 defined.
6995
75aea3d0
ILT
69962009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6997
6998 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6999 Change read_shndx type to unsigned int.
7000 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7001 int.
7002 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7003 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7004 Change read_shndx type to unsigned int.
7005 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7006 int.
7007 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7008 * layout.cc (Layout::create_symtab_sections): Cast the result of
7009 local_symcount * symsize to off_t in the gold_assert.
7010
be8fcb75
ILT
70112009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7012
7013 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7014 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7015 R_ARM_BASE_ABS.
7016 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7017 (Arm_relocate_functions::thm_abs5): New function.
7018 (Arm_relocate_functions::abs12): New function.
7019 (Arm_relocate_functions::abs16): New function.
7020 (Arm_relocate_functions::base_abs): New function.
7021 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7022 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7023 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7024 R_ARM_BASE_ABS.
7025 (Scan::global): Likewise.
7026 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7027 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7028 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7029 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7030 R_ARM_BASE_ABS.
7031
c2a122b6
ILT
70322009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7033
7034 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7035 (Arm_relocate_functions::movt_prel): New function.
7036 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7037 (Arm_relocate_functions::thm_movt_prel): New function.
7038 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7039 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7040 (Scan::global, Relocate::relocate): Likewise.
7041 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7042
c4aa1e2d
ILT
70432009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7044
7045 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7046 Incremental_checker.
7047 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7048 unsigned int.
7049 (class Incremental_inputs_header): New class.
7050 (Incremental_inputs_header_writer): Edit comment.
7051 (Incremental_inputs_entry): New class.
7052 (Incremental_inputs_entry_writer): Edit comment.
7053 (Sized_incremental_binary::do_find_incremental_inputs_section):
7054 Add *strtab_shndx parameter, fill it.
7055 (Sized_incremental_binary::do_check_inputs): New method.
7056 (Incremental_checker::can_incrementally_link_output_file): Use
7057 Sized_incremental_binary::check_inputs.
7058 (Incremental_inputs::report_command_line): Save command line in
7059 command_line_.
7060 * incremental.h:
7061 (Incremental_binary::find_incremental_inputs_section): New
7062 method.
7063 (Incremental_binary::do_find_incremental_inputs_section): Add
7064 strtab_shndx parameter.
7065 (Incremental_binary::do_check_inputs): New pure virtual method.
7066 (Sized_incremental_binary::do_check_inputs): Declare.
7067 (Incremental_checker::Incremental_checker): Add incremental_inputs
7068 parameter, use it to initialize incremental_inputs_.
7069 (Incremental_checker::incremental_inputs_): New field.
7070 (Incremental_checker::command_line): New method.
7071 (Incremental_checker::inputs): New method.
7072 (Incremental_checker::command_line_): New field.
7073
c549a694
ILT
70742009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7075
7076 * incremental.cc: Include <cstdarg> and "target-select.h".
7077 (vexplain_no_incremental): New function.
7078 (explain_no_incremental): New function.
7079 (Incremental_binary::error): New method.
7080 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7081 method.
7082 (make_sized_incremental_binary): New function.
7083 (open_incremental_binary): New function.
7084 (can_incrementally_link_file): Add checks if output is ELF and has
7085 inputs section.
7086 * incremental.h: Include "elfcpp_file.h" and "output.h".
7087 (Incremental_binary): New class.
7088 (Sized_incremental_binary): New class.
7089 (open_incremental_binary): Declare.
7090 * object.cc (is_elf_object): Use
7091 elfcpp::Elf_recognizer::is_elf_file.
7092 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7093 * output.h (Output_file::filesize): New method.
7094
fd3c5f0b
ILT
70952009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7096
7097 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7098 New function.
7099 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7100 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7101 function.
7102 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7103 function.
7104 (Arm_relocate_functions::movw_abs_nc): New function.
7105 (Arm_relocate_functions::movt_abs): New function.
7106 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7107 (Arm_relocate_functions::thm_movt_abs): New function.
7108 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7109 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7110 (Scan::global): Likewise.
7111 (Relocate::relocate): Likewise.
7112 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7113
7f5309a5
ILT
71142009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7115
7116 * arm.cc (Arm_relocate_functions::got_prel) New function.
7117 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7118 (Relocate::relocate): Likewise.
7119 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7120
364c7fa5
ILT
71212009-10-06 Ian Lance Taylor <iant@google.com>
7122
7123 * options.h (class General_options): Define
7124 split_stack_adjust_size parameter.
7125 * object.h (class Object): Add uses_split_stack_ and
7126 has_no_split_stack_ fields. Add uses_split_stack and
7127 has_no_split_stack accessor functions. Declare
7128 handle_split_stack_section.
7129 (class Reloc_symbol_changes): Define.
7130 (class Sized_relobj): Define Function_offsets. Declare
7131 split_stack_adjust, split_stack_adjust_reltype, and
7132 find_functions.
7133 * object.cc (Object::handle_split_stack_section): New function.
7134 (Sized_relobj::do_layout): Call handle_split_stack_section.
7135 * dynobj.cc (Sized_dynobj::do_layout): Call
7136 handle_split_stack_section.
7137 * reloc.cc (Sized_relobj::relocate_sections): Call
7138 split_stack_adjust for executable sections in split_stack
7139 objects. Pass reloc_map to relocate_section.
7140 (Sized_relobj::split_stack_adjust): New function.
7141 (Sized_relobj::split_stack_adjust_reltype): New function.
7142 (Sized_relobj::find_functions): New function.
7143 * target-reloc.h: Include "object.h".
7144 (relocate_section): Add reloc_symbol_changes parameter. Change
7145 all callers.
7146 * target.h (class Target): Add calls_non_split method. Declare
7147 do_calls_non_split virtual method. Declare match_view and
7148 set_view_to_nop.
7149 * target.cc: Include "elfcpp.h".
7150 (Target::do_calls_non_split): New function.
7151 (Target::match_view): New function.
7152 (Target::set_view_to_nop): New function.
7153 * gold.cc (queue_middle_tasks): Give an error if mixing
7154 split-stack and non-split-stack objects with -r.
7155 * i386.cc (Target_i386::relocate_section): Add
7156 reloc_symbol_changes parameter.
7157 (Target_i386::do_calls_non_split): New function.
7158 * x86_64.cc (Target_x86_64::relocate_section): Add
7159 reloc_symbol_changes parameter.
7160 (Target_x86_64::do_calls_non_split): New function.
7161 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7162 parameter.
7163 * powerpc.cc (Target_powerpc::relocate_section): Add
7164 reloc_symbol_changes parameter.
7165 * sparc.cc (Target_sparc::relocate_section): Add
7166 reloc_symbol_changes parameter.
7167 * configure.ac: Call AM_CONDITIONAL for the default target.
7168 * configure: Rebuild.
7169 * testsuite/Makefile.am (TEST_AS): New variable.
7170 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7171 (check_DATA): Add split_i386 and split_x86_64 files.
7172 (SPLIT_DEFSYMS): Define.
7173 (split_i386_[1234n].o): New targets.
7174 (split_i386_[124]): New targets.
7175 (split_i386_[1234r].stdout): New targets.
7176 (split_x86_64_[1234n].o): New targets.
7177 (split_x86_64_[124]): New targets.
7178 (split_x86_64_[1234r].stdout): New targets.
7179 (MOSTLYCLEANFILES): Add new executables.
7180 * testsuite/split_i386.sh: New file.
7181 * testsuite/split_x86_64.sh: New file.
7182 * testsuite/split_i386_1.s: New file.
7183 * testsuite/split_i386_2.s: New file.
7184 * testsuite/split_i386_3.s: New file.
7185 * testsuite/split_i386_4.s: New file.
7186 * testsuite/split_i386_n.s: New file.
7187 * testsuite/split_x86_64_1.s: New file.
7188 * testsuite/split_x86_64_2.s: New file.
7189 * testsuite/split_x86_64_3.s: New file.
7190 * testsuite/split_x86_64_4.s: New file.
7191 * testsuite/split_x86_64_n.s: New file.
7192 * testsuite/testfile.cc (Target_test): Update relocation_section
7193 function.
7194 * testsuite/Makefile.in: Rebuild.
7195
e8a9fcda
ILT
71962009-10-06 Ian Lance Taylor <iant@google.com>
7197
7198 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7199 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7200 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7201 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7202 the address on ldo_addrs_.
7203 (Target_i386::Relocate::fix_up_ldo): New function.
7204
e99daf92
ILT
72052009-10-06 Rafael Espindola <espindola@google.com>
7206
7207 * plugin.cc (add_input_library): New.
7208 (Plugin::load): Add add_input_library to tv.
7209 (Plugin_manager::add_input_file): Add the is_lib argument.
7210 (add_input_file): Update call to Plugin_manager::add_input_file.
7211 (add_input_library): New.
7212 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7213
966d4097
DK
72142009-09-30 Doug Kwan <dougkwan@google.com>
7215
7216 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7217 symbol and call Symbol::may_need_copy_reloc to determine if
7218 a copy reloc is needed.
7219 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7220 nocopyreloc is given in command line.
7221 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7222 given in command line.
7223 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7224 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7225 of the removed Target_i386::may_need_copy_reloc.
7226 * options.h (copyreloc): New option with default value false.
7227 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7228 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7229 instead of the removed Target_powerpc::may_need_copy_reloc.
7230 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7231 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7232 instead of the removed Target_sparc::may_need_copy_reloc.
7233 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7234 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7235 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7236 instead of the removed Target_x86_64::may_need_copy_reloc.
7237
029ba973
ILT
72382009-09-30 Ian Lance Taylor <iant@google.com>
7239
7240 * object.h (class Object): Remove target_ field, and target,
7241 sized_target, and set_target methods.
7242 (Object::sized_target): Remove.
7243 (class Sized_relobj): Update declarations. Remove sized_target.
7244 * object.cc (Sized_relobj::setup): Remove target parameter.
7245 Change all callers.
7246 (Input_objects::add_object): Don't do anything with the target.
7247 (make_elf_sized_object): Add punconfigured parameter. Change all
7248 callers. Set or test parameter target.
7249 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7250 Change all callers.
7251 * parameters.cc (Parameters::set_target): Change parameter type to
7252 be non-const.
7253 (Parameters::default_target): Remove.
7254 (set_parameters_target): Change parameter type to be non-const.
7255 (parameters_force_valid_target): New function.
7256 (parameters_clear_target): New function.
7257 * parameters.h (class Parameters): Update declarations. Remove
7258 default_target method. Add sized_target and clear_target
7259 methods. Change target_ to be non-const.
7260 (set_parameters_target): Update declaration.
7261 (parameters_force_valid_target): Declare.
7262 (parameters_clear_target): Declare.
7263 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7264 as NULL if we aren't searching.
7265 (Add_symbols::run): Don't check for compatible target.
7266 * fileread.cc (Input_file::open_binary): Call
7267 parameters_force_valid_target.
7268 * gold.cc (queue_middle_tasks): Likewise.
7269 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
7270 set_target on object.
7271 * dynobj.h (class Sized_dynobj): Update declarations.
7272 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
7273 make_elf_object returns NULL.
7274 (Archive::include_member): Don't check whether object target is
7275 compatible.
7276 * output.cc (Output_section::add_input_section): Get target from
7277 parameters.
7278 (Output_section::relax_input_section): Likewise.
7279 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
7280 parameters.
7281 (Sized_relobj::do_scan_relocs): Likewise.
7282 (Sized_relobj::relocate_sections): Likewise.
7283 * resolve.cc (Symbol_table::resolve): Likewise.
7284 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7285 parameter. Change all callers.
7286 (Symbol_table::add_from_object): Get target from parameters.
7287 (Symbol_table::add_from_relobj): Don't check object target.
7288 (Symbol_table::add_from_dynobj): Likewise.
7289 (Symbol_table::define_special_symbol): Get target from
7290 parameters.
7291 * symtab.h (class Symbol_table): Update declaration.
7292 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7293 parameter. Change all callers. Clear parameter target.
7294 (Binary_test): Test target here.
7295 * testsuite/object_unittest.cc (gold_testsuite): Remove
7296 target_test_pointer parameter. Change all callers.
7297 (Object_test): Test target here.
7298
a6a22b83
ILT
72992009-09-26 Ian Lance Taylor <iant@google.com>
7300
7301 * testsuite/initpri1.c: Don't try to use constructor priorities if
7302 compiling with gcc before 4.3.
7303
6a8f49fe
ILT
73042009-09-22 Mikolaj Zalewski <mikolajz@google.com>
7305
7306 * testsuite/retain_symbols_file_test.sh (check_present): Change
7307 output file name to retain_symbols_file_test.stdout.
7308 (check_absent): Likewise.
7309
8c604651
CS
73102009-09-18 Craig Silverstein <csilvers@google.com>
7311
7312 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
7313 * options.cc: Include <cerrno> and <fstream>.
7314 (General_options::finalize): Parse -retain-symbols-file tag.
7315 * options.h: New flag.
7316 (General_options): New method should_retain_symbol, new
7317 variable symbols_to_retain.
7318 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
7319 should_retain_symbol map.
7320 * testsuite/Makefile.am (retain_symbols_file_test): New test.
7321 * testsuite/Makefile.in: Regenerate.
7322 * testsuite/retain_symbols_file_test.sh: New file.
7323
ca58b19f
NC
73242009-09-18 Nick Clifton <nickc@redhat.com>
7325
7326 * po/es.po: Updated Spanish translation.
7327
20e6d0d6
DK
73282009-09-17 Doug Kwan <dougkwan@google.com>
7329
7330 * debug.h (DEBUG_RELAXATION): New constant.
7331 (DEBUG_ALL): Add DEBUG_RELAXATION.
7332 (debug_string_to_enum): Add relaxation debug option.
7333 * layout.cc
7334 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
7335 Layout::Relaxation_debug_check::read_sections,
7336 Layout::Relaxation_debug_check::read_sections): New method definitions.
7337 (Layout::Layout): Initialize data members
7338 record_output_section_data_from_scrips_,
7339 script_output_section_data_list_ and relaxation_debug_check_.
7340 (Layout::save_segments, Layout::restore_segments,
7341 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7342 Layout::relaxation_loop_body): New method definitions.
7343 (Layout::finalize): Support relaxation. Move section layout code to
7344 Layout::relaxation_loop_body.
7345 (Layout::set_asection_address_from_script): Move code for orphan
7346 section placement out.
7347 (Layout::place_orphan_sections_in_script): New method definition.
7348 * layout.h (Output_segment_headers, Output_file_header):
7349 New forward class declarations.
7350 (Layout::~Layout): Define.
7351 (Layout::new_output_section_data_from_script): New method definition.
7352 (Layout::place_orphan_sections_in_script): New method declaration.
7353 (Layout::Segment_states): New type declaration.
7354 (Layout::save_segments, Layout::restore_segments,
7355 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7356 Layout::relaxation_loop_body): New method declarations.
7357 (Layout::Output_section_data_list): New type declaration.
7358 (Layout::Relaxation_debug_check): New class definition.
7359 (Layout::record_output_section_data_from_script_,
7360 Layout::script_output_section_data_list_, Layout::segment_states_,
7361 Layout::relaxation_debug_check_): New data members.
7362 * output.cc: (Output_section_headers::do_size): New method definition.
7363 (Output_section_headers::Output_section_headers): Move size
7364 computation to Output_section_headers::do_size.
7365 (Output_segment_headers::do_size): New method definition.
e1df38aa 7366 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
7367 Output_file_header::do_size and call it.
7368 (Output_file_header::do_size): New method definition.
7369 (Output_data_group::Output_data_group): Adjust call to
7370 Output_section_data.
7371 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
7372 (Output_symtab_xindex::do_write): Add array bound check.
7373 (Output_section::Input_section::print_to_mapfile): Handle
7374 RELAXED_INPUT_SECTION_CODE.
7375 (Output_section::Output_section): Initialize data member checkpoint_.
7376 (Output_section::~Output_section): Delete checkpoint object pointed
7377 by checkpoint_.
7378 (Output_section::add_input_section): Always add an Input_section if
7379 relaxing.
7380 (Output_section::add_merge_input_section): Add assert.
7381 (Output_section::relax_input_section): New method definition.
7382 (Output_section::set_final_data_size): Set load address to zero for
7383 an unallocated section.
7384 (Output_section::do_address_and_file_offset_have_reset_values):
7385 New method definition.
7386 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
7387 Handle relaxed input section.
7388 (Output_section::sort_attached_input_sections): Checkpoint input
7389 section list lazily.
7390 (Output_section::get_input_sections): Change type of input_sections to
7391 list of Simple_input_section pointers. Checkpoint input section list
7392 lazily. Also handle relaxed input sections.
7393 (Output_section::add_input_section_for_script): Take a reference to
7394 a Simple_input_section object instead of Relobj pointer and section
7395 index as parameter. Handle relaxed input sections.
7396 (Output_section::save_states, Output_section::restore_states): New
7397 method definitions.
7398 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
7399 (Output_data::is_data_size_fixed): New method definition.
7400 (Output_data::reset_addresss_and_file_offset): Do not reset data size
7401 if it is fixed.
7402 (Output_data::address_and_file_offset_have_reset_values): New method
7403 definition.
7404 (Output_data::do_address_and_file_offset_have_reset_values): New method
7405 definition.
7406 (Output_data::set_data_size): Check that data size is not fixed.
7407 (Output_data::fix_data_size): New method definition.
7408 (Output_data::is_data_size_fixed_): New data member.
7409 (Output_section_headers::set_final_data_size): New method definition.
7410 (Output_section_headers::do_size): New method declaration.
7411 (Output_segment_headers::set_final_data_size): New method definition.
7412 (Output_segment_headers::do_size): New method declaration.
7413 (Output_file_header::set_final_data_size)::New method definition.
7414 (Output_file_header::do_size)::New method declaration.
7415 (Output_section_data::Output_section_data): Add new parameter
7416 is_data_size_fixed and use it to fix data size.
7417 (Output_data_const::Output_data_const): Adjust call to base class
7418 constructor and fix data size.
7419 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
7420 base class constructor and fix data size.
7421 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
7422 base class constructor and fix data size.
7423 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
7424 class constructor and fix data size.
7425 (Output_data_group::set_final_data_size): New method definition.
7426 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
7427 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
7428 class constructor and fix data size.
7429 (Output_relaxed_input_section): New class definition.
7430 (Output_section::Simple_input_section): New class definition.
7431 (Output_section::get_input_sections): Adjust parameter list.
7432 (Output_section::add_input_section_for_script): Same.
7433 (Output_section::save_states, Output_section::restore_states,
7434 Output_section::do_address_and_file_offset_have_reset_values,
7435 (Output_section::Input_section::Input_section): Handle
7436 RELAXED_INPUT_SECTION_CODE. Add new overload for
7437 Output_relaxed_input_section.
7438 (Output_section::Input_section::is_input_section,
7439 Output_section::Input_section::set_output_section): Handle relaxed
7440 input section.
7441 (Output_section::Input_section::is_relaxed_input_section,
7442 Output_section::Input_section::output_section_data,
7443 Output_section::Input_section::relaxed_input_section): New method
7444 definitions.
7445 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
7446 value.
7447 (Output_section::Input_section::u1_): Update comments.
7448 (Output_section::Input_section::u2_): Add new union member poris.
7449 (Output_section::Checkpoint_output_section): New classs definition.
7450 (Output_section::relax_input_section): New method declaration.
7451 (Output_section::checkpoint_): New data member.
7452 (Output_segment): Update comments.
7453 (Output_segment::Output_segment): Un-privatize copy constructor.
7454 (Output_segment::operator=): Un-privatize.
7455 * script-sections.cc (Output_section_element::Input_section_list):
7456 Change element type to Output_section::Simple_input_section.
7457 (Output_section_element_dot_assignment::set_section_addresses):
7458 Register output section data for relaxation clean up.
7459 (Output_data_exression::Output_data_expression): Adjust call to base
7460 constructor to fix data size.
7461 (Output_section_element_data::set_section_addresses): Register
7462 Output_data_expression object for relaxation clean up.
7463 (struct Input_section_info): Replace Relobj pointer and section index
7464 pair with Output_section::Simple_input_section and Convert struct to a
7465 class.
7466 (Input_section_sorter::operator()): Adjust access to
e1df38aa 7467 Input_section_info data member to use accessors.
20e6d0d6
DK
7468 (Output_section_element_input::set_section_addresses): Use layout
7469 parameter. Adjust code to use Output_section::Simple_input_section
7470 and Input_secction_info classes. Register filler for relaxation
7471 clean up.
7472 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
7473 and section index pair with Output_section::Simple_input_section
7474 class. Adjust code accordingly.
7475 (Phdrs_element::release_segment): New method definition.
7476 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
7477 segment list.
7478 (Script_sections::release_segments): New method definition.
7479 * gold/script-sections.h (Script_sections::release_segments): New
7480 method declaration.
7481 * gold/target.h (Target::may_relax, Target::relax,
7482 Target::do_may_relax, Target::do_relax): New method definitions.
7483
5e445df6
ILT
74842009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7485
7486 * arm.cc (has_signed_unsigned_overflow): New function.
7487 (Arm_relocate_functions::abs8): New function.
7488 (Target_arm::Scan::local): Handle R_ARM_ABS8.
7489 (Target_arm::Scan::global): Likewise.
7490 (Target_arm::relocate::relocate): Likewise.
7491 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7492 Likewise.
7493
8c604651 74942009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
7495
7496 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
7497 * testsuite/Makefile.in: Regenerate.
7498
1e9cc1c2
NC
74992009-09-11 Nick Clifton <nickc@redhat.com>
7500
7501 * po/gold.pot: Updated by the Translation project.
7502
6a89f575
CC
75032009-09-08 Cary Coutant <ccoutant@google.com>
7504
7505 * output.cc (Output_file::open): Add execute permission to empty file.
7506 * testsuite/Makefile.am (permission_test): New test.
7507 * testsuite/Makefile.in: Regenerate.
7508
fdcac5af
ILT
75092009-09-02 Ian Lance Taylor <iant@google.com>
7510
7511 * output.cc (Output_file::resize): Call map_no_anonymous rather
7512 than map.
7513
44453f85
ILT
75142009-09-01 Mikolaj Zalewski <mikolajz@google.com>
7515
7516 * gold.cc: Include "incremental.h".
7517 (queue_initial_tasks): Call Incremental_checker methods.
7518 * incremental.cc: Include "output.h".
7519 (Incremental_checker::can_incrementally_link_output_file): New
7520 method.
7521 * incremental.h (Incremental_checker): New class.
7522
7523 * output.cc (Output_file::open_for_modification): New method.
7524 (Output_file::map_anonymous): Changed return type to bool. Record
7525 map in base_ field.
7526 (Output_file::map_no_anonymous): New method, broken out of map.
7527 (Output_file::map): Use map_no_anonymous and map_anonymous.
7528 * output.h (class Output_file): Update declarations.
7529
293c1386
CC
75302009-08-24 Cary Coutant <ccoutant@google.com>
7531
7532 * options.h (Command_line::Pre_options): New class.
7533 (Command_line::pre_options): New member.
7534 * options.cc (gold::options::ready_to_register): New variable.
7535 (One_option::register_option): Do nothing if not registering options.
7536 Assert if same short option registered twice.
7537 (General_options::General_options): Turn off option registration when
7538 done constructing.
7539 (Command_line::Pre_options::Pre_options): New constructor.
7540
f773f3d2
CC
75412009-08-24 Cary Coutant <ccoutant@google.com>
7542
06a73cfe
CC
7543 * options.h (General_options::no_keep_memory): Remove incorrect
7544 short option.
f773f3d2 7545
a15af8e2
RW
75462009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7547
7548 * Makefile.am (am__skiplex, am__skipyacc): New.
7549 * Makefile.in: Regenerate.
7550
c462b41b
RW
75512009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7552
14ec8efd
RW
7553 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7554 (INCLUDES): ... this.
7555 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7556 (AM_CPPFLAGS): Renamed from ...
7557 (INCLUDE): ... this.
7558 * Makefile.in, testsuite/Makefile.in: Regenerate.
7559
81ecdfbb
RW
7560 * Makefile.in: Regenerate.
7561 * aclocal.m4: Likewise.
7562 * config.in: Likewise.
7563 * configure: Likewise.
7564 * testsuite/Makefile.in: Likewise.
7565
c462b41b
RW
7566 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7567 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7568 * Makefile.in: Regenerate.
7569 * testsuite/Makefile.in: Regenerate.
7570
2da73f13
CC
75712009-08-19 Cary Coutant <ccoutant@google.com>
7572
7573 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7574 symbols in shared libraries overridden by hidden or internal symbols
7575 in the main program.
7576
2db70501
CD
75772009-08-19 Chris Demetriou <cgd@google.com>
7578
7579 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7580 checking source file names in error messages.
7581
f733487b
DK
75822009-08-18 Doug Kwan <dougkwan@google.com>
7583
7584 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7585 an elcpp::Ehdr as parameter. Adjust call to set_target.
7586 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7587 an elfcpp::Ehdr as parameter.
7588 * object.cc (Object::set_target): Remove the version that looks up
7589 a target and sets it.
7590 (Sized_relobj::setup): Take a Target object instead of
7591 an elfcpp::Ehdr as parameter. Adjust call to set_target.
7592 (make_elf_sized_object): Find target and ask target to
7593 make an ELF object.
7594 * object.h: (Object::set_target): Remove the version that looks up
7595 a target and sets it.
7596 (Sized_relobj::setup): Take a Target object instead of
7597 an elfcpp:Ehdr as parameter.
7598 * target.cc: Include dynobj.h.
7599 (Target::do_make_elf_object_implementation): New.
7600 (Target::do_make_elf_object): New.
7601 * target.h (Target::make_elf_object): New template declaration.
7602 (Target::do_make_elf_object): New method declarations.
7603 (Target::do_make_elf_object_implementation): New template declaration.
7604
cc70f101
ILT
76052009-08-14 Ian Lance Taylor <iant@google.com>
7606
7607 * gold.h (FUNCTION_NAME): Define.
7608 (gold_unreachable): Use FUNCTION_NAME.
7609
ef5e0cb1
ST
76102009-08-12 Sriraman Tallam <tmsriram@google.com>
7611
7612 * icf.cc (Icf::find_identical_sections): Issue a warning when a
7613 symbol in the --keep-unique list is not found.
7614
48c187ce
ST
76152009-08-12 Sriraman Tallam <tmsriram@google.com>
7616
7617 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
7618 been maked as --keep-unique.
7619 (Icf::unfold_section): New function.
7620 * icf.h (Icf::unfold_section): New function.
7621 * options.h (General_options::keep_unique): New option.
7622 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
7623 * testsuite/Makefile.in: Regenerate.
7624 * testsuite/icf_keep_unique_test.sh: New file.
7625 * testsuite/icf_keep_unique_test.cc: New file.
7626
645afe0c
CC
76272009-08-12 Cary Coutant <ccoutant@google.com>
7628
7629 PR 10471
7630 * resolve.cc (Symbol_table::resolve): Check for references from
7631 dynamic objects to hidden and internal symbols.
7632 * testsuite/Makefile.am (hidden_test.sh): New test.
7633 * testsuite/Makefile.in: Regenerate.
7634 * testsuite/hidden_test.sh: New script.
7635 * testsuite/hidden_test_1.c: New test source.
7636 * testsuite/hidden_test_main.c: New test source.
7637
11af873f
DK
76382009-08-11 Doug Kwan <dougkwan@google.com>
7639
7640 * arm.cc: Update comments.
7641 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
7642 segment to locate the .ARM.exidx section if present.
7643
b9f7d72d
DK
76442009-08-09 Doug Kwan <dougkwan@google.com>
7645
7646 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
7647 patch.
7648
ddd3c53c
ST
76492009-08-07 Sriraman Tallam <tmsriram@google.com>
7650 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
7651 compiler warnings.
7652
27721062
ST
76532009-08-06 Sriraman Tallam <tmsriram@google.com>
7654
7655 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
7656 valid tls_segment only for non-debug-section relocations.
7657 * testsuite/Makefile.am: Add gc_tls_test.
7658 * testsuite/Makefile.in: Regenerate.
7659 * testsuite/gc_tls_test.cc: New file.
7660 * testsuite/gc_tls_test.sh: New file.
7661
ef15dade 76622009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 7663
ef15dade
ST
7664 * icf.cc: New file.
7665 * icf.h: New file.
7666 * Makefile.am (CCFILES): Add icf.cc.
7667 (HFILES): Add icf.h
7668 * Makefile.in: Regenerate.
7669 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
7670 * gc.h (gc_process_relocs): Populate lists used by icf to contain
7671 section, symbol and addend information for the relocs.
7672 * gold.cc (queue_middle_tasks): Call identical code folding.
7673 * gold.h: Add defines for multimap.
7674 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
7675 to the call of finalize_local_symbols.
7676 * main.cc (main): Create object of class Icf.
7677 * object.cc (Sized_relobj::do_layout): Allow this function to be
7678 called twice during icf.
7679 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
7680 to sections marked as identical by icf.
7681 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
7682 when available.
7683 (Sized_relobj::do_section_entsize): New function.
7684 * object.h (Object::section_entsize): New function.
7685 (Object::do_section_entsize): New pure virtual function.
7686 (Relobj::finalize_local_symbols): Add new parameter.
7687 (Relobj::do_section_entsize): New function.
7688 * options.h (General_options::icf): New option.
7689 (General_options::icf_iterations): New option.
7690 (General_options::print_icf_sections): New option.
7691 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
7692 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
7693 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
7694 icf.
7695 * symtab.cc (Symbol_table::is_section_folded): New function.
7696 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
7697 to sections marked as identical by icf.
7698 * symtab.h (Symbol_table::set_icf): New function.
7699 (Symbol_table::icf): New function.
7700 (Symbol_table::is_section_folded): New function.
7701 (Symbol_table::icf_): New data member.
7702 * target-reloc.h (relocate_section): Ignore sections folded by icf.
7703 * testsuite/Makefile.am: Add commands to build icf_test.
7704 * testsuite/Makefile.in: Regenerate.
7705 * testsuite/icf_test.sh: New file.
7706 * testsuite/icf_test.cc: New file.
7707
c3b65ac4
CD
77082009-07-24 Chris Demetriou <cgd@google.com>
7709
7710 * layout.cc (is_compressible_debug_section): Fix incorrect
7711 comment about compressed section names.
7712
1caf2c51
ILT
77132009-07-20 Ian Lance Taylor <ian@airs.com>
7714
7715 PR 10419
7716 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
7717
1ef4d87f
ILT
77182009-07-16 Ian Lance Taylor <iant@google.com>
7719
7720 PR 10400
7721 * layout.h: #include <map>.
7722 (class Kept_section): Change from struct to class. Add accessors
7723 and setters. Add section size to Comdat_group mapping. Change
7724 Comdat_group to std::map. Add is_comdat_ field. Add
7725 linkonce_size field in union.
7726 (class Layout): Update declaration of find_or_add_kept_section.
7727 Don't declare find_kept_object.
7728 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
7729 parameter. Add object, shndx, is_comdat, and is_group_name
7730 parameters. Change all callers. Adjust for new Kept_section.
7731 (Layout::find_kept_object): Remove.
7732 * object.cc (Sized_relobj::include_section_group): Update use of
7733 Kept_section. Rename secnum to shndx. Only record
7734 Kept_comdat_section if sections are the same size.
7735 (Sized_relobj::include_linkonce_section): Update use of
7736 Kept_section. Only record Kept_comdat_section if sections are the
7737 same size. Set size of linkonce section.
7738 (Sized_relobj::map_to_kept_section): Update call to
7739 get_kept_comdat_section.
7740 * object.h (class Sized_relobj): Rename fields in
7741 Kept_comdat_section to drop trailing underscores; change object
7742 field to Relobj*. Change Kept_comdat_section_table to store
7743 struct rather than pointer.
7744 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
7745 Add kept_object and kept_shndx parameters. Change all callers.
7746 (Sized_relobj::get_kept_comdat_section): Change return type to
7747 bool. Add kept_object and kept_shndx parameters. Change all
7748 callers.
7749 * plugin.cc (Pluginobj::include_comdat_group): Update call to
7750 Layout::find_or_add_kept_section.
7751
37c3b7b0
ILT
77522009-07-09 Ian Lance Taylor <iant@google.com>
7753
7754 * merge.cc (Object_merge_map::initialize_input_to_output_map):
7755 Reserve space in the hash table.
7756
98fa85cb
ILT
77572009-07-06 Mikolaj Zalewski <mikolajz@google.com>
7758
7759 * fileread.cc (File_read::get_mtime): New method.
7760 * fileread.h (Timespec): New structure.
7761 (File_read::get_mtime): New method.
7762 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
7763 Renamed from timestamp_nsec.
7764 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
7765 Elf_Xword.
e1df38aa 7766 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 7767 timestamp_nsec.
e1df38aa 7768 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
7769 (Incremental_inputs::report_obejct): Save mtime; style fix.
7770 (Incremental_inputs::report_script): Save mtime; style fix.
7771 (Incremental_inputs::finalize_inputs): Style fix.
7772 (Incremental_inputs::finalize): Style fix.
7773 (Incremental_inputs::create_input_section_data): Store inputs
7774 mtime.
7775 * incremental.h (Incremental_inputs::report_script): Add mtime
7776 argument.
7777 (Incremental_inputs::Input_info::Input_info): Intialize only one
7778 union member.
7779 (Incremental_inputs::Input_info::archive): Move to nameless
7780 union.
7781 (Incremental_inputs::Input_info::obejct): Move to nameless union.
7782 (Incremental_inputs::Input_info::script): Move to nameless union.
7783 (Incremental_inputs::mtime): New field.
7784 * script.cc (read_input_script): Pass file mtime to
7785 Incremental_input.
7786 * script.h (Script_info::inputs): Style fix.
7787
c9d70757
ILT
77882009-07-01 Ian Lance Taylor <ian@airs.com>
7789
7790 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
7791 instead of 32.
7792
9c547ec3
ILT
77932009-06-24 Ian Lance Taylor <iant@google.com>
7794
7795 PR 10156
7796 * layout.cc (Layout::choose_output_section): If we find an
7797 existing section, update the flags.
7798 (Layout::create_notes): New function, broken out of
7799 Layout::finalize.
7800 (Layout::finalize): Don't create note sections.
7801 (Layout::create_note): Don't crash if linker script discards
7802 section.
7803 (Layout::create_gold_note): Likewise.
7804 (Layout::create_build_id): Likewise. Don't set
7805 after_input_sections on the section.
7806 (Layout::create_executable_stack_info): Remove target parameter.
7807 Change caller.
7808 * layout.h (class Layout): Declare create_notes. Update
7809 declaration of create_executable_stack_info.
7810 * gold.cc (queue_middle_tasks): Call create_notes.
7811 * output.cc (Output_section::update_flags_for_input_section): Move
7812 here from output.h. If SHF_ALLOC flag is newly set, mark address
7813 invalid.
7814 * output.h (Output_data::mark_address_invalid): New function.
7815 (class Output_section): Only declare, not define,
7816 update_flags_for_input_section. Remove set_flags.
7817
55458500
ILT
78182009-06-24 Ian Lance Taylor <iant@google.com>
7819
7820 * script-sections.cc (Output_section_definition::
7821 set_section_addresses): Rename shadowing local load_address to
7822 laddr.
7823
1307d6cd
ILT
78242009-06-24 Ian Lance Taylor <iant@google.com>
7825
7826 PR 10244
7827 * reloc.cc (relocate_sections): Skip empty relocation sections.
7828
ec3f783e
ILT
78292009-06-23 Ian Lance Taylor <iant@google.com>
7830
7831 PR 10156
7832 * layout.cc (Layout::create_note): Use choose_output_section
7833 rather than make_output_section.
7834
459c9f1c
ILT
78352009-06-23 Ian Lance Taylor <iant@google.com>
7836
7837 PR 10237
7838 * options.cc (General_options::parse_V): Set printed_version_.
7839 (General_options::General_options): Initialize printed_version_.
7840 * options.h (class General_options): Add printed_version_ field.
7841 * gold.cc (queue_initial_tasks): If there are no input files,
7842 don't give a fatal error if we printed the version information.
7843 (queue_middle_tasks): If using -r with a shared object, give a
7844 fatal error rather than an ordinary error.
7845
1518dc8f
ILT
78462009-06-23 Ian Lance Taylor <iant@google.com>
7847
7848 PR 10219
7849 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7850 (Layout::make_output_section): Set have_stabstr_section_ if we see
7851 a .stab*str section.
7852 (Layout::finalize): Call link_stabs_sections.
7853 (Layout::link_stabs_sections): New file.
7854 * layout.h (class Layout): Add have_stabstr_section_ field.
7855 Declare link_stabs_sections.
7856
3d857b98
DK
78572009-06-23 Doug Kwan <dougkwan@google.com>
7858
7859 * Makefile.am (libgold_a_LIBADD): New.
7860 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7861 * Makefile.in: Regenerate.
7862 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7863 * configure: Regenerate.
7864 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7865 * fileread.cc: Include sys/state.h
7866 * gold.h: Declare memmem and strndup if found missing.
7867 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7868
0639a6f6
ILT
78692009-06-23 Ian Lance Taylor <iant@google.com>
7870
7871 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7872 * configure: Rebuild.
7873
8d63875c
ILT
78742009-06-23 Ian Lance Taylor <iant@google.com>
7875
7876 PR 10147
7877 * object.cc (Object::section_contents): Don't try to get a view if
7878 the section has length zero.
7879 (Object::handle_gnu_warning_section): If the section is empty, use
7880 the name of the section as the warning.
7881
f7c8a183
ILT
78822009-06-23 Ian Lance Taylor <iant@google.com>
7883
7884 PR 10133
7885 * stringpool.h (class Stringpool_template): Add optimize_ field.
7886 (Stringpool_template::set_optimize): New function.
7887 * stringpool.cc (Stringpool_template::Stringpool_template):
7888 Initialize optimize_ field.
7889 (Stringpool_template::set_string_offsets): Test local optimize
7890 fild rather than parameter.
7891 * layout.cc (Layout::Layout): Call set_optimize on the section
7892 name stringpool.
7893
e6a307ba
ILT
78942009-06-22 Ian Lance Taylor <iant@google.com>
7895
7896 PR 10030
7897 * yyscript.y: Parse TARGET.
7898 * script.cc (script_set_target): New function.
7899 * script-c.h (script_set_target): Declare.
7900 * options.cc (General_options::string_to_object_format): Rename
7901 from string_to_object_format in anonymous namespace. Change
7902 callers.
7903 * options.h (class General_options): Declare
7904 string_to_object_format.
7905
3ee173de
ILT
79062009-06-22 Ian Lance Taylor <iant@google.com>
7907
7908 * script-sections.cc (Script_sections::create_segments): Don't put
7909 program headers in a PT_LOAD segment if -n or -N.
7910
79112009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7912
7913 PR 10141
7914 * options.h (class General_options): Add -z lazy and -z now. Sort
7915 -z options into alphabetical order.
7916 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7917
cd6739a1 79182009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7919
7920 * layout.cc (Layout::make_output_section): Call
7921 Target::new_output_section.
7922 (Layout::attach_allocated_section_to_segment): Put large section
7923 sections in a separate load segment with the large segment flag
7924 set.
7925 (Layout::segment_precedes): Sort large data segments after other
7926 load segments.
7927 (align_file_offset): New static function.
7928 (Layout::set_segment_offsets): Use align_file_offset.
7929 * output.h (class Output_section): Add is_small_section_ and
7930 is_large_section_ fields.
7931 (Output_section::is_small_section): New function.
7932 (Output_section::set_is_small_section): New function.
7933 (Output_section::is_large_section): New function.
7934 (Output_section::set_is_large_section): New function.
7935 (Output_section::is_large_data_section): New function.
7936 (class Output_segment): Add is_large_data_segment_ field.
7937 (Output_segment::is_large_data_segment): New function.
7938 (Output_segment::set_is_large_data_segment): New function.
7939 * output.cc (Output_section::Output_section): Initialize new
7940 fields.
7941 (Output_segment::Output_segment): Likewise.
7942 (Output_segment::add_output_section): Add assertion that large
7943 data sections always go in large data segments. Force small data
7944 sections to the end of the list of data sections. Force small BSS
7945 sections to the start of the list of BSS sections. For large BSS
7946 sections to the end of the list of BSS sections.
7947 * symtab.h (class Symbol): Declare is_common_shndx.
7948 (Symbol::is_defined): Check Symbol::is_common_shndx.
7949 (Symbol::is_common): Likewise.
7950 (class Symbol_table): Define enum Commons_section_type. Update
7951 declarations. Add small_commons_ and large_commons_ fields.
7952 * symtab.cc (Symbol::is_common_shndx): New function.
7953 (Symbol_table::Symbol_table): Initialize new fields.
7954 (Symbol_table::add_from_object): Put small and large common
7955 symbols in the right list.
7956 (Symbol_table::sized_finalized_symbol): Check
7957 Symbol::is_common_shndx.
7958 (Symbol_table::sized_write_globals): Likewise.
7959 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7960 common symbol lists. Don't call do_allocate_commons_list if the
7961 list is empty.
7962 (Symbol_table::do_allocate_commons_list): Remove is_tls
7963 parameter. Add comons_section_type parameter. Change all
7964 callers. Handle small and large common symbols.
7965 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7966 Symbol::is_common_shndx.
7967 * resolve.cc (symbol_to_bits): Likewise.
7968 * target.h (Target::small_common_shndx): New function.
7969 (Target::small_common_section_flags): New function.
7970 (Target::large_common_shndx): New function.
7971 (Target::large_common_section_flags): New function.
7972 (Target::new_output_section): New function.
7973 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7974 small_common_section_flags, and large_common_section_flags
7975 fields.
7976 (Target::do_new_output_section): New virtual function.
7977 * arm.cc (Target_arm::arm_info): Initialize new fields.
7978 * i386.cc (Target_i386::i386_info): Likewise.
7979 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7980 Likewise.
7981 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7982 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7983 (Target_x86_64::do_new_output_section): New function.
7984 * configure.ac: Define conditional MCMODEL_MEDIUM.
7985 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7986 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7987 (large_LDFLAGS): Define.
7988 * testsuite/large.c: New file.
7989 * testsuite/testfile.cc (Target_test::test_target_info):
7990 Initialize new fields.
7991 * configure, testsuite/Makefile.in: Rebuild.
7992
bb04269c
DK
79932009-06-05 Doug Kwan <dougkwan@google.com>
7994
7995 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7996 * Makefile.in: Regenerate.
bb04269c
DK
7997 * i386.cc (class Target_i386): Define new virtual method to
7998 override do_is_local_label_name in parent.
7999 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8000 local symbols if --discard-locals or -X is given.
8001 * options.h (class General_options): Declare new options
8002 '--discard-locals' and '-X' for discarding locals.
8003 * target.h (class Target): Define new methods is_local_label_name.
8004 Declare new virtual method do_is_local_label_name.
8005 * target.cc: New file.
8006 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8007 (check_SCRIPTS): Add discard_locals_test.sh.
8008 (check_DATA): Add discard_local_tests.syms.
8009 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8010 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8011 * testsuite/Makefile.in: Regenerate.
8012 * testsuite/discard_locals_test.c: New file.
8013 * testsuite/discard_locals_test.sh: Same.
8014
805bb01c
DK
80152009-06-05 Doug Kwan <dougkwan@google.com>
8016
8017 * object.cc (Sized_relobj::Sized_relobj): Initialize
8018 discarded_eh_frame_shndx_ to -1U.
8019 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8020 section.
8021 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8022 a discarded .eh_frame section.
8023 (Sized_relobj::do_finalize_local_symbols): Ditto.
8024 * object.h (class Sized_relobj): Declare new member
8025 discarded_eh_frame_shndx_.
8026 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8027 (local_labels_test.o, local_labels_test): New rules.
8028 * testsuite/Makefile.in: Regenerate.
8029
1dcd334d
DK
80302009-06-04 Doug Kwan <dougkwan@google.com>
8031
8032 * layout.cc (Layout::section_name_mapping): Add mapping for
8033 special ARM sections.
8034
96d49306
DK
80352009-06-03 Doug Kwan <dougkwan@google.com>
8036
8037 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8038 (utils::has_overflow): Same.
8039
dff16297
ILT
80402009-06-03 Ian Lance Taylor <iant@google.com>
8041
8042 * layout.cc (Layout::section_name_mapping): New array, replacing
8043 Layout::linkonce_mapping.
8044 (Layout::section_name_mapping_count): New variable, replacing
8045 Layout::linkonce_mapping_count.
8046 (Layout::linkonce_output_name): Remove.
8047 (Layout::output_section_name): Rewrite.
8048 * layout.h (class Layout): Rename Linkonce_mapping to
8049 Section_name_mapping, linkonce_mapping to section_name_mapping,
8050 linkonce_mapping_count to section_name_mapping_count. Don't
8051 declare linkonce_output_name.
8052
c121c671
DK
80532009-06-03 Doug Kwan <dougkwan@google.com>
8054
8055 * gold/arm.cc (namespace utils): New.
8056 (Target_arm::reloc_is_non_pic): Define new method.
8057 (class Arm_relocate_functions): New.
8058 (Target_arm::Relocate::relocate): Handle relocation types used by
8059 Android.
8060
07800fab
ILT
80612009-06-03 Ian Lance Taylor <iant@google.com>
8062
8063 * arm.cc (Target_arm::scan::global): Use || instead of |.
8064
c121c671
DK
80652009-06-02 Doug Kwan <dougkwan@google.com>
8066
8067 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8068 issued_non_pic_error_.
8069 (class Target_arm::Scan): Declare new method check_non_pic.
8070 Define new method symbol_needs_plt_entry.
8071 Declare new data member issued_non_pic_error_.
8072 (class Target_arm::Relocate): Declare new method
8073 should_apply_static_reloc.
8074 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8075 (Target_arm::Scan::check_non_pic): Define new method.
8076 (Target_arm::Scan::local): Handle a small subset of reloc types used
8077 by Android.
8078 (Target_arm::Scan::local): Same.
8079 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8080
b19b0c6d
ILT
80812009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8082
8083 * incremental.cc (Incremental_inputs::report_command_line): Filter
8084 out --incremental-* options.
8085
94cdfcff
DK
80862009-05-29 Doug Kwan <dougkwan@google.com>
8087
8088 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8089 template class.
8090 (class Target_arm): Update comment.
8091 (Target_arm::Target_arm): Initialize new data members GOT_,
8092 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8093 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8094 and Target_arm::rel_dyn_section.
8095 Declare new_enum Target_arm::Got_type.
8096 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8097 and DYNBSS_.
8098 Update commments for member do_dynsym_value.
8099 (Target_arm::got_size, Target_arm::plt_section,
8100 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8101 new methods inside class defintion.
8102 (Target_arm::got_section): Define new method.
8103 (Target_arm::rel_dyn_section): Same.
8104 (Output_data_plt_arm): New template class.
8105 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8106 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8107 (Output_data_plt_arm::add_entry): Same.
8108 (Output_data_plt_arm::first_plt_entry): Define new
8109 static data member for PLT instruction template.
8110 (Output_data_plt_arm::plt_entry): Same.
8111 (Output_data_plt_arm::do_write): Define new method.
8112 (Target_arm::make_plt_entry): Same.
8113 (Target_arm::do_finalize_sections): Same.
8114 (Target_arm::do_dynsym_value): Same.
8115
4a657b0d
DK
81162009-05-28 Doug Kwan <dougkwan@google.com>
8117
8118 * Makefile.am (TARGETSOURCES): Add arm.cc.
8119 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8120 * Makefile.in: Regenerate.
8121 * arm.cc: New file.
8122 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8123
e7ae8c36
DK
81242009-05-26 Doug Kwan <dougkwan@google.com>
8125
8126 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8127 (General_options::check_excluded_libs): Strip off directories in
8128 archive name before matching like GNU ld does.
8129 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8130 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8131 (exclude_libs_test_LDFLAGS): Add linker option
8132 -Wl,--exclude-libs,libexclude_libs_test_3
8133 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8134 an explicit archive without using -l.
8135 (alt/libexclude_libs_test_3.a): New make rule.
8136 * testsuite/Makefile.in: Regenerate.
8137 * testsuite/exclude_libs_test.c : Declare lib3_default().
8138 (main): Call it.
8139 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8140 * exclude_libs_test_3.c: New file.
8141
f12e7348
NC
81422009-05-26 Nick Clifton <nickc@redhat.com>
8143
8144 * po/id.po: New Indonesian translation.
8145 * po/gold.pot: Updated template file.
8146
4daadc0d
ST
81472009-05-22 Sriraman Tallam <tmsriram@google.com>
8148
e1df38aa 8149 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
8150 gc_comdat_test files. Add -Wl,--gc-sections to build
8151 gc_comdat_test.
8152 * testsuite/Makefile.in: Regenerate.
8153 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8154
531813ad
ST
81552009-05-21 Sriraman Tallam <tmsriram@google.com>
8156
8157 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8158 kept comdat section was garbage collected.
8159 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8160 * testsuite/Makefile.in: Regenerate.
8161 * testsuite/gc_comdat_test.sh: New file.
8162 * testsuite/gc_comdat_test_1.cc: New file.
8163 * testsuite/gc_comdat_test_2.cc: New file.
8164
65514900
CC
81652009-05-19 Doug Kwan <dougkwan@google.com>
8166
8167 * archive.cc (Archive::Archive): Move constructor from archive.h
8168 to here. Initialize no_export_.
8169 (Archive::get_elf_object_for_member): Set no_export flag of object.
8170 * archive.h (Archive::Archive): Move constructor body to
8171 archive.cc.
8172 (Archive::no_export): New method.
8173 (Archive::no_export_): New field.
8174 * object.h (Object::Object): Initialize no_export_ to false.
8175 (Object::no_export, Object::set_no_export): New methods.
8176 (Object::no_export_): New field.
8177 * options.cc (General_options::parse_exclude_libs): New method.
8178 (General_options::check_excluded_libs) Same.
8179 * options.h (exclude_libs): New option.
8180 (General_options::check_excluded_libs): New method declaration.
8181 (General_options::excluded_libs_): New field.
8182 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8183 default or protected visibility if an object has no-export flag set.
8184 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8185 (check_SCRIPTS): Add exclude_libs_test.sh.
8186 (check_DATA): Add exclude_libs_test.syms.
8187 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8188 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8189 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8190 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8191 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8192 libexclude_libs_test_2.a): New rules.
8193 * testsuite/Makefile.in: Regenerate.
8194 * testsuite/exclude_libs_test.c: New file.
8195 * testsuite/exclude_libs_test.sh: Ditto.
8196 * testsuite/exclude_libs_test_1.c: Ditto.
8197 * testsuite/exclude_libs_test_2.c: Ditto.
8198
1b77ea50
ILT
81992009-05-15 Ian Lance Taylor <iant@google.com>
8200
8201 * configure.ac: Check for declarations for cases where libiberty.h
8202 checks HAVE_DECL_xxx.
8203 * configure, config.in: Rebuild.
8204
072fe7ce
ILT
82052009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8206
8207 * gold.h (Incremental_argument_list): Remove (invalid) forward
8208 declaration.
8209 * incremental.cc (Incremental_inputs::report_achive): New method.
8210 (Incremental_inputs::report_object): New method.
8211 (Incremental_inputs::report_script): New method.
8212 (Incremental_inputs::finalize_inputs): New method.
8213 (Incremental_inputs::finalize): Call finalize_inputs().
8214 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8215 Create inputs entries.
8216 * incremental.h (Incremental_input_type): New enum.
8217 (Incremental_inputs::Incremental_input): Initialize new fields.
8218 (Incremental_inputs::report_inputs): New method.
8219 (Incremental_inputs::report_achive): New method.
8220 (Incremental_inputs::report_object): New method.
8221 (Incremental_inputs::report_script): New method.
8222 (Incremental_inputs::finalize_inputs): New method.
8223 (Incremental_inputs::Input_info): New struct.
8224 (Incremental_inputs::Input_info_map): New typedef.
8225 (Incremental_inputs::lock_): New field.
8226 (Incremental_inputs::Inputs_): New field.
8227 (Incremental_inputs::Inputs_map): New field.
8228 * main.cc (main): Call Incremental_input::report_inputs.
8229 * options.h (Input_argument_list): Typedef moved from
8230 Input_arguments.
8231 (Input_file_group::Files): Remove, use ::Input_argument_list.
8232 (Input_file_group::Input_argument_list): Remove, use
8233 ::Input_argument_list.
8234 * plugin.cc (Plugin_manager::add_input_file): Add error in
8235 incremental build.
8236 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8237 functions.
8238 * script.cc (read_input_script): Call
8239 Incremental_input::report_script.
8240 * script.h (Script_info): New class.
8241
b0481b0b
ILT
82422009-04-27 Ian Lance Taylor <iant@google.com>
8243
8244 * x86_64.cc (do_adjust_output_section): Set entsize to
8245 plt_entry_size.
8246
b22a5a41 82472009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
8248
8249 * output.cc (Output_file::close): After short writes, continue
8250 writing from the correct offset in the buffer being written.
8251
40fde488
CD
82522009-04-23 Chris Demetriou <cgd@google.com>
8253
8254 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8255 * configure: Regenerate.
8256 * config.in: Regenerate.
8257 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8258 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8259
3ce2c28e
ILT
82602009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8261
8262 * incremental.cc (Incremental_inputs_header_data): Renamed from
8263 Incremental_input_header_data.
8264 (Incremental_inputs_header_data::data_size): New field.
8265 (Incremental_inputs_header_data::put_input_file_count): Renamed
8266 from input_file_count.
8267 (Incremental_inputs_header_data::put_command_line_offset): Renamed
8268 from command_line_offset.
8269 (Incremental_inputs_header_data::put_reserved): Renamed from
8270 put_reserved.
8271 (Incremental_inputs_entry_data): Renamed from
8272 Incremental_input_entry_data.
8273 (Incremental_inputs_entry_data::data_size): New field.
8274 (Incremental_inputs::report_command_line): New method.
8275 (Incremental_inputs::finalize): New method.
8276 (Incremental_inputs::create_incremental_inputs_data): New method.
8277 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
8278 * incremental.h: New file.
8279 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
8280 (Layout::finalize): Create incremental inputs section in
8281 incremental builds.
8282 (Layout::create_incremental_info_sections): New method.
8283 * layout.h (Layout::incremental_inputs): New method.
8284 (Layout::create_incremental_info_sections): New method.
8285 (Layout::incremental_inputs_): New field.
8286 * main.cc (main): Notify Incremental_input of the command line.
8287
e55bde5e
ILT
82882009-04-01 Ian Lance Taylor <iant@google.com>
8289 Mikolaj Zalewski <mikolajz@google.com>
8290
8291 * gold.h (reserve_unordered_map): Define, three versions, one for
8292 each version of Unordered_map.
8293 * layout.cc (Layout::Layout): Remove options parameter. Add
8294 number_of_input_files parameter. Don't initialize options_.
8295 Initialize number_of_input_files_ and resized_signatures_. Move
8296 sections_are_attached_.
8297 (Layout::layout_group): Reserve space for group_signatures_.
8298 (Layout::find_or_add_kept_section): Change name parameter to be a
8299 reference. Resize signatures_ map when it gets large enough.
8300 (Layout::layout_eh_frame): Use parameters->options() instead of
8301 this->options_.
8302 (Layout::make_output_section): Likewise.
8303 (Layout::attach_allocated_section_to_segment): Likewise.
8304 (Layout::finalize, Layout::create_executable_stack): Likewise.
8305 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
8306 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
8307 * layout.h (class Layout): Update declarations. Remove options_
8308 field. Add number_of_input_files_ and resized_signatures_
8309 fields. Move sections_are_attached_ field.
8310 * main.cc (main): Pass number of input files to Layout
8311 constructor. Don't pass options.
8312
154b857c
ILT
83132009-03-30 Ian Lance Taylor <iant@google.com>
8314
8315 * ffsll.c (ffsll): Correct implementation.
8316
2f35ab9b
ILT
83172009-03-27 Ian Lance Taylor <iant@google.com>
8318
fd03461a
ILT
8319 * ffsll.c: New file.
8320 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
8321 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
8322 * ftruncate.c (ftruncate): Declare before definition.
8323 * mremap.c (mremap): Likewise.
8324 * pread.c (pread): Likewise.
8325 * configure, Makefile.in, config.in: Rebuild.
8326
2f35ab9b
ILT
8327 * mremap.c: New file.
8328 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
8329 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
8330 (mremap): Declare if HAVE_MREMAP is not defined.
8331 * configure, Makefile.in, config.in: Rebuild.
8332
33aea2fd
CC
83332009-03-27 Cary Coutant <ccoutant@google.com>
8334
8335 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
8336 position independent.
8337 * sparc.cc (Target_sparc::check_non_pic): Likewise.
8338 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
8339
6d479619
CC
83402009-03-24 Cary Coutant <ccoutant@google.com>
8341
8342 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
8343 an executable.
8344 (needs_dynamic_reloc): Likewise.
8345
afc06bb8
ILT
83462009-03-24 Ian Lance Taylor <iant@google.com>
8347
8348 * yyscript.y (file_cmd): Recognize EXTERN.
8349 (extern_name_list, extern_name_list_body): New nonterminals.
8350 * script.cc (script_add_extern): Define.
8351 * script-c.h (script_add_extern): Declare.
8352
f6060a4d
ILT
83532009-03-24 Rafael Avila de Espindola <espindola@google.com>
8354
8355 * object.cc (is_elf_object): Define.
8356 * object.h (is_elf_object): Declare.
8357 * archive.cc (Archive::get_elf_object_for_member): Call
8358 is_elf_object.
33aea2fd 8359 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 8360
26736d8e
ILT
83612009-03-24 Elliott Hughes <enh@google.com>
8362
8363 * output.cc (Output_file::map_anonymous): Define.
8364 (Output_file::map): Use map_anonymous. If the regular mmap fails,
8365 try an anonymous one. Report the size if the mmap fails.
8366 * output.h (class Output_file): Declare map_anonymous.
8367
22fd9730
ILT
83682009-03-24 Ian Lance Taylor <iant@google.com>
8369
8370 * target-select.cc (instantiate_target): Don't acquire the lock if
8371 the instantiated_target_ field has already been set.
8372
cb010894
ILT
83732009-03-23 Ian Lance Taylor <iant@google.com>
8374
7f055c20
ILT
8375 * gold-threads.h (class Initialize_lock): Define.
8376 * gold-threads.cc (class Initialize_lock_once): Define.
8377 (initialize_lock_control): New static variable.
8378 (initialize_lock_pointer): New static variable.
8379 (initialize_lock_once): New static function.
8380 (Initialize_lock::Initialize_lock): Define.
8381 (Initialize_lock::initialize): Define.
8382 * target-select.h: Include "gold-threads.h".
8383 (class Target_selector): Add lock_ and initialize_lock_ fields.
8384 Don't define instantiate_target, just declare it.
8385 * target-select.cc (Target_selector::Target_selector): Initialize
8386 new fields.
8387 (Target_selector::instantiate_target): Define.
8388 * descriptors.h: Include "gold-threads.h".
8389 (class Descriptors): Add initialize_lock_ field.
8390 * descriptors.cc (Descriptors::Descriptors): Initialize new
8391 field.
8392 (Descriptors::open): Use initialize_lock_ field
8393 * errors.h (class Errors): Add initialize_lock_ field.
8394 * errors.cc (Errors::Errors): Initialize new field.
8395 (Errors::initialize_lock): Use initialize_lock_ field.
8396 * powerpc.cc (class Target_selector_powerpc): Remove
8397 instantiated_target_ field. In do_recognize call
8398 instantiate_target rather than do_instantiate_target. In
8399 do_instantiate_target just allocate a new target.
8400 * sparc.cc (class Target_selector_sparc): Likewise.
8401
36959681
ILT
8402 * freebsd.h: New file.
8403 * i386.cc: Include "freebsd.h".
8404 (Target_i386): Derive from Target_freebsd rather than
8405 Sized_target.
8406 (Target_selector_i386): Derive from Target_selector_freebsd rather
8407 than Target_selector.
8408 * x86_64.cc: Include "freebsd.h".
8409 (Target_x86_64): Derive from Target_freebsd rather than
8410 Sized_target.
8411 (Target_selector_x86_64): Derive from Target_selector_freebsd
8412 rather than Target_selector.
8413 * target.h (class Target): Add adjust_elf_header and
8414 do_adjust_elf_header.
8415 * output.cc (Output_file_header:: do_sized_write): Call target
8416 adjust_elf_header routine.
8417 * configure.tgt: Set targ_osabi.
8418 * configure.ac: Define GOLD_DEFAULT_OSABI.
8419 * parameters.cc (Parameters::default_target): Pass
8420 GOLD_DEFAULT_OSABI to select_target.
8421 * target-select.h (class Target_selector): Make instantiate_target
8422 protected rather than private.
8423 * Makefile.am (HFILES): Add freebsd.h.
8424 * configure, Makefile.in, config.in: Rebuild.
8425
cb010894
ILT
8426 * merge.cc (do_add_input_section): Correct pend value. Change
8427 message about last entry not being null terminated from error to
8428 warning.
8429
0e879927
ILT
84302009-03-20 Mikolaj Zalewski <mikolajz@google.com>
8431
8432 * incremental.cc: New file.
8433 * Makefile.am (CCFILES): Add incremental.cc.
8434 * Makefile.in: Rebuild.
8435
41105937
PP
84362009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
8437
8438 * layout.cc (Layout::output_section_name): Preserve names
8439 of '.note.' sections.
e1df38aa 8440
60439920
ILT
84412009-03-19 Ian Lance Taylor <iant@google.com>
8442
8443 * descriptors.cc (Descriptors::open): Check that the options are
8444 valid before using them.
8445
0d371ad3
ILT
84462009-03-18 Ian Lance Taylor <iant@google.com>
8447
8448 * script-sections.h: Include <list>.
8449 (class Script_sections): Change Sections_elements from std::vector
8450 to std::list. Typedef public Elements_iterator. Add
8451 orphan_section_placement_, data_segment_align_start_, and
8452 saw_data_segment_align_ fields. Remove data_segment_align_index_
8453 field.
8454 * script-sections.cc (class Orphan_section_placement): New class.
8455 (class Sections_element): Add virtual functions is_relro and
8456 orphan_section_init. Remove virtual function place_orphan_here.
8457 (class Output_section_definition): Add is_relro and
8458 orphan_section_init. Remove place_orphan_here.
8459 (class Orphan_output_section): Likewise.
8460 (Script_sections::Script_sections): Update for field changes.
8461 (Script_sections::data_segment_align): Set saw_data_segment_align_
8462 and data_segment_align_start_, not data_segment_align_index.
8463 (Script_sections::data_segment_relro_end): Check
8464 saw_data_segment_align_. Use data_segment_align_start_ rather
8465 than data_segment_align_index_.
8466 (Script_sections::place_orphan): Rewrite to use
8467 Orphan_section_placement.
8468
9201d894
ILT
84692009-03-17 Ian Lance Taylor <iant@google.com>
8470
9c5b8369
ILT
8471 * archive.cc (Archive::add_symbols): Check for a version attached
8472 to the symbol name in the archive map.
8473 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
8474 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
8475 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
8476 (ver_test_11.a): New target.
8477 * testsuite/Makefile.in: Rebuild.
8478
9201d894
ILT
8479 * configure.ac: Check for chsize and posix_fallocate. Replace
8480 ftruncate.
8481 * ftruncate.c: New file, from gnulib.
8482 * output.cc (posix_fallocate): Define dummy version if not
8483 HAVE_POSIX_FALLOCATE.
8484 (Output_file::map): Call posix_fallocate rather than lseek and
8485 write.
8486 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
8487 * configure, Makefile.in, config.in: Rebuild.
8488
ef4ab7a8 84892009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 8490
ef4ab7a8
PP
8491 * layout.h (Layout::create_note): Add section_name parameter.
8492 * layout.cc (Layout::create_note): Likewise.
8493 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 8494
8c500701
ILT
84952009-03-17 Ian Lance Taylor <iant@google.com>
8496
e85b18e1
ILT
8497 * descriptors.cc: Include "options.h".
8498 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
8499 (Descriptors::open): Always use O_CLOEXEC when opening a new
8500 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
8501 then set FD_CLOEXEC.
8502
9efe6174
ILT
8503 * sparc.cc (class Target_sparc): Add has_got_section.
8504 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
8505 make sure we have a GOT section.
8506
8507 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
8508 (Target_sparc::Scan::local): Likewise.
8509 (Target_sparc::Scan::global): Likewise.
8510 (Target_sparc::Relocate::relocate): Likewise.
8511 (Target_sparc::Relocate::relocate_tls): Likewise.
8512
8c500701
ILT
8513 * symtab.cc (Symbol_table::define_default_version): New function,
8514 broken out of add_from_object.
8515 (Symbol_table::add_from_object): Call define_default_version.
8516 (Symbol_table::define_special_symbol): Add resolve_oldsym
8517 parameter. Change all callers. If the version for a symbol comes
8518 from a version script, resolve it with the symbol with the same
8519 name with no version. Also add the symbol without a version if
8520 appropriate.
8521 (do_define_in_output_data): If resolving with oldsym, don't delete
8522 sym.
8523 (do_define_in_output_segment): Likewise.
8524 (do_define_as_constant): Likewise.
8525 * symtab.h (class Symbol_table): Update declarations.
8526
f1ed28fb
ILT
85272009-03-13 Ian Lance Taylor <iant@google.com>
8528
15f8229b
ILT
8529 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8530 (Read_symbols::requeue): New function.
8531 (Read_symbols::do_read_symbols): If make_elf_object fails because
8532 the target type is not configured, and the file was searched for,
8533 issue a warning and retry with the next directory.
8534 (Add_symbols::run): If the file has an incompatible format, and
8535 it was searched for, requeue the Read_symbols task. On error,
8536 release the object.
8537 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8538 dirindex parameter to constructor. Change all callers. Declare
8539 incompatible_warning and requeue.
8540 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8541 input_argument_ and input_group_ fields. Add them to
8542 constructor. Change all callers.
8543 (class Read_script): Add dirindex_ field. Add it to constructor.
8544 Change all callers.
8545 * archive.cc (Archive::setup): Remove input_objects parameter.
8546 Change all callers.
8547 (Archive::get_file_and_offset): Likewise.
8548 (Archive::read_all_symbols): Likewise.
8549 (Archive::read_symbols): Likewise.
8550 (Archive::get_elf_object_for_member): Remove input_objects
8551 parameter. Add punconfigured parameter. Change all callers.
8552 (Archive::add_symbols): Change return type to bool. Check return
8553 value of include_member.
8554 (Archive::include_all_members): Likewise.
8555 (Archive::include_member): Change return type to bool. Return
8556 false if first included object has incompatible target. Set
8557 included_member_ field.
8558 (Add_archive_symbols::run): If add_symbols returns false, requeue
8559 Read_symbols task.
8560 * archive.h (class Archive): Add included_member_ field.
8561 Initialize it in constructor. Add input_file and searched_for
8562 methods. Update declarations.
8563 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8564 input_argument_ fields. Add them to constructor. Change all
8565 callers.
8566 * script.cc: Include "target-select.h".
8567 (class Parser_closure): Add skip_on_incompatible_target_ and
8568 found_incompatible_target_ fields. Add
8569 skip_on_incompatible_target parameter to constructor. Change all
8570 callers. Add methods skip_on_incompatible_target,
8571 clear_skip_on_incompatible_target, found_incompatible_target, and
8572 set_found_incompatible_target.
8573 (read_input_script): Add dirindex parameter. Change all callers.
8574 If parser finds an incompatible target, requeue Read_symbols
8575 task.
8576 (script_set_symbol): Clear skip_on_incompatible_target in
8577 closure.
8578 (script_add_assertion, script_parse_option): Likewise.
8579 (script_start_sections, script_add_phdr): Likewise.
8580 (script_check_output_format): New function.
8581 * script.h (read_input_script): Update declaration.
8582 * script-c.h (script_check_output_format): Declare.
8583 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8584 (ignore_cmd): Remove OUTPUT_FORMAT.
8585 * fileread.cc (Input_file::Input_file): Add explicit this.
8586 (Input_file::will_search_for): New function.
8587 (Input_file::open): Add pindex parameter. Change all callers.
8588 * fileread.h (class Input_file): Add input_file_argument method.
8589 Declare will_search_for. Update declarations.
8590 * object.cc (make_elf_object): Add punconfigured parameter.
8591 Change all callers.
8592 * object.h (class Object): Make input_file public. Add
8593 searched_for method.
8594 (make_elf_object): Update declaration.
8595 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8596 restart search.
8597 * dirsearch.h (class Dirsearch): Update declaration.
8598 * options.h (class General_options): Add --warn-search-mismatch.
8599 * parameters.cc (Parameters::is_compatible_target): New function.
8600 * parameters.h (class Parameters): Declare is_compatible_target.
8601 * workqueue.cc (Workqueue::add_blocker): New function.
8602 * workqueue.h (class Workqueue): Declare add_blocker.
8603
f1ed28fb
ILT
8604 * fileread.cc (Input_file::open): Remove options parameter.
8605 Change all callers.
8606 (Input_file::open_binary): Likewise.
8607 * script.cc (read_input_script): Likewise.
8608 * readsyms.h (class Read_symbols): Remove options_ field. Remove
8609 options parameter from constructor. Change all callers.
8610 (class Read_script): Likewise.
8611 * fileread.h (class Input_file): Update declarations.
8612 * script.h (read_input_script): Update declaration.
8613
34dd024a
NC
86142009-03-10 Nick Clifton <nickc@redhat.com>
8615
8616 * po/es.po: New Spanish translation.
8617
6d71b17c
CC
86182009-03-06 Cary Coutant <ccoutant@google.com>
8619
8620 * options.cc (parse_short_option): Keep dash_z from registering itself.
8621
031cdbed
ILT
86222009-03-03 Ian Lance Taylor <iant@google.com>
8623
8624 PR 9918
8625 * target-reloc.h (relocate_section): Pass output_section to
8626 relocate.
8627 * i386.cc (Target_i386::should_apply_static_reloc): Add
8628 output_section parameter. Change all callers.
8629 (Target_i386::Relocate::relocate): Add output_section parameter.
8630 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8631 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
8632 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
8633 * testsuite/two_file_shared.sh: New script.
8634 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
8635 (check_DATA): Add two_file_shared.dbg.
8636 (two_file_shared.dbg): New target.
8637 * testsuite/Makefile.in: Rebuild.
8638
15d5fa16
ILT
86392009-03-01 Ian Lance Taylor <iant@google.com>
8640
8641 * configure.ac: Check for byteswap.h.
8642 * configure: Rebuild.
8643 * config.in: Rebuild.
8644
8a4c0b0d
ILT
86452009-03-01 Mikolaj Zalewski <mikolajz@google.com>
8646
8647 * layout.cc (Layout::find_or_add_kept_section): New function.
8648 (Layout::add_comdat): Removed.
8649 * layout.h (struct Kept_section): Move out of class Layout.
8650 Remove trailing underscores from field names. Add group_sections
8651 field. Rename group_ field to is_group. Change all uses.
8652 (class Layout): Declare find_or_add_kept_section, not add_comdat.
8653 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
8654 comdat_groups_ field.
8655 (Sized_relobj::include_section_group): Use
8656 find_or_add_kept_section and Kept_section::group_sections.
8657 (Sized_relobj::include_linkonce_section): Likewise.
8658 * object.cc (class Sized_relobj): Don't define Comdat_group or
8659 Comdat_group_table. Remove find_comdat_group and
8660 add_comdat_group. Remove comdat_groups_ field.
8661 * plugin.cc (include_comdat_group): Use
8662 Layout::find_or_add_kept_section.
8663
b4ecf66b
ILT
86642009-02-28 Ian Lance Taylor <iant@google.com>
8665
14359ca0
ILT
8666 * README: --gc-sections and map files are now supported. Document
8667 some build requirements.
8668
b4ecf66b
ILT
8669 PR 6992
8670 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
8671 relocatable link set the value of the section symbol to zero.
8672 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
8673 relocatable link don't include the section address in the local
8674 symbol value.
8675
0602e05a
ILT
86762009-02-27 Ian Lance Taylor <iant@google.com>
8677
fd9d194f
ILT
8678 PR 6811
8679 * options.h (class Search_directory): Add is_system_directory.
8680 (class General_options): Declare is_in_system_directory.
8681 * options.cc (get_relative_sysroot): Make static.
8682 (get_default_sysroot): Make static.
8683 (General_optoins::is_in_system_directory): New function.
8684 * fileread.cc (Input_file::is_in_system_directory): New function.
8685 * fileread.h (class Input_file): Declare is_in_system_directory.
8686 * object.h (class Object): Add is_in_system_directory.
8687 (class Input_objects): Remove system_library_directory_ field.
8688 * object.cc (Input_objects::add_object): Don't set
8689 system_library_directory_.
8690 (input_objects::found_in_system_library_directory): Remove.
8691 * symtab.cc (Symbol_table::write_globals): Remove input_objects
8692 parameter. Change all callers.
8693 (Symbol_table::sized_write_globals): Likewise.
8694 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
8695 Call Object::is_in_system_directory.
8696 * symtab.h (class Symbol_table): Update declarations.
8697
61edd21f
ILT
8698 PR 5990
8699 * descriptors.h (Open_descriptor): Add is_on_stack field.
8700 * descriptors.cc (Descriptors::open): If the descriptor is on the
8701 top of the stack, remove it. Initialize is_on_stack field.
8702 (Descriptors::release): Only add pod to stack if it is not on the
8703 stack already.
8704 (Descriptors::close_some_descriptor): Clear stack_next and
8705 is_on_stack fields.
8706
e29e076a
ILT
8707 PR 7091
8708 * output.cc (Output_section::find_starting_output_address): Rename
8709 from starting_output_address; add PADDR parameter; change return
8710 type.
8711 * output.h (class Output_section): Declare
8712 find_starting_output_address instead of starting_output_address.
8713 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
8714 section symbol for which we can't find a merge section.
8715
0602e05a
ILT
8716 PR 9836
8717 * symtab.cc (Symbol_table::add_from_object): If the visibility is
8718 hidden or internal, force the symbol to be local.
8719 * resolve.cc (Symbol::override_visibility): Define.
8720 (Symbol::override_base): Use override_visibility.
8721 (Symbol_table::resolve): Likewise.
8722 (Symbol::override_base_with_special): Likewise.
8723 (Symbol_table::override_with_special): If the visibility is hidden
8724 or internal, force the symbol to be local.
8725 * symtab.h (class Symbol): Add set_visibility and
8726 override_visibility.
8727 * testsuite/ver_test_1.sh: New file.
8728 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
8729 (check_DATA): Add ver_test_1.syms.
8730 (ver_test_1.syms): New target.
8731 * testsuite/Makefile.in: Rebuild.
8732
401a9a73
CC
87332009-02-25 Cary Coutant <ccoutant@google.com>
8734
8735 * layout.cc (Layout::choose_output_section): Don't rename sections
8736 when using a linker script that has a SECTIONS clause.
8737 * Makefile.in: Regenerate.
8738
8739 * testsuite/Makefile.am (script_test_5.sh): New test case.
8740 * testsuite/Makefile.in: Regenerate.
8741 * testsuite/script_test_5.cc: New file.
8742 * testsuite/script_test_5.sh: New file.
8743 * testsuite/script_test_5.t: New file.
8744
f488e4b0
CC
87452009-02-13 Rafael Avila de Espindola <espindola@google.com>
8746
8747 * archive.cc (Archive::include_member): Update calls to add_symbols.
8748 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
8749 the Layout argument.
8750 * dynobj.h (do_add_symbols): Add the Layout argument.
8751 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
8752 Layout argument.
8753 * object.h (Object::add_symbols): Add the Layout argument.
8754 (Object::do_add_symbols): Add the Layout argument.
8755 (Sized_relobj::do_add_symbols): Add the Layout argument.
8756 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
8757 Unify the two versions.
8758 (Add_plugin_symbols): Remove.
8759 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
8760 (Sized_pluginobj::do_add_symbols): Unify the two versions.
8761 (Add_plugin_symbols): Remove.
8762 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
8763 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
8764 (Add_symbols::run): Make it work with Pulginobj.
8765
89dd1680
ILT
87662009-02-06 Ian Lance Taylor <iant@google.com>
8767
8768 * object.cc (Sized_relobj::do_layout): Make info message start
8769 with lower case letter.
8770
266d0a74
ILT
87712009-02-06 Mikolaj Zalewski <mikolajz@google.com>
8772
602b464e
ILT
8773 * binary.cc: Fix file comment.
8774
266d0a74
ILT
8775 * options.h (enum Incremental_disposition): Define.
8776 (class General_options): Add new options: --incremental,
8777 --incremental_changed, --incremental_unchanged,
8778 --incremental_unknown. Add incremental_disposition_ and
8779 implicit_incremental_ fields.
8780 (General_options::incremental_disposition): New function.
8781 (class Position_dependent_options): Add incremental_disposition
8782 option.
8783 (Position_dependent_options::copy_from_options): Set incremental
8784 dispositions.
8785 * options.cc (General_options::parse_incremental_changed): New
8786 function.
8787 (General_options::parse_incremental_unchanged): New function.
8788 (General_options::parse_incremental_unknown): New function.
8789 (General_options::General_options): Initialize new fields
8790 incremental_disposition_ and implicit_incremental_.
8791 (General_options::finalize): Check for uasge of --incremental-*
8792 without --incremental.
8793
f073bbf7
CD
87942009-02-06 Chris Demetriou <cgd@google.com>
8795
8796 * gold.h (gold_undefined_symbol): Change to take only a Symbol
8797 pointer and to report location as the file name associated with
8798 the symbol.
8799 (gold_undefined_symbol_at_location): New function to replace the
8800 old gold_undefined_symbol functionality.
8801 * target-reloc.h (relocate_section): Update to use
8802 gold_undefined_symbol_at_location.
8803 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8804 Call gold_undefined_symbol function rather than gold_error.
8805 * errors.h (Errors::undefined_symbol): Take location as a
8806 string, rather than calculating it from a relocation.
8807 * errors.cc (Errors::fatal): Print "fatal error:" before the
8808 formatted message.
8809 (Errors::error, Errors::error_at_location): Print "error: "
8810 before the formatted message.
8811 (Errors::undefined_symbol): Take location as a string, rather
8812 than calculating it from a relocation.
8813 (gold_undefined_symbol_at_location): New function akin to
8814 old gold_undefined_symbol, calculates location from relocation.
8815 (gold_undefined_symbol): Change to take only a Symbol pointer
8816 and to report location as the file name associated with the symbol.
8817 * testsuite/debug_msg.sh: Update for changed error messages.
8818 * testsuite/undef_symbol.sh: Likewise.
8819
8e94a90c
ILT
88202009-02-04 Duncan Sands <baldrick@free.fr>
8821
8822 PR 9812
8823 * reduced_debug_output.h
8824 (Output_reduced_debug_abbrev_section::failed): Use format for
8825 gold_warning.
8826 (Output_reduced_debug_info_section::faild): Likewise.
8827
88a0e15b
ILT
88282009-01-31 Mikolaj Zalewski <mikolajz@google.com>
8829
8830 * script.cc (Lazy_demangler): New class.
8831 (Version_script_info::get_symbol_version_helper): Demangle a
8832 symbol only once.
8833
5efc7cd2
CC
88342009-01-29 Cary Coutant <ccoutant@google.com>
8835
8836 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
8837 to __tls_get_addr.
8838 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8839
e0ebcf42
ILT
88402009-01-28 Ian Lance Taylor <iant@google.com>
8841
5efc7cd2 8842 * version.cc (version_string): Bump to 1.9.
75fe7426 8843
e0ebcf42
ILT
8844 * gold.h: Include <cstring> and <stdint.h>.
8845 * version.cc: Include <cstdio>.
8846 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8847 warning.
8848 * reduced_debug_output.cc (insert_into_vector): Rename from
8849 Insert_into_vector; change all callers. Use Swap_unaligned to
8850 avoid aliasing issue; remove union since it is unnecessary.
8851
8e2813be 88522009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8853
8854 * Makefile.am (CCFILES): Add gc.cc.
8855 (HFILES): Add gc.h.
8856 * Makefile.in: Regenerate.
8857 * gold.cc (Gc_runner): New class.
8858 (queue_initial_tasks): Call garbage collection related tasks
8859 when corresponding options are invoked.
8860 (queue_middle_gc_tasks): New function.
8861 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8862 processed early before laying out sections during garbage collection.
8863 * gold.h (queue_middle_gc_tasks): New function.
8864 (is_prefix_of): Move from "layout.cc".
8865 * i386.cc (Target_i386::gc_process_relocs): New function.
8866 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8867 * main.cc (main): Create object of class "Garbage_collection".
8868 * object.cc (Relobj::copy_symbols_data): New function.
8869 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8870 (Sized_relobj::do_layout): Allow this function to be called twice
8871 during garbage collection and defer layout of section during the
6d03d481
ST
8872 first call.
8873 * object.h (Relobj::get_symbols_data): New function.
8874 (Relobj::is_section_name_included): New function.
8875 (Relobj::copy_symbols_data): New function.
8876 (Relobj::set_symbols_data): New function.
8877 (Relobj::get_relocs_data): New function.
8878 (Relobj::set_relocs_data): New function.
8879 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8880 (Relobj::gc_process_relocs): New function.
8881 (Relobj::do_gc_process_relocs): New pure virtual function.
8882 (Relobj::sd_): New data member.
8883 (Sized_relobj::is_output_section_offset_invalid): New function.
8884 (Sized_relobj::do_gc_process_relocs): New function.
8885 * options.h (General_options::gc_sections): Modify to not be a no-op.
8886 (General_options::print_gc_sections): New option.
8887 * plugin.cc (Plugin_finish::run): Remove function call to
8888 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8889 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8890 * reloc.cc (Read_relocs::run): Add task to process relocs and
8891 determine unreferenced sections when doing garbage collection.
8892 (Gc_process_relocs): New class.
8893 (Sized_relobj::do_gc_process_relocs): New function.
8894 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8895 sections that are garbage collected.
8896 * reloc.h (Gc_process_relocs): New class.
8897 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8898 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8899 symbols whose corresponding sections are garbage collected.
8900 (Symbol_table::Symbol_table): Add new parameter for the garbage
8901 collection object.
8902 (Symbol_table::gc_mark_undef_symbols): New function.
8903 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8904 (Symbol_table::gc_mark_dyn_syms): New function.
8905 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8906 as garbage.
8907 (Symbol_table::add_from_object): Likewise.
8908 (Symbol_table::add_from_relobj): When building shared objects, do not
8909 treat externally visible symbols as garbage.
8910 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8911 table information for static and relocatable links.
8912 * symtab.h (Symbol_table::set_gc): New function.
8913 (Symbol_table::gc): New function.
8914 (Symbol_table::gc_mark_undef_symbols): New function.
8915 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8916 (Symbol_table::gc_mark_dyn_syms): New function.
8917 (Symbol_table::gc_): New data member.
e1df38aa 8918 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8919 function.
8920 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8921 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8922
3b293544
CF
89232009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8924
8925 * options.h (General_options::gc_sections): Define as a no-op for now.
8926 (General_options::no_keep_memory): Ditto.
8927 (General_options::Bshareable): Define.
8928 * options.cc (General_options::finalize): Honor -Bshareable.
8929
83d22aa8
AS
89302009-01-20 Andreas Schwab <schwab@suse.de>
8931
8932 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8933 read the value in the contents, since we don't use it. Use the
8934 template endianness when writing.
8935 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8936
cd536b21
AS
89372009-01-19 Andreas Schwab <schwab@suse.de>
8938
8939 * configure.tgt (powerpc64-*): Fix targ_obj.
8940
99e9a495
ILT
89412009-01-15 Ian Lance Taylor <iant@google.com>
8942
8943 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8944 local symbols when stripping all symbols.
8945
bbbfea06
CC
89462009-01-14 Cary Coutant <ccoutant@google.com>
8947
99e9a495 8948 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8949
0f7c0701
CC
89502009-01-14 Cary Coutant <ccoutant@google.com>
8951
8952 * archive.cc (Archive::get_elf_object_for_member): Remove call
8953 to File_read::claim_for_plugin.
8954 * descriptors.cc (Descriptors::open): Remove reference to
8955 is_claimed.
8956 (Descriptors::claim_for_plugin): Remove.
8957 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8958 (Descriptors::is_claimed): Remove.
8959 (claim_descriptor_for_plugin): Remove.
8960 * fileread.cc (File_read::claim_for_plugin): Remove.
8961 * fileread.h (File_read::claim_for_plugin): Remove.
8962 (File_read::descriptor): Reopen descriptor if necessary.
8963 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8964 (Plugin_manager::all_symbols_read): Add task parameter. Change
8965 all callers.
8966 (Plugin_manager::get_input_file): New function.
8967 (Plugin_manager::release_input_file): New function.
8968 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8969 corresponding data member.
8970 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8971 and pass to base constructor. Change all callers.
8972 (get_input_file, release_input_file): New functions.
8973 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8974 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8975 (Plugin_manager::all_symbols_read): Add task parameter.
8976 (Plugin_manager::get_input_file): New function.
8977 (Plugin_manager::release_input_file): New function.
8978 (Plugin_manager::task_): New data member.
8979 (Pluginobj::Pluginobj): Add filesize parameter.
8980 (Pluginobj::filename): New function.
8981 (Pluginobj::descriptor): New function.
8982 (Pluginobj::filesize): New function.
8983 (Pluginobj::filesize_): New data member.
8984 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8985 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8986 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8987
8988 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8989 with archive libraries.
8990 * testsuite/Makefile.in: Regenerate.
8991 * testsuite/plugin_test.c (struct sym_info): New type.
8992 (get_input_file, release_input_file): New static variables.
8993 (onload): Capture new transfer vector entries.
8994 (claim_file_hook): Stop reading at end of file according to filesize.
8995 Factor out parsing of readelf output into separate function.
8996 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8997 APIs and get the source file name from the symbol table. Convert
8998 source file name to corresponding object file name. Print info
8999 message when adding new input files.
9000 (parse_readelf_line): New function.
9001 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9002 * testsuite/plugin_test_2.sh: Likewise.
9003 * testsuite/plugin_test_3.sh: Likewise.
9004 * testsuite/plugin_test_4.sh: New test case.
9005
62a6d109
ILT
90062009-01-07 Ian Lance Taylor <iant@google.com>
9007
9008 * version.cc (version_string): Bump to 1.8.
9009
483620e8
CC
90102008-12-23 Cary Coutant <ccoutant@google.com>
9011
9012 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9013 * plugin.cc (Plugin_manager::finish): Rename as
9014 layout_deferred_objects. Move cleanup to separate function.
9015 (Plugin_manager::cleanup): New function.
9016 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9017 separately.
9018 * plugin.h (Plugin_manager::finish): Rename as
9019 layout_deferred_objects.
9020 (Plugin_manager::cleanup): New function.
9021 (Plugin_manager::cleanup_done): New field.
9022
d66a9eb3
CC
90232008-12-23 Cary Coutant <ccoutant@google.com>
9024
9025 * plugin.cc (is_visible_from_outside): New function.
9026 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9027 so we don't return "IR only" status for exported symbols or -r links.
9028
9029 * testsuite/Makefile.am (plugin_test_3): New test case.
9030 * testsuite/Makefile.in: Regenerate.
9031 * testsuite/plugin_test_3.sh: New file.
9032
5995b570
CC
90332008-12-22 Cary Coutant <ccoutant@google.com>
9034
9035 * object.cc (Sized_relobj::layout_section): New function.
9036 (Sized_relobj::do_layout): Defer layout of input sections until after
9037 plugin has provided replacement files.
9038 (Sized_relobj::do_layout_deferred_sections): New function.
9039 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9040 (Relobj::layout_deferred_sections): New function.
9041 (Relobj::do_layout_deferred_sections): New function.
9042 (Sized_relobj::do_layout_deferred_sections): New function.
9043 (Sized_relobj::layout_section): New function.
9044 (Sized_relobj::Deferred_layout): New structure.
9045 (Sized_relobj::deferred_layout_): New field.
9046 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9047 Change all callers. Layout deferred sections.
9048 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9049 references.
9050 (Plugin_hook::run): Move code from do_plugin_hook inline.
9051 (Plugin_hook::do_plugin_hook): Remove.
9052 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9053 (Plugin_manager::finish): Renamed, was cleanup.
9054 (Plugin_manager::should_defer_layout): New function.
9055 (Plugin_manager::add_deferred_layout_object): New function.
9056 (Plugin_manager::Deferred_layout_list): New type.
9057 (Plugin_manager::deferred_layout_objects_): New field.
9058 (Plugin_hook::do_plugin_hook): Remove.
9059
ee769c88
ILT
90602008-12-17 Ian Lance Taylor <iant@google.com>
9061
9062 * options.h (class General_options): Add --no case for
9063 --export-dynamic.
9064
abc8dcba
CC
90652008-12-16 Cary Coutant <ccoutant@google.com>
9066
9067 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9068 vector.
9069 (Plugin_manager::claim_file): Create plugin object even if
9070 plugin did not call the add_symbols callback.
9071 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9072 asking for more symbols than were added.
9073 * testsuite/Makefile.am (plugin_test_1): Add test case with
9074 no global symbols.
9075 (empty.syms): New target.
9076 * testsuite/Makefile.in: Regenerate.
9077 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9078 message. Don't call add_symbols if no globals.
9079 (all_symbols_read_hook): Don't provide replacement for empty
9080 claimed file.
9081
b0074644
ILT
90822008-12-12 Ian Lance Taylor <iant@google.com>
9083
68943102
ILT
9084 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9085 r_type == 0 for a local symbol with r_sym == 0.
9086 (scan_relocatable_relocs): Pass r_sym to
9087 local_non_section_strategy.
9088 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9089 r_sym parameter.
9090
b0074644
ILT
9091 * configure.ac: Update test for TLS descriptors: they are
9092 supported as of glibc 2.9.
9093 * configure: Rebuild.
9094
c2508178
ILT
90952008-12-11 Ian Lance Taylor <iant@google.com>
9096
9097 PR 7091
9098 * target-reloc.h (Default_scan_relocatable_relocs): For each
9099 function, map r_type == 0 to RELOC_DISCARD.
9100
2756a258
CC
91012008-12-10 Cary Coutant <ccoutant@google.com>
9102
9103 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9104 object to override a kept COMDAT group from a plugin object.
9105
bb6f53d3
ILT
91062008-12-09 Ian Lance Taylor <iant@google.com>
9107
fbc558e1
ILT
9108 PR 7088
9109 * yyscript.y (file_cmd): Handle INPUT.
9110
bb6f53d3
ILT
9111 * testsuite/initpri1.c: Change all declarations to be full
9112 prototypes by adding void, to avoid compiler warnings.
9113
4674ecfc
CC
91142008-12-05 Rafael Avila de Espindola <espindola@google.com>
9115
9116 * options.cc (General_options::parse_plugin_opt): New.
9117 (General_options::add_plugin): The argument now is just the filename.
9118 (General_options::add_plugin_option): New.
9119 * options.h (plugin_opt): New.
9120 (add_plugin): Change argument name.
9121 (add_plugin_option): New.
9122 * plugin.cc (Plugin::load): Don't parse the plugin option.
9123 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9124 (Plugin::add_option): New.
9125 (Plugin::args_): Change type.
9126 (Plugin::filename_): New.
9127 (Plugin_manager::add_plugin_option): New.
9128 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9129 * testsuite/Makefile.in: Regenerate.
9130
fd06b4aa
CC
91312008-12-05 Cary Coutant <ccoutant@google.com>
9132
9133 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9134 Handle --strip-lto-sections option.
9135 * options.h (strip_lto_sections): New option.
9136
6c52134c
CC
91372008-12-01 Cary Coutant <ccoutant@google.com>
9138
9139 * plugin.cc (ld_plugin_message): Change format parameter to const.
9140 Fix mismatch between new[] and delete.
9141
a45248e0
CC
91422008-11-14 Cary Coutant <ccoutant@google.com>
9143
9144 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9145 instead of -1U.
9146
c82fbeee
CS
91472008-11-05 Craig Silverstein <csilvers@google.com>
9148
9149 * options.cc (General_options::parse_dynamic_list): New function.
9150 * options.h (General_options): New flags dynamic_list,
9151 dynamic_list_data, dynamic_list_cpp_new, and
9152 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9153 (General_options::in_dynamic_list): New function.
9154 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9155 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9156 (Lex::can_continue_name): Likewise.
9157 (yylex): Likewise.
9158 (read_script_file): New parameter script_options.
9159 (read_dynamic_list): New function.
9160 (Script_options::define_dynamic_list): New function.
9161 (dynamic_list_keyword_parsecodes): New variable.
9162 (dynamic_list_keywords): New variable.
9163 * script.h (Script_options::define_dynamic_list): New function
9164 prototype.
9165 (read_dynamic_list): New function prototype.
9166 * symtab.cc (strprefix): New macro.
9167 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9168 dynamic_list_data, dynamic_list_cpp_new, and
9169 dynamic_list_cpp_typeinfo.
9170 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9171 (dynamic_list_expr): New rule.
9172 (dynamic_list_nodes): Likewise.
9173 (dynamic_list_node): Likewise.
9174 * testsuite/Makefile.am (dynamic_list): New test.
9175 * testsuite/Makefile.in: Regenerated.
9176 * testsuite/dynamic_list.t: New file.
9177 * testsuite/dynamic_list.sh: New file.
9178
e0bb29a5
CS
91792008-11-05 Craig Silverstein <csilvers@google.com>
9180
9181 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9182 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9183 (t11_last): Likewise.
9184 * testsuite/ver_test_6.c (main): Likewise.
9185
4e1e25e0
CC
91862008-10-07 Cary Coutant <ccoutant@google.com>
9187
9188 * options.c (General_options::finalize): Add check for -static and
9189 -shared.
9190 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9191 is not empty.
9192
92f03fcb
CC
91932008-10-02 Cary Coutant <ccoutant@google.com>
9194
9195 * plugin.cc (make_sized_plugin_object): Fix conditional
9196 compilation to work when not all targets are enabled.
9197
fbd8a257
CC
91982008-09-29 Cary Coutant <ccoutant@google.com>
9199
9200 * archive.cc (Archive::get_file_and_offset): Use filename instead
9201 of name to get library path.
9202 (Archive::include_member): Unlock external member of a thin archive.
9203
9204 * testsuite/Makefile.am (TEST_AR): New variable.
9205 (thin_archive_test_1): New test.
9206 (thin_archive_test_2): New test.
81636b3f
CC
9207 * testsuite/Makefile.in: Regenerate.
9208 * testsuite/thin_archive_main.cc: New file.
9209 * testsuite/thin_archive_test_1.cc: New file.
9210 * testsuite/thin_archive_test_2.cc: New file.
9211 * testsuite/thin_archive_test_3.cc: New file.
9212 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 9213
eff45813
CC
92142008-09-29 Cary Coutant <ccoutant@google.com>
9215
9216 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9217 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9218 instead of -1U.
9219 (Sized_relobj::do_finalize_local_symbols): Likewise.
9220 (Sized_relobj::map_to_kept_section): Likewise.
9221 * object.h (Sized_relobj::invalid_address): New constant.
9222 (Sized_relobj::do_output_section_offset): Check for invalid_address
9223 and return -1ULL.
9224 * output.cc (Output_reloc::local_section_offset): Use constant
9225 invalid_address instead of -1U.
9226 (Output_reloc::get_address): Likewise.
9227 (Output_section::output_address): Change -1U to -1ULL.
9228 * output.h (Output_reloc::invalid_address): New constant.
9229 * reloc.cc (Sized_relobj::write_sections): Use constant
9230 invalid_address instead of -1U.
9231 (Sized_relobj::relocate_sections): Likewise.
9232 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9233 values for merge sections.
9234 * target-reloc.h (relocate_for_relocatable): Use constant
9235 invalid_address instead of -1U.
9236
89fc3421
CC
92372008-09-19 Cary Coutant <ccoutant@google.com>
9238
9239 Add plugin functionality for link-time optimization (LTO).
9240 * configure.ac (plugins): Add --enable-plugins option.
9241 * configure: Regenerate.
9242 * config.in: Regenerate.
9243 * Makefile.am (LIBDL): New variable.
9244 (CCFILES): Add plugin.cc.
9245 (HFILES): Add plugin.h.
9246 (ldadd_var): Add LIBDL.
9247 * Makefile.in: Regenerate.
9248
9249 * archive.cc: Include "plugin.h".
9250 (Archive::setup): Don't preread archive symbols when using a plugin.
9251 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9252 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9253 files.
9254 (Archive::include_member): Add symbols from plugin objects.
9255 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9256 * descriptors.cc (Descriptors::open): Check for file descriptors
9257 abandoned by plugins.
9258 (Descriptors::claim_for_plugin): New function.
9259 * descriptors.h (Descriptors::claim_for_plugin): New function.
9260 (Open_descriptor::is_claimed): New field.
9261 (claim_descriptor_for_plugin): New function.
9262 * fileread.cc (File_read::claim_for_plugin): New function.
9263 * fileread.h (File_read::claim_for_plugin): New function.
9264 (File_read::descriptor): New function.
9265 * gold.cc: Include "plugin.h".
9266 (queue_initial_tasks): Add task to call plugin hooks for generating
9267 new object files.
9268 * main.cc: Include "plugin.h".
9269 (main): Load plugin libraries.
9270 * object.h (Pluginobj): Declare.
9271 (Object::pluginobj): New function.
9272 (Object::do_pluginobj): New function.
9273 (Object::set_target): New function.
9274 * options.cc: Include "plugin.h".
9275 (General_options::parse_plugin): New function.
9276 (General_options::General_options): Initialize plugins_ field.
9277 (General_options::add_plugin): New function.
9278 * options.h (Plugin_manager): Declare.
9279 (General_options): Add --plugin option.
9280 (General_options::has_plugins): New function.
9281 (General_options::plugins): New function.
9282 (General_options::add_plugin): New function.
9283 (General_options::plugins_): New field.
9284 * plugin.cc: New file.
9285 * plugin.h: New file.
9286 * readsyms.cc: Include "plugin.h".
9287 (Read_symbols::do_read_symbols): Check for archive before checking
9288 for ELF file. Call plugin hooks to claim files.
9289 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9290 from a real object file; force override when processing replacement
9291 files.
9292 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9293 (Symbol::init_base_object): Likewise.
9294 (Symbol::init_base_output_data): Likewise.
9295 (Symbol::init_base_output_segment): Likewise.
9296 (Symbol::init_base_constant): Likewise.
9297 (Symbol::init_base_undefined): Likewise.
9298 (Symbol::output_section): Assert that object is not a plugin.
9299 (Symbol_table::add_from_pluginobj): New function.
9300 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9301 undefined.
9302 (Symbol_table::sized_write_globals): Likewise.
9303 (Symbol_table::add_from_pluginobj): Instantiate template.
9304 * symtab.h (Sized_pluginobj): Declare.
9305 (Symbol::in_real_elf): New function.
9306 (Symbol::set_in_real_elf): New function.
9307 (Symbol::in_real_elf_): New field.
9308 (Symbol_table::add_from_pluginobj): New function.
9309
9310 * testsuite/Makefile.am (AM_CFLAGS): New variable.
9311 (LIBDL): New variable.
9312 (LDADD): Add LIBDL.
9313 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
9314 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
9315 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
9316 (MOSTLYCLEANFILES): Likewise.
9317 * testsuite/Makefile.in: Regenerate.
9318 * testsuite/plugin_test.c: New file.
9319 * testsuite/plugin_test_1.sh: New file.
9320 * testsuite/plugin_test_2.sh: New file.
9321
de31bda5
ILT
93222008-09-16 Ian Lance Taylor <iant@google.com>
9323
9c2d0ef9
ILT
9324 * target-reloc.h (relocate_section): Check whether a symbol is
9325 defined by the ABI before reporting an undefined symbol error.
9326 * target.h (Target::is_defined_by_abi): Make parameter const.
9327 (Target::do_is_defined_by_abi): Likewise.
9328 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
9329 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
9330 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
9331 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
9332 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
9333 * testsuite/Makefile.in: Rebuild.
9334
de31bda5
ILT
9335 * fileread.cc (make_view): Add casts to avoid warning.
9336
9fa33bee
AO
93372008-09-16 Alexandre Oliva <aoliva@redhat.com>
9338
9339 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
9340 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9341
183fd0e3
AO
93422008-09-16 Alexandre Oliva <aoliva@redhat.com>
9343
9344 * options.h (General_options::output_is_executable): New.
9345 (General_options::output_is_pie): New.
9346 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
9347 for shared libraries.
9348 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9349
7be8330a
CD
93502008-09-11 Chris Demetriou <cgd@google.com>
9351
9352 * options.h (origin): New -z option.
9353 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
9354 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
9355 in DT_FLAGS_1.
9356
a9caad02
CC
93572008-09-05 Cary Coutant <ccoutant@google.com>
9358
9359 * fileread.cc (File_read::make_view): Add check for attempt to map
9360 beyond end of file.
9361
ae6dce4d
CC
93622008-09-05 Cary Coutant <ccoutant@google.com>
9363
9364 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
9365 explicit instantiations.
9366
d7ab2a47
KVH
93672008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
9368
9369 PR gold/6858
9370 * options.cc (General_options::finalize): Allow undefined symbols
9371 in shlibs if linking -shared.
9372
9373 PR gold/6859
9374 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
9375 symbols as not needing a dynsym entry.
9376
1e52a9c1
CS
93772008-08-20 Craig Silverstein <csilvers@google.com>
9378
9379 * fileread.cc (File_read::open): Do not lock the file unless it
9380 was successfully opened.
9381
d85c80a3
CC
93822008-08-14 Cary Coutant <ccoutant@google.com>
9383
9384 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
9385 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
9386 * testsuite/tls_test.cc (struct int128): 128-bit struct
9387 for testing TLS relocs with non-zero addend.
9388 (v12): New TLS variable.
9389 (t12): New test.
9390 (t_last): Add check for v12.
9391 * testsuite/tls_test.h (t12): New function.
9392 * testsuite/tls_test_main.cc (thread_routine): Call new test.
9393
2d924fd9
ILT
93942008-08-13 Ian Lance Taylor <iant@google.com>
9395
9396 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
9397 set tls_segment_ or relro_segment_.
9398 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
9399 when appropriate.
9400 * output.h (Output_section::clear_is_relro): New function.
9401 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
9402 sections specially even when output_data_ is empty.
9403 (Output_segment::maximum_alignment): When first section is relro,
9404 only force alignment for PT_LOAD segments.
9405 * script.cc (script_data_segment_align): New function.
9406 (script_data_segment_relro_end): New function.
9407 * script-c.h (script_data_segment_align): Declare.
9408 (script_data_segment_relro_end): Declare.
9409 * script-sections.h (class Script_sections): Declare
9410 data_segment_align and data_segment_relro_end. Add fields
9411 segment_align_index_ and saw_relro_end_.
9412 * script-sections.cc (class Sections_element): Add set_is_relro
9413 virtual function. Add new bool* parameter to place_orphan_here.
9414 Add get_output_section virtual function.
9415 (class Output_section_definition): Add set_is_relro. Add new
9416 bool* parameter to place_orphan_here. Add get_output_section.
9417 Add is_relro_ field.
9418 (Output_section_definition::Output_section_definition): Initialize
9419 evaluated_address_, evaluated_load_address, evaluated_addralign_,
9420 and is_relro_ fields.
9421 (Output_section_definition::place_orphan_here): Add is_relro
9422 parameter.
9423 (Output_section_definition::set_section_addresses): Set relro for
9424 output section.
9425 (Output_section_definition::alternate_constraint): Likewise.
9426 (class Orphan_output_section): Add new bool* parameter to
9427 place_orphan_here. Add get_output_section.
9428 (Orphan_output_section::place_orphan_here): Add is_relro
9429 parameter.
9430 (Script_sections::Script_sections): Initialize
9431 data_segment_align_index_ and saw_relro_end_.
9432 (Script_sections::data_segment_align): New function.
9433 (Script_sections::data_segment_relro_end): New function.
9434 (Script_sections::place_orphan): Set or clear is_relro.
9435 (Script_sections::set_section_addresses): Force alignment of first
9436 TLS section.
9437 * yyscript.y (exp): Call script_data_segment_align and
9438 script_data_segment_relro_end.
9439 * testsuite/relro_script_test.t: New file.
9440 * testsuite/relro_test.cc (using_script): Declare.
9441 (t1, t2): Test using_script.
9442 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
9443 (relro_script_test_SOURCES): Define.
9444 (relro_script_test_DEPENDENCIES): Define.
9445 (relro_script_test_LDFLAGS): Define.
9446 (relro_script_test_LDADD): Define.
9447 (relro_script_test.so): New target.
9448 * testsuite/Makefile.in: Rebuild.
9449
f827c9a9
CC
94502008-08-06 Cary Coutant <ccoutant@google.com>
9451
9452 * archive.cc (Archive::total_archives, Archive::total_members)
9453 (Archive::total_members_loaded): New variables.
9454 (Archive::setup): Add parameter. Add option to preread
9455 archive symbols.
9456 (Archive::read_armap): Add counter.
9457 (Archive::get_file_and_offset): New function.
9458 (Archive::get_elf_object_for_member): New function.
9459 (Archive::read_all_symbols): New function.
9460 (Archive::read_symbols): New function.
9461 (Archive::add_symbols): Add counters.
9462 (Archive::include_all_members): Use armap to find members if it's
9463 already built.
9464 (Archive::include_member): Skip reading symbols if already read.
9465 Factored code into Archive::get_file_and_offset and
9466 Archive::get_elf_object_for_member. Changed call to
9467 Mapfile::report_include_archive_member.
9468 (Archive::print_stats): New function.
9469 * archive.h: Declare Object and Read_symbols_data classes.
9470 (Archive::Archive): Add initializers for new members.
9471 (Archive::setup): Add parameter.
9472 (Archive::print_stats): New function.
9473 (Archive::total_archives, Archive::total_members)
9474 (Archive::total_members_loaded): New variables.
9475 (Archive::get_file_and_offset): New function.
9476 (Archive::get_elf_object_for_member): New function.
9477 (Archive::read_all_symbols): New function.
9478 (Archive::read_symbols): New function.
9479 (Archive::Archive_member): New class.
9480 (Archive::members_): New member.
9481 (Archive::num_members_): New member.
9482 * main.cc: Include archive.h.
9483 (main): Call Archive::print_stats.
9484 * mapfile.cc (Mapfile::report_include_archive_member): Delete
9485 archive parameter; member_name is now the fully-decorated name.
9486 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
9487 * options.h: (General_options): Add --preread-archive-symbols option.
9488 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
9489 Archive::setup.
9490
de4c45bd
ILT
94912008-08-04 Ian Lance Taylor <iant@google.com>
9492
9493 * symtab.h (Symbol::use_plt_offset): New function.
9494 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
9495 * powerpc.cc (Relocate::relocate): Likewise.
9496 * sparc.cc (Relocate::relocate): Likewise.
9497 * x86_64.cc (Relocate::relocate): Likewise.
9498 * testsuite/weak_plt.sh: New test.
9499 * testsuite/weak_plt_main.cc: New test.
9500 * testsuite/weak_plt_shared.cc: New test.
9501 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
9502 (check_PROGRAMS): Add weak_plt.
9503 (check_DATA): Add weak_plt_shared.so.
9504 (weak_plt_main_pic.o, weak_plt): New targets.
9505 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
9506 * testsuite/Makefile.in: Rebuild.
9507
9508 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
9509 gcctestdir/ld.
9510 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
9511 * testsuite/Makefile.in: Rebuild.
9512
323ee3f4
AM
95132008-08-04 Alan Modra <amodra@bigpond.net.au>
9514
9515 * Makefile.am (POTFILES.in): Set LC_ALL=C.
9516 * Makefile.in: Regenerate.
9517 * po/POTFILES.in: Regenerate.
9518
7c07ecec
ILT
95192008-07-29 Ian Lance Taylor <iant@google.com>
9520
9521 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
9522 symbols before other symbols.
9523 * testsuite/script_test_2.cc (test_addr): Declare.
9524 (test_addr_alias): Declare.
9525 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9526 values.
7c07ecec
ILT
9527 * testsuite/script_test_2.t: Define test_addr_alias and
9528 test_addr.
9529
5778530e
ILT
95302008-07-24 Ian Lance Taylor <iant@google.com>
9531
2a00e4fb
ILT
9532 PR 5990
9533 * descriptors.cc: New file.
9534 * descriptors.h: New file.
9535 * gold-threads.h (class Hold_optional_lock): New class.
9536 * fileread.cc: Include "descriptors.h".
9537 (File_read::~File_read): Release descriptor rather than closing
9538 it.
9539 (File_read::open) [file]: Call open_descriptor rather than open.
9540 Set is_descriptor_opened_.
9541 (File_read::open) [memory]: Assert that descriptor is not open.
9542 (File_read::reopen_descriptor): New function.
9543 (File_read::release): Release descriptor.
9544 (File_read::do_read): Make non-const. Reopen descriptor.
9545 (File_read::read): Make non-const.
9546 (File_read::make_view): Reopen descriptor.
9547 (File_read::do_readv): Likewise.
9548 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9549 Update declarations.
9550 * layout.cc: Include "descriptors.h".
9551 (Layout::create_build_id): Use open_descriptor rather than open.
9552 * output.cc: Include "descriptors.h".
9553 (Output_file::open): Use open_descriptor rather than open.
9554 * archive.cc (Archive::const_iterator): Change Archive to be
9555 non-const.
9556 (Archive::begin, Archive::end): Make non-const.
9557 (Archive::count_members): Likewise.
9558 * archive.h (class Archive): Update declarations.
9559 * object.h (Object::read): Make non-const.
9560 * Makefile.am (CCFILES): Add descriptors.cc.
9561 (HFILES): Add descriptors.h.
9562 * Makefile.in: Rebuild.
9563
801647d1
ILT
9564 PR 6716
9565 * gold.h: Always include <clocale>. Add Solaris workarounds
9566 following code in binutils/sysdep.h.
9567
5edd166e
ILT
9568 PR 6048
9569 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9570 this->eh_frame_hdr_ is NULL before using it.
9571
c89ad728
ILT
9572 * dynobj.cc (Versions::Versions): Update comment.
9573
aa86f06b
ILT
9574 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9575 the base version name.
9576
5778530e
ILT
9577 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9578 array size plus one.
9579 (Stringpool_template::set_string_offsets): Subtract one from key
9580 before using it as an array index.
9581 (Stringpool_template::get_offset_with_length): Likewise.
9582 (Stringpool_template::write_to_buffer): Likewise.
9583 * stringpool.h (Stringpool_template::get_offset_from_key):
9584 Likewise.
9585
057ead22
ILT
95862008-07-23 Ian Lance Taylor <iant@google.com>
9587
7f649c59
ILT
9588 PR 6658
9589 * object.h (Merged_symbol_value::value): Do our best to handle a
9590 negative addend.
9591
057ead22
ILT
9592 PR 6647
9593 * script.cc (Version_script_info::get_versions): Don't add empty
9594 version tag to return value.
9595 (Version_script_info::get_symbol_version_helper): Change return
9596 type to bool. Add pversion parameter. Change all callers.
9597 (script_register_vers_node): Don't require a non-NULL tag.
9598 * script.h (class Version_script_info): Update declarations.
9599 (Version_script_info::get_symbol_version): Change return type to
9600 bool. Add version parameter. Change all callers.
9601 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
9602 handling. Handle an empty version from a version script.
9603 (Symbol_table::define_special_symbol): Likewise.
9604 * testsuite/ver_test_10.script: New file.
9605 * testsuite/ver_test_10.sh: New file.
9606 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
9607 (check_DATA): Add ver_test_10.syms.
9608 (ver_test_10.syms, ver_test_10.so): New target.
9609 * testsuite/Makefile.in: Rebuild.
9610
58e54ac2
CD
96112008-07-23 Simon Baldwin <simonb@google.com>
9612
9613 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
9614 to zero for undefined symbols from dynamic libraries.
9615
95d14cd3
ILT
96162008-07-23 Ian Lance Taylor <iant@google.com>
9617
9618 * symtab.cc (Symbol_table::resolve): Remove version parameter.
9619 Change all callers.
9620 * symtab.h (class Symbol_table): Update declaration.
9621 * testsuite/ver_test_9.cc: New file.
9622 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
9623 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9624 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
9625 (ver_test_9.so, ver_test_9.o): New targets.
9626 * testsuite/Makefile.in: Rebuild.
9627
92de84a6
ILT
96282008-07-22 Ian Lance Taylor <iant@google.com>
9629
34810851
ILT
9630 * options.h (class General_options): Define --check-sections.
9631 * layout.cc (Layout::set_segment_offsets): Handle
9632 --check-sections.
9633
af6156ef
ILT
9634 * options.h (class General_options): Define -n/--nmagic and
9635 -N/--omagic.
9636 * options.cc (General_options::finalize): For -n/--nmagic or
9637 -N/--omagic, set -static.
9638 * layout.cc (Layout::attach_allocated_section_to_segment): If
9639 -N/--omagic, don't put read-only and read-write sections in
9640 different segments.
9641 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
9642 finding a read-only segment.
9643 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
9644 don't set the minimum segment alignment to the common page size,
9645 and don't set the file offset to the address modulo the page size.
9646 * script-sections.cc (Script_sections::create_segments): If
9647 -n/--omagic, don't put read-only and read-write sections in
9648 different segments.
9649
92de84a6
ILT
9650 * cref.cc: New file.
9651 * cref.h: New file.
9652 * options.h (class General_options): Add --print-symbol-counts.
9653 * main.cc (main): Issue defined symbol report if requested.
9654 * archive.cc (Archive::interpret_header): Make into a const member
9655 function.
9656 (Archive::add_symbols): Call Input_objects::archive_start and
9657 archive_stop.
9658 (Archive::const_iterator): Define new class.
9659 (Archive::begin, Archive::end): New functions.
9660 (Archive::include_all_members): Rewrite to use iterator.
9661 (Archive::count_members): New function.
9662 * archive.h (class Archive): Update declarations.
9663 (Archive::filename): New function.
9664 * object.cc: Include "cref.h".
9665 (Sized_relobj::Sized_relobj): Initialize defined_count_.
9666 (Sized_relobj::do_get_global_symbol_counts): New function.
9667 (Input_objects::add_object): Add object to cross-referencer.
9668 (Input_objects::archive_start): New function.
9669 (Input_objects::archive_stop): New function.
9670 (Input_objects::print_symbol_counts): New function.
9671 * object.h: Declare Cref and Archive.
9672 (Object::get_global_symbol_counts): New function.
9673 (Object::do_get_global_symbol_counts): New pure virtual function.
9674 (class Sized_relobj): Add defined_count_ field. Update
9675 declarations.
9676 (class Input_objects): Add cref_ field. Update constructor.
9677 Update declarations.
9678 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
9679 defined_count_.
9680 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
9681 symbol counts.
9682 (Sized_dynobj::do_get_global_symbol_counts): New function.
9683 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
9684 defined_count_. Update declarations. Define Symbols typedef.
9685 * symtab.cc (Symbol_table::add_from_relobj): Add defined
9686 parameter. Change all callers.
9687 (Symbol_table::add_from_dynobj): Add sympointers and defined
9688 parameters. Change all callers.
9689 * symtab.h (class Symbol_table): Update declarations.
9690 * Makefile.am (CCFILES): Add cref.cc.
9691 (HFILES): Add cref.h.
9692 * Makefile.in: Rebuild.
9693
3f7c5e1d
CD
96942008-07-22 Simon Baldwin <simonb@google.com>
9695
9696 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
9697 to zero when writing undefined symbols.
9698
e0b64032
ILT
96992008-07-22 Ian Lance Taylor <iant@google.com>
9700
9701 * output.cc (Output_section::add_input_section): Don't try to
9702 merge empty merge sections.
9703
096b02cf
CS
97042008-07-21 Craig Silverstein <csilvers@google.com>
9705
9706 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9707 Include symbol version in error message.
cd536b21 9708
1d1f116d
CD
97092008-07-20 Chris Demetriou <cgd@google.com>
9710
cd536b21 9711 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
9712 (RANDOM_SEED_CFLAGS): New substituted variable.
9713 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
9714 * configure: Rebuild.
9715 * Makefile.in: Likewise.
9716 * testsuite/Makefile.in: Likewise.
9717
a18f591e
ILT
97182008-07-18 Ian Lance Taylor <iant@google.com>
9719
9720 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
9721 where we see NAME/NULL and NAME/VERSION as separate symbols.
9722 * testsuite/ver_test_main.cc (main): Call t4.
9723 (t4, t4_2a): Define.
9724 * testsuite/ver_test_2.cc (t4_2): Define.
9725 * testsuite/ver_test_2.script: Put t4_2a in VER2.
9726 * testsuite/ver_test_4.cc (t4_2a): Define.
9727 * testsuite/ver_test_4.script: Put t4_2a in VER2.
9728 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
9729
c6e3f6ed
ILT
97302008-07-17 Ian Lance Taylor <iant@google.com>
9731
9732 * dynobj.cc (Versions::add_def): If we give an error about a
9733 missing version, go ahead and create the version anyhow.
9734
ef9beddf
ILT
97352008-07-10 Ian Lance Taylor <iant@google.com>
9736
9737 Handle output sections with more than 0x7fffffff bytes.
9738 * object.h (class Relobj): Change map_to_output_ to
9739 output_sections_, and just keep a section pointer. Change all
9740 uses. Move comdat group support to Sized_relobj.
9741 (Relobj::is_section_specially_mapped): Remove.
9742 (Relobj::output_section): Remove poff parameter. Change all
9743 callers.
9744 (Relobj::output_section_offset): New function.
9745 (Relobj::set_section_offset): Rewrite.
9746 (Relobj::map_to_output): Remove.
9747 (Relobj::output_sections): New function.
9748 (Relobj::do_output_section_offset): New pure virtual function.
9749 (Relobj::do_set_section_offset): Likewise.
9750 (class Sized_relobj): Add section_offsets_ field. Add comdat
9751 group support from Relobj. Update declarations.
9752 (Sized_relobj::get_output_section_offset): New function.
9753 (Sized_relobj::do_output_section_offset): New function.
9754 (Sized_relobj::do_set_section_offset): New function.
9755 * object.cc (Relobj::output_section_address): Remove.
9756 (Sized_relobj::Sized_relobj): Initialize new fields.
9757 (Sized_relobj::include_section_group): Cast find_kept_object to
9758 Sized_relobj.
9759 (Sized_relobj::include_linkonce_section): Likewise.
9760 (Sized_relobj::do_layout): Use separate arrays for output section
9761 and output offset.
9762 (Sized_relobj::do_count_local_symbols): Change map_to_output to
9763 output_sections.
9764 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
9765 output_sections and section_offsets.
9766 (Sized_relobj::write_local_symbols): Likewise.
9767 (map_to_kept_section): Compute output address directly.
9768 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
9769 output_sections and section_offsets.
9770 (Sized_relobj::write_sections): Likewise.
9771 (Sized_relobj::relocate_sections): Likewise.
9772 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
9773 * output.h (class Output_reloc): Update declarations. Change
9774 u2_.relobj to Sized_relobj*.
9775 (class Output_data_reloc): Change add functions to use
9776 Sized_relobj*.
9777 * output.cc (Output_reloc::Output_reloc): Change relobj to
9778 Sized_relobj*.
9779 (Output_reloc::local_section_offset): Change return type to
9780 Elf_Addr. Use get_output_section_offset.
9781 (Output_reloc::get_address): Likewise.
9782 (Output_section::is_input_address_mapped): Don't call
9783 is_section_specially_mapped.
9784 (Output_section::output_offset): Likewise.
9785 (Output_section::output_address): Likewise.
9786 (Output_section::starting_output_address): Likewise.
9787 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
9788 parameter to Sized_relobj*.
9789 (Copy_relocs::need_copy_reloc): Likewise.
9790 (Copy_relocs::save): Likewise.
9791 * copy-relocs.h (class Copy_relocs): Update declarations.
9792 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
9793 Sized_relobj*. Change relobj_ field to Sized_relobj*.
9794 * target-reloc.h (relocate_for_relocatable): Change
9795 offset_in_output_section type to Elf_Addr. Change code that uses
9796 it as well.
9797 * layout.cc (Layout::layout): Always set *off.
9798 * mapfile.cc (Mapfile::print_input_section): Use
9799 output_section_offset.
9800 * i386.cc (Target_i386::copy_reloc): Change object parameter to
9801 Sized_relobj*.
9802 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
9803 * sparc.cc (Target_sparc::copy_reloc): Likewise.
9804 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
9805
5cb66f97
ILT
98062008-07-03 Ian Lance Taylor <iant@google.com>
9807
9808 * layout.cc (Layout::include_section): Do not discard unrecognized
9809 SHT_STRTAB sections.
9810
afe47622
CS
98112008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
9812
9813 * script.cc (Lex::can_continue_name): Make '?' allowable in
9814 version-script names.
9815 * testsuite/version_script.map: Change glob pattern to use '?'
9816
5adf9721
ILT
98172008-06-30 Manish Singh <yosh@gimp.org>
9818
9819 PR 6585
9820 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
9821 Correct typo.
9822
e6fde208
ILT
98232008-06-30 Ian Lance Taylor <iant@google.com>
9824
9825 PR 6660
9826 PR 6682
9827 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
9828 versions]: Don't try to read the value in the contents, since we
9829 don't use it. Use the template endianness when writing.
9830
3f2e6a2d
CC
98312008-06-25 Cary Coutant <ccoutant@google.com>
9832
9833 * fileread.cc (File_read::make_view): Assert on zero-length view.
9834 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
9835 symbol table when there are no symbols to read.
9836
c43d3a48
CS
98372008-06-23 Craig Silverstein <csilvers@google.com>
9838
9839 * version.cc (version_string): Bump to 1.7
9840
5f494ea0
CS
98412008-06-18 Craig Silverstein <csilvers@google.com>
9842
9843 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9844 constant 0xFFFF to type Valtype.
9845 (Powerpc_relocate_functions::rel16_ha): Likewise.
9846
c42e122e
ILT
98472008-06-17 Ian Lance Taylor <iant@google.com>
9848
f34787f8
ILT
9849 * output.h (Output_section::Input_section): Initialize p2align_ to
9850 zero for Output_section_data constructors.
9851 (Output_section::Input_section::addralign): If not an input
9852 section, return the alignment of the Output_section_data.
9853 * testsuite/copy_test.cc: New file.
9854 * testsuite/copy_test_1.cc: New file.
9855 * testsuite/copy_test_2.cc: New file.
9856 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9857 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9858 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9859 (copy_test_1_pic.o, copy_test_1.so): New targets.
9860 (copy_test_2_pic.o, copy_test_2.so): New targets.
9861 * testsuite/Makefile.in: Rebuild.
9862
c42e122e
ILT
9863 * script-sections.cc (Script_sections::place_orphan): Initialize
9864 local variable exact.
9865
ce3ac18a
DE
98662008-06-13 David Edelsohn <edelsohn@gnu.org>
9867
9868 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9869
42cacb20
DE
98702008-06-12 David Edelsohn <edelsohn@gnu.org>
9871 David S. Miller <davem@davemloft.net>
9872
9873 * powerpc.cc: New file.
9874 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9875 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9876 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9877 * Makefile.in: Rebuild.
9878
7b308235
ILT
98792008-06-09 Ian Lance Taylor <iant@google.com>
9880
9881 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9882 <exception>.
9883 (throwing, orig_terminate): New static variables.
9884 (terminate_handler): New static function.
9885 (t2): Set terminate handler.
9886
f0b886e3
ILT
98872008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9888
9889 PR 6584
cd536b21 9890 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9891 alignment.
9892
3e90f135
CC
98932008-05-30 Cary Coutant <ccoutant@google.com>
9894
9895 * archive.cc (Archive::include_all_members) Correct to step
9896 over symbol table and extended name table in thin archives.
9897
e09ad04a
ILT
98982008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9899
9900 PR 6407
9901 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9902 calculation.
9903
62b01cb5
ILT
99042008-05-28 Caleb Howe <cshowe@google.com>
9905
9906 * reduced_debug_output.cc: New file.
9907 * reduced_debug_output.h: New file.
92de84a6 9908 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9909 * options.cc (General_options::finalize): Add strip_debug_non_line
9910 to the strip heirarchy.
9911 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9912 fields.
9913 * layout.cc: Include "reduced_debug_output.h".
9914 (Layout::Layout): Initialize new fields.
9915 (line_only_debug_sections): New static array.
9916 (is_lines_only_debug_sections): New static inline function.
9917 (Layout::include_section): Handle --strip-debug-non-line.
9918 (Layout::make_output_section): If --strip-debug-non-line, build
9919 new output sections for .debug_abbrev and .debug_info.
9920 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9921 gold. Warn about possible overflow.
9922 (read_signed_LEB_128): Likewise.
9923 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9924 (read_signed_LEB_128): Declare.
9925 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9926 (HFILES): Add reduced_debug_output.h.
9927 * Makefile.in: Rebuild.
9928
7d9e3d98
ILT
99292008-05-21 Ian Lance Taylor <iant@google.com>
9930
9931 * mapfile.cc: New file.
9932 * mapfile.h: New file.
9933 * options.h (class General_options): Add -M/--print-map and -Map.
9934 * options.cc (General_options::finalize): Make -M equivalent to
9935 -Map -.
9936 * main.cc: Include <cstdio> and "mapfile.h".
9937 (main): Open mapfile if requested.
9938 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9939 constructor. Change caller.
9940 (queue_initial_tasks): Add mapfile parameter. Change caller.
9941 (queue_middle_tasks): Likewise.
9942 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9943 declarations.
9944 * archive.cc: Include "mapfile.h".
9945 (Archive::add_symbols): Add mapfile parameter. Change all
9946 callers. Pass mapfile, symbol, and reason to include_member.
9947 (Archive::include_all_members): Add mapfile parameter. Change all
9948 callers.
9949 (Archive::include_member): Add mapfile, sym, and why parameters.
9950 Change all callers. Report inclusion to map file.
9951 * archive.h: Include "fileread.h".
9952 (class Archive): Update declarations.
9953 (Archive::file): New const method.
9954 (class Add_archive_symbols): Add mapfile_ field. Update
9955 constructor. Change all callers.
9956 * readsyms.h (class Read_symbols): Likewise.
9957 (class Finish_group): Likewise.
9958 (class Read_script): Likewise.
9959 * common.cc: Include "mapfile.h".
9960 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9961 all callers.
9962 (Symbol_table::do_allocate_commons): Likewise.
9963 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9964 symbol allocation to mapfile.
9965 * common.h (class Allocate_commons_task): Add mapfile_ field.
9966 Update constructor. Change all callers.
9967 * symtab.h (class Symbol_table): Update declarations.
9968 * layout.cc: Include "mapfile.h".
9969 (Layout_task_runner::run): Print information to mapfile.
9970 (Layout::create_gold_note): Change Output_data_fixed_space to
9971 Output_data_zero_fill.
9972 (Layout::create_build_id): Likewise.
9973 (Layout::print_to_mapfile): New function.
9974 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9975 constructor. Change caller.
9976 (class Layout): Declare print_to_mapfile.
9977 * output.cc (Output_section::Input_section::print_to_mapfile): New
9978 function.
9979 (Output_section::add_input_section): If producing a map, always
9980 add to input_sections_ list.
9981 (Output_section::do_print_to_mapfile): New function.
9982 (Output_segment::print_sections_to_mapfile): New function.
9983 (Output_segment::print_section_list_to_mapfile): New function.
9984 * output.h: Include "mapfile.h".
9985 (Output_data::print_to_mapfile): New function.
9986 (Output_data::do_print_to_mapfile): New virtual function.
9987 (Output_segment_headers::do_print_to_mapfile): New function.
9988 (Output_file_header::do_print_to_mapfile): New function.
9989 (Output_data_const::do_print_to_mapfile): New function.
9990 (class Output_data_const_buffer): Add map_name_ field. Update
9991 constructor. Change all callers. Add do_print_to_mapfile
9992 function.
9993 (class Output_data_fixed_space): Likewise.
9994 (class Output_data_space): Likewise.
9995 (class Output_data_zero_fill): New class.
9996 (Output_data_strtab::do_print_to_mapfile): New function.
9997 (Output_data_reloc_base::do_print_to_mapfile): New function.
9998 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9999 (Output_data_group::do_print_to_mapfile): New function.
10000 (Output_data_got::do_print_to_mapfile): New function.
10001 (Output_data_dynamic::do_print_to_mapfile): New function.
10002 (Output_symtab_xindex::do_print_to_mapfile): New function.
10003 (class Output_section): Declare do_print_to_mapflie. Declare
10004 print_to_mapfile in Input_section.
10005 (class Output_segment): Declare new functions.
10006 * object.h (Sized_relobj::symbol_count): New function.
10007 * script-sections.cc
10008 (Output_section_element_dot_assignment::set_section_addresses):
10009 Change Output_data_fixed_space to Output_data_zero_fill.
10010 (Output_data_expression::do_print_to_mapfile): New function.
10011 * script.cc (read_input_script): Add mapfile parameter. Change
10012 all callers.
10013 * script.h (read_input_script): Update declaration.
10014 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10015 (Eh_frame::do_print_to_mapfile): New function.
10016 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10017 (Output_merge_string::do_print_to_mapfile): New function.
10018 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10019 function.
10020 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10021 function.
10022 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10023 function.
10024 * Makefile.am (CCFILES): Add mapfile.cc.
10025 (HFILES): Add mapfile.h.
10026 * Makefile.in: Rebuild.
10027
9f1d377b
ILT
100282008-05-19 Ian Lance Taylor <iant@google.com>
10029
10030 * options.h (class General_options): Add -z relro.
10031 * layout.cc (Layout::Layout): Initialize relro_segment_.
10032 (Layout::add_output_section_data): Return the output section.
10033 (Layout::make_output_section): Rcognize relro sections and mark
10034 them appropriately.
10035 (Layout::attach_allocated_section_to_segment): Put relro sections
10036 in a PT_GNU_RELRO segment.
10037 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10038 section as relro.
10039 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10040 PT_TLS segments.
10041 (Layout::linkonce_mapping): Map d.rel.ro.local to
10042 .data.rel.ro.local.
10043 (Layout::output_section_name): Us .data.rel.ro.local for any
10044 section which begins with that.
10045 * layout.h (class Layout): Update add_output_section_data
10046 declaration. Add relro_segment_ field.
10047 * output.cc (Output_section::Output_section): Initialize is_relro_
10048 and is_relro_local_ fields.
10049 (Output_segment::add_output_section): Group relro sections.
10050 (Output_segment::is_first_section_relro): New function.
10051 (Output_segment::maximum_alignment): If there is a relro section,
10052 align the segment to the common page size.
10053 (Output_segment::set_section_addresses): Track whether we are
10054 looking at relro sections. If the last section is a relro
10055 section, align to the common page size.
10056 (Output_segment::set_section_list_addresses): Add in_relro
10057 parameter. Change all callers. Align to the page size when
10058 moving from relro to non-relro section.
10059 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10060 segment.
10061 * output.h (class Output_section): Add is_relro_ and
10062 is_relro_local_ fields.
10063 (Output_section::is_relro): New function.
10064 (Output_section::set_is_relro): New function.
10065 (Output_section::is_relro_local): New function.
10066 (Output_section::set_is_relro_local): New function.
10067 (class Output_segment): Update declarations.
10068 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10069 * sparc.cc (Target_sparc::got_section): Likewise.
10070 * x86_64.cc (Target_x86_64::got_section): Likewise.
10071 * testsuite/relro_test_main.cc: New file.
10072 * testsuite/relro_test.cc: New file.
10073 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10074 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10075 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10076 (relro_test.so, relro_test_pic.o): New targets.
10077 * testsuite/Makefile.in: Rebuild.
10078
a984ee1d
ILT
100792008-05-16 Ian Lance Taylor <iant@google.com>
10080
01676dcd
ILT
10081 * output.cc (Output_segment::add_output_section): Remove front
10082 parameter.
10083 * output.h (class Output_segment): Remove
10084 add_initial_output_section and overloaded add_output_section.
10085 Update declaration of remaining add_output_section.
10086 * layout.cc (Layout::create_interp): Call add_output_section
10087 rather than add_initial_output_section.
10088 (Layout::finish_dynamic_section): Likewise.
10089
497897f9
ILT
10090 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10091 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10092 know the dynamic type.
10093 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10094 field. Initialize it in constructor.
10095 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10096 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10097 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10098 reloc.
10099
a984ee1d
ILT
10100 * output.cc (Output_reloc::get_address): Change return type to
10101 Elf_Addr.
10102 * output.h (class Output_reloc): Update get_address declaration.
10103 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10104 for section addresses.
10105
55ba0940
ILT
101062008-05-09 Ian Lance Taylor <iant@google.com>
10107
10108 PR 6493
10109 * gold.cc (gold_nomem): Use return value of write.
10110
75517b77
ILT
101112008-05-08 Ian Lance Taylor <iant@google.com>
10112
10113 * symtab.c (Symbol::init_base_output_data): Add version
10114 parameter. Change all callers.
10115 (Symbol::init_base_output_segment): Likewise.
10116 (Symbol::init_base_constant): Likewise.
10117 (Symbol::init_base_undefined): Likewise.
10118 (Sized_symbol::init_output_data): Likewise.
10119 (Sized_symbol::init_output_segment): Likewise.
10120 (Sized_symbol::init_constant): Likewise.
10121 (Sized_symbol::init_undefined): Likewise.
10122 (Symbol_table::do_define_in_output_data): If the new symbol has a
10123 version, mark it as the default.
10124 (Symbol_table::do_define_in_output_segment): Likewise.
10125 (Symbol_table::do_define_as_constant): Likewise.
10126 * symtab.h (class Symbol): Update declarations.
10127 (class Sized_symbol): Likewise.
10128 * resolve.cc (Symbol::override_version): New function.
c42e122e 10129 (Symbol::override_base): Call override_version.
75517b77
ILT
10130 (Symbol::override_base_with_special): Likewise.
10131 * testsuite/ver_script_8.script: New file.
10132 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10133 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10134 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10135 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10136
f1f70eae
ILT
101372008-05-06 Ian Lance Taylor <iant@google.com>
10138
f3e9c5c5
ILT
10139 PR 6049
10140 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10141 functions.
10142 (class General_options): Remove existing --undefined, and add
10143 --no-undefined instead. Add new --undefined as synonym for -u.
10144 * archive.cc (Archive::add_symbols): Check whether symbol was
10145 named with -u.
10146 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10147 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10148 all uses. Add IS_UNDEFINED. Update declarations to split
10149 different versions of init_base. Declare init_base_undefined.
10150 (Symbol::is_defined): Handle IS_UNDEFINED.
10151 (Symbol::is_undefined): Likewise.
10152 (Symbol::is_weak_undefined): Call is_undefined.
10153 (Symbol::is_absolute): Handle IS_CONSTANT.
10154 (class Sized_symbol): Update declarations to split different
10155 versions of init. Declare init_undefined.
10156 (class Symbol_table): Declare new functions.
10157 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10158 Change all callers.
10159 (Symbol::init_base_output_data): Likewise.
10160 (Symbol::init_base_output_segment): Likewise.
10161 (Symbol::init_base_constant): Likewise.
10162 (Symbol::init_base_undefined): New function.
10163 (Sized_symbol::init_object): Rename from init. Change all
10164 callers.
10165 (Sized_symbol::init_output_data): Likewise.
10166 (Sized_symbol::init_output_segment): Likewise.
10167 (Sized_symbol::init_constant): Likewise.
10168 (Sized_symbol::init_undefined): New function.
10169 (Symbol_table::add_undefined_symbols_from_command_line): New
10170 function.
10171 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10172 function.
10173 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10174 (Symbol::output_section): Likewise.
10175 (Symbol::set_output_section): Likewise.
10176 (Symbol_table::sized_finalize_symbol): Likewise.
10177 (Symbol_table::sized_write_globals): Likewise.
10178 * resolve.cc (Symbol_table::should_override): Likewise.
10179 (Symbol::override_base_with_special): Likewise.
10180
8bdcdf2c
ILT
10181 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10182 symbol, change it to have default visibility.
10183 * testsuite/protected_1.cc: New file.
10184 * testsuite/protected_2.cc: New file.
10185 * testsuite/protected_3.cc: New file.
10186 * testsuite/protected_main_1.cc: New file.
10187 * testsuite/protected_main_2.cc: New file.
10188 * testsuite/protected_main_3.cc: New file.
10189 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10190 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10191 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10192 (protected_1.so): New target.
10193 (protected_1_pic.o, protected_2_pic.o): New targets.
10194 (protected_3_pic.o): New target.
10195 (check_PROGRAMS): Add protected_2.
10196 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10197 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10198 * testsuite/Makefile.in: Rebuild.
10199
2b706932
ILT
10200 * options.h (DEFINE_var): Add set_user_set_##varname__.
10201 (DEFINE_bool_alias): New macro.
10202 (class General_options): Define -Bstatic using DEFINE_bool_alias
10203 rather than DEFINE_special. Add --undefined as an alias for -z
10204 defs.
10205 * options.cc (General_options::parse_Bstatic): Remove.
10206
d82a5bcc
ILT
10207 * options.h (class General_options): Add --fatal-warnings.
10208 * main.cc (main): Implement --fatal-warnings.
10209 * errors.h (Errors::warning_count): New function.
10210
f1f70eae
ILT
10211 * options.h (class General_options): Add -Bsymbolic-functions.
10212 * symtab.h (Symbol::is_preemptible): Check for
10213 -Bsymbolic-functions.
10214
8825ac63
ILT
102152008-05-05 Ian Lance Taylor <iant@google.com>
10216
d98bc257
ILT
10217 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10218 as noVARNAME rather than no-VARNAME.
10219 (class General_options): Add option -z combreloc.
10220 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10221 get_address.
10222 (Output_reloc::sort_before) [SHT_REL]: New function.
10223 (Output_reloc::sort_before) [SHT_RELA]: New function.
10224 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10225 Sort_relocs_comparison.
10226 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10227 parameter. Change all callers.
10228 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10229 sort_relocs parameter. Change all callers.
10230 * output.cc (Output_reloc::get_address): New function, broken out
10231 of write_rel.
10232 (Output_reloc::write_rel): Call it.
10233 (Output_reloc::compare): New function.
10234 (Output_data_reloc_base::do_write): Optionally sort relocs.
10235
60b2b4e7
ILT
10236 * configure.ac: If targ_extra_obj is set, link it in.
10237 * configure.tgt: Initialize all variables.
10238 (x86_64*): Set targ_extra_obj and targ_extra_size.
10239 * configure: Rebuild.
10240
8825ac63
ILT
10241 * object.cc (Sized_relobj::include_section_group): Adjust section
10242 indexes read from group data. Build vector to pass to
10243 layout_group.
10244 * layout.cc (Layout::layout_group): Add flags and shndxes
10245 parameters. Remove contents parameter. Change caller. Update
10246 explicit instantiations.
10247 * layout.h (class Layout): Update layout_group declaration.
10248 * output.cc (Output_data_group::Output_data_group): Add flags and
10249 input_shndxes parameters. Remove contents parameter. Change
10250 caller.
10251 (Output_data_group::do_write): Change input_sections_ to
10252 input_shndxes_.
10253 * output.h (class Output_data_group): Update constructor
10254 declaration. Rename input_sections_ to input_shndxes_.
10255 * testsuite/many_sections_test.cc: Add template.
10256
e94cf127
CC
102572008-04-30 Cary Coutant <ccoutant@google.com>
10258
4418b2d5
CC
10259 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10260
e94cf127
CC
10261 * layout.cc (Layout::include_section): Refactored check for debug
10262 info section.
10263 (Layout::add_comdat): Add new parameters. Change type
10264 of signature parameter. Add object and shndx to signatures table.
10265 (Layout::find_kept_object): New function.
10266 * layout.h: Include <cstring>.
10267 (Layout::is_debug_info_section): New function.
10268 (Layout::add_comdat): Add new parameters.
10269 (Layout::find_kept_object): New function.
10270 (Layout::Kept_section): New struct.
10271 (Layout::Signatures): Change type of map range.
10272 * object.cc (Relobj::output_section_address): New function.
10273 (Sized_relobj::include_section_group): Add new parameters. Change
10274 calls to Layout::add_comdat. Change to build table of kept comdat
10275 groups and table mapping discarded sections to kept sections.
10276 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
10277 (Sized_relobj::do_layout): Change calls to include_section_group and
10278 include_linkonce_section.
10279 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
10280 value to zero when section is discarded.
10281 (Sized_relobj::map_to_kept_section): New function.
10282 * object.h (Relobj::output_section_address): New function.
10283 (Relobj::Comdat_group): New type.
10284 (Relobj::find_comdat_group): New function.
10285 (Relobj::Comdat_group_table): New type.
10286 (Relobj::Kept_comdat_section): New type.
10287 (Relobj::Kept_comdat_section_table): New type.
10288 (Relobj::add_comdat_group): New function.
10289 (Relobj::set_kept_comdat_section): New function.
10290 (Relobj::get_kept_comdat_section): New function.
10291 (Relobj::comdat_groups_): New field.
10292 (Relobj::kept_comdat_sections_): New field.
10293 (Symbol_value::input_value): Update comment.
10294 (Sized_relobj::map_to_kept_section) New function.
10295 (Sized_relobj::include_linkonce_section): Add new parameter.
10296 * target-reloc.h (Comdat_behavior): New type.
10297 (get_comdat_behavior): New function.
10298 (relocate_section): Add code to map a discarded section to the
10299 corresponding kept section when applying a relocation.
10300
e4e5049b
CS
103012008-04-30 Craig Silverstein <csilvers@google.com>
10302
10303 * dwarf_reader.cc (next_generation_count): New static var.
10304 (Addr2line_cache_entry): New struct.
10305 (addr2line_cache): New static var.
10306 (Dwarf_line_info::one_addr2line): Added caching.
10307 (Dwarf_line_info::clear_addr2line_cache): New function.
10308 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
10309 cache-size parameter.
10310 (Dwarf_line_info::one_addr2line_cache): New function.
10311 * symtab.cc (Symbol_table::detect_odr_violations): Pass
10312 new cache-size argument to one_addr2line(), and clear cache.
10313
d09e9154
CC
103142008-04-28 Cary Coutant <ccoutant@google.com>
10315
10316 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
10317 R_386_PC8 relocations.
10318
7ef73768
ILT
103192008-04-23 Ian Lance Taylor <iant@google.com>
10320
55438702
ILT
10321 * object.cc (Sized_relobj::include_section_group): Check for
10322 invalid section group.
10323
c165fb93
ILT
10324 * object.cc (make_elf_object): Correct test for 64-bit ELF file
10325 header size.
10326
7ef73768
ILT
10327 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
10328 than read for file header.
10329 * archive.cc (Archive::include_member): Likewise.
10330
6194aaab
L
103312008-04-23 Paolo Bonzini <bonzini@gnu.org>
10332
10333 * aclocal.m4: Regenerate.
10334 * configure: Regenerate.
10335
d491d34e
ILT
103362008-04-19 Ian Lance Taylor <iant@google.com>
10337
5ea2bac6
ILT
10338 * version.cc (version_string): Bump to 1.6.
10339
7bc3e21a
ILT
10340 * testsuite/Makefile.am (many_sections_r_test): New target.
10341 (many_sections_r_test_SOURCES): Remove.
10342 (many_sections_r_test_DEPENDENCIES): Remove.
10343 (many_sections_r_test_LDFLAGS): Remove.
10344 (many_sections_r_test_LDADD): Remove.
10345
7fcd3aa9
ILT
10346 * object.cc (Sized_relobj::do_add_symbols): Always pass
10347 local_symbol_count_ to add_from_relobj.
10348
4c94d6ae
ILT
10349 * testsuite/Makefile.am (many_sections_check.h): Only check one in
10350 every thousand variables.
10351 * testsuite/Makefile.in: Rebuild.
10352
d491d34e
ILT
10353 * object.cc (Xindex::initialize_symtab_xindex): New function.
10354 (Xindex::read_symtab_xindex): New function.
10355 (Xindex::sym_xindex_to_shndx): New function.
10356 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
10357 available.
10358 (Sized_relobj::do_initialize_xindex): New function.
10359 (Sized_relobj::do_read_symbols): Adjust section links.
10360 (Sized_relobj::symbol_section_and_value): Add is_ordinary
10361 parameter. Change all callers.
10362 (Sized_relobj::include_section_group): Adjust section links and
10363 symbol section indexes.
10364 (Sized_relobj::do_layout): Adjust section links.
10365 (Sized_relobj::do_count_local_symbols): Adjust section links and
10366 symbol section indexes.
10367 (Sized_relobj::do_finalize_local_symbols): Distinguish between
10368 ordinary and special symbols.
10369 (Sized_relobj::write_local_symbols): Add symtab_xindex and
10370 dynsym_xindex parameters. Change all callers. Adjust section
10371 links. Use SHN_XINDEX when needed.
10372 (Sized_relobj::get_symbol_location_info): Adjust section links.
10373 Don't get fooled by special symbols.
10374 * object.h (class Xindex): Define.
10375 (class Object): Add xindex_ parameter. Declare virtual functoin
10376 do_initialize_xindex.
10377 (Object::adjust_sym_shndx): New function.
10378 (Object::set_xindex): New protected function.
10379 (class Symbol_value): Add is_ordinary_shndx_ field.
10380 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
10381 (Symbol_value::value): Assert ordinary section.
10382 (Symbol_value::initialize_input_to_output_map): Likewise.
10383 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
10384 Change all callers.
10385 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
10386 all callers.
10387 (class Sized_relobj): Update declarations.
10388 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
10389 parameter. Change all callers.
10390 (Sized_relobj::adjust_shndx): New function.
10391 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
10392 field.
10393 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
10394 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
10395 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
10396 (Sized_dynobj::read_dynsym_section): Adjust section links.
10397 (Sized_dynobj::read_dynamic): Likewise.
10398 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
10399 section links.
10400 (Sized_dynobj::do_initialize_xindex): New function.
10401 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
10402 do_initialize_xindex.
10403 (Sized_dynobj::adjust_shndx): New function.
10404 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
10405 dynsym_xindex_ fields.
10406 (Layout::finalize): Add a call to set_section_indexes before
10407 creating the symtab sections.
10408 (Layout::set_section_indexes): Don't do anything if the section
10409 already has a section index.
10410 (Layout::create_symtab_sections): Add shnum parameter. Change
10411 caller. Create .symtab_shndx section if needed.
10412 (Layout::create_shdrs): Add shstrtab_section parameter. Change
10413 caller.
10414 (Layout::allocated_output_section_count): New function.
10415 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
10416 needed.
10417 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
10418 fields. Update declarations.
10419 (Layout::symtab_xindex): New function.
10420 (Layout::dynsym_xindex): New function.
10421 (class Write_symbols_task): Add layout_ field.
10422 (Write_symbols_task::Write_symbols_task): Add layout parameter.
10423 Change caller.
10424 * output.cc (Output_section_headers::Output_section_headers): Add
10425 shstrtab_section parameter. Change all callers.
10426 (Output_section_headers::do_sized_write): Store overflow values
10427 for section count and section string table section index in
10428 section header zero.
10429 (Output_file_header::do_sized_write): Check for overflow of
10430 section count and section string table section index.
10431 (Output_symtab_xindex::do_write): New function.
10432 (Output_symtab_xindex::endian_do_write): New function.
10433 * output.h (class Output_section_headers): Add shstrtab_section_.
10434 Update declarations.
10435 (class Output_symtab_xindex): Define.
10436 (Output_section::has_out_shndx): New function.
10437 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
10438 field.
10439 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
10440 Change all callers.
10441 (Sized_symbol::init): Likewise.
10442 (Symbol::output_section): Check for ordinary symbol.
10443 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
10444 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
10445 callers.
10446 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
10447 Change all callers. Simplify handling of symbols from sections
10448 not included in the link.
10449 (Symbol_table::add_from_dynobj): Handle ordinary symbol
10450 distinction.
10451 (Weak_alias_sorter::operator()): Assert that symbols are
10452 ordinary.
10453 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
10454 distinction.
10455 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
10456 parameters. Change all callers.
10457 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
10458 symbol distinction. Use SHN_XINDEX when needed.
10459 (Symbol_table::write_section_symbol): Add symtab_xindex
10460 parameter. Change all callers.
10461 (Symbol_table::sized_write_section_symbol): Likewise. Use
10462 SHN_XINDEX when needed.
10463 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
10464 declarations.
10465 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
10466 (Symbol::is_defined): Check is_ordinary.
10467 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
10468 (Symbol::is_absolute, Symbol::is_common): Likewise.
10469 (class Sized_symbol): Update declarations.
10470 (class Symbol_table): Update declarations.
10471 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
10472 parameters. Change all callers.
10473 (Sized_symbol::override): Likewise.
10474 (Symbol_table::override): Likewise.
10475 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
10476 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
10477 is_ordinary, and orig_st_shndx parameters. Change all callers.
10478 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
10479 to be in an ordinary section.
10480 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
10481 object and is_ordinary parameters. Change all callers.
10482 (Sized_dwarf_line_info::read_relocs): Add object parameter.
10483 Change all callers. Don't add undefined or non-ordinary symbols
10484 to reloc_map_.
10485 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
10486 Change all callers.
10487 * dwarf_reader.h (class Sized_dwarf_line_info): Update
10488 declarations.
10489 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
10490 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
10491 (Sized_relobj::relocate_sections): Likewise.
10492 * target-reloc.h (scan_relocs): Adjust section symbol index.
10493 (scan_relocatable_relocs): Likewise.
10494 * i386.cc (Scan::local): Check for ordinary symbols.
10495 * sparc.cc (Scan::local): Likewise.
10496 * x86_64.cc (Scan::local): Likewise.
10497 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
10498 to symbol_section_and_value.
10499 * testsuite/many_sections_test.cc: New file.
10500 * testsuite/Makefile.am (BUILT_SOURCES): Define.
10501 (check_PROGRAMS): Add many_sections_test.
10502 (many_sections_test_SOURCES): Define.
10503 (many_sections_test_DEPENDENCIES): Define.
10504 (many_sections_test_LDFLAGS): Define.
10505 (BUILT_SOURCES): Add many_sections_define.h.
10506 (many_sections_define.h): New target.
10507 (BUILT_SOURCES): Add many_sections_check.h.
10508 (many_sections_check.h): New target.
10509 (check_PROGRAMS): Add many_sections_r_test.
10510 (many_sections_r_test_SOURCES): Define.
10511 (many_sections_r_test_DEPENDENCIES): Define.
10512 (many_sections_r_test_LDFLAGS): Define.
10513 (many_sections_r_test_LDADD): Define.
10514 (many_sections_r_test.o): New target.
10515 * testsuite/Makefile.in: Rebuild.
10516
c5818ff1
CC
105172008-04-17 Cary Coutant <ccoutant@google.com>
10518
10519 * errors.cc (Errors::info): New function.
10520 (gold_info): New function.
10521 * errors.h (Errors::info): New function.
10522 * gold.h (gold_info): New function.
10523 * object.cc (Input_objects::add_object): Print trace output.
10524 * options.cc (options::parse_set): New function.
10525 (General_options::parse_wrap): Deleted.
10526 (General_options::General_options): Deleted initializer.
10527 * options.h (options::String_set): New typedef.
10528 (options::parse_set): New function.
10529 (DEFINE_set): New macro.
10530 (General_options::wrap): Changed to use DEFINE_set. Changed
10531 callers of any_wrap_symbols and is_wrap_symbol.
10532 (General_options::trace, General_options::trace_symbol):
10533 New options.
10534 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10535 (General_options::wrap_symbols_): Deleted.
10536 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10537
b5be4a7c
DM
105382008-04-17 David S. Miller <davem@davemloft.net>
10539
10540 * options.cc (General_options::parse_V): New function.
10541 * options.h: Add entries for -V and -Qy.
10542
155a0dd7
ILT
105432008-04-17 Ian Lance Taylor <iant@google.com>
10544
10545 * common.cc (Symbol_table::allocate_commons): Remove options
10546 parameter. Change caller.
10547 (Symbol_table::do_allocate_commons): Remove options parameter.
10548 Change caller. Just call do_allocate_commons_list twice.
10549 (Symbol_table::do_allocate_commons_list): New function, broken out
10550 of do_allocate_commons.
10551 * common.h (class Allocate_commons_task): Remove options_ field.
10552 Update constructor.
10553 * symtab.cc (Symbol_table::Symbol_table): Initialize
10554 tls_commons_.
10555 (Symbol_table::add_from_object): Put TLS common symbols on
10556 tls_commons_ list.
10557 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10558 which are IN_OUTPUT_DATA.
10559 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10560 allocate_commons and do_allocate_commons declarations. Declare
10561 do_allocate_commons_list.
10562 * gold.cc (queue_middle_tasks): Update creation of
10563 Allocate_commons_task to not pass options.
10564 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10565 (TLS_TEST_C_FLAGS): New variable.
10566 (tls_test_c_pic.o): New target.
10567 (tls_test_shared.so): Link in tls_test_c_pic.o.
10568 (tls_test_c_pic_ie.o): New target.
10569 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10570 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10571 (tls_test_c.o): New target.
10572 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10573 (tls_pic_test_LDADD): Likewise.
10574 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10575 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10576 (tls_test_c_gnu2.o): New target.
10577 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10578 tls_test_c_gnu2.o.
10579 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10580 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10581 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10582 * testsuite/tls_test.cc: Include "config.h".
10583 (t_last): Call t11_last.
10584 * testsuite/tls_test.h (t11, t11_last): Declare.
10585 * testsuite/tls_test_c.c: New file.
10586 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10587 * configure.ac: Check for OpenMP support.
10588 * configure, config.in, Makefile.in: Rebuild.
10589 * testsuite/Makefile.in: Rebuild.
10590
edfbb029
CC
105912008-04-16 Cary Coutant <ccoutant@google.com>
10592
10593 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10594 (Target_i386::tls_base_symbol_defined_): New field.
10595 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10596 (Target_i386::Scan::global): Likewise.
10597 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10598 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10599 (Target_x86_64::tls_base_symbol_defined_): New field.
10600 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10601 (Target_x86_64::Scan::global): Likewise.
10602
f3c69fca
CC
106032008-04-16 Cary Coutant <ccoutant@google.com>
10604
10605 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
10606 (Symbol::needs_plt_entry): Allow weak undefined symbols.
10607 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
10608 building shared libraries.
10609 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
10610 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
10611 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
10612 * testsuite/Makefile.in: Rebuild.
10613 * testsuite/weak_undef.h: New file.
10614 * testsuite/weak_undef_file1.cc: Add extra test cases.
10615 * testsuite/weak_undef_file2.cc: Likewise.
10616 * testsuite/weak_undef_test.cc: Likewise.
10617
7c414435
DM
106182008-04-16 David S. Miller <davem@davemloft.net>
10619
32b769e1
DM
10620 * sparc.cc (Target_sparc::Scan): Change from struct to class.
10621 Add issued_non_pic_error_ field. Declare check_non_pic.
10622 (Target_sparc::Scan::check_non_pic): New function.
10623 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
10624 (Target_sparc::Scan::global): Likewise.
10625
11936fb1
DM
10626 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
10627 * configure: Rebuild.
10628
7c414435
DM
10629 * options.h (DEFINE_enable): New macro.
10630 (new_dtags): New enable option.
10631 (initfirst, interpose, loadfltr, nodefaultlib,
10632 nodelete, nodlopen, nodump): New -z options.
10633 * layout.cc (Layout:finish_dynamic_section): If new
10634 dtags enabled, emit DT_RUNPATH. Also, emit a
10635 DT_FLAGS_1 containing any specified -z flags.
10636
85c7bf8b
ILT
106372008-04-16 Ian Lance Taylor <iant@google.com>
10638
12c0daef
ILT
10639 * copy-relocs.cc: New file.
10640 * copy-relocs.h: New file.
10641 * reloc.cc: Remove Copy_relocs code.
10642 * reloc.h: Likewise.
10643 * reloc-types.h (struct Reloc_types) [both versions]: Add
10644 get_reloc_addend_noerror.
10645 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
10646 variants of add_global which take an addend which must be zero.
10647 * i386.cc: Include "copy-relocs.h".
10648 (class Target_i386): Change type of copy_relocs_ to variable,
10649 update initializer.
10650 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
10651 Change all callers.
10652 (Target_i386::do_finalize_sections): Change handling of
10653 copy_relocs_.
10654 * sparc.cc: Include "copy-relocs.h".
10655 (class Target_sparc): Change type of copy_relocs_ to variable,
10656 update initializer.
10657 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
10658 Change all callers.
10659 (Target_sparc::do_finalize_sections): Change handling of
10660 copy_relocs_.
10661 * x86_64.cc: Include "copy-relocs.h".
10662 (class Target_x86_64): Change type of copy_relocs_ to variable,
10663 update initializer.
10664 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
10665 class. Change all callers.
10666 (Target_x86_64::do_finalize_sections): Change handling of
10667 copy_relocs_.
10668 * Makefile.am (CCFILES): Add copy-relocs.cc.
10669 (HFILES): Add copy-relocs.h.
10670
4f4995b6
ILT
10671 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
10672
85c7bf8b
ILT
10673 * testsuite/script_test_4.sh: Permit leading zeroes.
10674
4f2a9edd
ILT
106752008-04-15 Ian Lance Taylor <iant@google.com>
10676
e6188289
ILT
10677 * script-sections.cc (Script_sections::create_segments): Use
10678 header_size_adjustment even when there is enough room for the
10679 headers.
10680 * testsuite/script_test_4.sh: New file.
10681 * testsuite/script_test_4.t: New file.
10682 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
10683 (check_DATA): Add script_test_4.stdout.
10684 (MOSTLYCLEANFILES): Likewise.
10685 (script_test_4): New target.
10686 (script_test_4.stdout): New target.
10687 * testsuite/Makefile.in: Rebuild.
10688
4f2a9edd
ILT
10689 * sparc.cc: Add definitions for Output_data_plt_sparc class
10690 constants.
10691
f5314dd5
DM
106922008-04-14 David S. Miller <davem@davemloft.net>
10693
10694 * sparc.cc: New file.
10695 * Makefile.am (TARGETSOURCES): Add sparc.cc
10696 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
10697 * configure.tgt: Document targ_extra_size and
10698 targ_extra_big_endian. Add entries for sparc-* and
10699 sparc64-*.
10700 * configure.ac: Handle targ_extra_size and
10701 targ_extra_big_endian.
10702 * Makefile.in: Rebuild.
10703 * configure: Likewise.
10704 * po/POTFILES.in: Likewise.
10705 * po/gold.pot: Likewise.
10706
154e0e9a
ILT
107072008-04-14 Ian Lance Taylor <iant@google.com>
10708
10709 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
10710 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
10711 in the name/type/flags to section mapping. Don't call
10712 allocate_output_section.
10713 (Layout::choose_output_section): Change parameter from adjust_name
10714 to is_input_section. Don't permit input sections after sections
10715 are attached to segments. Don't call allocate_output_section.
10716 (Layout::layout_eh_frame): Call update_flags_for_input_section,
10717 not write_enable_output_section.
10718 (Layout::make_output_section): Don't push to
10719 unattached_section_list_ nor call attach_to_segment. Call
10720 attach_section_to_segment if sections are attached.
10721 (Layout::attach_sections_to_segments): New function.
10722 (Layout::attach_section_to_segment): New function.
10723 (Layout::attach_allocated_section_to_segment): Rename from
10724 attach_to_segment. Remove flags parameter.
10725 (Layout::allocate_output_section): Remove function.
10726 (Layout::write_enable_output_section): Remove function.
10727 * layout.h (class Layout): Update for above changes. Add new
10728 field sections_are_attached_.
10729 * output.h (Output_section::update_flags_for_input_section): New
10730 function.
10731 * output.cc (Output_section::add_input_section): Call
10732 update_flags_for_input_section.
10733 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
10734
009a67a2
CC
107352008-04-11 Cary Coutant <ccoutant@google.com>
10736
10737 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
10738 thought unnecessary.
10739 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
10740
759b1a24
ILT
107412008-04-11 Ian Lance Taylor <iant@google.com>
10742
10743 * output.h (class Output_section_data): Remove inline definition
10744 of set_addralign.
10745 * output.cc (Output_section_data::set_addralign): New function.
10746
c2b45e22
CC
107472008-04-11 Cary Coutant <ccoutant@google.com>
10748
10749 Add support for TLS descriptors for i386 and x86_64.
10750 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
10751 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
10752 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
10753 GOT_TYPE_TLS_DESC.
10754 (Target_i386::got_mod_index_entry): Remove unnecessary code.
10755 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
10756 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
10757 relocations.
10758 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
10759 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
10760 Fix problem with initial-exec relocations.
10761 (Target_i386::Relocate::relocate_tls): Likewise.
10762 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
10763 relaxation.
10764 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
10765 support for section-plus-offset dynamic table entries.
10766 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
10767 (Output_data_dynamic::Dynamic_entry): Add support for
10768 section-plus-offset dynamic table entries.
10769 (Output_data_dynamic::Classification): Likewise.
10770 (Output_data_dynamic::classification_): Renamed offset_.
10771 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
10772 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
10773 (Target_x86_64::make_plt_section): New function.
10774 (Target_x86_64::reserve_tlsdesc_entries): New function.
10775 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
10776 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
10777 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
10778 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
10779 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
10780 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
10781 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
10782 add extra PLT entry for TLS descriptors.
10783 (Output_data_plt_x86_64::got_): New field.
10784 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
10785 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
10786 fields.
10787 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
10788 descriptors.
10789 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
10790 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
10791 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
10792 R_386_TLS_DESC_CALL relocations.
10793 (Target_x86_64::Scan::global): Likewise.
10794 (Target_x86_64::do_finalize_sections): Add dynamic table entries
10795 for TLS descriptors.
10796 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
10797 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
10798 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
10799 GD-to-IE relaxation.
10800 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
10801 and TLS_DESCRIPTORS.
10802 * Makefile.in: Rebuild.
10803 * configure: Rebuild.
10804 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
10805 (tls_test_shared2.so): New target.
10806 (tls_shared_gd_to_ie_test_SOURCES): New variable.
10807 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
10808 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
10809 (tls_shared_gd_to_ie_test_LDADD): New variable.
10810 (tls_shared_gnu2_gd_to_ie_test): New target.
10811 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
10812 New targets.
10813 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
10814 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
10815 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
10816 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
10817 (tls_shared_gnu2_test): New target.
10818 (tls_test_gnu2_shared.so): New target.
10819 (tls_shared_gnu2_test_SOURCES): New variable.
10820 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
10821 (tls_shared_gnu2_test_LDFLAGS): New variable.
10822 (tls_shared_gnu2_test_LDADD): New variable.
10823 * testsuite/Makefile.in: Rebuild.
10824 * testsuite/Makefile.
10825
83bfb6b7
ILT
108262008-04-11 Ian Lance Taylor <iant@google.com>
10827
10828 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
10829 justsyms.t.
10830 * testsuite/Makefile.in: Rebuild.
10831
10832 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
10833 long.
10834 * testsuite/script_test_2.cc (main): Adjust test.
10835
706e1f5e
ILT
108362008-04-11 David S. Miller <davem@davemloft.net>
10837 Ian Lance Taylor <iant@google.com>
10838
10839 * options.h (General_options): Add entries for '-Y' and
10840 '-relax'.
10841 * options.cc (General_options:finalize): If -Y was used, add those
10842 entries to the library path instead of the default "/lib" and
10843 "/usr/lib".
10844
7c98e6bb
DM
108452008-04-11 David S. Miller <davem@davemloft.net>
10846
10847 * testsuite/justsyms.t: Start at 0x100.
10848 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10849 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10850 long.
10851 * testsuite/script_test_2.cc: Adjust string and section length
10852 checks.
7c98e6bb 10853
99a37bfd
ILT
108542008-04-09 Ian Lance Taylor <iant@google.com>
10855
2cefc357
ILT
10856 PR gold/5996
10857 * script-sections.cc (Sections_element::allocate_to_segment): Add
10858 orphan parameter.
10859 (Output_section_definition::allocate_to_segment): Likewise.
10860 (Orphan_output_section::allocate_to_segment): Likewise.
10861 (Script_sections::attach_sections_using_phdrs_clause): Don't
10862 propagate non-PT_LOAD segments to orphan sections.
10863 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10864 readelf rather than objdump.
10865 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10866 .interp section and PT_INTERP segment are the same size.
10867 * testsuite/Makefile.in: Rebuild.
10868
99a37bfd
ILT
10869 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10870 aliases for symbols defined in the same object.
10871 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10872 (weak_alias_test_SOURCES): New variable.
10873 (weak_alias_test_DEPENDENCIES): New variable.
10874 (weak_alias_test_LDFLAGS): New variable.
10875 (weak_alias_test_LDADD): New variable.
10876 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10877 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10878 (weak_alias_test_3.o): New target.
10879 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10880 * testsuite/weak_alias_test_main.cc: New file.
10881 * testsuite/weak_alias_test_1.cc: New file.
10882 * testsuite/weak_alias_test_2.cc: New file.
10883 * testsuite/weak_alias_test_3.cc: New file.
10884
780e49c5
ILT
108852008-04-08 Ian Lance Taylor <iant@google.com>
10886
cdb0b8f5
ILT
10887 * options.h (class General_options): Add --noinhibit-exec option.
10888 * main.cc (main): Check --noinhibit-exec.
10889
0864d551
ILT
10890 * options.h (class General_options): Define --wrap as a special
10891 option. Add wrap_symbols_ field.
10892 (General_options::any_wrap_symbols): New function.
10893 (General_options::is_wrap_symbol): New function.
10894 * options.cc (General_options::parse_wrap): New function.
10895 (General_options::General_options): Initialize wrap_symbols_.
10896 * symtab.cc (Symbol_table::wrap_symbol): New function.
10897 (Symbol_table::add_from_object): Handle --wrap.
10898 * symtab.h (class Symbol_table): Declare wrap_symbol.
10899 * target.h (Target::wrap_char): New function.
10900 (Target::Target_info): Add wrap_char field.
10901 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10902 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10903 * testsuite/testfile.cc (Target_test::test_target_info):
10904 Likewise.
10905
789aa6de
ILT
10906 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10907 there is one.
10908
2c38906f
ILT
10909 * layout.h (class Layout): Add added_eh_frame_data_ field.
10910 * layout.cc (Layout::Layout): Initialize new field.
10911 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10912 output section until we find a section we merged successfully.
10913 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10914 that the size be non-zero.
10915
780e49c5
ILT
10916 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10917 qualifier.
10918
7fcd0256
ILT
109192008-04-08 Craig Silverstein <csilvers@google.com>
10920
10921 * configure.ac: Export new conditional variable HAVE_ZLIB.
10922 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10923 on HAVE_ZLIB.
10924 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10925 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10926
6835af53
ILT
109272008-04-07 Ian Lance Taylor <iant@google.com>
10928
e24f324c
ILT
10929 * version.cc (version_string): Set to "1.5".
10930
a036edd8
ILT
10931 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10932 Add issued_non_pic_error_ field. Declare check_non_pic.
10933 (Target_x86_64::Scan::check_non_pic): New function.
10934 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10935 (Target_x86_64::Scan::global): Likewise.
10936
624f8810
ILT
10937 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10938 addend parameter. Change caller. Handle merge sections.
10939 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10940 Address to Addend. Don't add in the result of
10941 local_section_offset, pass down the addend and use the returned
10942 value.
10943 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10944 Update declarations of local_section_offset and symbol_value.
10945 * testsuite/two_file_test_1.cc (t18): New function.
10946 * testsuite/two_file_test_2.cc (f18): New function.
10947 * testsuite/two_file_test_main.cc (main): Call t18.
10948 * testsuite/two_file_test.h (t18, f18): Declare.
10949
6835af53
ILT
10950 * configure.ac: Don't test for objdump, c++filt, or readelf.
10951 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10952 conditionals.
10953 (TEST_READELF): New variable.
10954 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10955 (check_PROGRAMS): Add two_file_strip_test.
10956 (two_file_strip_test): New target.
10957 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10958 (two_file_same_shared_strip_test_SOURCES): New variable.
10959 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10960 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10961 (two_file_same_shared_strip_test_LDADD): New variable.
10962 (two_file_shared_strip.so): New target.
10963 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10964 (ver_test_5.syms, ver_test_7.syms): Likewise.
10965 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10966 (strip_test_3.stdout): Use TEST_OBJDUMP.
10967 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10968
86925eef
CC
109692008-04-04 Cary Coutant <ccoutant@google.com>
10970
10971 * symtab.h (Symbol::is_weak_undefined): New function.
10972 (Symbol::is_strong_undefined): New function.
10973 (Symbol::is_absolute): New function.
10974 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10975 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10976 absolute symbols.
10977 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10978 (weak_undef_test): New target.
10979 * testsuite/Makefile.in: Rebuild.
10980 * testsuite/weak_undef_file1.cc: New file.
10981 * testsuite/weak_undef_file2.cc: New file.
10982 * testsuite/weak_undef_test.cc: New file.
10983
126f3ece
ILT
109842008-04-03 Craig Silverstein <csilvers@google.com>
10985
10986 * compressed_output.h (class Output_compressed_section): Use
10987 unsigned buffer.
10988 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10989 add zlib header.
10990 (zlib_compressed_suffix): Removed.
10991 (Output_compressed_section::set_final_data_size): Use unsigned
10992 buffers.
10993 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10994 Fix linker invocation.
10995 (flagstest_o_specialfile_and_compress_debug_sections):
10996 Likewise.
10997 * testsuite/Makefile.in: Regenerated.
10998
deae2a14
DM
109992008-04-02 David S. Miller <davem@davemloft.net>
11000
11001 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11002 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11003
70752818
ILT
110042008-04-02 Craig Silverstein <csilvers@google.com>
11005
11006 * TODO: New file.
11007
39d0cb0e
ILT
110082008-04-02 Ian Lance Taylor <iant@google.com>
11009
11010 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11011 parameters. Update for new key type to views_. Change all
11012 callers.
11013 (File_read::read): Adjust for byteshift in returned view.
11014 (File_read::add_view): New function, broken out of
11015 find_and_make_view.
11016 (File_read::make_view): New function, broken out of
11017 find_and_make_view.
11018 (File_read::find_or_make_view): Add offset and aligned
11019 parameters. Rewrite accordingly. Change all callers.
11020 (File_read::get_view): Add offset and aligned parameters. Adjust
11021 for byteshift in return value.
11022 (File_read::get_lasting_view): Likewise.
11023 * fileread.h (class File_read): Update declarations.
11024 (class File_read::View): Add byteshift_ field. Add byteshift to
11025 constructor. Add byteshift method.
11026 * archive.h (Archive::clear_uncached_views): New function.
11027 (Archive::get_view): Add aligned parameter. Change all callers.
11028 * object.h (Object::get_view): Add aligned parameter. Change all
11029 callers.
11030 (Object::get_lasting_view): Likewise.
11031
11032 * fileread.cc (File_read::release): Don't call clear_views if
11033 there are multiple objects.
11034 * fileread.h (File_read::clear_uncached_views): New function.
11035 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11036 on the archive.
11037
a1207466
CC
110382008-03-31 Cary Coutant <ccoutant@google.com>
11039
11040 Add thin archive support.
11041 * archive.cc (Archive::armagt): New const.
11042 (Archive::setup): Remove task parameter and calls to unlock.
11043 (Archive::unlock_nested_archives): New function.
11044 (Archive::read_header): Add nested_off parameter. Change
11045 all callers.
11046 (Archive::interpret_header): Likewise.
11047 (Archive::include_all_members): Change to handle thin
11048 archives.
11049 (Archive::include_member): Likewise.
11050 * archive.h (Archive::Archive): Add new parameters and
11051 initializers.
11052 (Archive::armagt): New const.
11053 (Archive::setup): Remove task parameter.
11054 (Archive::unlock_nested_archives): New function.
11055 (Archive::read_header): Add nested_off parameter.
11056 (Archive::interpret_header): Likewise.
11057 (Archive::Nested_archive_table): New typedef.
11058 (Archive::is_thin_archive_): New field.
11059 (Archive::nested_archives_): New field.
11060 (Archive::options_): New field.
11061 (Archive::dirpath_): New field.
11062 (Archive::task_): New field.
11063 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11064 for thin archives. Pass additional parameters to
11065 Archive::Archive. Unlock the archive file after calling
11066 Archive::setup.
cd536b21 11067
479f6503
ILT
110682008-03-29 Ian Lance Taylor <iant@google.com>
11069
686c8caf
ILT
11070 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11071 version symbol to be local.
11072 * testsuite/ver_test_4.sh: New file.
11073 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11074 (check_DATA): Add ver_test_4.syms.
11075 (ver_test_4.syms): New target.
11076 * testsuite/Makefile.in: Rebuild.
11077
ab794b6b
ILT
11078 * output.cc
11079 (Output_section::Input_section_sort_entry::has_priority): New
11080 function.
11081 (Output_section::Input_section_sort_entry::match_file_name): New
11082 function.
11083 (Output_section::Input_section_sort_entry::match_section_name):
11084 Remove.
11085 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11086 Remove.
11087 (Output_section::Input_section_sort_entry::match_section_file):
11088 Remove.
11089 (Output_section::Input_section_sort_compare::operator()): Rewrite
11090 using new Input_section_sort_entry functions. Sort crtbegin and
11091 crtend first. Sort sections with no priority before sections with
11092 a priority.
11093 * testsuite/initpri1.c (d3): Check j != 4.
11094 (cd5): New constructor/destructor function.
11095 (main): Check j != 2.
11096
479f6503
ILT
11097 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11098 new symbol when resolving, don't call set_is_default.
11099 * testsuite/ver_test_7.cc: New file.
11100 * testsuite/ver_test_7.sh: New file.
11101 * testsuite/Makefile.am (ver_test_7.so): New target.
11102 (ver_test_7.o): New target.
11103 (check_SCRIPTS): Add ver_test_7.sh.
11104 (check_DATA): Add ver_test_7.syms.
11105 (ver_test_7.syms): New target.
11106
2fd32231
ILT
111072008-03-28 Ian Lance Taylor <iant@google.com>
11108
11109 * layout.cc (Layout::layout): If we see an input section with a
11110 name that needs sorting, set the must_sort flag for the output
11111 section.
11112 (Layout::make_output_section): If the name of the output section
11113 indicates that it might require sorting, set the may_sort flag.
11114 * output.h (Output_section::may_sort_attached_input_sections): New
11115 function.
11116 (Output_section::set_may_sort_attached_input_sections): New
11117 function.
11118 (Output_section::must_sort_attached_input_sections): New
11119 function.
11120 (Output_section::set_must_sort_attached_input_sections): New
11121 function.
11122 (class Output_section): Declare Input_section_sort_entry. Define
11123 Input_section_sort_compare. Declare
11124 sort_attached_input_sections. Add new fields:
11125 may_sort_attached_input_sections_,
11126 must_sort_attached_input_sections_,
11127 attached_input_sections_are_sorted_.
11128 * output.cc (Output_section::Output_section): Initialize new
11129 fields.
11130 (Output_section::add_input_section): Add an entry to
11131 input_sections_ if may_sort or must_sort are true.
11132 (Output_section::set_final_data_size): Call
11133 sort_attached_input_sections if necessary.
11134 (Output_section::Input_section_sort_entry): Define new class.
11135 (Output_section::Input_section_sort_compare::operator()): New
11136 function.
11137 (Output_section::sort_attached_input_sections): New function.
11138 * configure.ac: Check whether the compiler supports constructor
11139 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11140 * testsuite/initpri1.c: New file.
11141 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11142 CONSTRUCTOR_PRIORITY.
11143 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11144 (initpri1_LDFLAGS): New variable.
11145 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11146
18e6b24e
ILT
111472008-03-27 Ian Lance Taylor <iant@google.com>
11148
49bdd526
ILT
11149 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11150 * testsuite/common_test_1.c: New file.
11151 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11152 (common_test_1_SOURCES): New variable.
11153 (common_test_1_DEPENDENCIES): New variable.
11154 (common_test_1_LDFLAGS): New variable.
11155
18e6b24e
ILT
11156 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11157 and commons_ correctly when NAME/VERSION does not override
11158 NAME/NULL.
11159 * testsuite/ver_test_6.c: New file.
11160 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11161 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11162 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11163
04bf7072
ILT
111642008-03-26 Ian Lance Taylor <iant@google.com>
11165
5871526f
ILT
11166 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11167 of an undefined symbol from a version script.
11168 * testsuite/Makefile.am (ver_test_5.so): New target.
11169 (ver_test_5.o): New target.
11170 (check_SCRIPTS): Add ver_test_5.sh.
11171 (check_DATA): Add ver_test_5.syms.
11172 (ver_test_5.syms): New target.
11173 * testsuite/ver_test_5.cc: New file.
11174 * testsuite/ver_test_5.script: New file.
11175 * testsuite/ver_test_5.sh: New file.
11176 * Makefile.in, testsuite/Makefile.in: Rebuild.
11177
04bf7072
ILT
11178 PR gold/5986
11179 Fix problems building gold with gcc 4.3.0.
11180 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11181 (gold_error_at_location, gold_warning_at_location): Use it.
11182 * configure.ac: Check whether we can compile and use a template
11183 function with a printf attribute.
11184 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11185 when jumping over bytes.
11186 * object.cc: Instantiate Object::read_section_data.
11187 * debug.h: Include <cstring>
11188 * dwarf_reader.cc: Include <algorithm>
11189 * main.cc: Include <cstring>.
11190 * options.cc: Include <cstring>.
11191 * output.cc: Include <cstring>.
11192 * script.cc: Include <cstring>.
11193 * script.h: Include <string>.
11194 * symtab.cc: Include <cstring> and <algorithm>.
11195 * target-select.cc: Include <cstring>.
11196 * version.cc: Include <string>.
11197 * testsuite/testmain.cc: Include <cstdlib>.
11198 * configure, config.in: Rebuild.
11199
874c5b28
ILT
112002008-03-25 Ian Lance Taylor <iant@google.com>
11201
819d6c3a
ILT
11202 * options.cc: Include "../bfd/bfdver.h".
11203 (options::help): Print bug reporting address.
11204
f4b2c6f5
ILT
11205 * version.cc (print_version): Adjust output for current value of
11206 BFD_VERSION_STRING.
11207
11208 * NEWS: New file.
11209
e96caa79
ILT
11210 * options.cc (options::help): Print list of supported targets.
11211 * target-select.h: Include <vector>.
11212 (class Target_selector): Make machine_, size_, and is_big_endian_
11213 fields const. Add bfd_name_ and instantiated_target_ fields.
11214 (Target_selector::Target_selector): Add bfd_name parameter.
11215 (Target_selector::recognize): Make non-virtual, call
11216 do_recognize.
11217 (Target_selector::recognize_by_name): Make non-virtual, call
11218 do_recognize_by_name.
11219 (Target_selector::supported_names): New function.
11220 (Target_selector::bfd_name): New function.
11221 (Target_selector::do_instantiate_target): New pure virtual
11222 function.
11223 (Target_selector::do_recognize): New virtual function.
11224 (Target_selector::do_recognize_by_name): New virtual function.
11225 (Target_selector::instantiate_target): New private function.
11226 (supported_target_names): Declare.
11227 * target-select.cc (Target_selector::Target_selector): Update for
11228 new parameter and fields.
11229 (select_target_by_name): Check that the name matches before
11230 calling recognize_by_name.
11231 (supported_target_names): New function.
11232 * i386.cc (class Target_selector_i386): Update Target_selector
11233 constructor call. Remove recognize and recognize_by_name. Add
11234 do_instantiate_target.
11235 * x86_64.cc (class Target_selector_x86_64): Likewise.
11236 * testsuite/testfile.cc (class Target_selector_test): Update for
11237 changes to Target_selector.
11238
874c5b28
ILT
11239 * README: Rewrite, with some notes on unsupported features.
11240
0a65a3a7
CC
112412008-03-24 Cary Coutant <ccoutant@google.com>
11242
11243 * i386.cc (Target_i386::Got_type): New enum declaration.
11244 (Target_i386::Scan::local): Updated callers of Output_data_got
11245 member functions.
11246 (Target_i386::Scan::global): Likewise.
11247 (Target_i386::Relocate::relocate): Likewise.
11248 (Target_i386::Relocate::relocate_tls): Likewise.
11249 * object.h (Got_offset_list): New class.
11250 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11251 (Sized_relobj::local_got_offset): Likewise.
11252 (Sized_relobj::set_local_got_offset): Likewise.
11253 (Sized_relobj::local_has_tls_got_offset): Removed.
11254 (Sized_relobj::local_tls_got_offset): Removed.
11255 (Sized_relobj::set_local_tls_got_offset): Removed.
11256 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11257 * output.cc (Output_data_got::add_global): Added got_type parameter.
11258 (Output_data_got::add_global_with_rel): Likewise.
11259 (Output_data_got::add_global_with_rela): Likewise.
11260 (Output_data_got::add_global_pair_with_rel): New function.
11261 (Output_data_got::add_global_pair_with_rela): New function.
11262 (Output_data_got::add_local): Added got_type parameter.
11263 (Output_data_got::add_local_with_rel): Likewise.
11264 (Output_data_got::add_local_with_rela): Likewise.
11265 (Output_data_got::add_local_pair_with_rel): New function.
11266 (Output_data_got::add_local_pair_with_rela): New function.
11267 (Output_data_got::add_global_tls): Removed.
11268 (Output_data_got::add_global_tls_with_rel): Removed.
11269 (Output_data_got::add_global_tls_with_rela): Removed.
11270 (Output_data_got::add_local_tls): Removed.
11271 (Output_data_got::add_local_tls_with_rel): Removed.
11272 (Output_data_got::add_local_tls_with_rela): Removed.
11273 * output.h (Output_data_got::add_global): Added got_type parameter.
11274 (Output_data_got::add_global_with_rel): Likewise.
11275 (Output_data_got::add_global_with_rela): Likewise.
11276 (Output_data_got::add_global_pair_with_rel): New function.
11277 (Output_data_got::add_global_pair_with_rela): New function.
11278 (Output_data_got::add_local): Added got_type parameter.
11279 (Output_data_got::add_local_with_rel): Likewise.
11280 (Output_data_got::add_local_with_rela): Likewise.
11281 (Output_data_got::add_local_pair_with_rel): New function.
11282 (Output_data_got::add_local_pair_with_rela): New function.
11283 (Output_data_got::add_global_tls): Removed.
11284 (Output_data_got::add_global_tls_with_rel): Removed.
11285 (Output_data_got::add_global_tls_with_rela): Removed.
11286 (Output_data_got::add_local_tls): Removed.
11287 (Output_data_got::add_local_tls_with_rel): Removed.
11288 (Output_data_got::add_local_tls_with_rela): Removed.
11289 * resolve.cc (Symbol::override_base_with_special): Removed
11290 reference to has_got_offset_ field.
11291 * symtab.cc (Symbol::init_fields): Replaced initialization
11292 of got_offset_ with got_offsets_. Removed initialization
11293 of has_got_offset_
53fcba31 11294 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
11295 (Symbol::got_offset): Likewise.
11296 (Symbol::set_got_offset): Likewise.
11297 (Symbol::has_tls_got_offset): Removed.
11298 (Symbol::tls_got_offset): Removed.
11299 (Symbol::set_tls_got_offset): Removed.
11300 (Symbol::got_offset_): Removed.
11301 (Symbol::tls_mod_got_offset_): Removed.
11302 (Symbol::tls_pair_got_offset_): Removed.
11303 (Symbol::got_offsets_): New field.
11304 (Symbol::has_got_offset): Removed.
11305 (Symbol::has_tls_mod_got_offset): Removed.
11306 (Symbol::has_tls_pair_got_offset): Removed.
11307 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
11308 (Target_x86_64::Scan::local): Updated callers of Output_data_got
11309 member functions.
11310 (Target_x86_64::Scan::global): Likewise.
11311 (Target_x86_64::Relocate::relocate): Likewise.
11312 (Target_x86_64::Relocate::relocate_tls): Likewise.
11313
bd52eafb
BE
113142008-03-25 Ben Elliston <bje@au.ibm.com>
11315
11316 * yyscript.y: Fix spelling error in comment.
11317
8b105e34
ILT
113182008-03-24 Ian Lance Taylor <iant@google.com>
11319
8ed814a9
ILT
11320 * options.h (class General_options): Define build_id option.
11321 * layout.h (class Layout): Declare write_build_id, create_note,
11322 create_build_id. Add build_id_note_ member.
11323 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
11324 "libiberty.h", "md5.h", "sha1.h".
11325 (Layout::Layout): Initialize eh_frame_data_,
11326 eh_frame_hdr_section_, and build_id_note_.
11327 (Layout::finalize): Call create_build_id.
11328 (Layout::create_note): New function, broken out of
11329 Layout::create_gold_note.
11330 (Layout::create_gold_note): Call create_note.
11331 (Layout::create_build_id): New function.
11332 (Layout::write_build_id): New function.
11333 (Close_task_runner::run): Call write_build_id.
11334
8b105e34
ILT
11335 * x86_64.cc: Correct license to GPLv3.
11336
086a1841
ILT
113372008-03-23 Ian Lance Taylor <iant@google.com>
11338
11339 * options.cc: Include "demangle.h".
11340 (parse_optional_string): New function.
11341 (parse_long_option): Handle takes_optional_argument.
11342 (parse_short_option): Update dash_z initializer. Handle
11343 takes_optional_argument.
11344 (General_options::General_options): Initialize do_demangle_.
11345 (General_options::finalize): Set do_demangle_. Handle demangling
11346 style.
11347 * options.h (parse_optional_string): Declare.
11348 (struct One_option): Add optional_arg field. Update constructor.
11349 Update call constructor calls. Add takes_optional_argument
11350 function.
11351 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
11352 (DEFINE_optional_string): Define.
11353 (General_options::demangle): Change from DEFINE_bool to
11354 DEFINE_optional_string.
11355 (General_options::no_demangle): New function.
11356 (General_options::do_demangle): New function.
11357 (General_options::set_do_demangle): New function.
11358 (General_options::execstack_status_): Move definition to end of
11359 class definition.
11360 (General_options::static_): Likewise.
11361 (General_options::do_demangle_): New field.
11362 * object.cc (big_endian>::get_symbol_location_info): Call
11363 Options::do_demangle, not Options::demangle.
11364 * symtab.cc (demangle): Likewise.
11365
cbb93e63
ILT
113662008-03-22 Ian Lance Taylor <iant@google.com>
11367
11368 * gold.h: Include <cstddef> and <sys/types.h>
11369 * options.h: Include <cstring>.
11370
ec531623
ILT
113712008-03-21 Ian Lance Taylor <iant@google.com>
11372
11373 * Added source code to GNU binutils.
This page took 0.64333 seconds and 4 git commands to generate.