include/ChangeLog
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
6daf5215
ILT
12011-07-08 Ian Lance Taylor <iant@google.com>
2
3 PR gold/11985
4 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5 if linker script discards key sections.
6 (Layout::create_dynamic_symtab): Likewise.
7 (Layout::assign_local_dynsym_offsets): Likewise.
8 (Layout::sized_create_version_sections): Likewise.
9 (Layout::create_interp): Likewise.
10 (Layout::finish_dynamic_section): Likewise.
11 (Layout::set_dynamic_symbol_size): Likewise.
12
beabb2c6
ILT
132011-07-08 Ian Lance Taylor <iant@google.com>
14
15 PR gold/12386
16 * options.h (class General_options): Add --unresolved-symbols.
17 * target-reloc.h (issue_undefined_symbol_error): Check
18 --unresolved-symbols. Add comments.
19
9c16daf1
ILT
202011-07-08 Ian Lance Taylor <iant@google.com>
21
22 * testsuite/odr_violation2.cc (Ordering::operator()): Make
23 expression more complex.
24
191f1a2d
ILT
252011-07-08 Ian Lance Taylor <iant@google.com>
26
27 PR gold/11317
28 * target-reloc.h (issue_undefined_symbol_error): New inline
29 function, broken out of relocate_section.
30 (relocate_section): Call issue_undefined_symbol_error.
31 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
32 there is no TLS segment if we are about to issue an undefined
33 symbol error.
34 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
35
62855347
ILT
362011-07-08 Ian Lance Taylor <iant@google.com>
37
38 PR gold/12279
39 * resolve.cc (Symbol_table::should_override): Add fromtype
40 parameter. Change all callers. Give error when linking together
41 TLS and non-TLS symbol.
42 (Symbol_table::should_override_with_special): Add fromtype
43 parameter. Change all callers.
44 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
45 there is no TLS segment if we have reported some errors.
46 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
47
67181c72
ILT
482011-07-08 Ian Lance Taylor <iant@google.com>
49
50 PR gold/12372
51 * target.h (Target::plt_address_for_global): New function.
52 (Target::plt_address_for_local): New function.
53 (Target::plt_section_for_global): Remove.
54 (Target::plt_section_for_local): Remove.
55 (Target::do_plt_address_for_global): New virtual function.
56 (Target::do_plt_address_for_local): New virtual function.
57 (Target::do_plt_section_for_global): Remove.
58 (Target::do_plt_section_for_local): Remove.
59 (Target::register_global_plt_entry): Add Symbol_table and Layout
60 parameters.
61 * output.cc (Output_data_got::Got_entry::write): Use
62 plt_address_for_global and plt_address_for_local.
63 * layout.cc (Layout::add_target_dynamic_tags): Use size and
64 address of output section.
65 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
66 got_irelative_, and irelative_count_ fields. Update
67 declarations.
68 (Output_data_plt_i386::has_irelative_section): New function.
69 (Output_data_plt_i386::entry_count): Add irelative_count_.
70 (Output_data_plt_i386::set_final_data_size): Likewise.
71 (class Target_i386): Add got_irelative_ and rel_irelative_
72 fields. Update declarations.
73 (Target_i386::Target_i386): Initialize new fields.
74 (Target_i386::do_plt_address_for_global): New function replacing
75 do_plt_section_for_global.
76 (Target_i386::do_plt_address_for_local): New function replacing
77 do_plt_section_for_local.
78 (Target_i386::got_section): Create got_irelative_.
79 (Target_i386::rel_irelative_section): New function.
80 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
81 fields. Don't define __rel_iplt_{start,end}.
82 (Output_data_plt_i386::add_entry): Add symtab and layout
83 parameters. Change all callers. Use different PLT and GOT for
84 IFUNC symbols.
85 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
86 layout parameters. Change all callers. Use different PLT and
87 GOT.
88 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
89 (Output_data_plt_i386::rel_irelative): New function.
90 (Output_data_plt_i386::address_for_global): New function.
91 (Output_data_plt_i386::address_for_local): New function.
92 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
93 IRELATIVE GOT when changing IFUNC GOT entries.
94 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
95 reloc.
96 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
97 if we didn't create an IRELATIVE GOT.
98 (Target_i386::Relocate::relocate): Use plt_address_for_global and
99 plt_address_for_local.
100 (Target_i386::do_dynsym_value): Use plt_address_for_global.
101 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
102 got_irelative_, and irelative_count_ fields. Update
103 declarations.
104 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
105 Initialize new fields. Remove symtab parameter. Change all
106 callers.
107 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
108 irelative_count_.
109 (Output_data_plt_x86_64::has_irelative_section): New function.
110 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
111 (class Target_x86_64): Add got_irelative_ and rel_irelative_
112 fields. Update declarations.
113 (Target_x86_64::Target_x86_64): Initialize new fields.
114 (Target_x86_64::do_plt_address_for_global): New function replacing
115 do_plt_section_for_global.
116 (Target_x86_64::do_plt_address_for_local): New function replacing
117 do_plt_section_for_local.
118 (Target_x86_64::got_section): Create got_irelative_.
119 (Target_x86_64::rela_irelative_section): New function.
120 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
121 all callers. Don't create __rel_iplt_{start,end}.
122 (Output_data_plt_x86_64::add_entry): Add symtab and layout
123 parameters. Change all callers. Use different PLT and GOT for
124 IFUNC symbols.
125 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
126 layout parameters. Change all callers. Use different PLT and
127 GOT.
128 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
129 parameters. Change all callers. Use different PLT and GOT for
130 IFUNC symbols.
131 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
132 (Output_data_plt_x86_64::rela_irelative): New function.
133 (Output_data_plt_x86_64::address_for_global): New function.
134 (Output_data_plt_x86_64::address_for_local): New function.
135 (Output_data_plt_x86_64::set_final_data_size): Likewise.
136 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
137 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
138 (Target_x86_64::register_global_plt_entry): Add symtab and layout
139 parameters.
140 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
141 reloc.
142 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
143 symbols if we didn't create an IRELATIVE GOT.
144 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
145 plt_address_for_local.
146 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
147 * testsuite/ifuncvar1.c: New test file.
148 * testsuite/ifuncvar2.c: New test file.
149 * testsuite/ifuncvar3.c: New test file.
150 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
151 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
152 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
153 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
154 * testsuite/Makefile.in: Rebuild.
155
33c15b45
CC
1562011-07-07 Cary Coutant <ccoutant@google.com>
157
158 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
159 (two_file_test_1_ndebug.o): Likewise.
160 (two_file_test_1b_ndebug.o): Likewise.
161 (two_file_test_2_ndebug.o): Likewise.
162 (two_file_test_main_ndebug.o): Likewise.
163 (incremental_test_2): Link with no-debug versions.
164
f48b5fb7
CC
1652011-07-06 Cary Coutant <ccoutant@google.com>
166
167 * gold/incremental.cc
168 (Output_section_incremental_inputs::write_info_blocks): Check for
169 hidden and internal symbols.
170
221597a5
CC
1712011-07-06 Cary Coutant <ccoutant@google.com>
172
173 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
174 Check disposition for startup file.
175 (Incremental_inputs::report_command_line): Ignore
176 --incremental-startup-unchanged option.
177 * options.cc (General_options::parse_incremental_startup_unchanged):
178 New function.
179 (General_options::General_options): Initialize new data member.
180 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
181 (General_options): Add --incremental-startup-unchanged option.
182 (General_options::incremental_startup_disposition): New function.
183 (General_options::incremental_startup_disposition_): New data member.
184
e24719f6
CC
1852011-07-06 Cary Coutant <ccoutant@google.com>
186
187 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
188 input file index to Script_info ctor.
189 (Sized_incremental_binary::do_file_has_changed): Find the
190 command-line argument for files named in scripts.
191 * incremental.h (Script_info::Script_info): New ctor
192 with input file index.
193 (Script_info::input_file_index): New function.
194 (Script_info::input_file_index_): New data member.
195 (Incremental_binary::get_library): Add const.
196 (Incremental_binary::get_script_info): Add const.
197 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
198 * testsuite/Makefile.am (incremental_test_5): New test case.
199 (incremental_test_6): New test case.
200 * testsuite/Makefile.in: Regenerate.
201
8f7c81e8
CC
2022011-07-06 Cary Coutant <ccoutant@google.com>
203
204 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
205 debug output when command lines differ.
206
9fbd3822
CC
2072011-07-06 Cary Coutant <ccoutant@google.com>
208
209 * incremental.cc (Incremental_inputs::report_command_line): Ignore
210 --incremental-patch option.
211 * layout.cc (Free_list::allocate): Extend allocation beyond original
212 end if enabled.
213 (Layout::make_output_section): Mark sections that should get
214 patch space.
215 * options.cc (parse_percent): New function.
216 * options.h (parse_percent): New function.
217 (DEFINE_percent): New macro.
218 (General_options): Add --incremental-patch option.
219 * output.cc (Output_section::Output_section): Initialize new data
220 members.
221 (Output_section::add_input_section): Print section name when out
222 of patch space.
223 (Output_section::add_output_section_data): Likewise.
224 (Output_section::set_final_data_size): Add patch space when
225 doing --incremental-full.
226 (Output_section::do_reset_address_and_file_offset): Remove patch
227 space.
228 (Output_segment::set_section_list_addresses): Print debug output
229 only if --incremental-update.
230 * output.h (Output_section::set_is_patch_space_allowed): New function.
231 (Output_section::is_patch_space_allowed_): New data member.
232 (Output_section::patch_space_): New data member.
233 * parameters.cc (Parameters::incremental_full): New function.
234 * parameters.h (Parameters::incremental_full): New function
235 * testsuite/Makefile.am (incremental_test_2): Add test for
236 --incremental-patch option.
237 * testsuite/Makefile.in: Regenerate.
238 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
239 (t18): Remove function body.
240
f6cccc2c
DK
2412011-07-05 Doug Kwan <dougkwan@google.com>
242
243 PR gold/12771
244 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
245 Arm_Address type for relocation result.
246 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
247 overflow check.
248 (Arm_relocate_functions::abs32): Use unaligned access.
249 (Arm_relocate_functions::rel32): Ditto.
250 (Arm_relocate_functions::prel31): Ditto.
251 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
252 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
253 static data relocations.
254 * testsuite/Makefile.in: Regnerate.
255 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
256
28a13fec
ILT
2572011-07-05 Ian Lance Taylor <iant@google.com>
258
259 PR gold/12392
260 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
261 symbols if necessary.
262 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
263
24d47b34
ILT
2642011-07-05 Ian Lance Taylor <iant@google.com>
265
266 PR gold/12952
267 * resolve.cc (Symbol::override_base_with_special): Simply override
268 version with special symbol version, ignoring previous version.
269
41f9cbbe
ILT
2702011-07-05 Ian Lance Taylor <iant@google.com>
271
272 * object.cc (Sized_relobj_file::include_section_group): Add
273 information to comment about signature location.
274
886288f1
ILT
2752011-07-02 Ian Lance Taylor <iant@google.com>
276
277 PR gold/12957
278 * options.h (class General_options): Add -f and -F.
279 * options.cc (General_options::finalize): Fatal error if -f/-F
280 are used without -shared.
281 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
282
ae3a6d4f
ILT
2832011-07-02 Ian Lance Taylor <iant@google.com>
284
285 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
286
21131061
ILT
2872011-07-01 Ian Lance Taylor <iant@google.com>
288
289 PR gold/12525
290 PR gold/12952
291 * resolve.cc (Symbol::override_base_with_special): Don't override
292 the version if the overriding symbol has a different name.
293 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
294 all callers. If we give an error about an undefined version,
295 define the base version if necessary.
296 * dynobj.h (class Versions): Update declaration.
297 * testsuite/weak_alias_test_5.cc: New file.
298 * testsuite/weak_alias_test.script: New file.
299 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
300 and versioned_alias have the right value, and call t2.
301 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
302 weak_alias_test_5.so.
303 (weak_alias_test_LDADD): Likewise.
304 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
305 * testsuite/Makefile.in: Rebuild.
306
611062c0
ILT
3072011-07-01 Ian Lance Taylor <iant@google.com>
308
309 PR gold/12525
310 * options.h (class General_options): Support -z notext.
311 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
312 -Wl,-z,notext.
313 (two_file_shared_nonpic.so): Likewise.
314 (two_file_shared_mixed.so): Likewise.
315 (two_file_shared_mixed_1.so): Likewise.
316 (weak_undef_lib_nonpic.so): Likewise.
317 (alt/weak_undef_lib_nonpic.so): Likewise.
318 (tls_test_shared_nonpic.so): Likewise.
319 * testsuite/Makefile.in: Rebuild.
320
328c7c2f
ILT
3212011-07-01 Ian Lance Taylor <iant@google.com>
322
323 PR gold/12525
324 * configure.ac: Test whether static linking works, setting
325 the automake conditional HAVE_STATIC.
326 * testsuite/Makefile.am: Disable tests using -static if
327 HAVE_STATIC is not true.
328 * configure, testsuite/Makefile.in: Rebuild.
329
02d7cd44
ILT
3302011-07-01 Ian Lance Taylor <iant@google.com>
331
332 PR gold/12525
333 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
334 Assert if we see DW_EH_PE_indirect.
335 * target.h (Target::ehframe_datarel_base): New function.
336 (Target::do_ehframe_datarel_base): New target function.
337 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
338 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
339 function.
340
07a60597
ILT
3412011-07-01 Ian Lance Taylor <iant@google.com>
342
343 PR gold/12571
344 * options.h (class General_options): Add
345 --ld-generated-unwind-info.
346 * ehframe.cc (Fde::write): Add address parameter. Change all
347 callers. If associated with PLT, fill in address and size.
348 (Cie::set_output_offset): Only add merge mapping if there is an
349 object.
350 (Cie::write): Add address parameter. Change all callers.
351 (Eh_frame::add_ehframe_for_plt): New function.
352 * ehframe.h (class Fde): Update declarations. Move shndx_ and
353 input_offset_ fields into union u_, with new plt field.
354 (Fde::Fde): Adjust for new union field.
355 (Fde::Fde) [Output_data version]: New constructor.
356 (Fde::add_mapping): Only add merge mapping if there is an object.
357 (class Cie): Update declarations.
358 (class Eh_frame): Declare add_ehframe_for_plt.
359 * layout.cc (Layout::layout_eh_frame): Break out code into
360 make_eh_frame_section, and call it.
361 (Layout::make_eh_frame_section): New function.
362 (Layout::add_eh_frame_for_plt): New function.
363 * layout.h (class Layout): Update declarations.
364 * merge.cc (Merge_map::add_mapping): Add assertion.
365 * i386.cc: Include "dwarf.h".
366 (class Output_data_plt_i386): Make first_plt_entry,
367 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
368 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
369 and plt_eh_frame_fde.
370 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
371 boundary. Call add_eh_frame_for_plt if appropriate.
372 * x86_64.cc: Include "dwarf.h".
373 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
374 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
375 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
376 and plt_eh_frame_fde.
377 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
378 appropriate.
379
14788a3f
ILT
3802011-06-29 Ian Lance Taylor <iant@google.com>
381
382 PR gold/12629
383 * object.cc (Sized_relobj_file::layout_section): Change shdr
384 parameter to be const.
385 (Sized_relobj_file::layout_eh_frame_section): New function, broken
386 out of do_layout.
387 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
388 appropriate. Call layout_eh_frame_section.
389 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
390 sections.
391 * object.h (class Sized_relobj_file): Update declarations.
392
6c21fce1
ILT
3932011-06-29 Ian Lance Taylor <iant@google.com>
394
37e41b03 395 PR gold/12652
6c21fce1
ILT
396 * script.cc (Token::integer_value): Accept trailing M/m/K/k
397 modifier.
398 (Lex::gather_token): Accept trailing M/m/K/k for integers.
399
4d5e4e62
ILT
4002011-06-29 Ian Lance Taylor <iant@google.com>
401
402 PR gold/12675
403 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
404 SHT_X86_64_UNWIND.
405 * layout.cc (Layout::layout_eh_frame): Likewise.
406
886f533a
ILT
4072011-06-29 Ian Lance Taylor <iant@google.com>
408
409 PR gold/12695
410 * layout.cc (Layout::symtab_section_shndx): New function.
411 * layout.h (class Layout): Declare symtab_section_shndx.
412 * output.cc (Output_section::write_header): Call it.
413
f3ae1b28
ILT
4142011-06-29 Ian Lance Taylor <iant@google.com>
415
416 PR gold/12818
417 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
418 symbols which are not used in a relocation.
419
aecf301f
ILT
4202011-06-28 Ian Lance Taylor <iant@google.com>
421
422 PR gold/12898
423 * layout.cc (Layout::segment_precedes): Don't crash if a linker
424 script create indistinguishable segments.
425 (Layout::set_segment_offsets): Use stable_sort when sorting
426 segments. Pass this to Compare_segments constructor.
427 * layout.h (class Layout): Make segment_precedes non-static.
428 (class Compare_segments): Change from struct to class. Add
429 layout_ field. Add constructor.
430 * script-sections.cc
431 (Script_sections::attach_sections_using_phdrs_clause): Rename
432 local orphan to is_orphan. Don't report failure to put empty
433 section in segment. On attachment failure, report name of
434 section, and attach to first PT_LOAD segment.
435
03ef7571
ILT
4362011-06-28 Ian Lance Taylor <iant@google.com>
437
438 PR gold/12934
439 * target-select.cc (Target_selector::Target_selector): Add
440 emulation parameter. Change all callers.
441 (select_target_by_bfd_name): Rename from select_target_by_name.
442 Change all callers.
443 (select_target_by_emulation): New function.
444 (supported_emulation_names): New function.
445 * target-select.h (class Target_selector): Add emulation_ field.
446 Update declarations.
447 (Target_selector::recognize_by_bfd_name): Rename from
448 recognize_by_name. Change all callers.
449 (Target_selector::supported_bfd_names): Rename from
450 supported_names. Change all callers.
451 (Target_selector::recognize_by_emulation): New function.
452 (Target_selector::supported_emulations): New function.
453 (Target_selector::emulation): New function.
454 (Target_selector::do_recognize_by_bfd_name): Rename from
455 do_recognize_by_name. Change all callers.
456 (Target_selector::do_supported_bfd_names): Rename from
457 do_supported_names. Change all callers.
458 (Target_selector::do_recognize_by_emulation): New function.
459 (Target_selector::do_supported_emulations): New function.
460 (select_target_by_bfd_name): Change name in declaration.
461 (select_target_by_emulation): Declare.
462 (supported_emulation_names): Declare.
463 * parameters.cc (parameters_force_valid_target): Try to find
464 target based on emulation from -m option.
465 * options.h (class General_options): Change doc string for -m.
466 * options.cc (help): Print emulations.
467 (General_options::parse_V): Likewise.
468 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
469 Add emulation parameter. Change all callers.
470
200b2bb9
ILT
4712011-06-28 Ian Lance Taylor <iant@google.com>
472
473 * target.h (class Target): Add osabi_ field.
474 (Target::osabi): New function.
475 (Target::set_osabi): New function.
476 (Target::Target): Initialize osabi_.
477 (Target::do_adjust_elf_header): Make pure virtual.
478 (Sized_target::do_adjust_elf_header): Declare.
479 * target.cc (Sized_target::do_adjust_elf_header): New function.
480 (class Sized_target): Instantiate all versions.
481 * freebsd.h (class Target_freebsd): Remove.
482 (Target_selector_freebsd::do_recognize): Call set_osabi on
483 Target.
484 (Target_selector_freebsd::do_recognize_by_name): Likewise.
485 (Target_selector_freebsd::set_osabi): Remove.
486 * i386.cc (class Target_i386): Inherit from Sized_target rather
487 than Target_freebsd.
488 * x86_64.cc (class Target_x86_64): Likewise.
489
b3ce541e
ILT
4902011-06-28 Ian Lance Taylor <iant@google.com>
491
492 * target.h (Target::can_check_for_function_pointers): Rewrite.
493 Make non-virtual.
494 (Target::can_icf_inline_merge_sections): Likewise.
495 (Target::section_may_have_icf_unsafe_poineters): Likewise.
496 (Target::Target_info): Add can_icf_inline_merge_sections field.
497 (Target::do_can_check_for_function_pointers): New virtual
498 function.
499 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
500 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
501 from can_check_for_function_pointers, move in file.
502 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
503 section_may_have_icf_unsafe_poineters, move in file.
504 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
505 * i386.cc (Target_i386::do_can_check_for_function_pointers):
506 Rename from can_check_for_function_pointers, move in file.
507 (Target_i386::can_icf_inline_merge_sections): Remove.
508 (Target_i386::i386_info): Initialize
509 can_icf_inline_merge_sections.
510 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
511 Initialize can_icf_inline_merge_sections.
512 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
513 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
514 Rename from can_check_for_function_pointers, move in file.
515 (Target_x86_64::can_icf_inline_merge_sections): Remove.
516 (Target_x86_64::x86_64_info): Initialize
517 can_icf_inline_merge_sections.
518 * testsuite/testfile.cc (Target_test::test_target_info):
519 Likewise.
520 * icf.cc (get_section_contents): Correct formatting.
521
6d1c4efb
ILT
5222011-06-27 Ian Lance Taylor <iant@google.com>
523
524 * symtab.cc (Symbol::versioned_name): New function.
525 (Symbol_table::add_to_final_symtab): Use versioned_name when
526 appropriate.
527 (Symbol_table::sized_write_symbol): Likewise.
528 * symtab.h (class Symbol): Declare versioned_name.
529 * stringpool.h (class Stringpool_template): Add variant of add
530 which takes a std::basic_string.
531 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
532 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
533 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
534 (ver_test_12.o): New target.
535 * testsuite/Makefile.in: Rebuild.
536
57eb9b50
DK
5372011-06-27 Doug Kwan <dougkwan@google.com>
538
539 * arm.cc (Arm_relocate_functions::thm_jump8,
540 Arm_relocate_functions::thm_jump11): Use a wider signed
541 type to compute offset.
542 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
543 arm_thm_jump8.
544 * testsuite/Makefile.in: Regenerate.
545 * testsuite/arm_branch_in_range.sh: Check test results of
546 arm_thm_jump11 and arm_thm_jump8.
547 * testsuite/arm_thm_jump11.s: New test source file.
548 * testsuite/arm_thm_jump11.t: New linker script.
549 * testsuite/arm_thm_jump8.s: New test source file.
550 * testsuite/arm_thm_jump8.t: New linker script.
551
487b39df
ILT
5522011-06-24 Ian Lance Taylor <iant@google.com>
553
554 * layout.cc: Include "object.h".
555 (ctors_sections_in_init_array): New static variable.
556 (Layout::is_ctors_in_init_array): New function.
557 (Layout::layout): Add entry to ctors_sections_in_init_array if
558 appropriate.
559 * layout.h (class Layout): Declare is_ctors_in_init_array.
560 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
561 is_ctors_reverse_view is set.
562 (Sized_relobj_file::write_sections): Add layout parameter. Change
563 all callers. Set is_ctors_reverse_view field of View_size.
564 (Sized_relobj_file::reverse_words): New function.
565 * object.h (Sized_relobj_file::View_size): Add
566 is_ctors_reverse_view field.
567 (class Sized_relobj_file): Update declarations.
568 * testsuite/initpri3.c: New test.
569 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
570 initpri3b.
571 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
572 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
573 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
574 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
575 * testsuite/Makefile.in: Rebuild.
576
472076e4
CC
5772011-06-24 Cary Coutant <ccoutant@google.com>
578
579 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
580 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
581 (debug_msg_cdebug.err): New targets.
582 * testsuite/Makefile.in: Regenerate.
583 * testsuite/debug_msg.sh: Check output of link with compressed debug.
584 Fix checks for link with shared library.
585
a60af0db
DK
5862011-06-24 Doug Kwan <dougkwan@google.com>
587
588 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
589 skip empty text sections.
590 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
591
5393d741
ILT
5922011-06-22 Ian Lance Taylor <iant@google.com>
593
594 PR gold/12910
595 * options.h (class General_options): Add --ctors-in-init-array.
596 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
597 friends as SHT_PROGBITS for merging sections.
598 (Layout::layout): Remove special handling of .init_array and
599 friends. Don't sort if doing relocatable link. Sort for .ctors
600 and .dtors if ctors_in_init_array.
601 (Layout::make_output_section): Force correct section types for
602 .init_array and friends. Don't sort if doing relocatable link,
603 Don't sort .ctors and .dtors if ctors_in_init_array.
604 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
605 (Layout::output_section_name): Add relobj parameter. Change all
606 callers. Handle .ctors. and .dtors. in code rather than table.
607 Handle .ctors and .dtors if ctors_in_init_array.
608 (Layout::match_file_name): New function, moved from output.cc.
609 * layout.h (class Layout): Update declarations.
610 * output.cc: Include "layout.h".
611 (Input_section_sort_entry::get_priority): New function.
612 (Input_section_sort_entry::match_file_name): Just call
613 Layout::match_file_name.
614 (Output_section::Input_section_sort_init_fini_compare::operator()):
615 Handle .ctors and .dtors. Sort by explicit priority rather than
616 by name.
617 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
618 * testsuite/initpri2.c: New test.
619 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
620 (check_PROGRAMS): Add initpri2.
621 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
622 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
623 * configure, testsuite/Makefile.in: Rebuild.
624
e1f74f98
ILT
6252011-06-19 Ian Lance Taylor <iant@google.com>
626
627 PR gold/12880
628 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
629 .interp section to a PT_INTERP segment even if we have seen a
630 --dynamic-linker option. Don't do it if we have seen a PHDRS
631 clause in a linker script.
632 (Layout::finalize): Don't create a .interp section if we've
633 already create a PT_INTERP segment.
634 (Layout::create_interp): Always call choose_output_section (revert
635 patch of 2011-06-17). Don't create PT_INTERP segment.
636 * script-sections.cc
637 (Script_sections::create_note_and_tls_segments): Add a .interp
638 section to a PT_INTERP segment even if we have seen a
639 --dynamic-linker option.
640
766f91bb
ILT
6412011-06-18 Ian Lance Taylor <iant@google.com>
642
643 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
644 merely because a non-PT_LOAD segment has a dynamic reloc.
645
0d212c3a
ILT
6462011-06-18 Ian Lance Taylor <iant@google.com>
647
648 * layout.cc (Layout::finish_dynamic_section): Don't create
649 DT_FLAGS entry if not needed.
650
911a5072
ILT
6512011-06-18 Ian Lance Taylor <iant@google.com>
652
653 PR gold/12745
654 * layout.cc (Layout::layout_eh_frame): Correct handling of
655 writable .eh_frame section.
656
534b4e5f
ILT
6572011-06-17 Ian Lance Taylor <iant@google.com>
658
659 PR gold/12893
660 * resolve.cc (Symbol_table::resolve): Don't give an error if a
661 symbol is redefined with the exact same object and value.
662
10b4f102
ILT
6632011-06-17 Ian Lance Taylor <iant@google.com>
664
665 PR gold/12880
666 * layout.h (class Layout): Add interp_segment_ field.
667 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
668 (Layout::attach_allocated_section_to_segment): If making shared
669 library, put .interp section in PT_INTERP segment.
670 (Layout::finalize): Also call create_interp if -dynamic-linker
671 option was used.
672 (Layout::create_interp): Assert that there is no PT_INTERP
673 segment. If not using a SECTIONS clause, use make_output_section.
674 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
675 * script-sections.cc
676 (Script_sections::create_note_and_tls_segments): If making shared
677 library, put .interp section in PT_INTERP segment.
678
a29b0dad
ILT
6792011-06-17 Ian Lance Taylor <iant@google.com>
680
e588ea8d
ILT
681 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
682 when making a shared library.
683
6842011-06-17 Ian Lance Taylor <iant@google.com>
685
686 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
687 parameter. Change all callers. Don't issue warning about PC32
688 against locally defined symbol.
a29b0dad 689
9d3b0698
ILT
6902011-06-16 Ian Lance Taylor <iant@google.com>
691
692 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
693 occurs in same object.
694
85b0f90c
AM
6952011-06-14 Alan Modra <amodra@gmail.com>
696
697 * po/POTFILES.in: Regenerate.
698
a94907d9
ILT
6992011-06-09 Ian Lance Taylor <iant@google.com>
700
701 * script-sections.cc
702 (Orphan_output_section::set_section_addresses): For a relocatable
703 link set address to 0.
704
4fb3a1c3
CC
7052011-06-09 Cary Coutant <ccoutant@google.com>
706
707 PR gold/12804
708 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
709 used with --compress-debug-sections.
710 * gold/object.cc (Sized_relobj_file::do_layout): Report
711 uncompressed size of compressed input sections.
712
61220854
CC
7132011-06-08 Cary Coutant <ccoutant@google.com>
714
715 PR gold/12804
716 * testsuite/two_file_test_2_v1.cc: Change initialization of
717 v2 to keep it in .data.
718
e6455dfb
CC
7192011-06-07 Cary Coutant <ccoutant@google.com>
720
721 * common.cc (Symbol_table::do_allocate_commons_list): Call
722 gold_fallback.
723 * errors.cc (Errors::fatal): Adjust call to gold_exit.
724 (Errors::fallback): New function.
725 (gold_fallback): New function.
726 * errors.h (Errors::fallback): New function.
727 * gold.cc (gold_exit): Change status parameter to enum; adjust
728 all callers.
729 (queue_initial_tasks): Call gold_fallback.
730 * gold.h: Include cstdlib.
731 (Exit_status): New enum type.
732 (gold_exit): Change status parameter to enum.
733 (gold_fallback): New function.
734 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
735 (Layout::create_symtab_sections): Likewise.
736 (Layout::create_shdrs): Likewise.
737 * main.cc (main): Adjust call to gold_exit.
738 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
739 (Output_data_got::add_got_entry_pair): Likewise.
740 (Output_section::add_input_section): Likewise.
741 (Output_section::add_output_section_data): Likewise.
742 (Output_segment::set_section_list_addresses): Likewise.
743 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
744
fb0e076f
CC
7452011-06-07 Cary Coutant <ccoutant@google.com>
746
747 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
748 for incremental links.
749 * output.cc (Output_segment::set_section_list_addresses): Remove
750 FIXME and test for TLS or BSS.
751
a5ee4d5d
CC
7522011-06-07 Cary Coutant <ccoutant@google.com>
753
754 * testsuite/Makefile.am: Add incremental_copy_test,
755 incremental_common_test_1.
756 * testsuite/Makefile.in: Regenerate.
757 * testsuite/common_test_1_v1.c: New source file.
758 * testsuite/common_test_1_v2.c: New source file.
759 * testsuite/copy_test_v1.cc: New source file.
760
5146f448
CC
7612011-06-07 Cary Coutant <ccoutant@google.com>
762
763 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
764 update, allocate common from bss section's free list.
765 * incremental-dump.cc (dump_incremental_inputs): Print flag for
766 linker-defined symbols.
767 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
768 Skip GOT and PLT entries that are no longer referenced.
769 (Output_section_incremental_inputs::write_info_blocks): Mark
770 linker-defined symbols.
771 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
772 * output.cc (Output_section::allocate): New function.
773 * output.h (Output_section::allocate): New function.
774 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
775 linker-defined symbols.
776 (Symbol::override_base_with_special): Copy is_predefined_ flag.
777 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
778 (Symbol::init_base_output_data): Likewise.
779 (Symbol::init_base_output_segment): Likewise.
780 (Symbol::init_base_constant): Likewise.
781 (Sized_symbol::init_output_data): Likewise.
782 (Sized_symbol::init_output_segment): Likewise.
783 (Sized_symbol::init_constant): Likewise.
784 (Symbol_table::do_define_in_output_data): Likewise.
785 (Symbol_table::do_define_in_output_segment): Likewise.
786 (Symbol_table::do_define_as_constant): Likewise.
787 * symtab.h (Symbol::is_predefined): New function.
788 (Symbol::init_base_output_data): Add is_predefined parameter.
789 (Symbol::init_base_output_segment): Likewise.
790 (Symbol::init_base_constant): Likewise.
791 (Symbol::is_predefined_): New data member.
792 (Sized_symbol::init_output_data): Add is_predefined parameter.
793 (Sized_symbol::init_output_segment): Likewise.
794 (Sized_symbol::init_constant): Likewise.
795 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
796
26d3c67d
CC
7972011-06-07 Cary Coutant <ccoutant@google.com>
798
799 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
800 instead of emit_copy_reloc.
801 (Copy_relocs::emit_copy_reloc): Refactor.
802 (Copy_relocs::make_copy_reloc): New function.
803 (Copy_relocs::add_copy_reloc): Remove.
804 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
805 section.
806 (Copy_relocs::make_copy_reloc): New function.
807 (Copy_relocs::add_copy_reloc): Remove.
808 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
809 unchanged input files.
810 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
811 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
812 Reserve BSS space for COPY relocations.
813 (Sized_incremental_binary::do_emit_copy_relocs): New function.
814 (Output_section_incremental_inputs::write_info_blocks): Record
815 whether a symbol is copied from a shared object.
816 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
817 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
818 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
819 (Incremental_input_entry_reader::get_output_symbol_index): Add
820 is_copy parameter.
821 (Incremental_binary::emit_copy_relocs): New function.
822 (Incremental_binary::do_emit_copy_relocs): New function.
823 (Sized_incremental_binary::Sized_incremental_binary): Initialize
824 new data member.
825 (Sized_incremental_binary::add_copy_reloc): New function.
826 (Sized_incremental_binary::do_emit_copy_relocs): New function.
827 (Sized_incremental_binary::Copy_reloc): New struct.
828 (Sized_incremental_binary::Copy_relocs): New typedef.
829 (Sized_incremental_binary::copy_relocs_): New data member.
830 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
831 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
832 * target.h (Sized_target::emit_copy_reloc): New function.
833 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
834
7cdb37d9
CC
8352011-06-02 Cary Coutant <ccoutant@google.com>
836
837 PR gold/12163
838 * gold/archive.cc (Archive::Archive): Initialize new data member.
839 (Archive::include_all_members): Return if archive has already been
840 included.
841 * gold/archive.h (Archive::include_all_members_): New data member.
842
cc643b88
NC
8432011-06-02 Nick Clifton <nickc@redhat.com>
844
845 * dynobj.h: Fix spelling mistake in comment.
846 * output.cc: Likewise.
847
f62a3ca7
DK
8482011-05-31 Doug Kwan <dougkwan@google.com>
849 Asier Llano
850
851 PR gold/12826
cc643b88 852 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
853 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
854 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
855 redundant arm_exidx_test.so.
856 * testsuite/Makefile.in: Regenerate.
857 (check_SCRIPTS): Add pr12826.sh
858 (check_DATA): Add pr12826.stdout
859 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
860 * testsuite/pr12826.sh: New file.
861 * testsuite/pr12826_1.s: Ditto.
862 * testsuite/pr12826_1.s: Ditto.
863
8dbe1edc
ILT
8642011-05-30 Ian Lance Taylor <iant@google.com>
865
866 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
867 sections.
868
c49875be
ILT
8692011-05-29 Ian Lance Taylor <iant@google.com>
870
871 PR gold/12804
872 * testsuite/Makefile.am: Use different file name for two_file_test
873 temporary file for each incremental test.
874 * testsuite/Makefile.in: Rebuild.
875
69d53f7a
ILT
8762011-05-29 Ian Lance Taylor <iant@google.com>
877
878 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
879 binary input file is empty.
880
41d0ab5f
ILT
8812011-05-27 Ian Lance Taylor <iant@google.com>
882
883 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
884 (ver_test_9.so): Likewise.
885 * testsuite/Makefile.in: Rebuild.
886
89d8a36b
CC
8872011-05-26 Cary Coutant <ccoutant@google.com>
888
889 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
890 * incremental.cc (Incremental_inputs::report_input_section): Fix
891 comment, indentation.
892 (Incremental_inputs::report_comdat_group): New function.
893 (Output_section_incremental_inputs::set_final_data_size): Adjust size
894 of data for incremental input file entry.
895 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
896 group count, COMDAT group signatures.
897 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
898 an unchanged input file.
899 * incremental.h (Incremental_object_entry::Incremental_object_entry):
900 Initialize new data member.
901 (Incremental_object_entry::add_comdat_group): New function.
902 (Incremental_object_entry::get_comdat_group_count): New function.
903 (Incremental_object_entry::get_comdat_signature_key): New function.
904 (Incremental_object_entry::groups_): New data member.
905 (Incremental_inputs::report_comdat_group): New function.
906 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
907 data for incremental input file entry.
908 (Incremental_input_entry_reader::get_comdat_group_count): New function.
909 (Incremental_input_entry_reader::get_input_section): Adjust size of
910 data for incremental input file entry.
911 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
912 (Incremental_input_entry_reader::get_comdat_group_signature): New
913 function.
914 * object.cc (Sized_relobj::include_section_group): Report kept
915 COMDAT groups for incremental links.
916
1706a06f
ILT
9172011-05-24 David Meyer <pdox@google.com>
918
919 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
920 with name parameter. Add found_name parameter.
921 * fileread.cc (Input_file::find_file): Adjust code accordingly.
922 * dirsearch.h (class Dirsearch): Update declaration.
923
a10ae760
ILT
9242011-05-24 Ian Lance Taylor <iant@google.com>
925
926 * archive.cc (Library_base::should_include_member): Pull in object
927 from archive if it defines the entry symbol.
928 * parameters.cc (Parameters::entry): New function.
929 * parameters.h (class Parameters): Declare entry.
930 * output.h (class Output_file_header): Remove entry_ field.
931 * output.cc (Output_file_header::Output_file_header): Remove entry
932 parameter. Change all callers.
933 (Output_file_header::entry): Use parameters->entry.
934 * gold.cc (queue_middle_tasks): Likewise.
935 * plugin.cc (Plugin_hook::run): Likewise.
936
aa92d6ed
CC
9372011-05-24 Cary Coutant <ccoutant@google.com>
938
939 * gold.cc (queue_initial_tasks): Pass incremental base filename
940 to Output_file::open_base_file; don't print error message.
941 * incremental-dump.cc (main): Adjust call to
942 Output_file::open_for_modification.
943 * incremental-dump.cc (main): Likewise.
944 * incremental.cc (Incremental_inputs::report_command_line):
945 Ignore --incremental-base option when comparing command lines.
946 Ignore parameter when given as separate argument.
947 * options.h (class General_options): Add --incremental-base.
948 * output.cc (Output_file::Output_file):
949 (Output_file::open_base_file): Add base_name and writable parameters;
950 read base file into new file; print error message here.
951 (Output_file::map_no_anonymous): Add writable parameter; adjust all
952 callers.
953 * output.h (Output_file::open_for_modification): Rename to...
954 (Output_file::open_base_file): ...this; add base_name and
955 writable parameters; adjust all callers.
956 (Output_file::map_no_anonymous): Add writable parameter; adjust all
957 callers.
958 * testsuite/Makefile.am (incremental_test_4): Test
959 --incremental-base.
960 * testsuite/Makefile.in: Regenerate.
961
2eedd706
CC
9622011-05-24 Cary Coutant <ccoutant@google.com>
963
964 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
965 incremental_test_4.
966 * testsuite/Makefile.in: Regenerate.
967 * testsuite/two_file_test_1_v1.cc: New test source file.
968 * testsuite/two_file_test_1b_v1.cc: New test source file.
969 * testsuite/two_file_test_2_v1.cc: New test source file.
970
0f1c85a6
CC
9712011-05-24 Cary Coutant <ccoutant@google.com>
972
973 * dynobj.h (Dynobj::do_dynobj): New function.
974 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
975 flag and soname for shared objects.
976 * incremental.cc (Incremental_inputs::report_object): Make
977 either Incremental_object_entry or Incremental_dynobj_entry; add
978 soname to string table.
979 (Incremental_inputs::report_input_section): Add assertion.
980 (Output_section_incremental_inputs::set_final_data_size): Adjust
981 type of input file entry for shared libraries; adjust size of
982 shared library info entry.
983 (Output_section_incremental_inputs::write_input_files): Write
984 as_needed flag for shared libraries.
985 (Output_section_incremental_inputs::write_info_blocks): Adjust type
986 of input file entry for shared libraries; write soname.
987 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
988 soname from incremental info.
989 * incremental.h (enum Incremental_input_flags): Add
990 INCREMENTAL_INPUT_AS_NEEDED.
991 (Incremental_input_entry::Incremental_input_entry): Initialize new
992 data member.
993 (Incremental_input_entry::set_as_needed): New function.
994 (Incremental_input_entry::as_needed): New function.
995 (Incremental_input_entry::do_dynobj_entry): New function.
996 (Incremental_input_entry::as_needed_): New data member.
997 (Incremental_object_entry::Incremental_object_entry): Don't check
998 for shared library.
999 (Incremental_object_entry::do_type): Likewise.
1000 (class Incremental_dynobj_entry): New class.
1001 (Incremental_input_entry_reader::as_needed): New function.
1002 (Incremental_input_entry_reader::get_soname): New function.
1003 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1004 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1005 size of shared library info entry.
1006 * layout.cc (Layout::finish_dynamic_section): Don't test for
1007 incremental link when adding DT_NEEDED entries.
1008 * object.h (Object::Object): Initialize new data member.
1009 (Object::dynobj): New function.
1010 (Object::set_as_needed): New function.
1011 (Object::as_needed): New function.
1012 (Object::do_dynobj): New function.
1013 (Object::as_needed_): New data member.
1014
6fa2a40b
CC
10152011-05-24 Cary Coutant <ccoutant@google.com>
1016
1017 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1018 info; adjust display of GOT entries.
1019 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1020 vector of input objects; remove file_status_.
1021 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1022 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1023 got_plt reader; call target hooks to reserve GOT entries.
1024 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1025 of input file info header and GOT info entry.
1026 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1027 relocation info.
1028 (Got_plt_view_info::got_descriptor): Remove.
1029 (Got_plt_view_info::sym_index): New data member.
1030 (Got_plt_view_info::input_index): New data member.
1031 (Local_got_offset_visitor::visit): Write input file index.
1032 (Global_got_offset_visitor::visit): Write 0 for input file index.
1033 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1034 with sym_index and input_index.
1035 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1036 incremental info GOT entry; replace got_descriptor with input_index.
1037 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1038 map from input file index to object.
1039 (Sized_relobj_incr::do_layout): Replace direct data member reference
1040 with accessor function.
1041 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1042 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1043 Adjust size of input file info header.
1044 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1045 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1046 (Incremental_input_entry_reader::get_input_section): Adjust size of
1047 input file info header.
1048 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1049 of incremental info GOT entry.
1050 (Incremental_got_plt_reader::get_got_desc): Remove.
1051 (Incremental_got_plt_reader::get_got_symndx): New function.
1052 (Incremental_got_plt_reader::get_got_input_index): New function.
1053 (Sized_incremental_binary::Sized_incremental_binary): Remove
1054 file_status_; add input_objects_.
1055 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1056 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1057 (Sized_incremental_binary::file_is_unchanged): Remove.
1058 (Sized_incremental_binary::set_input_object): New function.
1059 (Sized_incremental_binary::input_object): New function.
1060 (Sized_incremental_binary::file_status_): Remove.
1061 (Sized_incremental_binary::input_objects_): New data member.
1062 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1063 references.
1064 (Sized_relobj_incr::invalid_address): Move to base class.
1065 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1066 class.
1067 (Sized_relobj_incr::do_output_section_offset): Likewise.
1068 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1069 (Sized_relobj_incr::section_offsets_): Likewise.
1070 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1071 function.
1072 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1073 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1074 with accessor function.
1075 (Sized_relobj_file::do_layout): Likewise.
1076 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1077 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1078 (Sized_relobj_file::compute_final_local_value): Replace refs to
1079 section_offsets_ with accessor function.
1080 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1081 * object.h (Relobj::Relobj): Initialize new data members.
1082 (Relobj::add_dyn_reloc): New function.
1083 (Relobj::first_dyn_reloc): New function.
1084 (Relobj::dyn_reloc_count): New function.
1085 (Relobj::first_dyn_reloc_): New data member.
1086 (Relobj::dyn_reloc_count_): New data member.
1087 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1088 references.
1089 (Sized_relobj::Address): New typedef.
1090 (Sized_relobj::invalid_address): Move here from child class.
1091 (Sized_relobj::Sized_relobj): Initialize new data members.
1092 (Sized_relobj::sized_relobj): New function.
1093 (Sized_relobj::is_output_section_offset_invalid): Move here from
1094 child class.
1095 (Sized_relobj::get_output_section_offset): Likewise.
1096 (Sized_relobj::local_has_got_offset): Likewise.
1097 (Sized_relobj::local_got_offset): Likewise.
1098 (Sized_relobj::set_local_got_offset): Likewise.
1099 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1100 (Sized_relobj::clear_got_offsets): New function.
1101 (Sized_relobj::section_offsets): Move here from child class.
1102 (Sized_relobj::do_output_section_offset): Likewise.
1103 (Sized_relobj::do_set_section_offset): Likewise.
1104 (Sized_relobj::Local_got_offsets): Likewise.
1105 (Sized_relobj::local_got_offsets_): Likewise.
1106 (Sized_relobj::section_offsets_): Likewise.
1107 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1108 references.
1109 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1110 class.
1111 (Sized_relobj_file::sized_relobj): New function
1112 (Sized_relobj_file::local_has_got_offset): Move to base class.
1113 (Sized_relobj_file::local_got_offset): Likewise.
1114 (Sized_relobj_file::set_local_got_offset): Likewise.
1115 (Sized_relobj_file::get_output_section_offset): Likewise.
1116 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1117 (Sized_relobj_file::do_output_section_offset): Likewise.
1118 (Sized_relobj_file::do_set_section_offset): Likewise.
1119 (Sized_relobj_file::Local_got_offsets): Likewise.
1120 (Sized_relobj_file::local_got_offsets_): Likewise.
1121 (Sized_relobj_file::section_offsets_): Likewise.
1122 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1123 (all constructors).
1124 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1125 (Output_reloc::get_symbol_index): Likewise.
1126 (Output_reloc::local_section_offset): Likewise.
1127 (Output_reloc::get_address): Likewise.
1128 (Output_reloc::symbol_value): Likewise.
1129 (Output_data_got::reserve_slot): Move to class definition.
1130 (Output_data_got::reserve_local): New function.
1131 (Output_data_got::reserve_slot_for_global): Remove.
1132 (Output_data_got::reserve_global): New function.
1133 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1134 (all constructors, two instantiations).
1135 (Output_reloc::get_relobj): New function (two instantiations).
1136 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1137 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1138 (Output_data_reloc::add_global): Adjust type of relobj.
1139 (Output_data_reloc::add_global_relative): Likewise.
1140 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1141 (Output_data_reloc::add_local): Likewise.
1142 (Output_data_reloc::add_local_relative): Likewise.
1143 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1144 (Output_data_reloc::add_local_section): Likewise.
1145 (Output_data_reloc::add_output_section): Likewise.
1146 (Output_data_reloc::add_absolute): Likewise.
1147 (Output_data_reloc::add_target_specific): Likewise.
1148 (Output_data_got::reserve_slot): Move definition here.
1149 (Output_data_got::reserve_local): New function.
1150 (Output_data_got::reserve_global): New function.
1151 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1152 section_offsets_ with accessor function.
1153 (Sized_relobj_file::write_sections): Likewise.
1154 (Sized_relobj_file::do_relocate_sections): Likewise.
1155 * target.h (Sized_target::reserve_local_got_entry): New function.
1156 (Sized_target::reserve_global_got_entry): New function.
1157 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1158 (Target_x86_64::reserve_global_got_entry): New function.
1159 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1160
4829d394
CC
11612011-05-23 Cary Coutant <ccoutant@google.com>
1162
1163 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1164 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1165 bit when checking got_type.
1166 * incremental.cc (Sized_incremental_binary::setup_readers):
1167 Store symbol table and string table locations; initialize bit vector
1168 of file status flags.
1169 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1170 unchanged files.
1171 (Sized_incremental_binary::do_process_got_plt): New function.
1172 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1173 (Output_section_incremental_inputs::set_final_data_size): Record
1174 file index for each input file.
1175 (Output_section_incremental_inputs::write_got_plt): Store file index
1176 instead of input entry offset for each GOT entry.
1177 * incremental.h
1178 (Incremental_input_entry::Incremental_input_entry): Initialize new
1179 data member.
1180 (Incremental_input_entry::set_offset): Store file index.
1181 (Incremental_input_entry::get_file_index): New function.
1182 (Incremental_input_entry::file_index_): New data member.
1183 (Incremental_binary::process_got_plt): New function.
1184 (Incremental_binary::do_process_got_plt): New function.
1185 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1186 data members.
1187 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1188 (Sized_incremental_binary::set_file_is_unchanged): New function.
1189 (Sized_incremental_binary::file_is_unchanged): New function.
1190 (Sized_incremental_binary::do_process_got_plt): New function.
1191 (Sized_incremental_binary::file_status_): New data member.
1192 (Sized_incremental_binary::main_symtab_loc_): New data member.
1193 (Sized_incremental_binary::main_strtab_loc_): New data member.
1194 * output.cc (Output_data_got::Got_entry::write): Add case
1195 RESERVED_CODE.
1196 (Output_data_got::add_global): Call add_got_entry.
1197 (Output_data_got::add_global_plt): Likewise.
1198 (Output_data_got::add_global_with_rel): Likewise.
1199 (Output_data_got::add_global_with_rela): Likewise.
1200 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1201 (Output_data_got::add_global_pair_with_rela): Likewise.
1202 (Output_data_got::add_local): Call add_got_entry.
1203 (Output_data_got::add_local_plt): Likewise.
1204 (Output_data_got::add_local_with_rel): Likewise.
1205 (Output_data_got::add_local_with_rela): Likewise.
1206 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1207 (Output_data_got::add_local_pair_with_rela): Likewise.
1208 (Output_data_got::reserve_slot): New function.
1209 (Output_data_got::reserve_slot_for_global): New function.
1210 (Output_data_got::add_got_entry): New function.
1211 (Output_data_got::add_got_entry_pair): New function.
1212 (Output_section::add_output_section_data): Edit FIXME.
1213 * output.h
1214 (Output_section_data_build::Output_section_data_build): New
1215 constructor with size parameter.
1216 (Output_data_space::Output_data_space): Likewise.
1217 (Output_data_got::Output_data_got): Initialize new data member; new
1218 constructor with size parameter.
1219 (Output_data_got::add_constant): Call add_got_entry.
1220 (Output_data_got::reserve_slot): New function.
1221 (Output_data_got::reserve_slot_for_global): New function.
1222 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1223 (Output_data_got::add_got_entry): New function.
1224 (Output_data_got::add_got_entry_pair): New function.
1225 (Output_data_got::free_list_): New data member.
1226 * target.h (Sized_target::init_got_plt_for_update): New function.
1227 (Sized_target::register_global_plt_entry): New function.
1228 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1229 Initialize new data member; call init; add constructor with PLT count.
1230 (Output_data_plt_x86_64::init): New function.
1231 (Output_data_plt_x86_64::add_relocation): New function.
1232 (Output_data_plt_x86_64::reserve_slot): New function.
1233 (Output_data_plt_x86_64::free_list_): New data member.
1234 (Target_x86_64::init_got_plt_for_update): New function.
1235 (Target_x86_64::register_global_plt_entry): New function.
1236 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1237 incremental updates.
1238 (Output_data_plt_x86_64::add_relocation): New function.
1239 * testsuite/object_unittest.cc (Object_test): Set default options.
1240
ec69d6da
ILT
12412011-05-16 Ian Lance Taylor <iant@google.com>
1242
1243 * options.h (class General_options): Make -i a synonym for -r.
1244
732e31de
ILT
12452011-05-16 Ian Lance Taylor <iant@google.com>
1246
1247 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
1248
403676b5
CC
12492011-05-10 Cary Coutant <ccoutant@google.com>
1250
1251 * object.cc (Sized_relobj::do_count_local_symbols): Check for
1252 strip_all (-s).
1253
5b7b7d6e
ILT
12542011-05-06 Ian Lance Taylor <iant@google.com>
1255
1256 * layout.cc (Layout::layout): If the output section flags change,
1257 update the ordering.
1258
f0f9babf
CC
12592011-04-25 Cary Coutant <ccoutant@google.com>
1260
1261 * incremental-dump.cc (dump_incremental_inputs): Print local
1262 symbol info for each input file.
1263 * incremental.cc
1264 (Output_section_incremental_inputs::set_final_data_size): Add local
1265 symbol info to input file entries in incremental info.
1266 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1267 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
1268 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
1269 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
1270 implementation.
1271 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
1272 (Sized_incr_relobj::do_relocate): Write the local symbols.
1273 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
1274 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
1275 Adjust size of input file header.
1276 (Incremental_inputs_reader::get_local_symbol_offset): New function.
1277 (Incremental_inputs_reader::get_local_symbol_count): New function.
1278 (Incremental_inputs_reader::get_input_section): Adjust size of input
1279 file header.
1280 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
1281 (Sized_incr_relobj::This): New typedef.
1282 (Sized_incr_relobj::sym_size): New const data member.
1283 (Sized_incr_relobj::Local_symbol): New struct.
1284 (Sized_incr_relobj::do_output_local_symbol_count): New function.
1285 (Sized_incr_relobj::do_local_symbol_offset): New function.
1286 (Sized_incr_relobj::local_symbol_count_): New data member.
1287 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
1288 (Sized_incr_relobj::local_symbol_index_): New data member.
1289 (Sized_incr_relobj::local_symbol_offset_): New data member.
1290 (Sized_incr_relobj::local_dynsym_offset_): New data member.
1291 (Sized_incr_relobj::local_symbols_): New data member.
1292 * object.h (Relobj::output_local_symbol_count): New function.
1293 (Relobj::local_symbol_offset): New function.
1294 (Relobj::do_output_local_symbol_count): New function.
1295 (Relobj::do_local_symbol_offset): New function.
1296 (Sized_relobj::do_output_local_symbol_count): New function.
1297 (Sized_relobj::do_local_symbol_offset): New function.
1298
d0a9ace3
ILT
12992011-04-22 Vladimir Simonov <sv@sw.ru>
1300
1301 * descriptors.cc (set_close_on_exec): New function.
1302 (Descriptors::open): Use set_close_on_exec.
1303 * output.cc (S_ISLNK): Define if not defined.
1304
94a3fc8b
CC
13052011-04-22 Cary Coutant <ccoutant@google.com>
1306
1307 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1308 global symbol map.
1309 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1310 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
1311 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
1312 relocations.
1313 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
1314 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
1315 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
1316 * incremental.h
1317 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
1318 function.
1319 (Incremental_binary::apply_incremental_relocs): New function.
1320 (Incremental_binary::do_apply_incremental_relocs): New function.
1321 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1322 data member.
1323 (Sized_incremental_binary::add_global_symbol): New function.
1324 (Sized_incremental_binary::global_symbol): New function.
1325 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1326 (Sized_incremental_binary::symbol_map_): New data member.
1327 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
1328 * target.h (Sized_target::apply_relocation): New function.
1329 * target-reloc.h (apply_relocation): New function.
1330 * x86_64.cc (Target_x86_64::apply_relocation): New function.
1331
c87e4302
DK
13322011-04-22 Doug Kwan <dougkwan@google.com>
1333
1334 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
1335 flag of a SHT_ARM_EXIDX section.
1336 * testsuite/Makefile.am (arm_exidx_test): New test rules.
1337 * testsuite/Makefile.in: Regenerate.
1338 * testsuite/arm_exidx_test.s: New file.
1339 * testsuite/arm_exidx_test.sh: Same.
1340
e7782cf6
CC
13412011-04-20 Cary Coutant <ccoutant@google.com>
1342
1343 PR gold/12689
1344 * archive.h (Incremental_archive_entry::Archive_member):
1345 Initialize arg_serial_ (second constructor).
1346
308ecdc7
ILT
13472011-04-17 Ian Lance Taylor <iant@google.com>
1348
1349 * object.cc (Relocate_info::location): Simplify location string.
1350 * errors.cc (Errors::error_at_location): Don't print program
1351 name.
1352 (Errors::warning_at_location): Likewise.
1353 (Errors::undefined_symbol): Likewise.
1354 * testsuite/debug_msg.sh: Update accordingly.
1355
bec5b579
CC
13562011-04-14 Cary Coutant <ccoutant@google.com>
1357
1358 * gold/layout.cc (Layout::symtab_section_offset): New function.
1359 * gold/layout.h (Layout::symtab_section_offset): New function.
1360 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
1361
88597d34
ILT
13622011-04-12 Ian Lance Taylor <iant@google.com>
1363
1364 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
1365 with MREMAP_MAYMOVE.
1366 * output.h (class Output_file): Add map_is_allocated_ field.
1367 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
1368 not available, provide stubs. If mremap is not available, #define
1369 it to gold_mremap.
1370 (MREMAP_MAYMOVE): Define if not defined.
1371 (Output_file::Output_file): Initialize map_is_allocated_.
1372 (Output_file::resize): Check map_is_allocated_.
1373 (Output_file::map_anonymous): If mmap fails, use malloc.
1374 (Output_file::unmap): Don't do anything for an anonymous map.
1375 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
1376 is not available, provide stubs.
1377 (File_read::View::~View): Use free rather than delete[].
1378 (File_read::make_view): Use malloc rather than new[]. If mmap
1379 fails, use malloc.
1380 (File_read::find_or_make_view): Use malloc rather than new[].
1381 * gold.h: Remove HAVE_REMAP code.
1382 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
1383 exists. Rename mremap to gold_mremap. If mmap is not available
1384 don't do anything.
1385 * configure, config.in: Rebuild.
1386
11e361bc
ILT
13872011-04-11 Ian Lance Taylor <iant@google.com>
1388
1389 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
1390 initialize local variable v.
1391
cdc29364
CC
13922011-04-11 Cary Coutant <ccoutant@google.com>
1393
1394 * archive.cc (Archive::include_member): Adjust call to
1395 report_object.
1396 (Add_archive_symbols::run): Track argument serial numbers.
1397 (Lib_group::include_member): Likewise.
1398 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1399 * archive.h (Incremental_archive_entry::Archive_member):
1400 Initialize arg_serial_.
1401 (Archive_member::arg_serial_): New data member.
1402 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1403 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1404 incremental link.
1405 (Sized_dynobj::do_for_all_local_got_entries): New function.
1406 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1407 function.
1408 * fileread.cc (get_mtime): New function.
1409 * fileread.h (get_mtime): New function.
1410 * gold.cc (queue_initial_tasks): Check for incremental update.
1411 (process_incremental_input): New function.
1412 (queue_middle_tasks): Don't force valid target for incremental
1413 update.
1414 * incremental-dump.cc (find_input_containing_global): Adjust
1415 size of symbol info entry.
1416 (dump_incremental_inputs): Dump argument serial number and
1417 in_system_directory flag; bias shndx by 1; print symbol names
1418 when dumping per-file symbol lists; use new symbol info readers.
1419 * incremental.cc
1420 (Output_section_incremental_inputs:update_data_size): New function.
1421 (Sized_incremental_binary::setup_readers): Setup input readers
1422 for each input file; build maps for files added from libraries
1423 and scripts.
1424 (Sized_incremental_binary::check_input_args): New function.
1425 (Sized_incremental_binary::do_check_inputs): Build map of argument
1426 serial numbers to input arguments.
1427 (Sized_incremental_binary::do_file_has_changed): Rename
1428 do_file_is_unchanged to this; compare file modification times.
1429 (Sized_incremental_binary::do_init_layout): New function.
1430 (Sized_incremental_binary::do_reserve_layout): New function.
1431 (Sized_incremental_binary::do_get_input_reader): Remove.
1432 (Sized_incremental_binary::get_symtab_view): New function.
1433 (Incremental_checker::can_incrementally_link_output_file): Remove.
1434 (Incremental_inputs::report_command_line): Exclude --debug options.
1435 (Incremental_inputs::report_archive_begin): Add parameter; track
1436 argument serial numbers; don't put input file entry for archive
1437 before archive members.
1438 (Incremental_inputs::report_archive_end): Put input file entry
1439 for archive after archive members.
1440 (Incremental_inputs::report_object): Add parameter; track argument
1441 serial numbers and in_system_directory flag.
1442 (Incremental_inputs::report_script): Add parameter; track argument
1443 serial numbers.
1444 (Output_section_incremental_inputs::set_final_data_size): Adjust
1445 size of symbol info entry; check for forwarding symbols.
1446 (Output_section_incremental_inputs::write_input_files): Write
1447 in_system_directory flag and argument serial number.
1448 (Output_section_incremental_inputs::write_info_blocks): Map section
1449 indices between incremental info and original input file; store
1450 input section index for each symbol.
1451 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1452 change operator() to visit().
1453 (class Global_got_offset_visitor): Likewise.
1454 (class Global_symbol_visitor_got_plt):
1455 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1456 classes.
1457 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1458 (Sized_incr_relobj::do_read_symbols): New function.
1459 (Sized_incr_relobj::do_layout): New function.
1460 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1461 (Sized_incr_relobj::do_add_symbols): New function.
1462 (Sized_incr_relobj::do_should_include_member): New function.
1463 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1464 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1465 (Sized_incr_relobj::do_section_size): New function.
1466 (Sized_incr_relobj::do_section_name): New function.
1467 (Sized_incr_relobj::do_section_contents): New function.
1468 (Sized_incr_relobj::do_section_flags): New function.
1469 (Sized_incr_relobj::do_section_entsize): New function.
1470 (Sized_incr_relobj::do_section_address): New function.
1471 (Sized_incr_relobj::do_section_type): New function.
1472 (Sized_incr_relobj::do_section_link): New function.
1473 (Sized_incr_relobj::do_section_info): New function.
1474 (Sized_incr_relobj::do_section_addralign): New function.
1475 (Sized_incr_relobj::do_initialize_xindex): New function.
1476 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1477 (Sized_incr_relobj::do_read_relocs): New function.
1478 (Sized_incr_relobj::do_gc_process_relocs): New function.
1479 (Sized_incr_relobj::do_scan_relocs): New function.
1480 (Sized_incr_relobj::do_count_local_symbols): New function.
1481 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1482 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1483 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1484 (Sized_incr_relobj::do_relocate): New function.
1485 (Sized_incr_relobj::do_set_section_offset): New function.
1486 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1487 (Sized_incr_dynobj::do_read_symbols): New function.
1488 (Sized_incr_dynobj::do_layout): New function.
1489 (Sized_incr_dynobj::do_add_symbols): New function.
1490 (Sized_incr_dynobj::do_should_include_member): New function.
1491 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1492 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1493 (Sized_incr_dynobj::do_section_size): New function.
1494 (Sized_incr_dynobj::do_section_name): New function.
1495 (Sized_incr_dynobj::do_section_contents): New function.
1496 (Sized_incr_dynobj::do_section_flags): New function.
1497 (Sized_incr_dynobj::do_section_entsize): New function.
1498 (Sized_incr_dynobj::do_section_address): New function.
1499 (Sized_incr_dynobj::do_section_type): New function.
1500 (Sized_incr_dynobj::do_section_link): New function.
1501 (Sized_incr_dynobj::do_section_info): New function.
1502 (Sized_incr_dynobj::do_section_addralign): New function.
1503 (Sized_incr_dynobj::do_initialize_xindex): New function.
1504 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1505 (make_sized_incremental_object): New function.
1506 (Incremental_library::copy_unused_symbols): New function.
1507 (Incremental_library::do_for_all_unused_symbols): New function.
1508 * incremental.h (enum Incremental_input_flags): New type.
1509 (class Incremental_checker): Remove.
1510 (Incremental_input_entry::Incremental_input_entry): Add argument
1511 serial number.
1512 (Incremental_input_entry::arg_serial): New function.
1513 (Incremental_input_entry::set_is_in_system_directory): New function.
1514 (Incremental_input_entry::is_in_system_directory): New function.
1515 (Incremental_input_entry::arg_serial_): New data member.
1516 (Incremental_input_entry::is_in_system_directory_): New data member.
1517 (class Script_info): Move here from script.h.
1518 (Script_info::Script_info): Add filename parameter.
1519 (Script_info::filename): New function.
1520 (Script_info::filename_): New data member.
1521 (Incremental_script_entry::Incremental_script_entry): Add argument
1522 serial number.
1523 (Incremental_object_entry::Incremental_object_entry): Likewise.
1524 (Incremental_object_entry::add_input_section): Build list of input
1525 sections with map to original shndx.
1526 (Incremental_object_entry::get_input_section_index): New function.
1527 (Incremental_object_entry::shndx_): New data member.
1528 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1529 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1530 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1531 serial number.
1532 (Incremental_inputs::report_archive_begin): Likewise.
1533 (Incremental_inputs::report_object): Likewise.
1534 (Incremental_inputs::report_script): Likewise.
1535 (class Incremental_global_symbol_reader): New class.
1536 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1537 and store flags and input file type.
1538 (Incremental_input_entry_reader::arg_serial): New function.
1539 (Incremental_input_entry_reader::type): Extract type from flags.
1540 (Incremental_input_entry_reader::is_in_system_directory): New function.
1541 (Incremental_input_entry_reader::get_input_section_count): Call
1542 accessor function for type.
1543 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1544 function for type; adjust size of global symbol entry.
1545 (Incremental_input_entry_reader::get_global_symbol_count): Call
1546 accessor function for type.
1547 (Incremental_input_entry_reader::get_object_count): Likewise.
1548 (Incremental_input_entry_reader::get_object_offset): Likewise.
1549 (Incremental_input_entry_reader::get_member_count): Likewise.
1550 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1551 (Incremental_input_entry_reader::get_member_offset): Likewise.
1552 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1553 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1554 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1555 (Incremental_input_entry_reader::get_global_symbol_reader): New
1556 function.
1557 (Incremental_input_entry_reader::get_output_symbol_index): New
1558 function.
1559 (Incremental_input_entry_reader::type_): Remove.
1560 (Incremental_input_entry_reader::flags_): New data member.
1561 (Incremental_inputs_reader::input_file_offset): New function.
1562 (Incremental_inputs_reader::input_file_index): New function.
1563 (Incremental_inputs_reader::input_file): Call input_file_offset.
1564 (Incremental_inputs_reader::input_file_at_offset): New function.
1565 (Incremental_relocs_reader::get_r_type): Reformat.
1566 (Incremental_relocs_reader::get_r_shndx): Reformat.
1567 (Incremental_relocs_reader::get_r_offset): Reformat.
1568 (Incremental_relocs_reader::data): New function.
1569 (Incremental_binary::Incremental_binary): Initialize new data members.
1570 (Incremental_binary::check_inputs): Add cmdline parameter.
1571 (Incremental_binary::file_is_unchanged): Remove.
1572 (Input_reader::arg_serial): New function.
1573 (Input_reader::get_unused_symbol_count): New function.
1574 (Input_reader::get_unused_symbol): New function.
1575 (Input_reader::do_arg_serial): New function.
1576 (Input_reader::do_get_unused_symbol_count): New function.
1577 (Input_reader::do_get_unused_symbol): New function.
1578 (Incremental_binary::input_file_count): New function.
1579 (Incremental_binary::get_input_reader): Change signature to use
1580 index instead of filename.
1581 (Incremental_binary::file_has_changed): New function.
1582 (Incremental_binary::get_input_argument): New function.
1583 (Incremental_binary::get_library): New function.
1584 (Incremental_binary::get_script_info): New function.
1585 (Incremental_binary::init_layout): New function.
1586 (Incremental_binary::reserve_layout): New function.
1587 (Incremental_binary::output_file): New function.
1588 (Incremental_binary::do_check_inputs): New function.
1589 (Incremental_binary::do_file_is_unchanged): Remove.
1590 (Incremental_binary::do_file_has_changed): New function.
1591 (Incremental_binary::do_init_layout): New function.
1592 (Incremental_binary::do_reserve_layout): New function.
1593 (Incremental_binary::do_input_file_count): New function.
1594 (Incremental_binary::do_get_input_reader): Change signature.
1595 (Incremental_binary::input_args_map_): New data member.
1596 (Incremental_binary::library_map_): New data member.
1597 (Incremental_binary::script_map_): New data member.
1598 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1599 new data members.
1600 (Sized_incremental_binary::output_section): New function.
1601 (Sized_incremental_binary::inputs_reader): Add const.
1602 (Sized_incremental_binary::symtab_reader): Add const.
1603 (Sized_incremental_binary::relocs_reader): Add const.
1604 (Sized_incremental_binary::got_plt_reader): Add const.
1605 (Sized_incremental_binary::get_symtab_view): New function.
1606 (Sized_incremental_binary::Inputs_reader): New typedef.
1607 (Sized_incremental_binary::Input_entry_reader): New typedef.
1608 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1609 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1610 (Sized_incremental_binary::do_file_has_changed): New function.
1611 (Sized_incremental_binary::do_init_layout): New function.
1612 (Sized_incremental_binary::do_reserve_layout): New function.
1613 (Sized_input_reader::Inputs_reader): Remove.
1614 (Sized_input_reader::Input_entry_reader): Remove.
1615 (Sized_input_reader::do_arg_serial): New function.
1616 (Sized_input_reader::do_get_unused_symbol_count): New function.
1617 (Sized_input_reader::do_get_unused_symbol): New function.
1618 (Sized_incremental_binary::do_input_file_count): New function.
1619 (Sized_incremental_binary::do_get_input_reader): Change signature;
1620 use index instead of filename.
1621 (Sized_incremental_binary::section_map_): New data member.
1622 (Sized_incremental_binary::input_entry_readers_): New data member.
1623 (class Sized_incr_relobj): New class.
1624 (class Sized_incr_dynobj): New class.
1625 (make_sized_incremental_object): New function.
1626 (class Incremental_library): New class.
1627 * layout.cc (Free_list::num_lists): New static data member.
1628 (Free_list::num_nodes): New static data member.
1629 (Free_list::num_removes): New static data member.
1630 (Free_list::num_remove_visits): New static data member.
1631 (Free_list::num_allocates): New static data member.
1632 (Free_list::num_allocate_visits): New static data member.
1633 (Free_list::init): New function.
1634 (Free_list::remove): New function.
1635 (Free_list::allocate): New function.
1636 (Free_list::dump): New function.
1637 (Free_list::print_stats): New function.
1638 (Layout_task_runner::run): Resize output file for incremental updates.
1639 (Layout::Layout): Initialize new data members.
1640 (Layout::set_incremental_base): New function.
1641 (Layout::init_fixed_output_section): New function.
1642 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1643 incremental updates.
1644 (Layout::create_gold_note): Do not create gold note section for
1645 incremental updates.
1646 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1647 for incremental updates.
1648 (Layout::set_section_offsets): For incremental updates, allocate space
1649 from free list.
1650 (Layout::create_symtab_sections): Layout with offsets relative to
1651 start of section; for incremental updates, allocate space from free
1652 list.
1653 (Layout::create_shdrs): For incremental updates, allocate space from
1654 free list.
1655 (Layout::finish_dynamic_section): For incremental updates, do not
1656 check --as-needed (fixed in subsequent patch).
1657 * layout.h (class Free_list): New class.
1658 (Layout::set_incremental_base): New function.
1659 (Layout::incremental_base): New function.
1660 (Layout::init_fixed_output_section): New function.
1661 (Layout::allocate): New function.
1662 (Layout::incremental_base_): New data member.
1663 (Layout::free_list_): New data member.
1664 * main.cc (main): Print Free_list statistics.
1665 * object.cc (Relobj::finalize_incremental_relocs): Add
1666 clear_counts parameter; clear counts only when clear_counts is set.
1667 (Sized_relobj::Sized_relobj): Initialize new base class.
1668 (Sized_relobj::do_layout): Don't report special sections.
1669 (Sized_relobj::do_for_all_local_got_entries): New function.
1670 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
1671 symtab_off to all symbol table offsets.
1672 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
1673 * object.h (class Got_offset_list): Move to top of file.
1674 (Object::Object): Allow case where input_file == NULL.
1675 (Object::~Object): Likewise.
1676 (Object::input_file): Assert that input_file != NULL.
1677 (Object::lock): Allow case where input_file == NULL.
1678 (Object::unlock): Likewise.
1679 (Object::is_locked): Likewise.
1680 (Object::token): Likewise.
1681 (Object::release): Likewise.
1682 (Object::is_incremental): New function.
1683 (Object::get_mtime): New function.
1684 (Object::for_all_local_got_entries): New function.
1685 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1686 (Object::set_is_in_system_directory): New function.
1687 (Object::is_in_system_directory): New function.
1688 (Object::do_is_incremental): New function.
1689 (Object::do_get_mtime): New function.
1690 (Object::do_for_all_local_got_entries): New function.
1691 (Object::is_in_system_directory_): New data member.
1692 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1693 (class Sized_relobj_base): New class.
1694 (class Sized_relobj): Derive from Sized_relobj_base.
1695 (class Sized_relobj::Symbols): Redeclare from base class.
1696 (class Sized_relobj::local_got_offset_list): Remove.
1697 (class Sized_relobj::Output_sections): Redeclare from base class.
1698 (class Sized_relobj::do_for_all_local_got_entries): New function.
1699 (class Sized_relobj::write_local_symbols): Add offset parameter.
1700 (class Sized_relobj::local_symbol_offset_): Update comment.
1701 (class Sized_relobj::local_dynsym_offset_): Update comment.
1702 * options.cc (Input_arguments::add_file): Remove const.
1703 * options.h (Input_file_argument::Input_file_argument):
1704 Initialize arg_serial_ (all constructors).
1705 (Input_file_argument::set_arg_serial): New function.
1706 (Input_file_argument::arg_serial): New function.
1707 (Input_file_argument::arg_serial_): New data member.
1708 (Input_arguments::Input_arguments): Initialize file_count_.
1709 (Input_arguments::add_file): Remove const.
1710 (Input_arguments::number_of_input_files): New function.
1711 (Input_arguments::file_count_): New data member.
1712 (Command_line::number_of_input_files): Call
1713 Input_arguments::number_of_input_files.
1714 * output.cc (Output_segment_headers::Output_segment_headers):
1715 Set current size.
1716 (Output_section::Input_section::current_data_size): New function.
1717 (Output_section::Output_section): Initialize new data members.
1718 (Output_section::add_input_section): Don't do merge sections for
1719 an incremental link; allocate space from free list for an
1720 incremental update.
1721 (Output_section::add_output_section_data): Allocate space from
1722 free list for an incremental update.
1723 (Output_section::update_data_size): New function.
1724 (Output_section::set_fixed_layout): New function.
1725 (Output_section::reserve): New function.
1726 (Output_segment::set_section_addresses): Remove const.
1727 (Output_segment::set_section_list_addresses): Remove const; allocate
1728 space from free list for an incremental update.
1729 (Output_segment::set_offset): Adjust size of RELRO segment for an
1730 incremental update.
1731 * output.h (Output_data::current_data_size): Move here from
1732 child classes.
1733 (Output_data::pre_finalize_data_size): New function.
1734 (Output_data::update_data_size): New function.
1735 (Output_section_headers::update_data_size): new function.
1736 (Output_section_data_build::current_data_size): Move to Output_data.
1737 (Output_data_strtab::update_data_size): New function.
1738 (Output_section::current_data_size): Move to Output_data.
1739 (Output_section::set_fixed_layout): New function.
1740 (Output_section::has_fixed_layout): New function.
1741 (Output_section::reserve): New function.
1742 (Output_section::update_data_size): New function.
1743 (Output_section::has_fixed_layout_): New data member.
1744 (Output_section::free_list_): New data member.
1745 (Output_segment::set_section_addresses): Remove const.
1746 (Output_segment::set_section_list_addresses): Remove const.
1747 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
1748 New function.
1749 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
1750 New function.
1751 * readsyms.cc (Read_symbols::do_read_symbols): Add library
1752 parameter when calling Add_symbols constructor; store argument
1753 serial number for members of a lib group.
1754 (Add_symbols::locks): Allow case where token == NULL.
1755 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
1756 (Read_member::~Read_member): New function.
1757 (Read_member::is_runnable): New function.
1758 (Read_member::locks): New function.
1759 (Read_member::run): New function.
1760 (Check_script::~Check_script): New function.
1761 (Check_script::is_runnable): New function.
1762 (Check_script::locks): New function.
1763 (Check_script::run): New function.
1764 (Check_library::~Check_library): New function.
1765 (Check_library::is_runnable): New function.
1766 (Check_library::locks): New function.
1767 (Check_library::run): New function.
1768 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
1769 (Add_symbols::library_): New data member.
1770 (class Read_member): New class.
1771 (class Check_script): New class.
1772 (class Check_library): New class.
1773 * reloc.cc (Read_relocs::is_runnable): Allow case where
1774 token == NULL.
1775 (Read_relocs::locks): Likewise.
1776 (Scan_relocs::locks): Likewise.
1777 (Relocate_task::locks): Likewise.
1778 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
1779 to clear counters.
1780 (Sized_relobj::incremental_relocs_scan): Fix comment.
1781 (Sized_relobj::do_relocate): Pass output file offset to
1782 write_local_symbols.
1783 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
1784 from class declaration.
1785 * script.cc (read_input_script): Allocate Script_info; pass
1786 argument serial number to report_script.
1787 * script.h (class Script_info): Move to incremental.h.
1788 * symtab.cc (Symbol_table::add_from_incrobj): New function.
1789 * symtab.h (Symbol_table::add_from_incrobj): New function.
1790 (Symbol_table::set_file_offset): New function.
1791
b961d0d7
CC
17922011-04-05 Cary Coutant <ccoutant@google.com>
1793
1794 * incremental-dump.cc (dump_incremental_inputs): Change signature
1795 to take a Sized_incremental_binary; change caller. Use readers
1796 in Sized_incremental_binary.
1797 * incremental.cc
1798 (Sized_incremental_binary::find_incremental_inputs_sections):
1799 Rename do_find_incremental_inputs_sections to this.
1800 (Sized_incremental_binary::setup_readers): New function.
1801 (Sized_incremental_binary::do_check_inputs): Check
1802 has_incremental_info_ flag; move setup code to setup_readers;
1803 use input readers.
1804 (Sized_incremental_binary::do_file_is_unchanged): New function.
1805 (Sized_incremental_binary::do_get_input_reader): New function.
1806 * incremental.h (class Incremental_binary): Move to end of file.
1807 (Incremental_binary::file_is_unchanged): New function.
1808 (Incremental_binary::do_file_is_unchanged): New function.
1809 (Incremental_binary::Input_reader): New class.
1810 (Incremental_binary::get_input_reader): New function.
1811 (class Sized_incremental_binary): Move to end of file.
1812 (Sized_incremental_binary::Sized_incremental_binary): Setup the
1813 input section reader classes.
1814 (Sized_incremental_binary::has_incremental_info): New function.
1815 (Sized_incremental_binary::inputs_reader): New function.
1816 (Sized_incremental_binary::symtab_reader): New function.
1817 (Sized_incremental_binary::relocs_reader): New function.
1818 (Sized_incremental_binary::got_plt_reader): New function.
1819 (Sized_incremental_binary::do_file_is_unchanged): New function.
1820 (Sized_incremental_binary::Sized_input_reader): New class.
1821 (Sized_incremental_binary::get_input_reader): New function.
1822 (Sized_incremental_binary::find_incremental_inputs_sections):
1823 Rename do_find_incremental_inputs_sections to this.
1824 (Sized_incremental_binary::setup_readers): New function.
1825 (Sized_incremental_binary::has_incremental_info_): New data member.
1826 (Sized_incremental_binary::inputs_reader_): New data member.
1827 (Sized_incremental_binary::symtab_reader_): New data member.
1828 (Sized_incremental_binary::relocs_reader_): New data member.
1829 (Sized_incremental_binary::got_plt_reader_): New data member.
1830 (Sized_incremental_binary::current_input_file_): New data member.
1831
a869183f
PP
18322011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
1833
1834 PR gold/12640
1835 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
1836 violation.
1837
18382011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
1839
1840 * archive.cc (Archive::include_member): Adjust call to report_object.
1841 (Add_archive_symbols::run): Add script_info to call to
1842 report_archive_begin.
1843 (Lib_group::include_member): Adjust call to report_object.
1844 (Add_lib_group_symbols::run): Adjust call to report_object.
1845 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
1846 blocks. Add object count for script input files.
1847 * incremental.cc (Incremental_inputs::report_archive_begin): Add
1848 script_info parameter; change all callers.
1849 (Incremental_inputs::report_object): Add script_info parameter;
1850 change all callers.
1851 (Incremental_inputs::report_script): Store backpointer to
1852 incremental info entry.
1853 (Output_section_incremental_inputs::set_final_data_size): Record
1854 additional information for scripts.
1855 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1856 * incremental.h (Incremental_script_entry::add_object): New function.
1857 (Incremental_script_entry::get_object_count): New function.
1858 (Incremental_script_entry::get_object): New function.
1859 (Incremental_script_entry::objects_): New data member; adjust
1860 constructor.
1861 (Incremental_inputs::report_archive_begin): Add script_info parameter.
1862 (Incremental_inputs::report_object): Add script_info parameter.
1863 (Incremental_inputs_reader::get_object_count): New function.
1864 (Incremental_inputs_reader::get_object_offset): New function.
1865 * options.cc (Input_arguments::add_file): Return reference to
1866 new input argument.
1867 * options.h (Input_argument::set_script_info): New function.
1868 (Input_argument::script_info): New function.
1869 (Input_argument::script_info_): New data member; adjust all
1870 constructors.
1871 (Input_file_group::add_file): Return reference to new input argument.
1872 (Input_file_lib::add_file): Likewise.
1873 (Input_arguments::add_file): Likewise.
1874 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
1875 * script.cc (Parser_closure::Parser_closure): Add script_info
1876 parameter; adjust all callers.
1877 (Parser_closure::script_info): New function.
1878 (Parser_closure::script_info_): New data member.
1879 (read_input_script): Report scripts earlier to incremental info.
1880 (script_add_file): Set script_info in Input_argument.
1881 (script_add_library): Likewise.
1882 * script.h (Script_options::Script_info): Rewrite class.
1883
a869183f 18842011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
1885
1886 * archive.cc (Library_base::should_include_member): Move
1887 method here from class Archive.
1888 (Archive::Archive): Initialize base class.
1889 (Archive::should_include_member): Move to base class.
1890 (Archive::do_for_all_unused_symbols): New function.
1891 (Add_archive_symbols::run): Remove redundant access to
1892 incremental_inputs.
1893 (Lib_group::Lib_group): Initialize base class.
1894 (Lib_group::do_filename): New function.
1895 (Lib_group::include_member): Pass pointer to Lib_group to
1896 report_object.
1897 (Lib_group::do_for_all_unused_symbols): New function.
1898 (Add_lib_group_symbols::run): Report archive information for
1899 incremental links.
1900 * archive.h (class Library_base): New base class.
1901 (class Archive): Derive from Library_base.
1902 (Archive::filename): Move to base class.
1903 (Archive::set_incremental_info): Likewise.
1904 (Archive::incremental_info): Likewise.
1905 (Archive::Should_include): Likewise.
1906 (Archive::should_include_member): Likewise.
1907 (Archive::Armap_entry): Remove.
1908 (Archive::Unused_symbol_iterator): Remove.
1909 (Archive::unused_symbols_begin): Remove.
1910 (Archive::unused_symbols_end): Remove.
1911 (Archive::do_filename): New function.
1912 (Archive::do_get_mtime): New function.
1913 (Archive::do_for_all_unused_symbols): New function.
1914 (Archive::task_): Move to base class.
1915 (Archive::incremental_info_): Likewise.
1916 (class Lib_group): Derive from Library_base.
1917 (Lib_group::do_filename): New function.
1918 (Lib_group::do_get_mtime): New function.
1919 (Lib_group::do_for_all_unused_symbols): New function.
1920 (Lib_group::task_): Move to base class.
1921 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
1922 function.
1923 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1924 function.
1925 * incremental.cc (Incremental_inputs::report_archive_begin):
1926 Use Library_base; call library's get_mtime; add incremental inputs
1927 entry before members.
1928 (class Unused_symbol_visitor): New class.
1929 (Incremental_inputs::report_archive_end): Use Library_base; use
1930 visitor class to record unused symbols; don't add incremental inputs
1931 entry after members.
1932 (Incremental_inputs::report_object): Use Library_base.
1933 * incremental.h
1934 (Incremental_archive_entry::Incremental_archive_entry): Remove
1935 unused Archive parameter.
1936 (Incremental_inputs::report_archive_begin): Use Library_base.
1937 (Incremental_inputs::report_archive_end): Likewise.
1938 (Incremental_inputs::report_object): Likewise.
1939 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1940 function.
1941 * object.h (Object::for_all_global_symbols): New function.
1942 (Object::do_for_all_global_symbols): New function.
1943 (Sized_relobj::do_for_all_global_symbols): New function.
1944 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1945 function.
1946 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1947 function.
1948
61ab3e40
ILT
19492011-03-27 Ian Lance Taylor <iant@google.com>
1950
1951 * archive.cc (Archive::interpret_header): Return -1 if something
1952 goes wrong. Change callers accordingly.
1953
30e1f9e6
CC
19542011-03-25 Cary Coutant <ccoutant@google.com>
1955
1956 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1957 * testsuite/Makefile.in: Regenerate.
1958
9c793f14
RÁE
19592010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1960
1961 * plugin.cc (get_view): New.
1962 (Plugin::load): Pass get_view to the plugin.
1963 (Plugin_manager::get_view): New.
1964
9312bb0a
ILT
19652011-03-21 Ian Lance Taylor <iant@google.com>
1966
1967 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1968 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1969
7e12ba9e
ST
19702011-03-21 Sriraman Tallam <tmsriram@google.com>
1971
1972 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1973 Change == to -eq.
1974 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1975 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1976 Change == to -eq.
1977 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1978 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1979
fd7a005d
ILT
19802011-03-14 Ian Lance Taylor <iant@google.com>
1981
1982 * script-sections.cc (Sort_output_sections::script_compare):
1983 Rename from is_before, change return type.
1984 (Sort_output_sections::operator()): Adjust accordingly.
1985
ed16fd1b
ILT
19862011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1987
1988 PR gold/12572
1989 * testsuite/odr_violation2.cc: Add comment to make all error line
1990 numbers double digits.
1991 * testsuite/debug_msg.sh: Adjust expected errors.
1992
71ff8986
ILT
19932011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1994
1995 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1996 but mark earlier ones as non-canonical
1997 (offset_to_iterator): Update search target and example
1998 (do_addr2line): Return extra lines in a vector*
1999 (format_file_lineno): Extract from do_addr2line
2000 (one_addr2line): Add vector* out-param
2001 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2002 when a lineno entry appeared last for its instruction
2003 (Dwarf_line_info): Add vector* out-param
2004 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2005 * symtab.cc (Odr_violation_compare): Include the lineno in the
2006 comparison again.
2007 (linenos_from_loc): New. Combine the canonical line for an
2008 address with its other lines.
2009 (True_if_intersect): New. Helper functor to make
2010 std::set_intersection a query.
2011 (detect_odr_violations): Compare sets of lines instead of just
2012 one line for each function. This became less deterministic, but
2013 has fewer false positives.
2014 * symtab.h: Declarations.
2015 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2016 mix an optimized and non-optimized object in the same binary
2017 (odr_violation2.so): Same.
2018 * testsuite/Makefile.in: Regenerate from Makefile.am.
2019 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2020 * testsuite/debug_msg.sh: Update line numbers and add
2021 assertions.
2022 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2023 non-optimized context.
2024 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2025 isn't inlined, and use OdrDerived in an optimized context.
2026 * testsuite/odr_header1.h: Defines OdrDerived, where
2027 optimization will change the
2028 first-instruction-in-the-destructor's file and line number.
2029 * testsuite/odr_header2.h: Defines OdrBase.
2030
a19fefdc
ILT
20312011-03-09 Ian Lance Taylor <iant@google.com>
2032
2033 * fileread.cc (File_read::clear_views): Don't delete the whole
2034 file view.
2035
ecb351e9
ILT
20362011-03-08 Ian Lance Taylor <iant@google.com>
2037
2038 PR gold/12525
2039 * fileread.cc: #include <climits>.
2040 (GOLD_IOV_MAX): Define.
2041 (File_read::read_multiple): Limit number of entries by iov_max.
2042 * fileread.h (class File_read): Always set max_readv_entries to
2043 128.
2044
b821d13c
ILT
20452011-03-07 Ian Lance Taylor <iant@google.com>
2046
2047 PR gold/12525
2048 * options.h (class General_options): Add -dy and -dn.
2049
89243142
CC
20502011-03-02 Cary Coutant <ccoutant@google.com>
2051
2052 * testsuite/script_test_9.t: Add TLS segment.
2053
d0773f31
ILT
20542011-03-02 Simon Baldwin <simonb@google.com>
2055
2056 * configure.ac: Add check for gnu_indirect_function support in
2057 the toolchain building binutils.
2058 * configure: Rebuild.
2059
badc8139
RÁE
20602010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
2061
2062 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2063 plugin only symbols.
2064 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2065 in plugin files as not needed in the symbol table.
2066
4cf7a849
ST
20672011-02-11 Sriraman Tallam <tmsriram@google.com>
2068
2069 * output.cc (Output_section::add_input_section): Delay fill
2070 generation for section ordering.
2071
b578bd7d
ILT
20722011-02-09 Ian Lance Taylor <iant@google.com>
2073
2074 PR gold/12316
2075 * object.h (class Sized_relobj): Remove clear_local_symbols.
2076 * reloc.cc (Sized_relobj::do_relocate): Don't call
2077 clear_local_symbols.
2078
84ced98a
RÁE
20792010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
2080
2081 * plugin.cc (is_visible_from_outside): Return true for symbols
2082 in the -u option.
2083
55382fb7
ILT
20842011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2085
2086 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2087 filename.
2088
4e271fff
ST
20892011-02-02 Sriraman Tallam <tmsriram@google.com>
2090
2091 * icf.h (is_section_foldable_candidate): Change type of parameter
2092 to std::string.
2093 * icf.cc (Icf::find_identical_sections): Change type of local variable
2094 section_name to be std::string.
2095 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2096
d433c3ac
ILT
20972011-01-25 Ian Lance Taylor <iant@google.com>
2098
2099 * script.cc (script_add_extern): Rewrite to use
2100 add_symbol_reference.
2101
880473a6
DK
21022011-01-25 Doug Kwan <dougkwan@google.com>
2103
d433c3ac 2104 * icf.cc (get_section_contents): Always lock section's object.
880473a6 2105
f30f86fa
ILT
21062011-01-24 Ian Lance Taylor <iant@google.com>
2107
2108 * options.h (class General_options): Accept
2109 --no-detect-odr-violations.
2110
8e51a0b9
ILT
21112011-01-24 Ian Lance Taylor <iant@google.com>
2112
2113 * version.cc (version_string): Bump to 1.11.
2114
0f3b89d8
ILT
21152011-01-24 Ian Lance Taylor <iant@google.com>
2116
2117 * plugin.cc (class Plugin_rescan): Define new class.
2118 (Plugin_manager::claim_file): Set any_claimed_.
2119 (Plugin_manager::save_archive): New function.
2120 (Plugin_manager::save_input_group): New function.
2121 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2122 necessary.
2123 (Plugin_manager::new_undefined_symbol): New function.
2124 (Plugin_manager::rescan): New function.
2125 (Plugin_manager::rescannable_defines): New function.
2126 (Plugin_manager::add_input_file): Set any_added_.
2127 * plugin.h (class Plugin_manager): define new fields rescannable_,
2128 undefined_symbols_, any_claimed_, and any_added_. Declare
2129 Plugin_rescan as friend. Declare new functions.
2130 (Plugin_manager::Rescannable): Define type.
2131 (Plugin_manager::Rescannable_list): Define type.
2132 (Plugin_manager::Undefined_symbol_list): Define type.
2133 (Plugin_manager::Plugin_manager): Initialize new fields.
2134 * archive.cc (Archive::defines_symbol): New function.
2135 (Add_archive_symbols::run): Pass archive to plugins if any.
2136 * archive.h (class Archive): Declare defines_symbol.
2137 * readsyms.cc (Input_group::~Input_group): New function.
2138 (Finish_group::run): Pass input_group to plugins if any.
2139 * readsyms.h (class Input_group): Declare destructor.
2140 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2141 any.
2142
3bb951e5
ILT
21432011-01-10 Ian Lance Taylor <iant@google.com>
2144
2145 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2146 section as relro.
2147 (Layout::set_segment_offsets): Reset increase_relro before calling
2148 set_section_addresses a second time.
2149
0aa45fac
CC
21502011-01-04 Cary Coutant <ccoutant@google.com>
2151
2152 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2153 sections before NOBITS sections.
2154
0db46eb4
L
21552011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2156
2157 * version.cc (print_version): Update copyright to 2011.
2158
829c9745
CC
21592010-12-23 Cary Coutant <ccoutant@google.com>
2160
2161 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2162 of OS to this->add. Add OD parameter to second form of the function.
2163
7500420b
ILT
21642010-12-20 Ian Lance Taylor <iant@google.com>
2165
2166 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2167 second of two consecutive entries with same offset.
2168
f8e9a930
RW
21692010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2170
2171 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2172 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2173 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2174 to avoid unneeded links against $(LDADD).
2175 * testsuite/Makefile.in: Regenerate.
2176
2fbb4320
ILT
21772010-12-15 Ian Lance Taylor <iant@google.com>
2178
2179 PR gold/12324
2180 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2181 for R_X86_64_32 and R_X86_64_PC32.
2182 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2183 ver_matching_def_pic.o.
2184 (ver_matching_def_pic.o): New target.
2185
fedb228d
RW
21862010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2187
2188 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2189 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2190 Move definition before File_read::View member definitions.
2191 (File_read::View::~View): Initialize and hold lock before
2192 updating current_mapped_bytes.
2193
9b547ce6
RW
21942010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2195
2196 * dwarf_reader.cc: Remove outdated comment.
2197 * gold-threads.cc: Fix typo in error message.
2198 * archive.cc: Fix typos in comments.
2199 * archive.h: Likewise.
2200 * arm-reloc-property.cc: Likewise.
2201 * arm-reloc-property.h: Likewise.
2202 * arm-reloc.def: Likewise.
2203 * arm.cc: Likewise.
2204 * attributes.h: Likewise.
2205 * cref.cc: Likewise.
2206 * ehframe.cc: Likewise.
2207 * fileread.h: Likewise.
2208 * gold.h: Likewise.
2209 * i386.cc: Likewise.
2210 * icf.cc: Likewise.
2211 * incremental.h: Likewise.
2212 * int_encoding.cc: Likewise.
2213 * layout.h: Likewise.
2214 * main.cc: Likewise.
2215 * merge.h: Likewise.
2216 * object.cc: Likewise.
2217 * object.h: Likewise.
2218 * options.cc: Likewise.
2219 * readsyms.cc: Likewise.
2220 * reduced_debug_output.cc: Likewise.
2221 * reloc.cc: Likewise.
2222 * script-sections.cc: Likewise.
2223 * sparc.cc: Likewise.
2224 * symtab.h: Likewise.
2225 * target-reloc.h: Likewise.
2226 * target.cc: Likewise.
2227 * target.h: Likewise.
2228 * timer.cc: Likewise.
2229 * timer.h: Likewise.
2230 * x86_64.cc: Likewise.
2231
83e17bd5
CC
22322010-12-09 Cary Coutant <ccoutant@google.com>
2233
2234 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2235 stack.
2236 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2237 parameter; change all callers.
2238 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2239 * options.h (warn_execstack): New option.
2240
017257f8
DK
22412010-12-07 Doug Kwan <dougkwan@google.com>
2242
2243 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2244 like function call relocations.
2245
c20cbc06
ILT
22462010-12-07 Ian Lance Taylor <iant@google.com>
2247
2248 * archive.cc (Archive::get_elf_object_for_member): Permit
2249 punconfigured to be NULL.
2250 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
2251 (Archive::include_member): Pass NULL to get_elf_object_for_member
2252 if we searched for the archive and this is the first included
2253 object.
2254
4dbfafcc
ILT
22552010-12-01 Ian Lance Taylor <iant@google.com>
2256
2257 * dwarf_reader.h (class Sized_dwarf_line_info): Add
2258 track_relocs_type_ field.
2259 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2260 Set track_relocs_type_.
2261 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
2262 contents when using RELA relocs.
2263 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
2264 reloc_map_.
2265 * reloc.cc (Track_relocs::next_addend): New function.
2266 * reloc.h (class Track_relocs): Declare next_addend.
2267
e5e19edd
ILT
22682010-12-01 Ian Lance Taylor <iant@google.com>
2269
2270 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
2271 virtual destructor.
2272
9a5ce24c
ILT
22732010-12-01 Ian Lance Taylor <iant@google.com>
2274
2275 * README: Update compilers known to work and fail.
2276
c7791212
NC
22772010-11-23 Matthias Klose <doko@ubuntu.com>
2278
2279 * configure.in: For --enable-gold, handle value `default' instead of
2280 `both*'. Always install ld as ld.bfd, install as ld if gold is
2281 not the default.
2282 * configure: Regenerate.
2283
0ad220c9
DK
22842010-11-18 Doug Kwan <dougkwan@google.com>
2285
2286 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
2287 and right_alignment to be zero. Store result alignment only if it is
2288 greater than existing alignment.
2289
ab8056e0
CC
22902010-11-16 Cary Coutant <ccoutant@google.com>
2291
2292 PR gold/12220
2293 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2294 Check for ".zdebug_line".
2295
fd064a5b
CC
22962010-11-16 Doug Kwan <dougkwan@google.com>
2297 Cary Coutant <ccoutant@google.com>
2298
2299 * output.h (Output_segment::set_section_addresses): Pass increase_relro
2300 by reference; adjust all callers.
2301 * output.cc (Output_segment::set_section_addresses): Adjust references
2302 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
2303 list is empty.
2304 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
2305 end at page boundary.
2306
6fc6ea19
CC
23072010-11-16 Cary Coutant <ccoutant@google.com>
2308
2309 PR gold/12220
2310 * layout.cc (Layout::choose_output_section): Transform names of
2311 compressed sections even when using a script with a SECTIONS clause.
2312 (Layout::output_section_name): Remove code to transform
2313 compressed debug section names.
2314 * output.cc (Output_section::add_input_section): Use uncompressed
2315 section size when tracking input sections.
2316
95a2c8d6
RS
23172010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
2318
2319 * symtab.h (Symbol::NON_PIC_REF): Remove.
2320 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
2321 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
2322 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
2323 (Symbol::use_plt_offset): Take a flags argument and pass it
2324 directly to needs_dynamic_reloc. Restrict check for undefined
2325 weak symbols to function calls.
2326 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
2327 (Target_arm::Scan::global): Use it.
2328 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
2329 (Target_arm::Relocate::relocate): Likewise.
2330 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
2331 parameter with an r_type parameter. Use get_reference_flags
2332 to get the flags.
2333 (Target_arm::Relocate::relocate): Update accordingly.
2334 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
2335 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
2336 (Target_i386::Scan::global): Likewise.
2337 (Target_i386::Relocate::relocate): Likewise.
2338 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
2339 parameter with an r_type parameter. Use get_reference_flags
2340 to get the flags.
2341 (Target_i386::Relocate::relocate): Update accordingly.
2342 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
2343 (Target_powerpc::Scan::global): Use it.
2344 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
2345 (Target_powerpc::Relocate::relocate): Likewise.
2346 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
2347 (Target_sparc::Scan::global): Use it.
2348 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
2349 (Target_sparc::Relocate::relocate): Likewise.
2350 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
2351 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
2352 (Target_x86_64::Scan::global): Likewise.
2353 (Target_x86_64::Relocate::relocate): Likewise.
2354
f625ae50
DK
23552010-11-08 Doug Kwan <dougkwan@google.com>
2356 Cary Coutant <ccoutant@google.com>
2357
2358 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
2359 (Arm_exidx_merge_section::section_contents_): New data member.
2360 (Arm_input_section::Arm_input_section): Initialize original_contents_.
2361 (Arm_input_section::~Arm_input_section): De-allocate memory.
2362 (Arm_input_section::original_contents_): New data member.
2363 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
2364 in parameters instead of calling Object::section_contents without
2365 locking.
2366 (Arm_output_section::group_section): New parameter TASK. Pass it
2367 to callees that need locking objects.
2368 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
2369 to lock EXIDX input sections. Fix a formatting issue. Call
2370 Arm_exidx_merged_section::build_contents to create merged section
2371 contents.
2372 (Arm_output_section::create_stub_group): New parameter TASK. Use it
2373 to lock object of stub table owner.
2374 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
2375 TEXT_SIZE to initialize data member TEXT_SIZE_.
2376 (Arm_exidx_input_section::addralign): Fix typo in comment.
2377 (Arm_exidx_input_section::text_size): New method.
2378 (Target_arm::do_relax): New parameter TASK. Pass it to callees
2379 that require locking objects. Lock objects before scanning for stubs
2380 and updating local symbols.
2381 (Arm_input_section<big_endian>::init): Copy contents of original
2382 input section.
2383 (Arm_input_section<big_endian>::do_write): Use saved contents of
2384 original input section instead of calling Object::section_contents
2385 without locking.
2386 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
2387 size without calling Object::section_size().
2388 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
2389 for size. Allocate a buffer for merged EXIDX entries.
2390 (Arm_exidx_merged_section::build_contents): New method.
2391 (Arm_exidx_merged_section::do_write): Move merge section contents
2392 building code to Arm_exidx_merged_section::build_contetns. Write
2393 out contetns in buffer instead of building it on the fly.
2394 (Arm_relobj::make_exidx_input_section): Also pass text section size
2395 to Arm_exidx_input_section constructor.
2396 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
2397 (Arm_dynobj::do_read_symbols): Fix memory leak.
2398 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2399 * target.h: (class Task): Add forward declaration.
2400 (Target::relax): Add new parameter TASK and pass it to
2401 Target::do_relax().
2402 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2403
5f9bcf58
CC
24042010-11-05 Cary Coutant <ccoutant@google.com>
2405
2406 PR gold/10708
2407 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2408 object when reading from the file.
2409 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2410 second layout pass.
2411 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2412 when reading section contents.
2413 (get_section_contents): Likewise.
2414 (icf::find_identical_sections): Likewise.
2415 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2416 object when reading from the file.
2417 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2418 the object when doing deferred section layout.
2419
e597fa08
NC
24202010-11-03 Nick Clifton <nickc@redhat.com>
2421
2422 PR gold/12001
2423 * script.h (class Symbol_assignment: name): New member. Returns
2424 the name of the symbol.
2425 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2426 Returns true if the given symbol name is on the list of
2427 assignments wating to be processed.
2428 * archive.cc (should_incldue_member): If the symbol is undefined,
2429 check to see if it is on the list of symbols pending assignment.
2430
3f9a3278
ILT
24312010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2432
2433 * script-sections.cc (Script_sections::find_memory_region): Check
2434 for a NULL output section pointer.
2435
d06fb4d1
DK
24362010-10-29 Doug Kwan <dougkwan@google.com>
2437
2438 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2439 Output_section::add_relaxed_input_section.
2440 * output.cc (Output_section::add_relaxed_input_section): Add new
2441 arguments LAYOUT and NAME. Set section order index.
2442 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2443 Copy section order index.
2444 * output.h (Output_section::add_relaxed_input_section): Add new
2445 arguments LAYOUT and NAME.
2446
90e24de5
ILT
24472010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2448
2449 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2450 NATIVE_OR_CROSS_LINKER.
2451 * testsuite/Makefile.in: Regenerate.
2452
c9484ea5
DK
24532010-10-20 Doug Kwan <dougkwan@google.com>
2454
2455 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2456 without SHF_LINK_ORDER flags.
2457 * layout.cc (Layout::choose_output_section): Do not filter
2458 SHF_LINK_ORDER flag in a relocatable link.
2459
5bc2f5be
CC
24602010-10-17 Cary Coutant <ccoutant@google.com>
2461
2462 * output.h (Output_segment::set_section_addresses): Change function
2463 signature. Update all callers.
2464 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2465 sections.
2466 (Output_segment::set_section_addresses): Align after last TLS
2467 section. Add padding before last relro section instead of after.
2468
0c91cf04
DK
24692010-10-17 Doug Kwan <dougkwan@google.com>
2470
2471 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2472 GOT output section to be writable.
2473
8c21d9d3
CC
24742010-10-14 Cary Coutant <ccoutant@google.com>
2475
2476 * debug.h (DEBUG_INCREMENTAL): New flag.
2477 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2478 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2479 mode.
2480 * incremental.cc (report_command_line): Ignore all forms of
2481 --incremental.
2482 * layout.cc (Layout::Layout): Check parameters for incremental link
2483 mode.
2484 * options.cc (General_options::parse_incremental): New function.
2485 (General_options::parse_no_incremental): New function.
2486 (General_options::parse_incremental_full): New function.
2487 (General_options::parse_incremental_update): New function.
2488 (General_options::incremental_mode_): New data member.
2489 (General_options::finalize): Check incremental_mode_.
2490 * options.h (General_options): Update help text for --incremental.
2491 Add --no-incremental, --incremental-full, --incremental-update.
2492 (General_options::Incremental_mode): New enum type.
2493 (General_options::incremental_mode): New function.
2494 (General_options::incremental_mode_): New data member.
2495 * parameters.cc (Parameters::incremental_mode_): New data member.
2496 (Parameters::set_options): Set incremental_mode_.
2497 (Parameters::set_incremental_full): New function.
2498 (Parameters::incremental): New function.
2499 (Parameters::incremental_update): New function.
2500 (set_parameters_incremental_full): New function.
2501 * parameters.h (Parameters::set_incremental_full): New function.
2502 (Parameters::incremental): New function.
2503 (Parameters::incremental_update): New function.
2504 (Parameters::incremental_mode_): New data member.
2505 (set_parameters_incremental_full): New function.
2506 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2507 incremental link mode.
2508 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2509 (Sized_relobj::do_relocate_sections): Likewise.
2510 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2511 option.
2512 * testsuite/Makefile.in: Regenerate.
2513 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2514
bb32aa18 25152010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
2516
2517 * script-sections.h (class Script_sections): Make
2518 Sections_elements typedef public.
2519 * script-sections.cc (class Sort_output_sections): Add elements_
2520 field. Add constructor which sets it; change all callers.
2521 (Sort_output_sections::is_before): New function.
2522 (Sort_output_sections::operator()): Call is_before.
2523 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2524 conditional.
2525 * testsuite/script_test_10.sh: New test. Test script section
2526 order.
2527 * testsuite/script_test_10.t: Likewise.
2528 * testsuite/script_test_10.s: Likewise.
2529 * testsuite/Makefile.am: Wrap the cross linker tests and the
2530 common tests into NATIVE_OR_CROSS_LINKER.
2531 (check_SCRIPTS): Add script_test_10.sh.
2532 (check_DATA): Add script_test_10.stdout.
2533 (script_test_10.o, script_test_10): New targets.
2534 (script_test_10.stdout): New target.
2535 * configure, testsuite/Makefile.in: Regenerate.
2536
3cef7179
ILT
25372010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2538
2539 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2540 error for the deprecated relocations.
2541 (Target_arm::Scan::global): Likewise.
2542 (Target_arm::Relocate::relocate): Likewise.
2543
7411e9a8
RS
25442010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2545
2546 * fileread.cc (Input_file::find_file): Initialize *found_name
2547 and *namep when using the fallback search for case 4.
2548
6a9da32a
CC
25492010-10-11 Cary Coutant <ccoutant@google.com>
2550
2551 * options.h (class General_options): Redefine -z lazy as an alias for
2552 the negation of -z now.
2553
ac897c20
ILT
25542010-10-11 Ian Lance Taylor <iant@google.com>
2555
2556 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2557 binding.
2558
ea5cae92
NC
25592010-10-06 Nick Clifton <nickc@redhat.com>
2560
2561 * script-sections.cc(class Memory_region): Remove
2562 current_lma_offset_ field. Rename current_vma_offset_ to
2563 current_offset_. Add last_section_ field.
2564 (Memory_region::get_current_vma_address): Rename to
2565 get_current_address.
2566 (Memory_region::get_current_lma_address): Delete.
2567 (Memory_region::increment_vma_offset): Rename to
2568 increment_offset.
2569 (Memory_region::increment_lma_offset): Delete.
2570 (Memory_region::attributes_compatible): New method. Returns
2571 true if the provided section is compatible with the region.
2572 (Memory_region::get_last_section): New method. Returns the last
2573 section to use the region.
2574 (Memory_region::set_last_section): New method. Stores the last
2575 section to use the region.
2576 (Script_sections::block_in_region): New method. Returns true if
2577 a block of memory is contained within a region.
2578 (Script_sections::find_memory_region): New method. Locates a
2579 memory region to be used to set a VMA or LMA address.
2580 (Output_section_definition::set_section_addresses): Add code to
2581 check for addresses set by memory regions.
2582 (Output_segment::set_section_addresses): Remove memory region
2583 walking code.
2584 (Script_sections::create_segment): Add a warning if a header
2585 segment is created outside of any region.
2586 * script-sections.h (class Script_sections): Add prototypes for
2587 find_memory_region and block_in_region methods.
2588 * testsuite/memory_test.s: Use .long instead of .word.
2589 * testsuite/memory_test.t: Add some more output sections.
2590 * testsuite/memory_test.sh: Update expected output.
2591
a9bfd952
DK
25922010-10-02 Doug Kwan <dougkwan@google.com>
2593
2594 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2595 defintion to symtab.h
2596 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2597 declaration to defintion.
2598
bacff3ab
NC
25992010-10-01 Nick Clifton <nickc@redhat.com>
2600
2601 * expression.cc (eval): Replace dummy argument with NULL.
2602 (eval_maybe_dot): Check for a NULL result section pointer.
2603 (Symbol_expression::value): Likewise.
2604 (Dot_expression::value): Likewise.
2605 (BINARY_EXPRESSION): Likewise.
2606 (Max_expression::value): Likewise.
2607 (Min_expression::value): Likewise.
2608 (Absolute_expression::value): Likewise.
2609 (Addr_expression::value_from_output_section): Likewise.
2610 (Loaddddr_expression::value_from_output_section): Likewise.
2611 (Segment_start_expression::value): Likewise.
2612 * script-sections.cc
2613 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2614 argument with NULL.
2615 (Sections_elememt_dot_assignment::set_section_addresses):
2616 Likewise.
2617 (Output_data_expression::do_write_to_buffer): Likewise.
2618 (Output_section_definition::finalize_symbols): Likewise.
2619 (Output_section_definition::set_section_addresses): Likewise.
2620
f81bc8b5
DK
26212010-09-30 Doug Kwan <dougkwan@google.com>
2622
2623 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2624
c95e9f27
ST
26252010-09-28 Sriraman Tallam <tmsriram@google.com>
2626
2627 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 2628 function.
c95e9f27
ST
2629 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2630 virtual function.
2631 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2632 virtual function.
2633 * icf.cc (get_section_contents): Inline merge sections only when
2634 target allows it.
2635
3cac54d2
RW
26362010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2637
2638 * configure: Regenerate.
2639
2904037a
ILT
26402010-09-17 Ian Lance Taylor <iant@google.com>
2641
2642 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
2643 * testsuite/Makefile.am (memory_test.o): New target.
2644 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2645 memory_test.t.
2646 * testsuite/Makefile.in: Rebuild.
2904037a 2647
bca7fb63
DK
26482010-09-17 Doug Kwan <dougkwan@google.com>
2649
2650 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2651 defintion if relocation uses GOT entries of the symbol.
2652 * testsuite/icf_safe_test.sh: Fix test.
2653 * testsuite/icf_safe_so_test.sh: Fix test.
2654
4ef28648
CC
26552010-09-16 Cary Coutant <ccoutant@google.com>
2656
2657 * script_sections.cc (class Memory_region): Remove "NULL" from
2658 vector initializations.
2659
793990de
CC
26602010-09-15 Cary Coutant <ccoutant@google.com>
2661
2662 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2663 Resolve forwarding symbols.
2664
81e015e2
DK
26652010-09-15 Doug Kwan <dougkwan@google.com>
2666
2667 * gold/testsuite/script_test_3.t: Add ARM special sections.
2668 * gold/testsuite/script_test_4.t: Same.
2669 * gold/testsuite/script_test_5.t: Same.
2670 * gold/testsuite/script_test_6.t: Same.
2671 * gold/testsuite/script_test_7.t: Same.
2672 * gold/testsuite/script_test_7.t: Same.
2673 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2674
36171d64
CC
26752010-09-14 Cary Coutant <ccoutant@google.com>
2676
2677 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
2678 (Target_x86_64::Relocate::relocate_tls): Replace check for
2679 saw_tls_block_reloc_ with test for executable section.
2680
d89051bd
CC
26812010-09-12 Cary Coutant <ccoutant@google.com>
2682
2683 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2684 position-independent executables to shared libraries need dynamic
2685 relocations.
2686 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2687 position-independent executables.
2688 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2689 * testsuite/Makefile.in: Regenerate.
2690
fca41f0f
NC
26912010-09-10 Nick Clifton <nickc@redhat.com>
2692
2693 PR gold/11997
2694 * testsuite/memory_test.t: Discard any sections that are not
2695 needed.
2696
6695e4b3
L
26972010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2698
2699 PR gold/11996
2700 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2701 "This::" to work around a bug in gcc 4.2.
2702
2703 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2704
0f72bf6f
RÁE
27052010-09-09 Rafael Espindola <espindola@google.com>
2706
2707 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
2708 sections with different PF_X flags in the same segment.
2709 (Layout::find_first_load_seg): Search all segments to find the first
2710 one.
2711 * options.h (rosegment): New.
2712
27132010-09-08 Rafael Espindola <espindola@google.com>
a6577478 2714
05a79166 2715 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 2716
aa98ff75
DK
27172010-09-08 Doug Kwan <dougkwan@google.com>
2718
2719 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
2720 (Arm_relobj::do_relocate_sections): Add new parameter for output
2721 file to match the parent.
2722 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
2723 of local symbols instead of input values. Update code to track
2724 changes in gold::relocate_section.
2725 * object.cc (Sized_relobj::compute_final_local_value): New methods.
2726 (Sized_relobj::compute_final_local_value_internal): New methods.
2727 (Sized_relobj::do_finalize_local_symbols): Move code from loop
2728 body into private version of Sized_relobj::compute_final_local_value.
2729 Call the inline method.
2730 * object.h (Symbol_value::Symbol_value): Define destructor. Free
2731 merged symbol value if there is one.
2732 (Symbol_value::has_output_value): New method defintiion.
2733 (Sized_relobj::Compute_final_local_value_status): New enum type.
2734 (Sized_relobj::compute_final_local_value): New methods.
2735 (Sized_relobj::compute_final_local_value_internal): New methods.
2736 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
2737 and arm_cortex_a8.sh.
2738 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
2739 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
2740 New tests.
2741 * Makefile.in: Regenerate.
2742 * testsuite/arm_bl_out_of_range.s: Update test.
2743 * testsuite/thumb_bl_out_of_range.s: Ditto.
2744 * testsuite/thumb_blx_out_of_range.s: Ditto.
2745 * testsuite/arm_branch_out_of_range.sh: New file.
2746 * testsuite/arm_cortex_a8.sh: Ditto.
2747 * testsuite/arm_cortex_a8_b.s: Ditto.
2748 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
2749 * testsuite/arm_cortex_a8_b_local.s: Ditto.
2750 * testsuite/arm_cortex_a8_bl.s: Ditto.
2751 * testsuite/arm_cortex_a8_blx.s: Ditto.
2752 * testsuite/arm_cortex_a8_local.s: Ditto.
2753 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
2754 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2755
05a79166
L
27562010-09-08 Rafael Espindola <espindola@google.com>
2757
2758 * Makefile.am (memory_test.stdout): Run readelf with -W.
2759 * Makefile.in: Regenerate.
2760 * testsuite/memory_test.sh: Make the regexps accept both 32 and
2761 64 bit output.
2762
33dbc701
RÁE
27632010-09-08 Rafael Espindola <espindola@google.com>
2764
2765 * script-sections.cc (Script_sections::add_memory_region): Convert
2766 field precision to int.
2767 * script.cc (script_set_section_region, script_set_section_region):
2768 Convert field precision to int.
2769
731ca54a
RÁE
27702010-09-08 Rafael Espindola <espindola@google.com>
2771
2772 * arm.cc (do_finalize_sections): Create the __exidx_start and
2773 __exdix_end symbols even when the section is missing.
2774
7f8cd844
NC
27752010-09-08 Nick Clifton <nickc@redhat.com>
2776
2777 * README: Remove claim that MEMORY is not supported.
2778 * expression.cc (script_exp_function_origin)
2779 (script_exp_function_length): Move from here to ...
2780 * script.cc: ... here.
2781 (script_set_section_region, script_add_memory)
2782 (script_parse_memory_attr, script_include_directive): New
2783 functions.
2784 * script-sections.cc
2785 (class Memory_region): New class.
2786 (class Output_section_definition): Add set_memory_region,
2787 set_section_vma, set_section_lma and get_section_name methods.
2788 (class Script_Sections): Add add_memory_region,
2789 find_memory_region, find_memory_region_origin,
2790 find_memory_region_length and set_memory_region methods.
2791 Have set_section_addresses method walk the list of set memory
2792 regions.
2793 Extend the print methos to display memory regions.
2794 * script-sections.h: Add prototypes for new methods.
2795 Add enum for MEMORY region attributes.
2796 * yyscript.y: Add support for parsing MEMORY regions.
2797 * script-c.h: Add prototypes for new functions.
2798 * testsuite/Makefile.am: Add test of MEMORY region functionality.
2799 * testsuite/Makefile.in: Regenerate.
2800 * testsuite/memory_test.sh: New script.
2801 * testsuite/memory_test.s: New assembler source file.
2802 * testsuite/memory_test.t: New linker script.
2803
a4649286
DK
28042010-08-27 Doug Kwan <dougkwan@google.com>
2805
2806 * gold/resolve.cc (Symbol_table::should_override): Let a weak
2807 reference override an existing dynamic weak reference.
2808 * testsuite/Makefile.am: Add new test dyn_weak_ref.
2809 * testsuite/Makefile.in: Regenerate.
2810 * testsuite/dyn_weak_ref.sh: New file.
2811 * testsuite/dyn_weak_ref_1.c: Ditto.
2812 * testsuite/dyn_weak_ref_2.c: Ditto.
2813
b56648ad
ILT
28142010-08-27 Ian Lance Taylor <iant@google.com>
2815
2816 * incremental.h (class Incremental_input_entry): Add virtual
2817 destructor.
2818
809313cb
ILT
28192010-08-27 Ian Lance Taylor <iant@google.com>
2820
2821 * testsuite/start_lib_test_3.c: Mark t3 as used.
2822
11e32464
NC
28232010-08-27 Nick Clifton <nickc@redhat.com>
2824
2825 * options.cc (version_script): Fix small typo in previous
2826 whitespace tidyup.
2827
ca09d69a
NC
28282010-08-25 Nick Clifton <nickc@redhat.com>
2829
2830 * archive.cc: Formatting fixes: Remove whitespace between
2831 typename and following asterisk. Remove whitespace between
2832 function name and opening parenthesis.
2833 * archive.h: Likewise.
2834 * arm.cc: Likewise.
2835 * attributes.cc: Likewise.
2836 * attributes.h: Likewise.
2837 * common.cc: Likewise.
2838 * copy-relocs.cc: Likewise.
2839 * dirsearch.h: Likewise.
2840 * dynobj.cc: Likewise.
2841 * ehframe.cc: Likewise.
2842 * ehframe.h: Likewise.
2843 * expression.cc: Likewise.
2844 * fileread.cc: Likewise.
2845 * fileread.h: Likewise.
2846 * gc.h: Likewise.
2847 * gold-threads.cc: Likewise.
2848 * gold.cc: Likewise.
2849 * i386.cc: Likewise.
2850 * icf.h: Likewise.
2851 * incremental-dump.cc: Likewise.
2852 * incremental.cc: Likewise.
2853 * layout.cc: Likewise.
2854 * layout.h: Likewise.
2855 * main.cc: Likewise.
2856 * merge.cc: Likewise.
2857 * merge.h: Likewise.
2858 * object.cc: Likewise.
2859 * object.h: Likewise.
2860 * options.cc: Likewise.
2861 * options.h: Likewise.
2862 * output.cc: Likewise.
2863 * output.h: Likewise.
2864 * plugin.cc: Likewise.
2865 * plugin.h: Likewise.
2866 * powerpc.cc: Likewise.
2867 * reloc.cc: Likewise.
2868 * script-c.h: Likewise.
2869 * script-sections.cc: Likewise.
2870 * script.cc: Likewise.
2871 * stringpool.cc: Likewise.
2872 * symtab.cc: Likewise.
2873 * symtab.h: Likewise.
2874 * target.cc: Likewise.
2875 * timer.cc: Likewise.
2876 * timer.h: Likewise.
2877 * version.cc: Likewise.
2878 * x86_64.cc: Likewise.
2879
b8fa8750
NC
28802010-08-24 Nick Clifton <nickc@redhat.com>
2881
2882 PR 11899
2883 * layout.cc (segment_precedes): Sort segments by their physical
2884 addresses, if they have been set.
2885
9919d93b
CC
28862010-08-23 Cary Coutant <ccoutant@google.com>
2887
2888 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
2889 symbols data.
2890 (Lib_group::include_member): Unlock object after deleting its
2891 symbols data.
2892 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
2893 the bug fixed here.
2894
97b4be1c
CC
28952010-08-19 Neil Vachharajani <nvachhar@google.com>
2896 Cary Coutant <ccoutant@google.com>
2897
2898 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
2899 constructor, and set_blocker.
2900 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
2901 readsyms_blocker_.
2902 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
2903 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
2904 * testsuite/Makefile.am (start_lib_test): New test case.
2905 * testsuite/Makefile.in: Regenerate.
2906 * testsuite/start_lib_test_main.c: New file.
2907 * testsuite/start_lib_test_1.c: New file.
2908 * testsuite/start_lib_test_2.c: New file.
2909 * testsuite/start_lib_test_3.c: New file.
2910
dd0b1884
ILT
29112010-08-19 Ian Lance Taylor <iant@google.com>
2912
2913 * Makefile.in: Rebuild with automake 1.11.1.
2914 * aclocal.m4: Likewise.
2915 * testsuite/Makefile.in: Likewise.
2916
7223e9ca
ILT
29172010-08-19 Ian Lance Taylor <iant@google.com>
2918
2919 PR 10893
2920 * i386.cc (class Output_data_plt_i386): Update declarations.
2921 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
2922 local_ifuncs_ fields.
2923 (Target_i386::do_plt_section_for_global): New function.
2924 (Target_i386::do_plt_section_for_local): New function.
2925 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2926 parameter; change all callers. Initialize global_ifuncs_ and
2927 local_ifuncs_. If doing a static link define __rel_iplt_start and
2928 __rel_iplt_end.
2929 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2930 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2931 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2932 symbols.
2933 (Target_i386::make_plt_section): New function, broken out of
2934 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2935 (Target_i386::make_plt_entry): Call make_plt_section.
2936 (Target_i386::make_local_ifunc_plt_entry): New function.
2937 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2938 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2939 R_386_IRELATIVE to switch.
2940 (Target_i386::Scan::global): Likewise.
2941 (Target_i386::Relocate::relocate): Likewise.
2942 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2943 switch.
2944 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2945 (Target_x86_64::do_plt_section_for_global): New function.
2946 (Target_x86_64::do_plt_section_for_local): New function.
2947 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2948 parameter; change all callers. If doing a static link define
2949 __rela_iplt_start and __rela_iplt_end.
2950 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2951 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2952 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2953 to point to .plt.
2954 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2955 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2956 switch.
2957 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2958 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2959 R_X86_64_IRELATIVE to switch.
2960 (Target_x86_64::Scan::global): Likewise.
2961 (Target_x86_64::Relocate::relocate): Likewise.
2962 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2963 switch.
2964 * target.h (class Target): Add plt_section_for_global and
2965 plt_section_for_local functions. Add do_plt_section_for_global
2966 and do_plt_section_for_local virtual functions.
2967 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2968 clarifying comments.
2969 (Symbol::use_plt_offset): Handle IFUNC symbol.
2970 * object.cc (Sized_relobj::Sized_relobj): Initialize
2971 local_plt_offsets_.
2972 (Sized_relobj::local_has_plt_offset): New function.
2973 (Sized_relobj::local_plt_offset): New function.
2974 (Sized_relobj::set_local_plt_offset): New function.
2975 (Sized_relobj::do_count): Handle IFUNC symbol.
2976 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2977 a bit away from input_shndx_ field. Add set_is_func_symbol and
2978 is_ifunc_symbol functions.
2979 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2980 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2981 local_plt_offsets_ field.
2982 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2983 * output.h (class Output_section_data): Add non-const
2984 output_section function.
2985 (class Output_data_got): Update declarations.
2986 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2987 Add use_plt_offset parameter to global and local constructors.
2988 Change all callers. Change local_sym_index_ field to 31 bits.
2989 Change GSYM_CODE and CONSTANT_CODE accordingly.
2990 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2991 doing a static link don't set sh_link field.
2992 (Output_data_got::Got_entry::write): Use PLT offset if
2993 appropriate.
2994 (Output_data_got::add_global_plt): New function.
2995 (Output_data_got::add_local_plt): New function.
2996 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2997 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2998 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2999 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3000 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3001 IFUNC conditional.
3002 * testsuite/ifunc-sel.h: New file.
3003 * testsuite/ifuncmain1.c: New file.
3004 * testsuite/ifuncmain1vis.c: New file.
3005 * testsuite/ifuncmod1.c: New file.
3006 * testsuite/ifuncdep2.c: New file.
3007 * testsuite/ifuncmain2.c: New file.
3008 * testsuite/ifuncmain3.c: New file.
3009 * testsuite/ifuncmod3.c: New file.
3010 * testsuite/ifuncmain4.c: New file.
3011 * testsuite/ifuncmain5.c: New file.
3012 * testsuite/ifuncmod5.c: New file.
3013 * testsuite/ifuncmain6pie.c: New file.
3014 * testsuite/ifuncmod6.c: New file.
3015 * testsuite/ifuncmain7.c: New file.
3016 * configure, testsuite/Makefile.in: Rebuild.
3017
56f75c03
ILT
30182010-08-18 Ian Lance Taylor <iant@google.com>
3019
3020 * incremental.cc
3021 (Output_section_incremental_inputs::write_input_files): Add cast
3022 to avoid signed/unsigned comparison warning.
3023 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3024
55455f89
CC
30252010-08-12 Cary Coutant <ccoutant@google.com>
3026
3027 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3028
e2054bcb
ILT
30292010-08-13 Ian Lance Taylor <iant@google.com>
3030
3031 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3032
74f67560
DK
30332010-08-12 Cary Coutant <ccoutant@google.com>
3034 Doug Kwan <dougkwan@google.com>
3035
3036 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3037 defintion overrides non-weak undef, remember that the original undef
3038 is not weak.
3039 * symtab.cc (Symbol_table::sized_write_global): For undef without
3040 an original weak binding, set binding to global in output.
3041 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3042 * testsuite/Makefile.in: Regenerate.
3043 * testsuite/strong_ref_weak_def.sh: New file.
3044 * testsuite/strong_ref_weak_def_1.c: Ditto.
3045 * testsuite/strong_ref_weak_def_2.c: Ditto.
3046
d1238d12
CC
30472010-08-12 Cary Coutant <ccoutant@google.com>
3048
3049 * testsuite/incremental_test.sh: Rewrite.
3050 * testsuite/incremental_test_1.c: Rewrite.
3051 * testsuite/incremental_test_2.c: Rewrite.
3052
0e70b911
CC
30532010-08-12 Cary Coutant <ccoutant@google.com>
3054
3055 * arm.cc (Target_arm::got_size): Add const.
3056 (Target_arm::got_entry_count): New function.
3057 (Target_arm::plt_entry_count): New function.
3058 (Target_arm::first_plt_entry_offset): New function.
3059 (Target_arm::plt_entry_size): New function.
3060 (Output_data_plt_arm::entry_count): New function.
3061 (Output_data_plt_arm::first_plt_entry_offset): New function.
3062 (Output_data_plt_arm::get_plt_entry_size): New function.
3063 * i386.cc (Target_i386::got_size): Add const.
3064 (Target_i386::got_entry_count): New function.
3065 (Target_i386::plt_entry_count): New function.
3066 (Target_i386::first_plt_entry_offset): New function.
3067 (Target_i386::plt_entry_size): New function.
3068 (Output_data_plt_i386::entry_count): New function.
3069 (Output_data_plt_i386::first_plt_entry_offset): New function.
3070 (Output_data_plt_i386::get_plt_entry_size): New function.
3071 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3072 find_incremental_inputs_sections. Dump incremental_got_plt section.
3073 * incremental.cc: Include target.h.
3074 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3075 parameter. Adjust all callers. Find incremental_got_plt section.
3076 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3077 section.
3078 (Output_section_incremental_inputs::set_final_data_size): Calculate
3079 size of incremental_got_plt section.
3080 (Output_section_incremental_inputs::do_write): Write the
3081 incremental_got_plt section.
3082 (Got_plt_view_info): New struct.
3083 (Local_got_offset_visitor): New class.
3084 (Global_got_offset_visitor): New class.
3085 (Global_symbol_visitor_got_plt): New class.
3086 (Output_section_incremental_inputs::write_got_plt): New function.
3087 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3088 Add parameter. Adjust all callers.
3089 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3090 (Incremental_inputs::got_plt_section): New function.
3091 (Incremental_inputs::got_plt_section_): New data member.
3092 (Incremental_got_plt_reader): New class.
3093 * layout.cc (Layout::create_incremental_info_sections): Add the
3094 incremental_got_plt section.
3095 * object.h (Got_offset_list::get_list): New function.
3096 (Got offset_list::for_all_got_offsets): New function.
3097 (Sized_relobj::local_got_offset_list): New function.
3098 * powerpc.cc (Target_powerpc::got_size): Add const.
3099 (Target_powerpc::got_entry_count): New function.
3100 (Target_powerpc::plt_entry_count): New function.
3101 (Target_powerpc::first_plt_entry_offset): New function.
3102 (Target_powerpc::plt_entry_size): New function.
3103 (Output_data_plt_powerpc::entry_count): New function.
3104 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3105 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3106 * sparc.cc (Target_sparc::got_size): Add const.
3107 (Target_sparc::got_entry_count): New function.
3108 (Target_sparc::plt_entry_count): New function.
3109 (Target_sparc::first_plt_entry_offset): New function.
3110 (Target_sparc::plt_entry_size): New function.
3111 (Output_data_plt_sparc::entry_count): New function.
3112 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3113 (Output_data_plt_sparc::get_plt_entry_size): New function.
3114 * symtab.h (Symbol::got_offset_list): New function.
3115 (Symbol_table::for_all_symbols): New function.
3116 * target.h (Sized_target::got_entry_count): New function.
3117 (Sized_target::plt_entry_count): New function.
3118 (Sized_target::plt_entry_size): New function.
3119 * x86_64.cc (Target_x86_64::got_size): Add const.
3120 (Target_x86_64::got_entry_count): New function.
3121 (Target_x86_64::plt_entry_count): New function.
3122 (Target_x86_64::first_plt_entry_offset): New function.
3123 (Target_x86_64::plt_entry_size): New function.
3124 (Output_data_plt_x86_64::entry_count): New function.
3125 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3126 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3127
09ec0418
CC
31282010-08-12 Cary Coutant <ccoutant@google.com>
3129
3130 * archive.cc: Include incremental.h.
3131 (Archive::Archive): Initialize incremental_info_.
3132 (Archive::include_member): Record archive members in incremental info.
3133 (Add_archive_symbols::run): Record begin and end of an archive in
3134 incremental info.
3135 (Lib_group::include_member): Record objects in incremental info.
3136 * archive.h (Incremental_archive_entry): Forward declaration.
3137 (Archive::set_incremental_info): New member function.
3138 (Archive::incremental_info): New member function.
3139 (Archive::Unused_symbol_iterator): New class.
3140 (Archive::unused_symbols_begin): New member function.
3141 (Archive::unused_symbols_end): New member function.
3142 (Archive::incremental_info_): New data member.
3143 * incremental-dump.cc (find_input_containing_global): New function.
3144 (dump_incremental_inputs): Dump new incremental info sections.
3145 * incremental.cc: Include symtab.h.
3146 (Output_section_incremental_inputs): New class.
3147 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3148 new incremental info sections.
3149 (Sized_incremental_binary::do_check_inputs): Likewise.
3150 (Incremental_inputs::report_archive): Remove.
3151 (Incremental_inputs::report_archive_begin): New function.
3152 (Incremental_inputs::report_archive_end): New function.
3153 (Incremental_inputs::report_object): New function.
3154 (Incremental_inputs::finalize_inputs): Remove.
3155 (Incremental_inputs::report_input_section): New function.
3156 (Incremental_inputs::report_script): Rewrite.
3157 (Incremental_inputs::finalize): Do nothing but finalize string table.
3158 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3159 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3160 (Incremental_inputs::create_data_sections): New function.
3161 (Incremental_inputs::relocs_entsize): New function.
3162 (Output_section_incremental_inputs::set_final_data_size): New function.
3163 (Output_section_incremental_inputs::do_write): New function.
3164 (Output_section_incremental_inputs::write_header): New function.
3165 (Output_section_incremental_inputs::write_input_files): New function.
3166 (Output_section_incremental_inputs::write_info_blocks): New function.
3167 (Output_section_incremental_inputs::write_symtab): New function.
3168 * incremental.h (Incremental_script_entry): Forward declaration.
3169 (Incremental_object_entry): Forward declaration.
3170 (Incremental_archive_entry): Forward declaration.
3171 (Incremental_inputs): Forward declaration.
3172 (Incremental_inputs_header_data): Remove.
3173 (Incremental_inputs_header): Remove.
3174 (Incremental_inputs_header_write): Remove.
3175 (Incremental_inputs_entry_data): Remove.
3176 (Incremental_inputs_entry): Remove.
3177 (Incremental_inputs_entry_write): Remove.
3178 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3179 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3180 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3181 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3182 Likewise.
3183 (Incremental_input_entry): New class.
3184 (Incremental_script_entry): New class.
3185 (Incremental_object_entry): New class.
3186 (Incremental_archive_entry): New class.
3187 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3188 (Incremental_inputs::report_inputs): Remove.
3189 (Incremental_inputs::report_archive): Remove.
3190 (Incremental_inputs::report_archive_begin): New function.
3191 (Incremental_inputs::report_archive_end): New function.
3192 (Incremental_inputs::report_object): Change prototype.
3193 (Incremental_inputs::report_input_section): New function.
3194 (Incremental_inputs::report_script): Change prototype.
3195 (Incremental_inputs::get_reloc_count): New function.
3196 (Incremental_inputs::set_reloc_count): New function.
3197 (Incremental_inputs::create_data_sections): New function.
3198 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3199 (Incremental_inputs::inputs_section): New function.
3200 (Incremental_inputs::symtab_section): New function.
3201 (Incremental_inputs::relocs_section): New function.
3202 (Incremental_inputs::get_stringpool): Add const.
3203 (Incremental_inputs::command_line): Add const.
3204 (Incremental_inputs::inputs): Remove.
3205 (Incremental_inputs::command_line_key): New function.
3206 (Incremental_inputs::input_file_count): New function.
3207 (Incremental_inputs::input_files): New function.
3208 (Incremental_inputs::relocs_entsize): New function.
3209 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3210 (Incremental_inputs::finalize_inputs): Remove.
3211 (Incremental_inputs::Input_info): Remove.
3212 (Incremental_inputs::lock_): Remove.
3213 (Incremental_inputs::inputs_): Change type.
3214 (Incremental_inputs::inputs_map_): Remove.
3215 (Incremental_inputs::current_object_entry_): New data member.
3216 (Incremental_inputs::inputs_section_): New data member.
3217 (Incremental_inputs::symtab_section_): New data member.
3218 (Incremental_inputs::relocs_section_): New data member.
3219 (Incremental_inputs::reloc_count_): New data member.
3220 (Incremental_inputs_reader): New class.
3221 (Incremental_symtab_reader): New class.
3222 (Incremental_relocs_reader): New class.
3223 * layout.cc (Layout::finalize): Move finalization of incremental info
3224 and creation of incremental info sections to follow finalization of
3225 symbol table. Set offsets for postprocessing sections.
3226 (Layout::create_incremental_info_sections): Call
3227 Incremental_inputs::create_data_sections. Add incremental symtab
3228 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3229 sections to layout after input sections.
3230 * layout.h (struct Timespec): Forward declaration.
3231 (Layout::incremental_inputs): Add const.
3232 (Layout::create_incremental_info_sections): Add parameter.
3233 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3234 * object.cc: Include incremental.h.
3235 (Relobj::finalize_incremental_relocs): New function.
3236 (Sized_relobj::do_layout): Record input sections in incremental info.
3237 * object.h (Object::output_section): New function.
3238 (Object::output_section_offset): Moved from Relobj.
3239 (Object::get_incremental_reloc_base): New function.
3240 (Object::get_incremental_reloc_count): New function.
3241 (Object::do_output_section): New function.
3242 (Object::do_output_section_offset): Moved from Relobj.
3243 (Object::do_get_incremental_reloc_base): New function.
3244 (Object::do_get_incremental_reloc_count): New function.
3245 (Object::Object): Initialize new data members.
3246 (Relobj::output_section): Renamed do_output_section and moved to
3247 protected.
3248 (Relobj::output_section_offset): Moved to Object.
3249 (Relobj::do_get_incremental_reloc_base): New function.
3250 (Relobj::do_get_incremental_reloc_count): New function.
3251 (Relobj::allocate_incremental_reloc_counts): New function.
3252 (Relobj::count_incremental_reloc): New function.
3253 (Relobj::finalize_incremental_relocs): New function.
3254 (Relobj::next_incremental_reloc_index): New function.
3255 (Relobj::reloc_counts_): New data member.
3256 (Relobj::reloc_bases_): New data member.
3257 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
3258 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
3259 (Sized_relobj::incremental_relocs_scan): New function.
3260 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3261 (Sized_relobj::incremental_relocs_write): New function.
3262 (Sized_relobj::incremental_relocs_write_reltype): New function.
3263 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
3264 incremental link.
3265 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
3266 archives and object files elsewhere.
3267 (Add_symbols::run): Report object files here.
3268 (Finish_group::run): Report end of archive at end of group.
3269 * reloc.cc: Include layout.h, incremental.h.
3270 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
3271 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
3272 (Sized_relobj::incremental_relocs_scan): New function.
3273 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3274 (Sized_relobj::do_relocate_sections): Write incremental relocations.
3275 (Sized_relobj::incremental_relocs_write): New function.
3276 (Sized_relobj::incremental_relocs_write_reltype): New function.
3277 * script.cc (read_input_script): Rewrite test for incremental link.
3278 Change call to Incremental_inputs::report_script.
3279 * symtab.h (Symbol_table::first_global_index): New function.
3280 (Symbol_table::output_count): New function.
3281
ce0d1972
DK
32822010-08-12 Doug Kwan <dougkwan@google.com>
3283
3284 * arm.cc (Target_arm::merge_object_attributes): Check command line
3285 options --no-wchar-size-warning and --no-enum-size-warning.
3286 * options.h (General_options): Add ld-compatible options
3287 --no-enum-size-warning and --no-wchar-size-warning.
3288
6e5710ce
ILT
32892010-08-04 Ian Lance Taylor <iant@google.com>
3290
3291 * x86_64.cc (Target_x86_64::Scan::local): Use
3292 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
3293 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
3294 (Target_x86_64::Scan::global): Likewise.
3295 (Target_x86_64::Relocate::relocate): Likewise.
3296 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
3297 Likewise.
3298
fef830db
CC
32992010-08-03 Cary Coutant <ccoutant@google.com>
3300
3301 * merge.cc (Output_merge_string::do_add_input_section): Count strings
3302 to reserve space in merged_strings vector. Keep total input size
3303 for stats.
3304 (Output_merge_string::do_print_merge_stats): Print total input size.
3305 * merge.h (Output_merge_string): Add input_size_ field.
3306 * stringpool.cc (Stringpool_template::string_length): Move
3307 implementations out of Stringpool_template class and place in
3308 stringpool.h.
3309 * stringpool.h (string_length): Move out of Stringpool_template.
3310
1e3811b0
ILT
33112010-08-03 Ian Lance Taylor <iant@google.com>
3312
3313 PR 11712
3314 * layout.cc (relaxation_loop_body): If address of load segment is
3315 set, adjust address to include headers if possible.
3316
7af0c620
ILT
33172010-08-03 Ian Lance Taylor <iant@google.com>
3318
3319 * version.cc (version_string): Bump to 1.10.
3320
22f0da72
ILT
33212010-08-03 Ian Lance Taylor <iant@google.com>
3322
3323 PR 11805
3324 * layout.h (enum Output_section_order): Define.
3325 (class Layout): Update declarations.
3326 * layout.cc (Layout::get_output_section): Add order parameter.
3327 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
3328 is_first_non_relro parameters. Change all callers.
3329 (Layout::choose_output_section): Likewise.
3330 (Layout::add_output_section_data): Likewise.
3331 (Layout::make_output_section): Likewise. Set order.
3332 (Layout::default_section_order): New function.
3333 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
3334 * output.cc (Output_section::Output_section): Initialize order_.
3335 Don't initialize deleted fields.
3336 (Output_segment::Output_segment): Don't initialize deleted
3337 fields.
3338 (Output_segment::add_output_section_to_load): New function
3339 replacing add_output_section. Change all callers to call this or
3340 add_output_section_to_nonload.
3341 (Output_segment::add_output_section_to_nonload): New function.
3342 (Output_segment::remove_output_section): Rewrite.
3343 (Output_segment::add_initial_output_data): Likewise.
3344 (Output_segment::has_any_data_sections): Likewise.
3345 (Output_segment::is_first_section_relro): Likewise.
3346 (Output_segment::maximum_alignment): Likewise.
3347 (Output_segment::has_dynamic_reloc): New function replacing
3348 dynamic_reloc_count. Change all callers.
3349 (Output_segment::has_dynamic_reloc_list): New function replacing
3350 dynamic_reloc_count_list. Change all callers.
3351 (Output_segment::set_section_addresses): Rewrite.
3352 (Output_segment::set_offset): Rewrite.
3353 (Output_segment::find_first_and_last_list): Remove.
3354 (Output_segment::set_tls_offsets): Rewrite.
3355 (Output_segment::first_section_load_address): Likewise.
3356 (Output_segment::output_section_count): Likewise.
3357 (Output_segment::section_with_lowest_load_address): Likewise.
3358 (Output_segment::write_section_headers): Likewise.
3359 (Output_segment::print_sections_to_map): Likewise.
3360 * output.h (class Output_data): Remove dynamic_reloc_count_
3361 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
3362 (Output_data::add_dynamic_reloc): Rewrite.
3363 (Output_data::has_dynamic_reloc): New function.
3364 (Output_data::dynamic_reloc_count): Remove.
3365 (class Output_section): Add order_ field. Remvoe is_relro_local_,
3366 is_last_relro_, is_first_non_relro_, is_interp_,
3367 is_dynamic_linker_section_ fields. Add order and set_order
3368 functions. Remove is_relro_local, set_is_relro_local,
3369 is_last_relro, set_is_last_relro, is_first_non_relro,
3370 set_is_first_non_relro functions, is_interp, set_is_interp,
3371 is_dynamic_linker_section, and set_is_dynamic_linker_section
3372 functions.
3373 (class Output_segment): Change Output_data_list from std::list to
3374 std:;vector. Add output_lists_ field. Remove output_data_ and
3375 output_bss_ fields. Update declarations.
3376
3ff2ccb0
ILT
33772010-08-02 Ian Lance Taylor <iant@google.com>
3378
3379 * arm.cc (Target_arm::gc_process_relocs): Use typename.
3380 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
3381 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
3382
88a4108b
ILT
33832010-08-02 Ian Lance Taylor <iant@google.com>
3384
3385 PR 11855
3386 * script.cc (Script_options::Script_options): Initialize
3387 symbol_definitions_ and symbol_references_.
3388 (Script_options::add_symbol_assignment): Update
3389 symbol_definitions_ and symbol_references_.
3390 (Script_options::add_symbol_reference): New function.
3391 (script_symbol): New function.
3392 * script.h (class Script_options): Add symbol_definitions_ and
3393 symbol_references_ fields.
3394 (Script_options::referenced_const_iterator): New type.
3395 (Script_options::referenced_begin): New function.
3396 (Script_options::referenced_end): New function.
3397 (Script_options::is_referenced): New function.
3398 (Script_options::any_unreferenced): New function.
3399 * script-c.h (script_symbol): Declare.
3400 * yyscript.y (exp): Call script_symbol.
3401 * symtab.cc: Include "script.h".
3402 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3403 Change all callers. Check symbols referenced by scripts.
3404 (Symbol_table::add_undefined_symbols_from_command_line): Add
3405 layout parameter. Change all callers.
3406 (Symbol_table::do_add_undefined_symbols_from_command_line):
3407 Likewise. Break out loop body. Check symbols referenced by
3408 scripts.
3409 (Symbol_table::add_undefined_symbol_from_command_line): New
3410 function broken out of
3411 do_add_undefined_symbols_from_command_line.
3412 * symtab.h (class Symbol_table): Update declarations.
3413 * archive.cc: Include "layout.h".
3414 (Archive::should_include_member): Add layout parameter. Change
3415 all callers. Check for symbol mentioned in expression.
3416 * archive.h (class Archive): Update declaration.
3417 * object.cc (Sized_relobj::do_should_include_member): Add layout
3418 parameter.
3419 * object.h (Object::should_include_member): Add layout parameter.
3420 Change all callers.
3421 (Object::do_should_include_member): Add layout parameter.
3422 (class Sized_relobj): Update declaration.
3423 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3424 parameter.
3425 * dynobj.h (class Sized_dynobj): Update declaration.
3426 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3427 layout parameter.
3428 * plugin.h (class Sized_pluginobj): Update declaration.
3429
5f1ab67a
ILT
34302010-08-02 Ian Lance Taylor <iant@google.com>
3431
3432 PR 11866
3433 * output.cc (Output_segment::set_offset): Search for the first and
3434 last sections rather than assuming that the list is in order.
3435 (Output_segment::find_first_and_last_list): New function.
3436 * output.h (class Output_segment): Update declarations.
3437 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3438 (relro_strip_test_SOURCES): New variable.
3439 (relro_strip_test_DEPENDENCIES): New variable.
3440 (relro_strip_test_LDFLAGS): New variable.
3441 (relro_strip_test_LDADD): New variable.
3442 (relro_strip_test.so): New target.
3443
a8df5856
ILT
34442010-08-02 Ian Lance Taylor <iant@google.com>
3445
3446 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3447 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3448 (Target_i386::got_tlsdesc_section): New function.
3449 (Target_i386::got_section): Create space for GOT entries for
3450 TLSDESC relocations.
3451 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3452 R_386_TLS_GOTDESC.
3453 (Target_i386::Scan::global): Likewise.
3454 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3455 using TLSDESC GOT.
3456 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3457 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3458 (Target_x86_64::got_tlsdesc_section): New function.
3459 (Target_x86_64::got_section): Create space for GOT entries for
3460 TLSDESC relocations.
3461 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3462 R_386_TLS_GOTDESC.
3463 (Target_x86_64::Scan::global): Likewise.
3464 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3465 using TLSDESC GOT.
3466
0c10a0a6
ILT
34672010-08-02 Ian Lance Taylor <iant@google.com>
3468
3469 * testsuite/final_layout.sh: Use dc to convert from hex to
3470 decimal.
3471
41cbeecc
ST
34722010-07-29 Sriraman Tallam <tmsriram@google.com>
3473
3474 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3475 paramter to the call to gold::gc_process_relocs.
3476 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3477 paramter to the call to gold::gc_process_relocs.
3478 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3479 parameter to the call to gold::gc_process_relocs.
3480 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3481 template parameter to the call to gold::gc_process_relocs.
3482 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3483 paramter to the call to gold::gc_process_relocs.
3484 * gc.h (get_embedded_addend_size): New function.
3485 (gc_process_relocs): Save the size of the reloc for use by ICF.
3486 * icf.cc (get_section_contents): Get the addend from the text section
3487 for SHT_REL relocation sections.
3488 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3489 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3490 * int_encoding.h (read_from_pointer): New overloaded function.
3491 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3492 * testsuite/icf_sht_rel_addend_test.sh: New file.
3493 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3494 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3495
6ea55b82
RW
34962010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3497
3498 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3499 * Makefile.in: Regenerate.
3500 * testsuite/Makefile.in: Regenerate.
3501
9691462b
ILT
35022010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3503
3504 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3505 * gold/testsuite/debug_msg.cc: Likewise.
3506 * gold/testsuite/odr_violation1.cc
3507 * gold/testsuite/odr_violation2.cc
3508
76897331
CC
35092010-07-21 Cary Coutant <ccoutant@google.com>
3510
3511 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3512 string, and length fields.
3513 (Output_merge_string::Merged_strings_list): New type.
3514 (Output_merge_string::Merged_strings_lists): New typedef.
3515 (Output_merge_string): Replace merged_strings_ with
3516 merged_strings_lists_.
3517 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3518 Merged_strings_list per input object and section. Don't store pointer
3519 to the string. Don't store length with each merged string entry.
3520 (Output_merge_string::finalize_merged_data): Loop over list of merged
3521 strings lists. Recompute length of each merged string.
3522
78384e8f
CC
35232010-07-15 Cary Coutant <ccoutant@google.com>
3524
3525 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3526 here.
3527
783659f9
ILT
35282010-07-14 Ian Lance Taylor <iant@google.com>
3529
3530 * descriptors.cc (Descriptors::open): Report correct name in error
3531 message.
3532
131687b4
DK
35332010-07-13 Doug Kwan <dougkwan@google.com>
3534
3535 * arm.cc (Arm_input_section::Arm_input_section): For a
3536 SHT_ARM_EXIDX section, always keeps the input sections.
3537 (Arm_input_section::set_exidx_section_link): New method.
3538 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3539 has_errors_ to false.
3540 (Arm_exidx_input_section::has_errors,
3541 Arm_exidx_input_section::set_has_errors): New methods.
3542 (Arm_exidx_input_section::has_errors_): New data member.
3543 (Arm_relobj::get_exidx_shndx_list): New method.
3544 (Arm_output_section::append_text_sections_to_list): Do not skip
3545 section without SHF_EXECINSTR.
3546 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3547 errors.
3548 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3549 section header. Make error messages more verbose. Check for
3550 a non-executable section linked to an EXIDX section.
3551 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3552 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3553 check that there is no deferred EXIDX section if we exit early.
3554 Instead of not making an EXIDX section in case of an error, make one
3555 and set the has_errors flag of it.
3556 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3557 in a relocatable link.
3558 (Target_arm::do_relax): Look for the EXIDX output section instead of
3559 assuming that it is called .ARM.exidx.
3560 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3561 section list. Do not check for SHF_EXECINSTR section flags but
3562 skip any input section with errors.
3563 * output.cc (Output_section::Output_section): Initialize
3564 always_keeps_input_sections_ to false.
3565 (Output_section::add_input_section): Check for
3566 always_keeps_input_sections_.
3567 * output.h (Output_section::always_keeps_input_sections,
3568 Output_section::set_always_keeps_input_sections): New methods.
3569 (Output_section::always_keeps_input_sections): New data member.
3570
69517287
RÁE
35712010-07-13 Rafael Espindola <espindola@google.com>
3572
3573 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3574 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3575
82742395
ILT
35762010-07-13 Philip Herron <herron.philip@googlemail.com>
3577 Ian Lance Taylor <iant@google.com>
3578
3579 * output.h (Output_section_lookup_maps::add_merge_section):
3580 Correct check of whether value was inserted.
3581 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3582 (Output_section_lookup_maps::add_relaxed_input_section):
3583 Likewise.
3584 * arm.cc (Target_arm::got_section): Remove used local os.
3585 * i386.cc (Target_i386::got_section): Likewise.
3586 * x86_64.cc (Target_x86_64::got_section): Likewise.
3587 * sparc.cc (Target_sparc::got_section): Likewise.
3588 (Target_sparc::relocate): Remove unused local have_got_offset.
3589 * powerpc.cc (Target_powerpc::relocate): Likewise.
3590
f2d707b5
ILT
35912010-07-13 Ian Lance Taylor <iant@google.com>
3592
241531d6
ILT
3593 * compressed_output.cc (zlib_decompress): Fix signature in
3594 !HAVE_ZLIB_H case.
3595
f2d707b5
ILT
3596 * archive.cc (Archive::include_member): Unlock an external member
3597 of a thin archive. Don't bother to delete an object we know is
3598 NULL.
3599
a2e47362
CC
36002010-07-12 Cary Coutant <ccoutant@google.com>
3601
3602 * compressed_output.cc (zlib_decompress): New function.
3603 (get_uncompressed_size): New function.
3604 (decompress_input_section): New function.
3605 * compressed_output.h (get_uncompressed_size): New function.
3606 (decompress_input_section): New function.
3607 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3608 Handle compressed debug sections.
3609 * layout.cc (is_compressed_debug_section): New function.
3610 (Layout::output_section_name): Map compressed section names to
3611 canonical names.
3612 * layout.h (is_compressed_debug_section): New function.
3613 (is_debug_info_section): Recognize compressed debug sections.
3614 * merge.cc: Include compressed_output.h.
3615 (Output_merge_data::do_add_input_section): Handle compressed
3616 debug sections.
3617 (Output_merge_string::do_add_input_section): Handle compressed
3618 debug sections.
3619 * object.cc: Include compressed_output.h.
3620 (Sized_relobj::Sized_relobj): Initialize new data members.
3621 (build_compressed_section_map): New function.
3622 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3623 * object.h (Object::section_is_compressed): New method.
3624 (Object::do_section_is_compressed): New method.
3625 (Sized_relobj::Compressed_section_map): New type.
3626 (Sized_relobj::do_section_is_compressed): New method.
3627 (Sized_relobj::compressed_sections_): New data member.
3628 * output.cc (Output_section::add_input_section): Handle compressed
3629 debug sections.
3630 * reloc.cc: Include compressed_output.h.
3631 (Sized_relobj::write_sections): Handle compressed debug sections.
3632
ce279a62
CC
36332010-07-08 Cary Coutant <ccoutant@google.com>
3634
3635 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3636 weak when resolving to a dynamic def.
3637 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3638 for weak undef/dynamic def cases. Adjust callers.
3639 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3640 undef_binding_weak_.
3641 (Symbol_table::sized_write_globals): Adjust symbol binding.
3642 (Symbol_table::sized_write_symbol): Add binding parameter.
3643 * symtab.h (Symbol::set_undef_binding): New method.
3644 (Symbol::is_undef_binding_weak): New method.
3645 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3646 (Symbol_table::should_override): Add new parameter.
3647 (Symbol_table::sized_write_symbol): Add new parameter.
3648
3649 * testsuite/weak_undef_file1.cc: Add new test case.
3650 * testsuite/weak_undef_file2.cc: Fix header comment.
3651 * testsuite/weak_undef_test.cc: Add new test case.
3652
b2286c10
DK
36532010-06-29 Doug Kwan <dougkwan@google.com>
3654
3655 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3656 Initialize USE_SYMBOL_.
3657 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3658 definition.
3659 (Arm_reloc_property::uses_symbol_): New data member declaration.
3660 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3661 uses symbol value and symbol is undefined but not weakly undefined.
3662
4802450a
RÁE
36632010-06-28 Rafael Espindola <espindola@google.com>
3664
3665 * plugin.cc (Plugin::load): Use dlerror.
3666
e5ca47ba
ILT
36672010-06-26 Jeffrey Yaskin <jyasskin@google.com>
3668
3669 * symtab.cc (detect_odr_violations): When reporting an ODR
3670 violation, report an object where the symbol is defined.
3671
8a75a161
DK
36722010-06-25 Doug Kwan <dougkwan@google.com>
3673
3674 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
3675 (Target_arm::section_may_have_icf_unsafe_pointers): New method
3676 definition.
3677 (Target_arm::Scan::local_reloc_may_be_function_pointer,
3678 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
3679 target hook to detect function points.
3680 (Target_arm::Scan::possible_function_pointer_reloc): New method.
3681 * icf.h (Icf::check_section_for_function_pointers): Change type of
3682 parameter SECTION_NAME to const reference to std::string. Use
3683 target hook to determine if section may have unsafe pointers.
3684 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3685 method definition.
3686
42218b9f
RÁE
36872010-06-21 Rafael Espindola <espindola@google.com>
3688
3689 * fileread.cc (Input_file::find_fie): New
3690 (Input_file::open): Use Input_file::find_fie.
3691 * fileread.h (Input_file::find_fie): New
3692 * plugin.cc (set_extra_library_path): New.
3693 (Plugin::load): Add set_extra_library_path to the transfer vector.
3694 (Plugin_manager::set_extra_library_path): New.
3695 (Plugin_manager::add_input_file): Use the extra search path if set.
3696 (set_extra_library_path(): New.
3697 * plugin.h (Plugin_manager): Add set_extra_library_path and
3698 extra_search_path_.
3699
a0506cca
CC
37002010-06-19 Cary Coutant <ccoutant@google.com>
3701
3702 * layout.cc (gdb_sections): Add .debug_types.
3703 (lines_only_debug_sections): Likewise.
3704
6508b958
RÁE
37052010-06-18 Rafael Espindola <espindola@google.com>
3706
3707 * plugin.cc (add_input_file,add_input_library)
3708 (Plugin_manager::add_input_file): Make filename arguments const.
3709 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
3710 const.
3711
3e235302
DK
37122010-06-16 Doug Kwan <dougkwan@google.com>
3713
3714 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
3715 .ARM.attributes section if we have not merged any input
3716 attributes sections.
3717
106e8a6c
DK
37182010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3719
3720 * arm.cc: Allow combining objects with no EABI version
3721 information.
3722
91ff43fe
RÁE
37232010-06-15 Rafael Espindola <espindola@google.com>
3724
3725 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
3726
68ed838c
ILT
37272010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3728
3729 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
3730 (struct iovec): Correct !HAVE_READV definition.
3731
f3a2388f
CC
37322010-06-10 Cary Coutant <ccoutant@google.com>
3733
3734 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
3735 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
3736 reloc sections.
3737 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
3738
3739 PR 11683
3740 * symtab.h (Symbol::is_placeholder): New member function.
3741 * target-reloc.h (relocate_section): Check for placeholder symbols.
3742
3743 * testsuite/Makefile.am (plugin_test_8): New test.
3744 (plugin_test_9): New test.
3745 * testsuite/Makefile.in: Regenerate.
3746
e1df38aa
NC
37472010-06-09 Nick Clifton <nickc@redhat.com>
3748
3749 * yyscript.y (input_list_element): Allow strings prefixed with
3750 the '-' character. Treat these as libraries.
3751 * script.cc (script_add_library): New function. Adds a library
3752 specified by "-l<name>" found in an input script.
3753 * script-c.h: Add prototype for script_add_library.
3754
25bbe950
DK
37552010-06-07 Doug Kwan <dougkwan@google.com>
3756
3757 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
3758 Restrict stub-group size to be within long conditional branch
3759 range when working around cortex-A8 erratum.
3760
0f32ea4c
ILT
37612010-06-07 Damien Diederen <dd@crosstwine.com>
3762
3763 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
3764 #ifdef typo.
3765
8fe2a369
ST
37662010-06-03 Sriraman Tallam <tmsriram@google.com>
3767
3768 PR gold/11658
3769 * output.cc
3770 (Output_section::Input_section_sort_entry::compare_section_ordering):
3771 Change to return non-zero correctly.
3772 (Output_section::Input_section_sort_section_order_index_compare
3773 ::operator()): Change to fix ambiguity in comparisons.
3774
6e9ba2ca
ST
37752010-06-01 Sriraman Tallam <tmsriram@google.com>
3776
3777 * gold.h (is_wildcard_string): New function.
3778 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
3779 (Layout::layout_eh_frame): Ditto.
3780 (Layout::find_section_order_index): New method.
3781 (Layout::read_layout_from_file): New method.
3782 * layout.h (Layout::find_section_order_index): New method.
3783 (Layout::read_layout_from_file): New method.
3784 (Layout::input_section_position_): New private member.
3785 (Layout::input_section_glob_): New private member.
3786 * main.cc (main): Call read_layout_from_file here.
3787 * options.h (--section-ordering-file): New option.
3788 * output.cc (Output_section::input_section_order_specified_): New
3789 member.
3790 (Output_section::Output_section): Initialize new member.
3791 (Output_section::add_input_section): Add new parameter.
3792 Keep input sections when --section-ordering-file is used.
3793 (Output_section::set_final_data_size): Sort input sections when
3794 section ordering file is specified.
3795 (Output_section::Input_section_sort_entry): Add new parameter.
3796 Check sorting type.
3797 (Output_section::Input_section_sort_entry::compare_section_ordering):
3798 New method.
3799 (Output_section::Input_section_sort_compare::operator()): Change to
3800 consider section_order_index.
3801 (Output_section::Input_section_sort_init_fini_compare::operator()):
3802 Change to consider section_order_index.
3803 (Output_section::Input_section_sort_section_order_index_compare
3804 ::operator()): New method.
3805 (Output_section::sort_attached_input_sections): Change to sort
3806 according to section order when specified.
e1df38aa
NC
3807 (Output_section::add_input_section<32, true>): Add new parameter.
3808 (Output_section::add_input_section<64, true>): Add new parameter.
3809 (Output_section::add_input_section<32, false>): Add new parameter.
3810 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
3811 * output.h (Output_section::add_input_section): Add new parameter.
3812 (Output_section::input_section_order_specified): New
3813 method.
3814 (Output_section::set_input_section_order_specified): New method.
3815 (Input_section::Input_section): Initialize section_order_index_.
3816 (Input_section::section_order_index): New method.
3817 (Input_section::set_section_order_index): New method.
3818 (Input_section::section_order_index_): New member.
3819 (Input_section::Input_section_sort_section_order_index_compare): New
3820 struct.
3821 (Output_section::input_section_order_specified_): New member.
3822 * script-sections.cc (is_wildcard_string): Delete and move modified
3823 method to gold.h.
3824 (Output_section_element_input::Output_section_element_input): Modify
3825 call to is_wildcard_string.
3826 (Output_section_element_input::Input_section_pattern
3827 ::Input_section_pattern): Ditto.
3828 (Output_section_element_input::Output_section_element_input): Ditto.
3829 * testsuite/Makefile.am (final_layout): New test case.
3830 * testsuite/Makefile.in: Regenerate.
3831 * testsuite/final_layout.cc: New file.
3832 * testsuite/final_layout.sh: New file.
3833
3537c84b
RÁE
38342010-06-01 Rafael Espindola <espindola@google.com>
3835
3836 * plugin.cc (Plugin::load): Pass the output name to the plugin.
3837
105b6afd
RÁE
38382010-06-01 Rafael Espindola <espindola@google.com>
3839
3840 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
3841 visibility of symbols.
3842
29e11421
DK
38432010-05-27 Doug Kwan <dougkwan@google.com>
3844
3845 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
3846 from start of output section instead of address for a local symbol
3847 in a merged or relaxed section when doing a relocatable link.
3848
5e0f337e
RÁE
38492010-05-26 Rafael Espindola <espindola@google.com>
3850
3851 PR 11604
3852 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
3853 adding sections the garbage collector removed.
3854 * gold/testsuite/Makefile.am: Add test.
3855 * gold/testsuite/Makefile.in: Regenerate.
3856 * gold/testsuite/plugin_test_7.sh: New.
3857 * gold/testsuite/plugin_test_7_1.c: New.
3858 * gold/testsuite/plugin_test_7_2.c: New.
3859
f4187277
RÁE
38602010-05-26 Rafael Espindola <espindola@google.com>
3861
3862 * script-sections.cc (Output_section_definition::set_section_addresses):
3863 Check for --section-start.
3864
5c388529
DK
38652010-05-26 Doug Kwan <dougkwan@google.com>
3866
3867 * arm.cc (Arm_scan_relocatable_relocs): New class.
3868 (Target_arm::relocate_special_relocatable): New method.
3869 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
3870 (Arm_relocate_functions::thumb_branch_common): Same.
3871 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
3872 instead of Default_scan_relocatable_relocs.
3873 * target-reloc.h (relocate_for_relocatable): Let target handle
3874 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
3875 * target.h (Sized_target::relocate_special_relocatable): New method.
3876
bca1c3ae
ILT
38772010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3878
3879 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
3880
0439c796
DK
38812010-05-23 Doug Kwan <dougkwan@google.com>
3882
3883 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
3884 instead of a cast.
3885 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
3886 with a direct branch, not a conditional branch, to a stub.
3887 * merge.cc (Output_merge_base::record_input_section): New method
3888 defintion.
3889 (Output_merge_data::do_add_input_section): Record input section if
3890 keeps-input-sections flag is set.
3891 (Output_merge_string::do_add_input_section): Ditto.
3892 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
3893 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
3894 INPUT_SECTIONS_.
3895 (Output_merge_base::keeps_input_sections,
3896 Output_merge_base::set_keeps_input_sections,
3897 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
3898 method definitions.
3899 (Output_merge_base::Input_sections): New type declaration.
3900 (Output_merge_base::input_sections_begin,
3901 Output_merge_base::input_sections_end,
3902 Output_merge_base::do_set_keeps_input_sections): New method definitions.
3903 (Output_merge_base::bool keeps_input_sections_,
3904 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
3905 Output_merge_base::input_sections_): New data members.
3906 (Output_merge_data::do_set_keeps_input_sections): New method
3907 defintion.
3908 (Output_merge_string::do_set_keeps_input_sections): Ditto.
3909 * output.cc (Output_section::Input_section::relobj): Move method
3910 defintion from class declaration to here and handle merge sections.
3911 (Output_section::Input_section::shndx): Ditto.
3912 (Output_section::Output_section): Remove initializations of removed
3913 data members and initialize new data member LOOKUP_MAPS_.
3914 (Output_section::add_input_section): Set keeps-input-sections flag
3915 for a newly created merge output section as appropriate. Adjust code
3916 to use Output_section_lookup_maps class.
3917 (Output_section::add_relaxed_input_section): Adjst code for lookup
3918 maps code refactoring.
3919 (Output_section::add_merge_input_section): Add a new parameter
3920 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
3921 class. If adding input section to a newly created merge output
3922 section fails, remove the new merge section.
3923 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3924 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3925 (Output_section::find_merge_section): Ditto.
3926 (Output_section::build_lookup_maps): New method defintion.
3927 (Output_section::find_relaxed_input_section): Adjust code to use
3928 Output_section_lookup_maps class.
3929 (Output_section::get_input_sections): Export merge sections. Adjust
3930 code to use Output_section_lookup_maps class.
3931 (Output_section:::add_script_input_section): Adjust code to use
3932 Output_section_lookup_maps class. Update lookup maps for merge
3933 sections also.
3934 (Output_section::discard_states): Use Output_section_lookup_maps.
3935 (Output_section::restore_states): Same.
3936 * output.h (Merge_section_properties): Move class defintion out of
3937 Output_section.
3938 (Output_section_lookup_maps): New class.
3939 (Output_section::Input_section::is_merge_section): New method
3940 defintion.
3941 (Output_section::Input_section::relobj): Move defintion out of class
3942 defintion. Declare method only.
3943 (Output_section::Input_section::shndx): Ditto.
3944 (Output_section::Input_section::output_merge_base): New method defintion.
3945 (Output_section::Input_section::u2_.pomb): New union field.
3946 (Output_section::Merge_section_by_properties_map,
3947 Output_section::Output_section_data_by_input_section_map,
3948 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3949 Remove types.
3950 (Output_section::add_merge_input_section): Add new parameter
3951 KEEPS_INPUT_SECTIONS.
3952 (Output_section::build_lookup_maps): New method declaration.
3953 (Output_section::merge_section_map_,
3954 Output_section::merge_section_by_properties_map_,
3955 Output_section::relaxed_input_section_map_,
3956 Output_section::is_relaxed_input_section_map_valid_): Remove data
3957 members.
3958 (Output_section::lookup_maps_): New data member.
3959
76295588
L
39602010-05-21 Doug Kwan <dougkwan@google.com>
3961
3962 PR gold/11619
3963 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3964 avoid a compilation error.
3965
d103a984
RÁE
39662010-05-19 Rafael Espindola <espindola@google.com>
3967
3968 * script-sections.cc (Output_section_definition::allocate_to_segment):
3969 Update the phdrs_list even when the output section is NULL.
3970 * testsuite/Makefile.am: Add test.
3971 * testsuite/Makefile.in: Regenerate.
3972 * testsuite/script_test_9.cc: New.
3973 * testsuite/script_test_9.sh: New.
3974 * testsuite/script_test_9.t: New.
3975
6625d24e
DK
39762010-05-19 Doug Kwan <dougkwan@google.com>
3977
3978 * arm.cc (Arm_input_section::original_size): New method.
3979 (Arm_input_section::do_addralign): Add a cast.
3980 (Arm_input_section::do_output_offset): Remove static cast.
3981 (Arm_input_section::original_addralign,
3982 Arm_input_section::original_size_): Change type to uint32_t.
3983 (Arm_input_section::init): Add safe casts for section alignment
3984 and size.
3985 (Arm_input_section::set_final_data_size): Do not set address and
3986 offset of stub table.
3987 (Arm_output_section::fix_exidx_coverage): Change use of of
3988 Output_section::Simple_input_section to that of
3989 Output_section::Input_section.
3990 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3991 except for the first pass.
3992 * output.cc (Output_section::get_input_sections): Change type of
3993 input_sections to std::list<Input_section>.
3994 (Output_section::add_script_input_section): Rename from
3995 Output_section::add_simple_input_section. Change type of SIS
3996 parameter from Simple_input_section to Input_section.
3997 * output.h (Output_section::Simple_input_section): Remove class.
3998 (Output_section::Input_section): Change class visibility to public.
3999 (Output_section::Input_section::addralign): Use stored alignments
4000 for special input sections if set.
4001 (Output_section::Input_section::set_addralign): New method.
4002 (Output_section::get_input_sections): Change parameter type from
4003 list of Simple_input_section to list of Input_section.
4004 (Output_section::add_script_input_section): Rename from
4005 Output_section::add_simple_input_section. Change first parameter's
4006 type from Simple_input_section to Input_section and remove the
4007 second and third parameters.
4008 * script-sections.cc (Input_section::Input_section_list): Change
4009 type to list of Output_section::Input_section/
4010 (Input_section_info::Input_section_info): Change parameter type of
4011 INPUT_SECTION to Output_section::Input_section.
4012 (Input_section_info::input_section): Change return type.
4013 (Input_section_info::input_section_): Change type to
4014 Output_section::Input_section.
4015 (Output_section_element_input::set_section_addresses): Adjust code
4016 to use Output_section::Input_section instead of
4017 Output_section::Simple_input_section. Adjust code for renaming
4018 of Output_section::add_simple_input_section.
4019 (Orphan_output_section::set_section_addresses): Ditto.
4020
e1e82ea4
RW
40212010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4022
4023 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4024 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4025
91e75c8a
RÁE
40262010-05-18 Rafael Espindola <espindola@google.com>
4027
4028 * options.cc (General_options::finalize): Handle -nostdlib.
4029 * options.h (nostdlib): New option.
4030 * script.cc (script_add_search_dir): Handle -nostdlib.
4031
da59ad79
DK
40322010-05-12 Doug Kwan <dougkwan@google.com>
4033
4034 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4035 attributes section only if there no attributes section after merging.
4036 (Target_arm::merge_object_attributes): Move value of
e1df38aa 4037 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
4038 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4039 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4040 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4041 and arm_attr_merge_7.stdout.
4042 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4043 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4044 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4045 arm_attr_merge_7b.o): New rules.
4046 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4047 arm_attr_merge_7
4048 * testsuite/Makefile.in: Regenerate.
4049 * testsuite/arm_attr_merge.sh: New file.
4050 * testsuite/arm_attr_merge_[67][ab].s: Same.
4051
3e01a7fd
NC
40522010-05-05 Nick Clifton <nickc@redhat.com>
4053
4054 * po/es.po: Updated Spanish translation.
4055
7ad2014a
L
40562010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4057
4058 * Makefile.am (install-exec-local): Properly install gold as
4059 default cross linker.
4060 * Makefile.in: Regenerated.
4061
4fda8867
NC
40622010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4063 Nick Clifton <nickc@redhat.com>
4064
4065 * configure.ac (install_as_default): Define and set to false
4066 unless --enable-gold or --enable-gold=both/gold has been
4067 specified.
4068 * configure: Regenerate.
4069
4070 * Makefile.am (install-exec-local): Install the executable as
4071 'ld.gold'. If install_as_default is true then also install it as
4072 'ld'.
4073 * Makefile.in: Regenerated.
4074
bd288ea2
ILT
40752010-04-24 Ian Lance Taylor <iant@google.com>
4076
4077 * layout.cc (Layout::layout_reloc): In relocatable link don't
4078 combine reloc sections for grouped sections.
4079
ef38fd8a
ST
40802010-04-23 Sriraman Tallam <tmsriram@google.com>
4081
4082 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4083 sections that are not ordinary to icf.
4084 * icf.cc (get_section_contents): Handle relocation pointing to section
4085 with no object or shndx information.
4086 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4087 * testsuite/Makefile.in: Regenerate.
4088 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4089 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4090
f6973bdc
ILT
40912010-04-22 Ian Lance Taylor <iant@google.com>
4092
4093 * expression.cc (Expression::Expression_eval_info): Add
4094 result_alignment_pointer field.
4095 (Expression::eval_with_dot): Add result_alignment_pointer
4096 parameter. Change all callers.
4097 (Expression::eval_maybe_dot): Likewise.
4098 (class Binary_expression): Add alignment_pointer parameter to
4099 left_value and right_value. Change all callers.
4100 (BINARY_EXPRESSION): Set result alignment.
4101 (class Trinary_expression): Add alignment_pointer parameter to
4102 arg2_value and arg3_value. Change all callers.
4103 (Trinary_cond::value): Set result alignment.
4104 (Max_expression::value, Min_expression::value): Likewise.
4105 (Align_expression::value): Likewise.
4106 * script-sections.cc (class Sections_element): Add dot_alignment
4107 parameter to set_section_addresses virtual function. Update
4108 instantiations.
4109 (class Output_section_element): Likewise.
4110 (Script_sections::create_segments): Add dot_alignment parameter.
4111 Change all callers.
4112 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4113 (Script_sections::set_phdrs_clause_addresses): Likewise.
4114 * script-sections.h: Update declarations.
4115 * script.h: Update declarations.
4116 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4117 min_p_align.
4118 * testsuite/script_test_3.t: Set large alignment.
4119 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4120 segment has expected alignment.
4121
9c9c98a5
NC
41222010-04-22 Nick Clifton <nickc@redhat.com>
4123
4124 * po/gold.pot: Updated by the Translation project.
4125 * po/vi.po: Updated Vietnamese translation.
4126
2253bfba
L
41272010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4128
4129 * testsuite/Makefile.am (check_PROGRAMS): Add
4130 icf_virtual_function_folding_test.
4131 * testsuite/Makefile.in: Regenerated.
4132
85fdf906
AH
41332010-04-15 Andrew Haley <aph@redhat.com>
4134
4135 * options.h (merge_exidx_entries): New option.
4136 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4137 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4138 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4139 (Target_arm::merge_exidx_entries): New function.
4140 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4141 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4142 to Arm_exidx_fixup constructor.
4143 Add new arg, merge_exidx_entries.
4144 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4145 Arm_output_section::fix_exidx_coverage.
4146
ce97fa81
ST
41472010-04-18 Sriraman Tallam <tmsriram@google.com>
4148
4149 * icf.cc (get_section_contents): Check for preemptible functions.
4150 Ignore addend when appropriate.
4151 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4152 section folded.
4153 (add_from_relobj): Check for section folded.
4154 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4155 * symtab.h (should_add_dynsym_entry): Add new parameter.
4156 * target-reloc.h (scan_relocs): Check for section folded.
4157 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4158 Check reloc types for function pointers in shared objects.
4159 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4160 case.
4161 (icf_preemptible_functions_test): New test case.
4162 (icf_string_merge_test): New test case.
4163 * testsuite.Makefile.in: Regenerate.
4164 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4165 bar_glob. Refactor code.
4166 * testsuite/icf_preemptible_functions_test.cc: New file.
4167 * testsuite/icf_preemptible_functions_test.sh: New file.
4168 * testsuite/icf_string_merge_test.cc: New file.
4169 * testsuite/icf_string_merge_test.sh: New file.
4170 * testsuite/icf_virtual_function_folding_test.cc: New file.
4171 * testsuite/icf_virtual_function_folding_test.sh: New file.
4172
04ceb17c
DK
41732010-04-14 Doug Kwan <dougkwan@google.com>
4174
4175 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4176 for local symbol recounting if we remove a section due to ICF.
4177 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4178 there are no regular objects in input.
4179
153e7da4
DK
41802010-04-13 Doug Kwan <dougkwan@google.com>
4181
4182 * arm.cc (Arm_input_section::set_final_data_size): Compute
4183 accurate final data size instead of using current data size.
4184
4dbd9faf
DK
41852010-04-09 Doug Kwan <dougkwan@google.com>
4186
4187 * layout.cc (Layout::choose_output_section): Handle script section
4188 types.
4189 (Layout::make_output_section_for_script): Add section type parameter.
4190 Handle script section types.
4191 * layout.h (Layout::make_output_section_for_script): Add section
4192 type parameter.
4193 * output.cc (Output_section::Output_section): Initialize data member
4194 is_noload_.
4195 (Output_section::do_reset_address_and_file_offset): Do not set address
4196 to 0 if section is a NOLOAD section.
4197 * output.h (Output_section::is_noload): New method.
4198 (Output_section::set_is_noload): Ditto.
4199 (Output_section::is_noload_): New data member.
4200 * script-c.h (Script_section_type): New enum type.
4201 (struct Parser_output_section_header): Add new file section_type.
4202 * script-sections.cc (Sections_element::output_section_name): Add
4203 parameter for returning script section type.
4204 (Output_section_definition::output_section_name): Ditto.
4205 (Output_section_definition::section_type)P; New method.
4206 (Output_section_definiton::script_section_type_name): Ditto.
4207 (Output_section_definition::script_section_type_): New data member.
4208 (Output_section_definition::Output_section_definition): Initialize
4209 data member Output_section_definition::script_section_type_.
4210 (Output_section_definition::create_sections): Pass script section type
4211 to Layout::make_output_section_for_script.
4212 (Output_section_definition::output_section_name): Return script
4213 section type to caller.
4214 (Output_section_definition::set_section_address): Do not advance
4215 dot value and load address if section type is NOLOAD. Set address
4216 of NOLOAD sections regardless of section flags.
4217 (Output_section_definition::print): Print section type if it is
4218 not SCRIPT_SECTION_TYPE_NONE.
4219 (Output_section_definition::section_type): New method.
4220 (Output_section_definition::script_section_type_name): Ditto.
4221 (Script_sections::output_section_name): Add new parameter
4222 PSECTION_TYPE for returning script section type. Pass it to
4223 section elements. Handle discard sections.
4224 (Sort_output_sections::operator()): Handle NOLOAD sections.
4225 * script-sections.h (Script_sections::Section_type): New enum type.
4226 (Script_sections::output_section_name): Add a new parameter for
4227 returning script section type.
4228 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4229 INFO and NOLOAD.
4230 * yyscript.y (union): Add new field SECTION_TYPE.
4231 (COPY, DSECT, INFO, NOLOAD): New tokens.
4232 (opt_address_and_section_type): Change type to output_section_header.
4233 (section_type): New non-terminal
4234 (section_header): Handle section type.
2253bfba 4235 (opt_address_and_section_type): Return section type value.
4dbd9faf 4236
721ea635
L
42372010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4238
4239 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4240 * testsuite/plugin_common_test_2.c (foo): Likewise.
4241
6bf924b0
DK
42422010-04-08 Doug Kwan <dougkwan@google.com>
4243
4244 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4245 Output_merge_data.
4246 * output.cc (Output_section::add_merge_input_section): Simplify
4247 code and return status of Output_merge_base::add_input_section.
e1df38aa 4248 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
4249 returns true.
4250
24af6f92
DK
42512010-04-07 Doug Kwan <dougkwan@google.com>
4252
4253 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
4254 if section is marked as containing instructions but has no mapping
4255 symbols.
4256 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
4257 correct section index.
4258 (Arm_relobj::find_linked_text_section): Ditto.
4259
00698fc5
CC
42602010-04-07 Cary Coutant <ccoutant@google.com>
4261
4262 * archive.cc (include_member): Destroy Read_symbols_data object before
4263 releasing file.
4264 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
4265 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
4266 (Read_symbols_data::~Read_symbols_data) New destructor.
4267 (Section_relocs::Section_relocs) New constructor.
4268 (Section_relocs::~Section_relocs) New destructor.
4269 (Read_relocs_data::Read_relocs_data) New constructor.
4270 (Read_relocs_data::~Read_relocs_data) New destructor.
4271 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
4272 pointers to NULL after deleting.
4273
7296d933
DK
42742010-04-07 Doug Kwan <dougkwan@google.com>
4275
4276 * arm.cc: Replace "endianity" with "endianness" in comments.
4277 (Arm_exidx_cantunwind): Ditto.
4278 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
4279 (Arm_relobj::merge_flags_and_attributes): New method.
4280 (Arm_relobj::merge_flags_and_attributes_): New data member.
4281 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
4282 (Arm_relobj::scan_sections_for_stubs): Ditto.
4283 (Arm_relobj::do_read_symbols): Check to see if we really want to
4284 merge processor-specific flags and attributes. Exit early if
4285 an object is empty except for section names and the undefined symbol.
4286 (Target_arm::do_finalize_sections): Move check for ELF format to
4287 Arm_relobj::do_read_symbols. Merge processor specific flags and
4288 attributes from a regular object only when we have determined that
4289 it is aapropriate. Do not create an .ARM.attributes section in
4290 output if there is no regular input object.
4291 (Target_arm::merge_processor_specific_flags): Check
4292 --warn-mismatch before printing any error.
4293 (Target_arm::merge_object_attributes): Ditto.
4294 * gold.cc (queue_middle_tasks): Handle the case in which there is
4295 no regular object in input.
4296 * options.cc (General_options::parse_EB): New method.
4297 (General_options::parse_EL): Same.
4298 (General_options::General_options): Initialize endianness_.
4299 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
4300 New options.
4301 (General_options::Endianness): New enum.
4302 (General_options::endianness): New method.
4303 (General_options::endianness_): New data member.
4304 * parameters.cc (Parameters::set_options): Check target endianness.
4305 (Parameters::set_target_once): Ditto.
4306 (Parameters::check_target_endianness): New method.
4307 (parameters_force_valid_target): If either -EL or -EB is specified,
4308 use it to define endianness of default target.
4309 * parameters.h (Parameters::check_target_endianness): New method
4310 declaration.
4311 * target.h (class Target): Change "endianity" to "endianness"
4312 in comments.
4313
efc8d4f2
RW
43142010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4315
4316 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
4317 * configure: Regenerate.
4318 * Makefile.in: Regenerate.
4319 * testsuite/Makefile.in: Regenerate.
4320
be234d88
CC
43212010-04-06 Cary Coutant <ccoutant@google.com>
4322
4323 gcc PR lto/42757
4324 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
4325 prevailing definitions of common symbols.
4326 * testsuite/plugin_test_6.sh: New test case.
4327 * testsuite/plugin_common_test_1.c: New test case.
4328 * testsuite/plugin_common_test_2.c: New test case.
4329 * testsuite/Makefile.am (plugin_test_6): New test case.
4330 * testsuite/Makefile.in: Regenerate.
4331
bd32c6bd
NC
43322010-04-06 Nick Clifton <nickc@redhat.com>
4333
4334 * po/vi.po: New Vietnamese translation.
4335
323c532f
DK
43362010-03-30 Doug Kwan <dougkwan@google.com>
4337
4338 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
4339
4fcd97eb
DK
43402010-03-25 Doug Kwan <dougkwan@google.com>
4341
4342 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
4343 to avoid a conversion warning on a 32-bit host.
4344
4ebf39db
ILT
43452010-03-24 Ian Lance Taylor <iant@google.com>
4346
4347 * testsuite/script_test_3.t: Add a TLS segment.
4348 * testsuite/Makefile.am (check_PROGRAMS): Add
4349 tls_phdrs_script_test.
4350 (tls_phdrs_script_test_SOURCES): Define.
4351 (tls_phdrs_script_test_DEPENDENCIES): Define.
4352 (tls_phdrs_script_test_LDFLAGS): Define.
4353 (tls_phdrs_script_test_LDADD): Define.
4354 * testsuite/Makefile.in: Rebuild.
4355
4a599bdd
CC
43562010-03-23 Cary Coutant <ccoutant@google.com>
4357
4358 * fileread.cc (find_or_make_view): Fix comment.
4359
6c93b22c
ILT
43602010-03-23 Ian Lance Taylor <iant@google.com>
4361
4362 * script-sections.cc (class Orphan_section_placement): Define
4363 PLACE_TLS and PLACE_TLS_BSS.
4364 (Orphan_section_placement::Orphan_section_placement): Initialize
4365 new places.
4366 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
4367 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
4368 (tls_script_test_SOURCES): Define.
4369 (tls_script_test_DEPENDENCIES): Define.
4370 (tls_script_test_LDFLAGS): Define.
4371 (tls_script_test_LDADD): Define.
4372 * testsuite/Makefile.in: Rebuild.
4373
a2c7281b
DK
43742010-03-22 Doug Kwan <dougkwan@google.com>
4375
4376 * arm.cc (Arm_relocate_functions::abs8,
4377 Arm_relocate_functions::abs16): Use correct check for overflow
4378 specified in the ARM ELF specs.
4379 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
4380 target of a BLX instruction specially.
4381 (Reloc_stub::stub_type_for_reloc): Ditto.
4382 (Relocate::relocate): Use symbolic names instead of numeric relocation
4383 codes to report error.
4384 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
4385 workaround.
4386 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
4387 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
4388 thumb2_blx_out_of_range.stdout
4389 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
4390 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
4391 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
4392 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
4393 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
4394 thumb2_blx_in_range, thumb2_blx_in_range.o,
4395 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
4396 thumb2_blx_out_of_range.o): New rules.
4397 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
4398 thumb2_blx_in_range and thumb2_blx_out_of_range.
4399 * testsuite/Makefile.in: Regenerate.
4400 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4401 * testsuite/thumb_blx_in_range.s: New file.
4402 * testsuite/thumb_blx_out_of_range.s: New file.
4403
b0193076
RÁE
44042010-03-22 Rafael Espindola <espindola@google.com>
4405
4406 * archive.cc (Should_include): Move to archive.h.
4407 (should_include_member): Make it a member of Archive.
4408 (Lib_group): New.
4409 (Add_lib_group_symbols): New.
4410 * archive.h: Include options.h.
4411 (Archive_member): Moved from Archive.
4412 (Should_include): Moved from archive.cc.
4413 (Lib_group): New.
4414 (Add_lib_group_symbols): New.
4415 * dynobj.cc (do_should_include_member): New.
4416 * dynobj.h (do_should_include_member): New.
4417 * gold.cc (queue_initial_tasks): Update call to queue.
4418 * main.cc (main): Print lib group stats.
4419 * object.cc (do_should_include_member): New.
4420 * object.h: Include archive.h.
4421 (Object::should_include_member): New.
4422 (Object::do_should_include_member): New.
4423 (Sized_relobj::do_should_include_member): New.
4424 * options.cc (General_options::parse_start_lib): New.
4425 (General_options::parse_end_lib): New.
4426 (Input_arguments::add_file): Handle lib groups.
4427 (Input_arguments::start_group): Check we are not in a lib.
4428 (Input_arguments::start_lib): New.
4429 (Input_arguments::end_lib): New.
4430 * options.h (General_options): Add start_lib and end_lib.
4431 (Input_argument::lib_): New.
4432 (Input_argument::lib): New.
4433 (Input_argument::is_lib): New.
4434 (Input_file_lib): New.
4435 (Input_arguments::in_lib_): New.
4436 (Input_arguments::in_lib): New.
4437 (Input_arguments::start_lib): New.
4438 (Input_arguments::end_lib_): New.
4439 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4440 in unused members as preempted.
4441 (Sized_pluginobj::do_should_include_member): New.
4442 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4443 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4444 return the blocker.
4445 (Read_symbols::do_whole_lib_group): New.
4446 (Read_symbols::do_lib_group): New.
4447 (Read_symbols::do_read_symbols): Handle lib groups.
4448 (Read_symbols::get_name): Handle lib groups.
4449 * readsyms.h (Read_symbols): Add an archive member pointer.
4450 (Read_symbols::do_whole_lib_group): New.
4451 (Read_symbols::do_lib_group): New.
4452 (Read_symbols::member_): New.
4453 * script.cc (read_input_script): Update call to queue_soon.
4454
d099120c
DK
44552010-03-19 Doug Kwan <dougkwan@google.com>
4456
4457 * arm.cc (Stub_table::Stub_table): Initialize new data members
4458 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4459 (Stub_table::add_reloc_stub): Assign stub offset and update
4460 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4461 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4462 New data members.
4463 (Stub_table::update_data_size_and_addralign): Use
4464 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4465 instead of going over all reloc stubs.
4466 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4467 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4468 Stringpool_template::offset_ to size of Stringpool_char.
4469 (Stringpool_template::new_key_offset): Remove code to initialize
4470 Stringpool_template::offset_.
4471 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4472 Stringpool_template::offset_ to zero.
4473
1aa37384
DK
44742010-03-15 Doug Kwan <dougkwan@google.com>
4475
4476 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4477 offset_.
4478 (Stringpool_template::new_key_offset): New method.
4479 (Stringpool_template::add_string): Assign offsets when adding new
4480 strings.
4481 (Stringpool_template::set_string_offsets): Do not set string offsets
4482 when not optimizing.
4483 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4484 member size_.
4485 (Chunked_vector::clear): Clear size_.
4486 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4487 (Chunked_vector::size): Return size_.
4488 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 4489 (Chunked_vector::size_): New data member.
1aa37384
DK
4490 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4491 (Stringpool_template::new_key_offset): New method declaration.
4492 (Stringpool_template::offset_): New data member.
4493
b672b057
RÁE
44942010-03-15 Rafael Espindola <espindola@google.com>
4495
4496 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4497 Add_symbols' constructor.
4498 * readsyms.h (Add_symbols): Remove the input_group member.
4499
b6848d3c
ILT
45002010-03-10 Ian Lance Taylor <iant@google.com>
4501
4502 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4503 target to ask whether a reference to a symbol requires a stack
4504 split.
4505 * target.h (Target::is_call_to_non_split): New function.
4506 (Target::do_is_call_to_non_split): Declare virtual function.
4507 * target.cc: Include "symtab.h".
4508 (Target::do_is_call_to_non_split): New function.
4509 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4510
a2a5469e
CC
45112010-03-10 Cary Coutant <ccoutant@google.com>
4512
4513 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4514 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4515 (File_read::open[2]): Add whole_file_view_ to list of views.
4516 (File_read::make_view): Remove test of whole_file_view_.
4517 (File_read::find_or_make_view): Create whole_file_view_ if
4518 necessary.
4519 (File_read::clear_views): Replace bool parameter with enum;
4520 adjust all callers. Don't delete views with permanent data;
4521 do delete cached views and views from archives if
4522 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4523 if clearing the corresponding view.
4524 * fileread.h (File_read::Clear_views_mode): New enum.
4525 (File_read::View::is_permanent_view): New method.
4526 (File_read::clear_views): Replace bool parameter
4527 with enum; adjust all callers.
4528 * options.h (General_options): Change keep_files_mapped option;
4529 add map_whole_files.
4530 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4531 releasing the file.
4532 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4533 the file.
4534
8861f32b
DM
45352010-03-10 David S. Miller <davem@davemloft.net>
4536
4537 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4538
d62d0f5f
ST
45392010-03-09 Sriraman Tallam <tmsriram@google.com>
4540
4541 * icf.cc (get_section_contents): Add '@' marker after processing the
4542 merge reloc.
4543
9177756d
DK
45442010-03-08 Doug Kwan <dougkwan@google.com>
4545
4546 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4547 due to a conversion warning.
4548 (Arm_relobj::update_output_local_symbol_count): Check for local
4549 symbol with unset output index.
4550
9e9e071b
ILT
45512010-03-05 Ian Lance Taylor <iant@google.com>
4552
4553 * options.h (class General_options): Add --spare-dynamic-tags.
4554 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4555 --spare-dynamic-tags.
4556
a81ee015
ILT
45572010-03-05 Ian Lance Taylor <iant@google.com>
4558
4559 * incremental.cc: Include "libiberty.h".
4560
44ec90b9
RO
45612010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4562
4563 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4564 function, is_info_ member.
4565 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4566 (Versions::Versions): Update caller.
4567 (Versions::define_base_version): Likewise.
4568 (Versions::add_def): Likewise.
4569
0897ed3b
ST
45702010-03-03 Sriraman Tallam <tmsriram@google.com>
4571
4572 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4573 (Scan::possible_function_pointer_reloc): New function.
4574 (Scan::local_reloc_may_be_function_pointer): Change to call
4575 possible_function_pointer_reloc.
4576 (Scan::global_reloc_may_be_function_pointer): Ditto.
4577 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4578 relocations in ".data.rel.ro._ZTV" section.
4579 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4580 * testsuite/icf_safe_so_test.cc: Ditto.
4581 * testsuite/icf_safe_test.cc: Ditto.
4582 * testsuite/icf_safe_test.sh: Ditto.
4583
d3bbad62
ILT
45842010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4585 Ian Lance Taylor <iant@google.com>
4586
4587 * target-reloc.h (relocate_section): Check the symbol table index
4588 for -1U before setting the local symbol index.
4589 (scan_relocatable_relocs): If copying the relocation, record that
4590 the local symbol is required.
4591 * object.h (Symbol_value::is_output_symtab_index_set): New
4592 function.
4593 (Symbol_value::may_be_discarded_from_output_symtab): New
4594 function.
4595 (Symbol_value::has_output_symtab_entry): New function.
4596 (Symbol_value::needs_output_symtab_entry): Remove.
4597 (Symbol_value::output_symtab_index): Make sure the symbol index is
4598 set.
4599 (Symbol_value::set_output_symtab_index): Make sure the symbol
4600 index is not set. Make sure the new index is valid.
4601 (Symbol_value::set_must_have_output_symtab_entry): New function.
4602 (Symbol_value::has_output_dynsym_entry): New function.
4603 (Symbol_value::set_output_dynsym_index): Make sure the new index
4604 is valid.
4605 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4606 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4607 local symbol if permitted.
4608 (Sized_relobj::do_finalize_local_symbols): Call
4609 is_output_symtab_index_set rather than needs_output_symtab_entry.
4610 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4611 rather than needs_output_symtab_entry. Call
4612 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4613 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4614 is_output_symtab_index_set rather than needs_output_symtab_entry.
4615 * testsuite/discard_locals_relocatable_test.c: New file.
4616 * testsuite/discard_locals_test.sh: Test -r.
4617 * testsuite/Makefile.am (check_DATA): Add
4618 discard_locals_relocatable_test1.syms,
4619 discard_local_relocatable_test2.syms.
4620 (MOSTLYCLEANFILES): Likewise. Also add
4621 discard_locals_relocatable_test1.lout and
4622 discard_locals_relocatable_test2.out.
4623 (discard_locals_relocatable_test1.syms): New target.
4624 (discard_locals_relocatable_test.o): New target.
4625 (discard_locals_relocatable_test1.out): New target.
4626 (discard_locals_relocatable_test2.syms): New target.
4627 (discard_locals_relocatable_test2.out): New target.
4628 (various): Add missing ../ld-new dependencies.
4629 * testsuite/Makefile.in: Rebuild.
4630
7e8ccf26
NC
46312010-03-03 Nick Clifton <nickc@redhat.com>
4632
4633 * po/fi.po: New Finnish translation.
4634
2a0ff005
DK
46352010-03-01 Doug Kwan <dougkwan@google.com>
4636
4637 * layout.cc (Layout::Layout): Force section types of .init_array*,
4638 .preinit_array* and .fini_array* sections.
4639 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4640 Fix check of return value of std::string::find.().
4641 (Output_section::Input_section_sort_compare::operator()): Remove
4642 comment about .init_array.
4643 (Output_section::Input_section_sort_init_fini_compare::operator()):
4644 New method.
4645 (Output_section::sort_attached_input_sections): Handle .init_array
4646 and .fini_array specially.
4647 * output.h (Output_section::Inut_section_sort_compare): Update
4648 comment.
4649 (Output_section::Input_section_sort_init_fini_compare): New struct.
4650
c3e4ae29
DK
46512010-02-26 Doug Kwan <dougkwan@google.com>
4652
4653 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4654 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4655 * testsuite/debug_msg.sh: Avoid matching source line number for
4656 use of global variable undef_int.
4657
2fd9ae7a
DK
46582010-02-26 Doug Kwan <dougkwan@google.com>
4659
4660 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4661 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4662 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4663 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4664 * options.cc (General_options::General_options): Initialize member
4665 fix_v4bx_.
4666 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
4667 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
4668 and rm_no_fix_v4bx.stdout
4669 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
4670 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
4671 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
4672 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
4673 and arm_no_fix_v4bx.
4674 * Makefile.in: Regenerate.
4675 * testsuite/arm_fix_v4bx.s: New file.
4676 * testsuite/arm_fix_v4bx.sh: Ditto.
4677
67ec7d0b
DK
46782010-02-24 Doug Kwan <dougkwan@google.com>
4679
4680 * arm.cc (Target_arm::got_section): Make the .got section the first
4681 non RELRO section in the data segment.
4682 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4683 suffixes of section names.
4684
10165461
DK
46852010-02-24 Doug Kwan <dougkwan@google.com>
4686
4687 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4688 flags and attributes merging if an input file is a binary file.
4689 * fileread.cc (Input_file::open): Record format of original file.
4690 * fileread.h (Input_file::Format): New enum type.
4691 (Input_file::Input_file): Initialize data member format_.
4692 (Input_file::format): New method definition.
4693 (Input_file::format_):: New data member.
4694
4a54abbb
DK
46952010-02-24 Doug Kwan <dougkwan@google.com>
4696
4697 * arm.cc (Arm_output_data_got): New class.
4698 (ARM_TCB_SIZE): New constant
4699 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4700 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4701 If user uses a script with a SECTIONS clause, issue only a warning
4702 for a misplaced EXIDX input section. Otherwise, issue an error.
4703 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4704 garbage collection.
4705 (Target_arm::got_mode_index_entry): Handle static linking.
4706 (Target_arm::Scan::local): Ditto.
4707 (Target_arm::Scan::global): Ditto.
4708 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
4709 all incorrectly implemented relocations.
e1df38aa 4710 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
4711 Arm_output_section::fix_exidx_coverage.
4712 * layout.cc (Layout::section_name_mapping): Remove trailing dots
4713 from ".ARM.exidx." and ".ARM.extab.".
4714
ca419a6f
ILT
47152010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4716
4717 * arm.cc (Target_arm::do_finalize_sections): Create attribute
4718 section if it does not already exist.
4719 * attributes.cc (Attributes_section_data::Attributes_section_data):
4720 Don't crash if size is zero.
4721
135b9c78
ILT
47222010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4723 Ian Lance Taylor <iant@google.com>
4724
4725 * gold.cc (queue_middle_tasks): If no input files were opened,
4726 exit.
4727 * workqueue.h (Task_function::Task_function): Assert that there is
4728 a blocker.
4729
bb0bfe4f
DK
47302010-02-22 Doug Kwan <dougkwan@google.com>
4731
4732 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
4733 * icf.cc (get_section_contents): Cast snprintf arguments to long long
4734 types to avoid warnings due to different uint64_t implementations
4735 on different hosts.
4736
2a2b6d42
DK
47372010-02-21 Doug Kwan <dougkwan@google.com>
4738
4739 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
4740 handling of the maximum backward branch offset.
4741 (Arm_relocate_functions::thumb_branch_common): Ditto.
4742 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
4743 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 4744 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
4745 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
4746 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
4747 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
4748 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
4749 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
4750 thumb_bl_out_of_range thumb_bl_out_of_range.o,
4751 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
4752 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
4753 thumb2_bl_out_of_range.o): New rules.
4754 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
4755 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
4756 thumb2_bl_out_of_range
4757 * testsuite/Makefile.in: Regenerate.
4758 * testsuite/arm_bl_in_range.s: New file.
4759 * testsuite/arm_bl_out_of_range.s: Ditto.
4760 * testsuite/arm_branch_in_range.sh: Ditto.
4761 * testsuite/arm_branch_range.t: Ditto.
4762 * testsuite/thumb2_branch_range.t: Ditto.
4763 * testsuite/thumb_bl_in_range.s: Ditto.
4764 * testsuite/thumb_bl_out_of_range.s: Ditto.
4765 * testsuite/thumb_branch_range.t: Ditto.
4766
b487ad64
ST
47672010-02-20 Sriraman Tallam <tmsriram@google.com>
4768
4769 * gc.h (gc_process_relocs): Change vectors to point to the new list.
4770 Add reloc offset information.
4771 * icf.cc (get_section_contents): Change iterators to point to the new
4772 vectors. Add reloc offset information to the contents.
4773 * icf.h (Icf::Sections_reachable_info): New typedef.
4774 (Icf::Sections_reachable_list): New typedef.
4775 (Icf::Offset_info): New typedef.
4776 (Icf::Reloc_info): New struct typedef.
4777 (Icf::Reloc_info_list): New typedef.
4778 (Icf::symbol_reloc_list): Delete method.
4779 (Icf::addend_reloc_list): Delete method.
4780 (Icf::section_reloc_list): Delete method.
4781 (Icf::reloc_info_list): New method.
4782 (Icf::reloc_info_list_): New member.
4783
f96accdf
DK
47842010-02-19 Doug Kwan <dougkwan@google.com>
4785
4786 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
4787 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
4788 * arm.cc (Arm_relocation_functions): New forward declaration.
4789 (Target_arm::Target_arm): Initialize new data members
4790 got_mod_index_offset_ and tls_base_symbol_defined_.
4791 (Target_arm::Relocate::relocate_tls): New method.
4792 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
4793 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
4794 New methods.
4795 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
4796 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
4797 (Target_arm::got_mod_index_offset_,
4798 Target_arm::tls_base_symbol_defined_): New data members.
4799 (Target_arm::Scan::local, Target::Scan::global,
4800 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
4801 relocations.
4802
c8761b9a
DK
48032010-02-18 Doug Kwan <dougkwan@google.com>
4804
4805 * arm.cc (Arm_relobj::find_linked_text_section): New method.
4806 (Arm_relobj::make_exidx_input_section): Pass section index of linked
4807 text section as a parameter becuase some broken tools may not set
4808 the link in section header.
4809 (Target_arm::has_got_section): New method.
4810 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
4811 without any mapping symbol as data only. Remove warning.
4812 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
4813 link in its section header, try to discover the link by inspecting the
4814 REL31 relocation at the beginning of the section.
4815 (Target_arm::Scan::check_non_pic): Report name of offending relocation
4816 in error message.
4817 (Target_arm::Scan::global): Treat any reference to the symbol
4818 _GLOBAL_OFFSET_TABLE_ as a GOT access.
4819
21bb3914
ST
48202010-02-12 Sriraman Tallam <tmsriram@google.com>
4821
4822 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
4823 (Scan::global_reloc_may_be_function_pointer): New function.
4824 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4825 (Scan::global_reloc_may_be_function_pointer): New function.
4826 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4827 (Scan::global_reloc_may_be_function_pointer): New function.
4828 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
4829 (Scan::global_reloc_may_be_function_pointer): New function.
4830 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
4831 (Scan::global_reloc_may_be_function_pointer): New function.
4832 (Scan::possible_function_pointer_reloc): New function.
4833 (Target_x86_64::can_check_for_function_pointers): New function.
4834 * gc.h (gc_process_relocs): Scan relocation types to determine if
4835 function pointers were taken for targets that support it.
4836 * icf.cc (Icf::find_identical_sections): Include functions for
4837 folding in safe ICF whose pointer is not taken.
4838 * icf.h (Secn_fptr_taken_set): New typedef.
4839 (fptr_section_id_): New member.
4840 (section_has_function_pointers): New function.
4841 (set_section_has_function_pointers): New function.
4842 (check_section_for_function_pointers): New function.
4843 * options.h: Fix comment for safe ICF option.
4844 * target.h (can_check_for_function_pointers): New function.
4845 * testsuite/Makefile.am: Add icf_safe_so_test test case.
4846 Modify icf_safe_test for X86-64.
4847 * testsuite/Makefile.in: Regenerate.
4848 * testsuite/icf_safe_so_test.cc: New file.
4849 * testsuite/icf_safe_so_test.sh: New file.
4850 * testsuite/icf_safe_test.cc (kept_func_3): New function.
4851 (main): Change to take pointer to function kept_func_3.
4852 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
4853 folding is done correctly for X86-64.
4854
0da6fa6c
DM
48552010-02-12 David S. Miller <davem@davemloft.net>
4856
4857 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
4858 is_symbolless parameter.
4859 (Output_reloc<SHT_REL>::is_symbolless): New.
4860 (Output_reloc<SHT_REL>::is_symbolless_): New.
4861 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
4862 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
4863 (Output_reloc<SHT_RELA>::is_symbolless): New.
4864 (Output_data_reloc::add_global): Handle is_symbolless.
4865 (Output_data_reloc::add_global_relative): Likewise.
4866 (Output_data_reloc::add_local): Likewise.
4867 (Output_data_reloc::add_local_relative): Likewise.
4868 (Output_data_reloc::add_symbolless_global_addend): New.
4869 (Output_data_reloc::add_symbolless_local_addend): New.
4870 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
4871 is_symbolless.
4872 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
4873 instead of ->is_relative_
4874 (Output_reloc::write): Likewise.
4875 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
4876 (Output_reloc::write_rel): Simplify.
4877
4878 * sparc.cc (Target_sparc::Scan::local): Use
4879 ->add_symbolless_local_addend as needed.
4880 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
4881 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
4882 based upon relocation offset.
4883
e4782e83
DK
48842010-02-11 Doug Kwan <dougkwan@google.com>
4885
4886 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
4887 (Target_arm::Scan::global): Ditto. Also remove a comment before the
4888 beginning of function.
4889 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
4890 and MOVT_ABS relocations. Those are non issued in scanning. Fix
4891 parameter is_32bit in calls to should_apply_static_reloc.
4892 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
4893 (check_DATA): Add arm_abs_global.stdout.
4894 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
4895 arm_abs_global.stdout): New rules.
4896 (MOSTLLYCLEANFILES): Add arm_abs_global
4897 * Makefile.in: Regenerate.
4898 * testsuite/arm_abs_global.s: New file.
4899 * testsuite/arm_abs_global.sh: Ditto.
4900 * testsuite/arm_abs_lib.s: Ditto.
4901
93ceb764
ILT
49022010-02-11 Ian Lance Taylor <iant@google.com>
4903
4904 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
4905 Read_relocs task.
4906 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
4907 Allocate_commons_task first.
4908 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
4909 task, rather than symtab_lock_.
4910 (Gc_process_relocs::~Gc_process_relocs): New function.
4911 (Gc_process_relocs::is_runnable): Check this_blocker_.
4912 (Gc_process_relocs::locks): Use next_blocker_ rather than
4913 blocker_.
4914 (Scan_relocs::~Scan_relocs): New function.
4915 (Scan_relocs::is_runnable): Check this_blocker_ rather than
4916 symtab_lock_.
4917 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
4918 next_blocker_.
4919 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
4920 fields. Add this_blocker_ and next_blocker_ fields. Adjust
4921 constructor accordingly.
4922 (class Gc_process_relocs): Likewise.
4923 (class Scan_relocs): Likewise.
4924 * common.h (class Allocate_commons_task): Remove symtab_lock_
4925 field, and corresponding constructor parameter.
4926 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4927 symtab_lock_.
4928 (Allocate_commons_task::locks): Likewise.
4929
114dfbe1
ILT
49302010-02-11 Ian Lance Taylor <iant@google.com>
4931
4932 * gold-threads.h (class Once): Define.
4933 (class Initialize_lock): Rewrite as child of Once.
4934 * gold-threads.cc (class Once_initialize): Define.
4935 (once_pointer_control): New static variable.
4936 (once_pointer, once_arg): New static variables.
4937 (c_run_once): New static function.
4938 (Once::Once, Once::run_once, Once::internal_run): New functions.
4939 (class Initialize_lock_once): Remove.
4940 (initialize_lock_control): Remove.
4941 (initialize_lock_pointer): Remove.
4942 (initialize_lock_once): Remove.
4943 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4944 (Initialize_lock::initialize): Rewrite.
4945 (Initialize_lock::do_run_once): New function.
4946 * archive.cc (Archive::interpret_header): Only clear name if it is
4947 not already empty.
4948 * fileread.cc: Include "gold-threads.h"
4949 (file_counts_lock): New static variable.
4950 (file_counts_initialize_lock): Likewise.
4951 (File_read::release): Only increment counts when using --stats.
4952 Use a lock around the increment.
4953 * parameters.cc (class Set_parameters_target_once): Define.
4954 (set_parameters_target_once): New static variable.
4955 (Parameters::Parameters): Move here from parameters.h.
4956 (Parameters::set_target): Rewrite.
4957 (Parameters::set_target_once): New function.
4958 (Parameters::clear_target): Move here and rewrite.
4959 * parameters.h (class Parameters): Update declarations. Add
4960 set_parameters_target_once_ field.
4961 (Parameters::Parameters): Move to parameters.cc.
4962 (Parameters::clear_target): Likewise.
4963 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4964 task.
4965 (Start_group::~Start_group): New function.
4966 (Start_group::is_runnable): New function.
4967 (Start_group::locks, Start_group::run): New functions.
4968 (Finish_group::run): Change saw_undefined to size_t.
4969 * readsyms.h (class Start_group): Define.
4970 (class Finish_group): Change saw_undefined_ field to size_t.
4971 (Finish_group::Finish_group): Remove saw_undefined and
4972 this_blocker parameters. Change all callers.
4973 (Finish_group::set_saw_undefined): New function.
4974 (Finish_group::set_blocker): New function.
4975 * symtab.h (class Symbol_table): Change saw_undefined to return
4976 size_t. Change saw_undefined_ field to size_t.
4977 * target-select.cc (Set_target_once::do_run_once): New function.
4978 (Target_selector::Target_selector): Initialize set_target_once_
4979 field. Don't initialize lock_ and initialize_lock_ fields.
4980 (Target_selector::instantiate_target): Rewrite.
4981 (Target_selector::set_target): New function.
4982 * target-select.h (class Set_target_once): Define.
4983 (class Target_selector): Update declarations. Make
4984 Set_target_once a friend. Remove lock_ and initialize_lock_
4985 fields. Add set_target_once_ field.
4986
fa17a3f4
ILT
49872010-02-10 Ian Lance Taylor <iant@google.com>
4988
4989 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4990 queueing any tasks.
4991 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4992 (queue_middle_tasks): Add all blockers before queueing any tasks.
4993 (queue_final_tasks): Likewise.
4994 * token.h (Task_token::add_blockers): New function.
4995 * object.h (Input_objects::number_of_relobjs): New function.
4996
c7177d31
ILT
49972010-02-10 Ian Lance Taylor <iant@google.com>
4998
5de0e392
ILT
4999 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5000 shared, not if not position independent.
5001 * x86_64.cc (Relocate::relocate_tls): Likewise.
5002 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5003 (tls_pie_pic_test): New target.
5004 * testsuite/Makefile.in: Rebuild.
5005
c7177d31
ILT
5006 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5007 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5008 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5009 * testsuite/Makefile.in: Rebuild.
5010
684b268a
DM
50112010-02-09 David S. Miller <davem@davemloft.net>
5012
5013 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5014 R_SPARC_RELATIVE using ->add_local_relative().
5015 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5016
612a8d3d
DM
5017 * output.h (Output_data_dynamic::add_section_size): New method
5018 that takes two Output_data objects.
5019 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5020 entry param. Handle it in initializers.
5021 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5022 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5023 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5024 arg.
5025 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5026 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5027 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5028 for dynrel_includes_plt.
5029 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5030 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5031 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5032 before .rela.plt
5033 (Target_sparc::do_finalize_sections): Update to pass true for
5034 dynrel_includes_plt.
5035 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5036 output before .rela.plt
5037 (Target_powerpc::do_finalize_sections): Update to pass true for
5038 dynrel_includes_plt when 32-bit.
5039
cb1be87e
DK
50402010-02-08 Doug Kwan <dougkwan@google.com>
5041
5042 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5043 method.
5044 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5045 Arm_relobj::scan_section_for_cortex_a8_stubs,
5046 Arm_relobj::do_relocation_section): Instead of calling
5047 Output_section::output_address, use faster
5048 Arm_relobj::simple_input_section_output_address.
5049
705b5121
DM
50502010-02-08 David S. Miller <davem@davemloft.net>
5051
5052 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5053 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5054 relocation helper function.
5055
024c4466
DM
5056 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5057 just like R_SPARC_GOT{10,13,22}.
5058 (Target_sparc::Scan::local): Likewise.
5059 (Target_sparc::Relocate:relocate): Likewise.
5060
9109c078
ILT
50612010-02-06 Ian Lance Taylor <iant@google.com>
5062
5063 * configure.ac: Rewrite targetobjs duplicate removal code to use
5064 only shell constructs.
5065 * configure: Rebuild.
5066
cf846138
DK
50672010-02-05 Doug Kwan <dougkwan@google.com>
5068
5069 PR 11247
5070 * arm.cc (Arm_relobj::section_is_scannable): New method.
5071 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5072 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5073
6cfaf60b
DK
50742010-02-04 Doug Kwan <dougkwan@google.com>
5075
5076 PR 11247
5077 * arm-reloc-property.cc (cstdio): Include.
5078 * configure.ac (targetobjs): Remove duplicates.
5079 * configure: Regenerate.
5080 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5081 big and little endian version for a given address size.
5082
5c57f1be
DK
50832010-02-03 Doug Kwan <dougkwan@google.com>
5084
5085 * arm-reloc-property.cc
5086 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5087 definition.
5088 * arm-reloc-property.h
5089 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5090 New method definition.
5091 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5092 declaration.
5093 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5094 overflow to N.
5095 (GOT_PREL): Change implemented to Y.
5096 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5097 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5098 (Arm_relocate_functions::movw_abs_nc): Remove method.
5099 (Arm_relocate_functions::movt_abs): Ditto.
5100 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5101 (Arm_relocate_functions::thm_movt_abs): Ditto.
5102 (Arm_relocate_functions::movw_rel_nc): Ditto.
5103 (Arm_relocate_functions::movw_rel): Ditto.
5104 (Arm_relocate_functions::movt_rel): Ditto.
5105 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5106 (Arm_relocate_functions:thm_movw_rel): Ditto.
5107 (Arm_relocate_functions:thm_movt_rel): Ditto.
5108 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5109 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5110 New method definitions.
5111 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5112 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5113 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5114 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5115 (Target_arm::Relocate::relocate): Check for non-static or
5116 unimplemented relocation code and exit early. Change calls to
5117 Target_arm::reloc_uses_thumb_bit and
5118 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5119 instead. Refactor code to handle similar relocations to increase
5120 code sharing. Remove check for unsupported relocation code in switch
5121 statement.
5122 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5123 relocation property table to find out size. Change error message to
5124 print out the name of a relocation code instead of the numeric value.
5125 (Target_arm::scan_reloc_for_stub): Use relocation property table
5126 instead of calling Target_arm::reloc_uses_thumb_bit().
5127
218c5831
DK
51282010-02-02 Doug Kwan <dougkwan@google.com>
5129
5130 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5131 types of relaxed input section.
5132
0d31c79d
DK
51332010-02-02 Doug Kwan <dougkwan@google.com>
5134
5135 * Makefile.am (HFILES): Add arm-reloc-property.h.
5136 (DEFFILES): New.
5137 (TARGETSOURCES): Add arm-reloc-property.cc
5138 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5139 (libgold_a_SOURCES): $(DEFFILES)
5140 * Makefile.in: Regenerate.
5141 * arm-reloc-property.cc: New file.
5142 * arm-reloc-property.h: New file.
5143 * arm-reloc.def: New file.
5144 * arm.cc: Update comments.
5145 (arm-reloc-property.h): New included header.
5146 (arm_reloc_property_table): New global variable.
5147 (Target_arm::do_select_as_default_target): New method definition.
5148 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5149 arm-reloc-property to targ_extra_obj.
5150 * parameters.cc (set_parameters_target): Call
5151 Target::select_as_default_target().
5152 * target.h (Target::select_as_default_target): New method definition.
5153 (Target::do_select_as_default_target): Same.
5154
546c7457
DK
51552010-02-01 Doug Kwan <dougkwan@google.com>
5156
5157 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5158 first_output_text_section_.
5159 (Arm_exidx_fixup::first_output_text_section): New method definition.
5160 (Arm_exidx_fixup::first_output_text_section_): New data member.
5161 (Arm_exidx_fixup::process_exidx_section): Record the first text
5162 output section seen.
5163 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5164 and entsize in output section header.
5165
11b861d5
DK
51662010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5167
5168 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5169 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5170 (Arm_relocate_functions::thm_alu11): New Method.
5171 (Arm_relocate_functions::thm_pc8): New Method.
5172 (Arm_relocate_functions::thm_pc12): New Method.
5173 (Target_arm::Scan::local): Handle the relocations.
5174 (Target_arm::Scan::global): Likewise.
5175 (Target_arm::Relocate::relocate): Likewise.
5176 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5177
c9a2c125
DK
51782010-01-29 Doug Kwan <dougkwan@google.com>
5179
5180 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5181 of relocation types as ld.
5182
1521477a
DK
51832010-01-29 Doug Kwan <dougkwan@google.com>
5184
5185 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5186 to public.
5187 (Arm_relocate_functions::thumb_branch_common): Ditto.
5188 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5189 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5190 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5191 Arm_relocate_functions::jump24): Remove.
5192 (Target_arm::Relocate::relocate): Adjust code to call
5193 Arm_relocation_functions::arm_branch_common and
5194 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 5195 wrappers. Merge switch-cases together to reduce source code size.
1521477a 5196
e7eca48c
DK
51972010-01-29 Doug Kwan <dougkwan@google.com>
5198
5199 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5200 output_local_symbol_count_needs_update_.
5201 (Arm_relobj::output_local_symbol_count_needs_update,
5202 Arm_relobj::set_output_local_symbol_count_needs_update,
5203 Arm_relobj::update_output_local_symbol_count): New methods.
5204 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5205 member.
5206 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5207 of pointed function as in a R_ARM_PREL31 relocation.
5208 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5209 for output local symbol count updating.
5210 (Target_arm::do_relax): Update output local symbol counts in objects
5211 if necessary.
5212 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5213
02961d7e
ILT
52142010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5215
5216 * arm.cc: Added support for the ARM relocations:
5217 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5218 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5219 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5220 movw_prel_nc).
5221 (Arm_relocate_functions::movw_rel): New method.
5222 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5223 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5224 thm_movw_prel_nc).
5225 (Arm_relocate_functions::thm_movw_rel): New method.
5226 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5227 thm_movt_prel).
5228 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5229 relocations.
5230 (Target_arm::Scan::global): Likewise.
5231 (Target_arm::Relocate::relocate): Likewise.
5232 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5233 Likewise.
5234
b10d2873
ILT
52352010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5236
5237 * arm.cc: Added support for ARM group relocations.
5238 (Target_arm::reloc_needs_sym_origin): New method.
5239 (Arm_relocate_functions::calc_grp_kn): New method.
5240 (Arm_relocate_functions::calc_grp_residual): New method.
5241 (Arm_relocate_functions::calc_grp_gn): New method.
5242 (Arm_relocate_functions::arm_grp_alu): New Method.
5243 (Arm_relocate_functions::arm_grp_ldr): New Method.
5244 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5245 (Arm_relocate_functions::arm_grp_ldc): New Method.
5246 (Target_arm::Scan::local): Handle the ARM group relocations.
5247 (Target_arm::Scan::global): Likewise.
5248 (Target_arm::Relocate::relocate): Likewise.
5249 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5250 Likewise.
5251
2b328d4e
DK
52522010-01-26 Doug Kwan <dougkwan@google.com>
5253
5254 * arm.cc (set): Include.
5255 (class Arm_exidx_fixup): Change type of last_input_section_ to const
5256 pointer type.
5257 (Arm_output_section::Text_section_list): New type.
5258 (Arm_output_section::append_text_sections_to_list): New method.
5259 (Arm_output_section::fix_exidx_coverage): Ditto.
5260 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
5261 (Arm_relobj::convert_input_section_to_relaxed_section): Use
5262 Relobj::set_section_offset() instead of
5263 Sized_relobj::invalidate_section_offset().
5264 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
5265 parameter for section headers. Ignore relocation sections for
5266 unallocated sections and EXIDX sections.
5267 (Target_arm::fix_exidx_coverage): New method.
5268 (Target_arm::output_section_address_less_than): New type.
5269 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
5270 linked text section instead of the EXIDX section.
5271 (Arm_output_section::create_stub_group): Add an assertion to check
5272 that this is not an EXIDX output section.
5273 (Arm_output_section::append_text_sections_to_list): New method.
5274 (Arm_output_section::fix_exidx_coverage): Ditto.
5275 (Arm_relobj::scan_sections_for_stubs): Adjust call to
5276 Arm_relobj::section_needs_reloc_stub_scanning.
5277 (Target_arm::do_relax): Fix EXIDX output section coverage in the
5278 first pass.
5279 (Target_arm::fix_exidx_coverage): New method.
5280 * object.h (Relobj::set_output_section): New method.
5281 (Sized_relobj::invalidate_section_offset): Remove method.
5282 (Sized_relobj::do_invalidate_section_offset): Remove method.
5283 (Sized_relobj::do_set_section_offset): Handle offset value -1.
5284
c7f3c371
DK
52852010-01-25 Doug Kwan <dougkwan@google.com>
5286
5287 * arm.cc (Arm_exidx_merged_section::do_output_offset):
5288 Fix warning due to signed and unsigned comparison on a 32-bit host.
5289
8923b24c
DK
52902010-01-22 Doug Kwan <dougkwan@google.com>
5291
5292 * arm.cc (Target_arm::do_relax): Record an output section for section
5293 offset adjustment it contains any stub table that has changed.
5294 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
5295 offsets in an output section if necessary.
5296 * output.cc (Output_section::Output_section): Initialize
5297 section_offsets_need_adjustments_.
5298 (Output_section::add_input_section_for_script): Renamed to
5299 Output_section::add_simple_input_section.
5300 (Output_section::save_states): Add a comment.
5301 (Output_section::discard_states): New method defintion.
5302 (Output_section::adjust_section_offsets): Same.
5303 * output.h (Output_section::add_input_section_for_script): Renamed to
5304 Output_section::add_simple_input_section.
5305 (Output_section::discard_states): New method declaration.
5306 (Output_section::adjust_section_offsets): Same.
5307 (Output_section::section_offsets_need_adjustment,
5308 Output_section::set_section_offsets_need_adjustment): New method
5309 definitions.
5310 (Output_section::section_offsets_need_adjustment_): New data member.
5311 * script-sections.cc
5312 (Output_section_element_input::set_section_address): Adjust code for
5313 renaming of Output_section::add_input_section_for_script.
5314 (Orphan_output_section::set_section_address): Same.
5315
9b2fd367
DK
53162010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5317
5318 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
5319 Fix_v4bx enum values .
5320 * gold/options.h (General_options): New option definitions.
5321 (General_options::fix_v4bx): New method.
5322 (General_options::Fix_v4bx): New enum.
5323 * gold/options.cc (General_options::parse_fix_v4bx): New method.
5324 (General_options::parse_fix_v4bx_interworking): New method.
5325
80d0d023
DK
53262010-01-22 Doug Kwan <dougkwan@google.com>
5327
5328 * arm.cc (Arm_exidx_fixup): New class.
5329
af2cdeae
DK
53302010-01-21 Doug Kwan <dougkwan@google.com>
5331
5332 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
5333 classes.
5334 (Arm_exidx_section_offset_map): New type.
5335
993d07c1
DK
53362010-01-21 Doug Kwan <dougkwan@google.com>
5337
5338 * arm.cc (Arm_exidx_input_section): New class.
5339 (Arm_relobj::exidx_input_section_by_link,
5340 Arm_relobj::exidx_input_section_by_shndx,
5341 Arm_relobj::make_exidx_input_section): New methods.
5342 (read_arm_attributes_section): Remove.
5343 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
5344 information about them.
5345 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
5346 to here.
5347
5ac169d4
DK
53482010-01-20 Doug Kwan <dougkwan@google.com>
5349
5350 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
5351 Input_section_specifier to Section_id.
5352 (Target_arm::new_arm_input_section: Adjust code for change of key
5353 type.
5354 (Target_arm::find_arm_input_section): Ditto.
5355 * gc.h (object.h): Include for Section_id nand Section_id_hash.
5356 (Section_id): Remove.
5357 (Garbage_collection::Section_id_hash): Remove.
5358 * icf.h (object.h): Include for Section_id nand Section_id_hash.
5359 (Section_id): Remove.
5360 (Icf::Section_id_hash): Remove.
5361 * object.h (Section_id, Const_section_id, Section_id_hash,
5362 Const_section_id_hash): New type definitions.
5363 * output.cc (Output_section::add_relaxed_input_section): Change to
5364 use Const_section_id instead of Input_section_specifier as key type.
5365 (Output_section::add_merge_input_section): Ditto.
5366 (Output_section::build_relaxation_map): Change to use Section_id
5367 instead of Input_section_specifier as key type.
5368 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5369 Ditto.
5370 (Output_section::convert_input_sections_to_relaxed_sections): Change
5371 to use Const_section_id instead of Input_section_specifier as key type.
5372 (Output_section::find_merge_section): Ditto.
5373 (Output_section::find_relaxed_input_section): Ditto.
5374 * output.h (Input_section_specifier): Remove class.
5375 (Output_section::Output_section_data_by_input_section_map): Change
5376 key type to Const_section_id.
5377 (Output_section::Output_relaxed_input_section_by_input_section_map):
5378 Ditto.
5379 (Output_section::Relaxation_map): Change key type to Section_id.
5380
a2162063
ILT
53812010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5382
5383 * gold/arm.cc: Added support for R_ARM_V4BX relocation
5384 (class Arm_v4bx_stub): New class.
5385 (DEF_STUBS): Updated definition to support v4_veneer_bx.
5386 (Stub_factory::make_arm_v4bx_stub): New method.
5387 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
5388 (Stub_table::empty): Handle v4bx stubs.
5389 (Stub_table::add_arm_v4bx_stub): New method.
5390 (Stub_table::find_arm_v4bx_stub): New method.
5391 (Arm_relocate_functions::v4bx): New method.
5392 (Target_arm::fix_v4bx): New method.
5393 (Target_arm::Target_arm): Handle R_ARM_V4BX.
5394 (Stub_table::relocate_stubs): Likewise.
5395 (Stub_table::do_write): Likewise.
5396 (Stub_table::update_data_size_and_addralign): Likewise.
5397 (Stub_table::finalize_stubs): Likewise.
5398 (Target_arm::Scan::local): Likewise.
5399 (Target_arm::Scan::global): Likewise.
5400 (Target_arm::do_finalize_sections): Likewise.
5401 (Target_arm::Relocate::relocate): Likewise.
5402 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5403 Likewise.
5404 (Target_arm::scan_reloc_for_stub): Likewise.
5405 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5406
5696ab0b
ILT
54072010-01-19 Ian Lance Taylor <iant@google.com>
5408
5409 * output.cc (Output_section_headers::do_sized_write): Write large
5410 segment count to sh_info field.
5411 (Output_file_header::do_sized_write): For large segment count,
5412 write PN_XNUM to e_phnum field.
5413
800d0f56
ILT
54142010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5415
5416 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5417 (Arm_relocate_functions::thm_jump8): New function.
5418 (Arm_relocate_functions::thm_jump11): New function.
5419 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5420 R_ARM_THM_JUMP11.
5421 (Target_arm::Scan::global): Likewise.
5422 (Target_arm::Relocate::relocate): Likewise.
5423 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5424 Likewise.
5425
41263c05
DK
54262010-01-14 Doug Kwan <dougkwan@google.com>
5427
5428 * arm.cc (map, utility): Include headers.
5429 (Target_arm::apply_cortex_a8_workaround): New method.
5430 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5431 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5432 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5433 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5434 the --[no-]fix-cortex-a8 command line options.
5435 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5436 (Target_arm::relocate_stub): Use addend in instruction template.
5437 * options.h (DEFINE_bool): Set the user-set flag.
5438 (General_options): Add --[no-]-fix-cortex options.
5439 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 5440 : Update fast look-up map after conversion.
41263c05 5441
459e9b03
ST
54422010-01-14 Sriraman Tallam <tmsriram@google.com>
5443
5444 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5445 in the first pass of do_layout.
5446
b521dfe4
DK
54472010-01-13 Doug Kwan <dougkwan@google.com>
5448
5449 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5450 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5451 apparent compiler problem of not folding static constant integral
5452 data members of elfcpp::Elf_sizes<32>.
5453
44272192
DK
54542010-01-13 Doug Kwan <dougkwan@google.com>
5455
5456 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5457 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5458 Arm_relobj::scan_section_for_cortex_a8_erratum,
5459 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5460 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5461 sections to scan for relocation stubs into a new method
5462 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5463 relocation and Cortex-A8 stub scanning.
5464 (Target_arm::do_relax): Force stubs to be after stubbed sections
5465 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 5466 the beginning of a new relaxation pass. Update a comment.
44272192
DK
5467 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5468
44b71ece
ILT
54692010-01-12 Ian Lance Taylor <iant@google.com>
5470
5471 * target-reloc.h (visibility_error): New inline function.
5472 (relocate_section): Call visibility_error.
5473 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5474 (MOSTLYCLEANFILES): Likewise.
5475 (protected_4_pic.o, protected_3.err): New targets.
5476 * testsuite/protected_4.cc: New file.
5477
a120bc7f
DK
54782010-01-12 Doug Kwan <dougkwan@google.com>
5479
5480 * arm.cc (Cortex_a8_reloc): New class.
5481 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5482 and cortex_a8_relocs_info_.
5483 (Target_arm::fix_cortex_a8): New method definition.
5484 (Target_arm::Cortex_a8_relocs_info): New type.
5485 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5486 New data member declarations.
5487 (Target_arm::scan_reloc_for_stub): Record information about
5488 relocations for THUMB branches that might be exempted from the
5489 Cortex-A8 workaround.
5490 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5491 at the beginning of a relaxation pass.
5492
20138696
DK
54932010-01-12 Doug Kwan <dougkwan@google.com>
5494
5495 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5496 (Arm_relobj::Mapping_symbol_position,
5497 Arm_reloj::Mapping_symbol_position_less,
5498 Arm_relobj::Mapping_symbols_info): New types.
5499 (Target_arm::is_mapping_symbol_name): New method definition.
5500 (Arm_relobj::do_count_local_symbols): Save information about mapping
5501 symbols.
5502
089d69dc
DK
55032010-01-11 Doug Kwan <dougkwan@google.com>
5504
5505 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5506 Arm_relocate_functions::thumb32_branch_upper,
5507 Arm_relocate_functions::thumb32_branch_lower,
5508 Arm_relocate_functions::thumb32_cond_branch_offset,
5509 Arm_relocate_functions::thumb32_cond_branch_upper,
5510 Arm_relocate_functions::thumb32_cond_branch_lower,
5511 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5512 branch offset encoding.
5513 (Arm_relocate_functions::thumb_branch_common): Use new branch
5514 offset encoding methods to avoid code duplication.
5515 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5516 (Stub_addend_reader::operator()): Use new branch encoding method
5517 to avoid code duplication.
5518
99e5bff2
DK
55192010-01-11 Doug Kwan <dougkwan@google.com>
5520
5521 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5522 (Target_arm::do_finalize_sections): Define special EXIDX section
5523 symbols only if referenced.
5524 * gc.h (Garbage_collection::add_reference): New method.
5525 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5526 code duplication.
5527
98e090bd
ILT
55282010-01-11 Ian Lance Taylor <iant@google.com>
5529
d0a91bd8
ILT
5530 * script.cc (Version_script_info::build_expression_list_lookup):
5531 Change complaing about duplicate wildcard match from error to
5532 warning.
5533
98e090bd
ILT
5534 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5535 of 2009-12-30.
5536 (Version_script_info::Version_script_info): Initialize globs_,
5537 default_version_, default_is_global_, and exact_. Don't
5538 initialize globals_ or locals_.
5539 (Version_script_info::build_lookup_tables): Build local symbols
5540 first.
5541 (Version_script_info::unquote): New function.
5542 (Version_script_info::add_exact_match): New function.
5543 (Version_script_info::build_expression_list_lookup): Remove lookup
5544 parameter. Add is_global parameter. Change all callers. Handle
5545 wildcard pattern specially. Unquote pattern. Call
5546 add_exact_match.
5547 (Version_script_info::get_name_to_match): New function.
5548 (Version_script_info::get_symbol_version): New function.
5549 (Version_script_info::get_symbol_version_helper): Remove.
5550 (Version_script_info::check_unmatched_names): Call unquote.
5551 * script.h (class Version_script_info): Change get_symbol_version
5552 to be non-inline and add is_global parameter; change all callers.
5553 Rewrite symbol_is_local. Update declarations. Define struct
5554 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5555 Remove globals_ and locals_ members. Add exact_, globs_,
5556 default_version_, is_global_.
5557 (Version_script_info::Glob): Remove pattern, add expression and
5558 is_global. Update constructor. Change all callers.
5559 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5560 default version.
5561 (Versions::symbol_section_contents): If a symbol is undefined, or
5562 defined in a dynamic object, set the version index to
5563 VER_NDX_LOCAL.
5564 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5565 symbol_is_local.
5566 (Symbol_table::add_from_pluginobj): Likewise.
5567 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5568
d56962d3
DK
55692010-01-11 Doug Kwan <dougkwan@google.com>
5570
5571 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5572 (incremental_dump_LDADD): Add linking option for libintl.
5573 * Makefile.in: Regenerate.
5574
94e6ee91
L
55752010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5576
5577 PR gold/11144
5578 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5579 instead of -Ds.
5580 * testsuite/Makefile.in: Regenerated.
5581
e96c574b
DK
55822010-01-10 Doug Kwan <dougkwan@google.com>
5583
5584 * options.h (DEFINE_var): Use parentheses around argument varname__
5585 in macro body to avoid any unintended subsequent substitutions.
5586
7198066b
ILT
55872010-01-10 Ian Lance Taylor <iant@google.com>
5588
ba4d53bf
ILT
5589 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5590 candidates before doing symbol resolution.
5591
7198066b
ILT
5592 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5593 ODR candidates if only one is weak.
5594
a2beed37
ILT
55952010-01-08 Ian Lance Taylor <iant@google.com>
5596
5597 * script.cc (Version_script_info::build_expression_list_lookup):
5598 Don't warn about ambiguous version, just record the ambiguity.
5599 (Version_script_info::get_symbol_version_helper): Give error if
5600 version is ambiguous.
5601
2fb7225c
DK
56022010-01-08 Doug Kwan <dougkwan@google.com>
5603
5604 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5605 prev_data_size_ and prev_addralign_. Remove initializer for
5606 deleted data member has_been_changed_.
5607 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5608 to determine if the table is empty.
5609 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5610 Remove.
5611 (Stub_table::add_reloc_stub): Define method in class definition
5612 instead of just declaring it there.
5613 (Stub_table::add_cortex_a8_stub): New method definition.
5614 (Stub_table::update_data_size_and_addralign): Ditto.
5615 (Stub_table::finalize_stubs): Ditto.
5616 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5617 (Stub_table::do_addralign_): Return address alignment in the
5618 (Stub_table::do_reset_address_and_file_offset): Define method in
5619 class definition instead of declaring it there. Set current data
5620 size to be the data size of the previous pass.
5621 (Stub_table::set_final_data_size): Use current data size as the
5622 final data size.
5623 (Stub_table::relocate_stub): Change parameter type of stub from
5624 Reloc_stub pointer to Stub pointer.
5625 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5626 (Stub_table::Cortex_a8_stub_list): New typedef.
5627 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5628 Stub_table::prev_addralign_): New data member.
5629 (Arm_relobj::Arm_relobj): Initialize data member
5630 section_has_cortex_a8_workaround_.
5631 (Arm_relobj::section_has_cortex_a8_workaround,
5632 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5633 definitions.
5634 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5635 declarations.
5636 (Target_arm::relocate_stub): Change parameter type of stub from
5637 Reloc_stub pointer to Stub pointer.
5638 (Insn_template::size, Insn_template::alignment): Handle
5639 THUMB16_SPECIAL_TYPE.
5640 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5641 Stub_table::update_data_size_and_addralign,
5642 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5643 definitions.
5644 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5645 (Stub_table::do_write): Ditto.
5646 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5647
880cd20d
ILT
56482010-01-08 Ian Lance Taylor <iant@google.com>
5649
5650 PR 11108
5651 * symtab.h (class Symbol): Remove fields is_target_special_ and
5652 has_plt_offset_. Add field is_defined_in_discarded_section_.
5653 (Symbol::is_defined_in_discarded_section): New function.
5654 (Symbol::set_is_defined_in_discarded_section): New function.
5655 (Symbol::has_plt_offset): Rewrite.
5656 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5657 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5658 Don't initialize is_target_special_ or has_plt_offset_.
5659 Initialize is_defined_in_discarded_section_.
5660 (Symbol_table::add_from_relobj): If appropriate, set
5661 is_defined_in_discarded_section.
5662 * resolve.cc (Symbol::override_base_with_special): Don't test
5663 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5664 * target-reloc.h (relocate_section): Do special handling for
5665 symbols defined in discarded sections for global symbols as well
5666 as local symbols.
5667
2703e3eb
ILT
56682010-01-08 Ian Lance Taylor <iant@google.com>
5669
5670 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
5671 the SHT_SYMTAB case.
5672
339d40a3
ILT
56732010-01-08 Ian Lance Taylor <iant@google.com>
5674
5675 * object.cc (Sized_relobj::do_layout): Don't get confused if
5676 layout_eh_frame returns NULL.
5677
abecea76
ILT
56782010-01-08 Ian Lance Taylor <iant@google.com>
5679
5680 PR 11084
5681 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
5682 dynamic symbol table, use the normal symbol table.
5683 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5684 symbol table.
5685
6b7dd3f3
ILT
56862010-01-08 Ian Lance Taylor <iant@google.com>
5687
5688 PR 11072
5689 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5690 sections.
5691
36c50e63
L
56922010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5693
5694 * version.cc (print_version): Change to "Copyright 2010".
5695
e291e7b9
ILT
56962010-01-08 Ian Lance Taylor <iant@google.com>
5697
5698 PR 10287
5699 PR 11063
5700 * i386.cc (class Target_i386): Change return type of plt_section
5701 to be non-const.
5702 (class Output_data_plt_i386): Add tls_desc_rel_ field.
5703 (Output_data_plt_i386::Output_data_plt_i386): Initialize
5704 tls_desc_rel_ field.
5705 (Output_data_plt_i386::rel_tls_desc): New function.
5706 (Target_i386::rel_tls_desc_section): New function.
5707 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
5708 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
5709 R_386_TLS_DESC reloc in rel_tls_desc_section.
5710 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
5711 Define struct Tlsdesc_info.
5712 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
5713 (Target_x86_64::do_reloc_symbol_index): New function.
5714 (Target_x86_64::add_tlsdesc_info): New function.
5715 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
5716 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
5717 tlsdesc_rel_ field.
5718 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
5719 all callers.
5720 (Output_data_plt_x86_64::rela_tlsdesc): New function.
5721 (Target_x86_64::rela_tlsdesc_section): New function.
5722 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
5723 handling.
5724 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
5725 (Target_x86_64::do_reloc_addend): New function.
5726 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
5727 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
5728 declarations. Define TARGET_CODE. Add arg field to u1_ union.
5729 (Output_reloc::type): New function.
5730 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
5731 (Output_reloc::is_target_specific): New function.
5732 (Output_reloc::target_arg): New function.
5733 (class Output_reloc) [SHT_RELA]: Add four new constructors for
5734 absolute relocs and target specific relocs.
5735 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
5736 add_target_specific.
5737 (class Output_data_reloc) [SHT_RELA]: Likewise.
5738 * output.cc (Output_reloc::Output_reloc): Add four new versions
5739 for absolute relocs and target specific relocs.
5740 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
5741 (Output_reloc::get_symbol_index): Likewise.
5742 (Output_reloc::local_section_offset): Check that local_sym_index_
5743 is not TARGET_CODE or 0.
5744 (Output_reloc::symbol_value): Likewise.
5745 (Output_reloc::write) [SHT_RELA]: Call target for target specific
5746 reloc.
5747 * target.h (class Target): Add reloc_symbol_index and reloc_addend
5748 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
5749 functions.
5750 * layout.cc (add_target_dynamic_tags): Use output section for
5751 DT_PLTRELSZ and DT_JMPREL.
5752
3a44184e
ILT
57532010-01-07 Ian Lance Taylor <iant@google.com>
5754
5755 PR 11061
5756 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
5757 function.
5758 (class Output_data_reloc_generic): Define.
5759 (class Output_data_reloc_base): Change base class to
5760 Output_data_reloc_generic. Change add() method to call
5761 bump_relative_reloc_count for a relative reloc. Remove
5762 sort_relocs_ field.
5763 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
5764 to sort_relocs().
5765 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
5766 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
5767 appropriate.
5768 * layout.h (class Layout): Update declaration.
5769
ea715a34
ILT
57702010-01-07 Ian Lance Taylor <iant@google.com>
5771
5772 * output.h (class Output_data): Add const version of
5773 output_section and do_output_section.
5774 (class Output_section_data): Add const version of
5775 do_output_section.
5776 (class Output_section): Likewise.
5777 * layout.cc (Layout::add_target_dynamic_tags): New function.
5778 * layout.h (class Layout): Update declarations.
5779 * arm.cc (Target_arm::do_finalize_sections): Use
5780 add_target_dynamic_tags.
5781 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5782 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5783 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5784 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5785
659948a4
ILT
57862010-01-07 Ian Lance Taylor <iant@google.com>
5787
5788 PR 11042
5789 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
5790 object as needed.
5791
9d3b86f6
ILT
57922010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
5793 Ian Lance Taylor <iant@google.com>
5794
5795 PR 11019
5796 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
5797 Xindex::read_symtab_xindex.
5798
bb0d3eb0
DK
57992010-01-07 Doug Kwan <dougkwan@google.com>
5800
5801 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
5802 (Insn_template::thumb16_bcond_insn): New method declaration.
5803 (Insn_template): Fix spelling.
5804 (Stub::thumb16_special): New method declaration.
5805 (Stub::do_write): Define virtual method which was previously pure
5806 virtual.
5807 (Stub::do_thumb16_special): New method declaration.
5808 (Stub::do_fixed_endian_write): New template member.
5809 (Reloc_stub::do_write): Remove.
5810 (Reloc_stub::do_fixed_endian_write): Remove.
5811 (Cortex_a8_stub): New class definition.
5812 (Stub_factory::make_cortex_a8_stub): New method definition.
5813 (Stub_factory::Stub_factory): Add missing static storage class
5814 qualifier for elf32_arm_stub_a8_veneer_blx.
5815
ffeef7df
ILT
58162010-01-07 Ian Lance Taylor <iant@google.com>
5817
dc3f80fe
ILT
5818 PR 10980
5819 * options.h (class General_options): Add --warn-unresolved-symbols
5820 and --error-unresolved-symbols.
5821 * errors.cc (Errors::undefined_symbol): Implement
5822 --warn-unresolved-symbols.
5823
ffeef7df
ILT
5824 * options.h (class General_options): Add -z text and -z textoff.
5825 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
5826
f1ec9ded
ST
58272010-01-06 Sriraman Tallam <tmsriram@google.com>
5828
5829 * gc.h (Garbage_collection::Cident_section_map): New typedef.
5830 (Garbage_collection::cident_sections): New function.
5831 (Garbage_collection::add_cident_section): New function.
5832 (Garbage_collection::cident_sections_): New member.
5833 (gc_process_relocs): Add references to sections whose names are C
5834 identifiers.
5835 * gold.h (cident_section_start_prefix): New constant.
5836 (cident_section_stop_prefix): New constant.
5837 (is_cident): New function.
5838 * layout.cc (Layout::define_section_symbols): Replace string constants
5839 with the newly defined constants.
5840 * object.cc (Sized_relobj::do_layout): Track sections whose names are
5841 C identifiers.
5842 * testsuite/Makefile.am: Add gc_orphan_section_test.
5843 * testsuite/Makefile.in: Regenerate.
5844 * testsuite/gc_orphan_section_test.cc: New file.
5845 * testsuite/gc_orphan_section_test.sh: New file.
5846
6eda8c29
ILT
58472010-01-06 Ian Lance Taylor <iant@google.com>
5848
b9674e17
ILT
5849 PR 10980
5850 * options.h (class General_options): Add --warn-shared-textrel.
5851 * layout.cc (Layout::finish_dynamic_section): Implement
5852 --warn-shared-textrel.
5853
6eda8c29
ILT
5854 PR 10980
5855 * options.h (class General_options): Add --warn-multiple-gp.
5856
32dcd44e
ILT
58572010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5858
5859 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
5860 $(THREADSLIB) and $(LIBDL).
5861 * Makefile.in: Rebuild.
5862
a192ba05
ILT
58632010-01-06 Ian Lance Taylor <iant@google.com>
5864
5865 PR 10980
5866 * options.cc (General_options::parse_section_start): New function.
5867 (General_options::section_start): New function.
5868 (General_options::General_options): Initialize all members.
5869 * options.h: Include <map>
5870 (class General_options): Add --section-start. Add section_starts_
5871 member.
5872 * layout.cc (Layout::attach_allocated_section_to_segment): If
5873 --section-start was used, set the address of the segment. Remove
5874 local sort_sections.
5875 (Layout::relaxation_loop_body): If the address of the load segment
5876 has been set by --section-start, don't use it.
5877 * output.h (Output_segment::update_flags_for_output_section): New
5878 function.
5879 * output.cc (Output_segment::add_output_section): Call
5880 update_flags_for_output_section.
5881
dde3f402
ILT
58822010-01-05 Ian Lance Taylor <iant@google.com>
5883
62dfdd4d
ILT
5884 PR 10980
5885 * options.h (class General_options): Add --undefined-version.
5886 * script.cc (struct Version_expression): Add was_matched_by_symbol
5887 field.
5888 (Version_script_info::matched_symbol): New function.
5889 (Version_script_info::get_symbol_version_helper): Call
5890 matched_symbol.
5891 (Version_script_info::check_unmatched_names): New function.
5892 * script.h (class Version_script_info): Update declarations.
5893 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
5894
9c4ae156
ILT
5895 * options.h (class General_options): Use DEFINE_bool_alias for
5896 allow_multiple_definition.
5897 * resolve.cc (Symbol_table::should_override): Don't test
5898 allow_multiple_definition.
5899
dde3f402
ILT
5900 PR 10980
5901 * options.h (class General_options): Add --cref.
5902 * main.cc (main): Print cref table if --cref. Don't close mapfile
5903 until after printing cref table.
5904 * cref.cc: Include "symtab.h".
5905 (class Cref_inputs): Define Cref_table_compare and Cref_table.
5906 (Cref_table_compare::operator()): New function.
5907 (Cref_inputs::gather_cref): New function.
5908 (filecol): New static const.
5909 (Cref_inputs::print_cref): New function.
5910 (Cref::print_cref): New function.
5911 * cref.h: Include <cstdio>.
5912 (class Cref): Update declarations.
5913 * mapfile.h (Mapfile::file): New function.
5914 * object.h (class Object): Define Symbols. Declare virtual
5915 do_get_global_symbols.
5916 (Object::get_global_symbols): New function.
5917 * object.cc (Input_objects::add_object): Pass object to cref_ if
5918 --cref.
5919 (Input_objects::archive_start): Likewise.
5920 (Input_objects::archive_stop): Likewise.
5921 (Input_objects::print_cref): New function.
5922 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5923 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5924 --cref.
5925 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5926 function.
5927 * plugin.h (class Sized_pluginobj): Update declarations.
5928
8781f709
ILT
59292010-01-05 Ian Lance Taylor <iant@google.com>
5930
5931 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5932 to is_default_version. Rename insdef to insdefault.
5933 (Symbol_table::add_from_relobj): Rename def to is_default_version
5934 and local to is_forced_local.
5935 (Symbol_table::add_from_pluginobj): Likewise.
5936 (Symbol_table::add_from_dynobj): Likewise.
5937 (Symbol_table::define_special_symbol): Rename insdef to
5938 insdefault.
5939
fe35d28d
ILT
59402010-01-04 Ian Lance Taylor <iant@google.com>
5941
30bc8c46
ILT
5942 PR 10980
5943 * options.h (class General_options): Add
5944 --allow-multiple-definition and -z muldefs.
5945 * resolve.cc (Symbol_table::should_override): Don't warn about a
5946 multiple symbol definition if --allow-multiple-definition or -z
5947 muldefs.
5948
7eaea549
ILT
5949 PR 10980
5950 * options.h (class General_options): Add --add-needed and
5951 --copy-dt-needed-entries. Tweak --as-needed help entry.
5952 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5953 error if --copy-dt-needed-entries aka --add-needed is used and
5954 would cause a change in behaviour.
5955
fe35d28d
ILT
5956 PR 10980
5957 * options.h (class General_options): Add -G as a short version of
5958 --shared. Add no-op options -assert, -g, and -i.
5959
55a2bb35
ST
59602010-01-04 Sriraman Tallam <tmsriram@google.com>
5961
5962 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5963 check for .text or .gnu.linkonce.t sections.
5964 * icf.cc (Icf::find_identical_sections): Ditto.
5965 Change the detection for mangled function name within the section
5966 name.
5967 * icf.h (is_section_foldable_candidate): New function.
5968
719328e1
ILT
59692009-12-30 Ian Lance Taylor <iant@google.com>
5970
5971 PR 10980
5972 * options.h (class General_options): Permit two dashes with
5973 --retain-symbols-file.
5974
d7bb5745
ILT
59752009-12-30 Ian Lance Taylor <iant@google.com>
5976
403a15dd
ILT
5977 PR 10979
5978 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5979 don't put the file header and segment headers in the text
5980 segment.
5981
eda294df
ILT
5982 PR 10979
5983 * common.cc (Sort_commons::operator()): Stabilize sort when both
5984 entries are NULL.
5985 (Symbol_table::do_allocate_commons_list): When allocating common
5986 symbols, skip a symbol which is no longer common.
5987 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5988 an object before checking its type.
5989 * testsuite/common_test_2.c: New file.
5990 * testsuite/common_test_3.c: New file.
5991 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5992 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5993 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5994 (common_test_2_pic.o, common_test_2.so): New targets.
5995 (common_test_3_pic.o, common_test_3.so): New targets.
5996 * testsuite/Makefile.in: Rebuild.
5997
d7bb5745
ILT
5998 PR 10979
5999 * script.cc (read_input_script): If we see a new SECTIONS clause,
6000 and we have added an input section, give an error.
6001 * layout.h (class Layout): Add have_added_input_section function.
6002 Add have_added_input_section_ field.
6003 * layout.cc (Layout::Layout): Initialize
6004 have_added_input_section_.
6005 (Layout::layout): Set have_added_input_section_.
6006 (Layout::layout_eh_frame): Likewise.
6007
fc59c572
ILT
60082009-12-30 Ian Lance Taylor <iant@google.com>
6009
6010 PR 10931
6011 * options.h (class General_options): Add --sort-common option.
6012 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6013 * common.cc (Sort_common): Add sort_order parameter to
6014 constructor. Add sort_order_ field.
6015 (Sort_commons::operator): Check sort_order_.
6016 (Symbol_table::allocate_commons): Determine the sort order.
6017 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6018 Change all callers.
6019 (Symbol_table::do_allocate_commons_list): Likewise.
6020
1c74fab0
ILT
60212009-12-30 Ian Lance Taylor <iant@google.com>
6022
6023 PR 10916
6024 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6025 symbols from this object, don't change the visibility of an
6026 undefined symbol.
6027 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6028
6affe781
ILT
60292009-12-30 Ian Lance Taylor <iant@google.com>
6030
6031 PR 10861
6032 * script.h (class Version_script_info): Define Language enum.
6033 Update declarations. Define Glob, Exact, and Lookup types. Add
6034 new fields globals_, locals_, and is_finalized_.
6035 * script.cc: Various formatting fixes.
6036 (class Parser_closure): Change language_stack_ from a vector of
6037 std::string to one of Version_script_info::Language. Adjust all
6038 uses accordingly.
6039 (class Lazy_demangler): Remove.
6040 (struct Version_expression): Change language from std::string to
6041 Version_script_info::Language.
6042 (Version_script_info::Version_script_info): New function.
6043 (Version_script_info::~Version_script_info): Don't call clear.
6044 (Version_script_info::finalize): New function.
6045 (Version_script_info::build_lookup_tables): New function.
6046 (Version_script_info::build_expression_list_lookup): New
6047 function.
6048 (Version_script_info::get_symbol_version_helper): Rewrite to use
6049 lookup tables.
6050 (Version_script_info::print_expression_list): Adjust to use
6051 Version_script_info::Language.
6052 (script_push_lex_into_version_mode): Check that the version script
6053 has not been finalized.
6054 (version_script_push_lang): Change language string to
6055 Version_script_info::Language.
6056 * options.cc (Command_line::version_script): New function.
6057 * options.h (class General_options): Add finalize_dynamic_list
6058 function. Change version_script from declaration to definition.
6059 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6060 * testsuite/version_script.map: Remove duplicate def of foo.
6061 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6062 version_script.map.
6063 * testsuite/Makefile.in: Rebuild.
6064
818bf354
ILT
60652009-12-30 Ian Lance Taylor <iant@google.com>
6066
6067 PR 10843
6068 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6069 if the input symbol index is 0, make the output symbol index 0.
6070
ebcc8304
ILT
60712009-12-30 Ian Lance Taylor <iant@google.com>
6072
6073 PR 10670
6074 * options.h (class General_options): Add -x/--discard-all.
6075 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6076 --discard-all. If the local symbol needs a dynamic entry, check
6077 that before handling --discard-locals.
6078
176fe33f
ILT
60792009-12-30 Ian Lance Taylor <iant@google.com>
6080
bb321bb1
ILT
6081 PR 10450
6082 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6083 flags to PF_R.
6084 (Output_segment::add_output_section): Don't change the flags if
6085 the type is PT_TLS.
6086
176fe33f
ILT
6087 PR 10450
6088 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6089 GNU hash table if they need a dynamic value. Otherwise, don't add
6090 them if they are defined in a dynamic object or are forced local.
6091
e8cd95c7
ILT
60922009-12-29 Ian Lance Taylor <iant@google.com>
6093
1b81fb71
ILT
6094 PR 10450
6095 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6096 .gnu.hash table for a 32-bit target.
6097
8d6d383d
ILT
6098 PR 10450
6099 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6100 regular and a dynamic object only needs a dynamic symbol table
6101 entry if it is externally visible.
6102
e785ec03
ILT
6103 PR 10450
6104 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6105 constructor. Add global_offset_table_ field.
6106 (Target_i386::got_section): Set global_offset_table_.
6107 (Target_i386::do_finalize_sections): Set global_offset_table_
6108 size.
6109 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6110 in constructor. Add global_offset_table_ field.
6111 (Target_x86_64::got_section): Set global_offset_table_.
6112 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6113 size.
6114
1a2dff53
ILT
6115 * layout.cc (Layout::Layout): Initialize increase_relro_.
6116 (Layout::get_output_section): Add is_relro, is_last_relro, and
6117 is_first_non_relro parameters. Change all callers.
6118 (Layout::choose_output_section): Likewise.
6119 (Layout::add_output_section_data): Likewise.
6120 (Layout::make_output_section): Likewise.
6121 (Layout::set_segment_offsets): Clear increase_relro when using a
6122 linker script.
6123 * layout.h (class Layout): Add increase_relro method. Add
6124 increase_relro_ field. Update declarations.
6125 * output.cc (Output_section::Output_section): Initialize
6126 is_last_relro_ and is_first_non_relro_.
6127 (Output_segment::add_output_section): Group relro sections is
6128 do_sort is true. Handle is_last_relro and is_first_non_relro.
6129 (Output_segment::maximum_alignment): Remove relro handling.
6130 (Output_segment::set_section_addresses): Add increase_relro
6131 parameter. Change all callers. Add initial alignment to align
6132 relro sections on separate page. Remove old relro handling.
6133 (Output_segment::set_section_list_addresses): Remove in_relro
6134 parameter. Change all callers.
6135 (Output_segment::set_offset): Add increase parameter. Change all
6136 callers. Remove old relro handling.
6137 * output.h (class Output_section): Add new methods: is_last_relro,
6138 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6139 Add is_last_relro_ and is_first_non_relro_ fields.
6140 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6141 Create separate .got.plt section. Call increase_relro.
6142 * x86_64.cc (Target_x86_64::got_section): Likewise.
6143 * testsuite/relro_script_test.t: Add .got.plt.
6144
f0ba79e2
ILT
6145 PR 10450
6146 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6147 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6148 (Layout::finalize): Call set_dynamic_symbol_size.
6149 (Layout::set_dynamic_symbol_size): New function.
6150 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6151 set_dynamic_symbol_size.
6152
e8cd95c7
ILT
6153 PR 10450
6154 * output.h (class Output_section): Add is_entsize_zero_ field.
6155 * output.cc (Output_section::Output_section): Initialize
6156 is_entsize_zero_.
6157 (Output_section::set_entsize): If two different entsizes are
6158 requested, force it to zero.
6159 (Output_section::add_input_section): Set flags for .debug_str
6160 before updating section flags. Set entsize.
6161 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6162 and SHF_STRING if all input sections have those flags.
6163
3e1b9a8a
RÁE
61642009-12-29 Rafael Espindola <espindola@google.com>
6165
6166 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
6167 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6168 reporting.
3e1b9a8a 6169
3dcad376
ST
61702009-12-29 Sriraman Tallam <tmsriram@google.com>
6171
6172 * options.cc (General_options::parse_version): Allow -v to exit
6173 without an error if there is nothing to link.
6174
084e2665
ILT
61752009-12-29 Ian Lance Taylor <iant@google.com>
6176
6177 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6178 using a version of gcc before 4.1.
6179 * configure: Rebuild.
6180
250acde3
CD
61812009-12-28 Chris Demetriou <cgd@google.com>
6182
6183 * attributes.cc (Output_attributes_section_data::do_write): Use
6184 std::vector::front rather than std::vector::data.
6185
99fff23b
ILT
61862009-12-28 Ian Lance Taylor <iant@google.com>
6187
6188 * symtab.h (class Symbol_table): Add enum Defined.
6189 * resolve.cc (Symbol_table::should_override): Add defined
6190 parameter. Change all callers. Test whether object is NULL
6191 before calling a method on it.
6192 (Symbol_table::report_resolve_problem): Add defined parameter.
6193 Change all callers.
6194 (Symbol_table::should_override_with_special): Likewise.
6195 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6196 parameter. Change all callers.
6197 (Symbol_table::do_define_in_output_data): Likewise.
6198 (Symbol_table::define_in_output_segment): Likewise.
6199 (Symbol_table::do_define_in_output_segment): Likewise.
6200 (Symbol_table::define_as_constant): Likewise.
6201 (Symbol_table::do_define_as_constant): Likewise.
6202 * script.h (class Symbol_assignment): Add is_defsym parameter to
6203 constructor; change all callers.
6204 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6205 parameter. Change all callers. Add is_defsym_ field.
6206 (class Parser_closure): Add parsing_defsym parameter to
6207 constructor; change all callers. Add parsing_defsym accessor
6208 function. Add parsing_defsym_ field.
6209
556bd683
ILT
62102009-12-28 Ian Lance Taylor <iant@google.com>
6211
6212 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 6213 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 6214
1782c879
ILT
62152009-12-23 Ian Lance Taylor <iant@google.com>
6216
6217 * i386.cc (Target_i386::do_calls_non_split): Recognize
6218 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
6219 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6220 -fsplit-stack prologue when using %r11.
1782c879 6221
329ca2b1
ST
62222009-12-21 Sriraman Tallam <tmsriram@google.com>
6223
6224 * options.cc (General_options::parse_version): Make -v continue and do
6225 the link like GNU ld does.
6226
d675ff46
RÁE
62272009-12-17 Rafael Avila de Espindola <espindola@google.com>
6228
6229 * Makefile.am (CCFILES): Add timer.cc.
6230 (HFILES): Add timer.h.
6231 * configure.ac: Check for sysconf and times.
6232 * main.cc: include timer.h.
6233 (main): Use Timer instead of get_run_time.
6234 * timer.cc: New.
6235 * timer.h: New.
6236 * workqueue.cc: include timer.h.
6237 (Workqueue::find_and_run_task):
6238 Report user, sys and wall time.
6239 * Makefile.in: Regenerate.
6240 * config.in: Regenerate.
6241 * configure: Regenerate.
6242
d6344fb5
DK
62432009-12-16 Doug Kwan <dougkwan@google.com>
6244
6245 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
6246 sections.
6247 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
6248 relaxed input sections.
6249 * output.cc (Output_section::find_relaxed_input_section): Change
6250 return type to Output_relaxed_input_section pointer. Adjust code
6251 for new type of relaxed_input_section_map_.
6252 * output.h (Output_section::find_relaxed_input_section): Change
6253 return type to Output_relaxed_input_section pointer.
6254 (Output_section::Output_relaxed_input_section_by_input_section_map):
6255 New type.
6256 (Output_section::relaxed_input_section_map_): Change type to
6257 Output_section::Output_relaxed_input_section_by_input_section_map.
6258 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
6259 input section.
6260
0e0d5469
ILT
62612009-12-15 Ian Lance Taylor <iant@google.com>
6262
6263 * layout.cc (Layout::create_shstrtab): Only write out after input
6264 sections if we are compressing debug sections.
6265
0649a889
ILT
62662009-12-15 Ian Lance Taylor <iant@google.com>
6267
6268 * archive.cc (Archive::add_symbols): Only look up a symbol without
6269 a version if there is, in fact, a version.
6270
2ea97941
ILT
62712009-12-14 Ian Lance Taylor <iant@google.com>
6272
6273 Revert -Wshadow changes, all changes from:
6274 2009-12-11 Doug Kwan <dougkwan@google.com>
6275 2009-12-11 Nick Clifton <nickc@redhat.com>
6276 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
6277
b0eec2cc
DK
62782009-12-11 Doug Kwan <dougkwan@google.com>
6279
6280 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
6281 due to -Wshadow.
6282 * attributes.cc (Object_attribute::size): Ditto.
6283 (Attributes_section_data::size): Ditto.
6284 (Attributes_section_data::Attributes_section_data): Ditto.
6285 (Output_attributes_section_data::do_write): Ditto.
6286 * attributes.h (Object_attribute::set_type): Ditto.
6287 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
6288
91d6fa6a
NC
62892009-12-11 Nick Clifton <nickc@redhat.com>
6290
6291 * archive.cc: Fix shadowed variable warnings.
6292 * arm.cc: Likewise.
6293 * compressed_output.cc: Likewise.
6294 * compressed_output.h: Likewise.
6295 * configure: Likewise.
6296 * dwarf_reader.cc: Likewise.
6297 * dynobj.cc: Likewise.
6298 * dynobj.h: Likewise.
6299 * ehframe.cc: Likewise.
6300 * ehframe.h: Likewise.
6301 * errors.cc: Likewise.
6302 * expression.cc: Likewise.
6303 * fileread.cc: Likewise.
6304 * fileread.h: Likewise.
6305 * freebsd.h: Likewise.
6306 * i386.cc: Likewise.
6307 * icf.cc: Likewise.
6308 * incremental.h: Likewise.
6309 * layout.cc: Likewise.
6310 * layout.h: Likewise.
6311 * mapfile.cc: Likewise.
6312 * merge.cc: Likewise.
6313 * merge.h: Likewise.
6314 * object.cc: Likewise.
6315 * object.h: Likewise.
6316 * options.h: Likewise.
6317 * output.cc: Likewise.
6318 * output.h: Likewise.
6319 * parameters.cc: Likewise.
6320 * plugin.cc: Likewise.
6321 * powerpc.cc: Likewise.
6322 * reduced_debug_output.cc: Likewise.
6323 * reduced_debug_output.h: Likewise.
6324 * reloc.cc: Likewise.
6325 * reloc.h: Likewise.
6326 * resolve.cc: Likewise.
6327 * script-sections.cc: Likewise.
6328 * script.cc: Likewise.
6329 * script.h: Likewise.
6330 * sparc.cc: Likewise.
6331 * symtab.cc: Likewise.
6332 * symtab.h: Likewise.
6333 * target-select.cc: Likewise.
6334 * target-select.h: Likewise.
6335 * token.h: Likewise.
6336 * workqueue.cc: Likewise.
6337 * workqueue.h: Likewise.
6338 * x86_64.cc: Likewise.
6339
a0351a69
DK
63402009-12-10 Doug Kwan <dougkwan@google.com>
6341
6342 * arm.cc (attributes.h): New include.
6343 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
6344 (Arm_relobj::~Arm_relobj): Delete object pointed by
6345 attributes_section_data_.
6346 (Arm_relobj::attributes_section_data): New method definition.
6347 (Arm_relobj::attributes_section_data_): New data member declaration.
6348 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
6349 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
6350 attributes_section_data_.
6351 (Arm_dynobj::attributes_section_data): New method definition.
6352 (Arm_dynobj::attributes_section_data_): New data member declaration.
6353 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
6354 initialization value of may_use_blx_ to false.
6355 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
6356 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
6357 object attributes to compute results instead of hard-coding.
6358 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
6359 Target_arm::get_secondary_compatible_arch,
6360 Target_arm::set_secondary_compatible_arch
6361 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6362 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
6363 New method declarations.
6364 (Target_arm::get_aeabi_object_attribute): New method definition.
6365 (Target_arm::attributes_section_data_): New data member declaration.
6366 (read_arm_attributes_section): New template definition.
6367 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
6368 (Arm_dynobj::do_read_symbols): Ditto.
6369 (Target_arm::do_finalize_sections): Merge attributes sections from
6370 input. Check for BLX use after attributes section merging.
6371 Fix __exidx_start and __exidx_end visibility. Create an
6372 .ARM.attributes section if necessary.
6373 (Target_arm::get_secondary_compatible_arch,
6374 Target_arm::set_secondary_compatible_arch,
6375 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6376 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 6377 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
6378 New method definitions.
6379
b59befec
ILT
63802009-12-09 Ian Lance Taylor <iant@google.com>
6381
6382 * plugin.cc (Plugin::load): Don't cast from void* to a function
6383 pointer.
6384
1276bc89
ILT
63852009-12-09 Ian Lance Taylor <iant@google.com>
6386
6387 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
6388 information fields.
6389
2f2de248
L
63902009-12-09 H.J. Lu <hongjiu.lu@intel.com>
6391
6392 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
6393 Replace two_file_shared_1.so with two_file_shared_2.so.
6394 * testsuite/Makefile.in: Regenerated.
6395
4f787271
DK
63962009-12-08 Doug Kwan <dougkwan@google.com>
6397
6398 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6399 (HFILES): Add attributes.h and int_encoding.h.
6400 * Makefile.in: Regenerate.
6401 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6402 function definitions to int_encoding.cc
6403 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6404 prototypes to int_encoding.h
6405 * reduced_debug_output.cc (int_encoding.h): New include.
6406 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6407 function definitions to int_encoding.cc
6408 (insert_into_vector, read_from_pointer): Move template definitions to
6409 int_encoding.h
6410 * attributes.cc: New file.
6411 * attributes.h: New file.
6412 * int_encoding.cc: New file.
6413 * int_encoding.h: New file.
6414
20b52f1a
RÁE
64152009-12-07 Rafael Avila de Espindola <espindola@google.com>
6416
6417 PR gold/11055
6418 * incremental-dump.cc (dump_incremental_inputs): New.
6419 (main): Use dump_incremental_inputs.
6420
53d7974c
L
64212009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6422
6423 PR gold/10893
6424 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6425 checking elfcpp::STT_FUNC.
6426 (Target_i386::Relocate::relocate): Likewise.
6427 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6428
6429 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6430 symbols from shared libraries into normal FUNC symbols.
6431
6432 * symtab.h (Symbol): Add is_func and use it.
6433
05a352e6
DK
64342009-12-05 Doug Kwan <dougkwan@google.com>
6435
6436 * arm.cc (Target_arm::arm_info): Initialize new fields
6437 attributes_section and attributes_vendor.
6438 * i386.cc (Target_i386::i386_info): Same.
6439 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6440 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6441 fields attributes_section and attributes_vendor.
53d7974c 6442 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
6443 * target.h (Target::attributes_section, Target::attributes_vendor,
6444 Target::is_attributes_section, Target::attribute_arg_type,
6445 Target::attributes_order): New method definitions.
6446 (Target::Target_info::attributes_section,
6447 Target::Target_info::attributes_vendor): New fields.
6448 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6449 virtual method definitions.
6450 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6451 attributes_section and attributes_vendor.
6452 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6453
f4e5969c
DK
64542009-12-05 Doug Kwan <dougkwan@google.com>
6455
6456 * arm.cc: Update comments about interworking and stub generation.
6457 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6458 considered as non-PIC.
6459 (Arm_relocate_functions::base_abs): Fix formatting.
6460 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6461 of function to use GOT entry address instead of offset.
6462 (Target_arm::Scan::global): Issue an error if a symbol would need a
6463 PLT does not get one because it is untyped. Remove code to create
6464 dynamic symbols for relative branches.
6465 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6466 takes unsigned integer instead of boolean.
6467
1abce4a6
L
64682009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6469
6470 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6471 (two_file_test_LDADD): Likewise.
6472 (common_test_1_LDADD): Likewise.
6473 (exception_test_LDADD) Likewise.
6474 (weak_test_LDADD): Likewise.
6475 (many_sections_test_LDADD): Likewise.
6476 (initpri1_LDADD): Likewise.
6477 (script_test_1_LDADD): Likewise.
6478 (script_test_2_LDADD): Likewise.
6479 (justsyms_LDADD): Likewise.
6480 (binary_test_LDADD): Likewise.
6481 (large_LDADD): Likewise.
6482 * testsuite/Makefile.in: Regenerated.
6483
adcf2816 64842009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 6485
adcf2816
L
6486 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6487 (Symbol_table::override_with_special): Likewise.
6488 (Symbol_table::add_from_object): Likewise.
6489
28e67f5d
RÁE
64902009-12-04 Rafael Avila de Espindola <espindola@google.com>
6491
6492 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6493 Don't set the data_offset twice.
6494
ae10a101
RÁE
64952009-12-04 Rafael Avila de Espindola <espindola@google.com>
6496
6497 * testsuite/Makefile.in: Regenerate.
6498
f59f41f3
DK
64992009-12-03 Doug Kwan <dougkwan@google.com>
6500
6501 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6502 (Target_arm::do_finalize_sections): Add parameter for symbol table
6503 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6504 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6505 parameter for symbol table pointer.
6506 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6507 an additional parameter for a pointer to symbol table.
6508 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6509 parameter for a symbol table pointer.
6510 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6511 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6512 Ditto.
6513 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6514 parameter for a symbol table pointer.
6515
ca55d848
RÁE
65162009-12-03 Rafael Avila de Espindola <espindola@google.com>
6517
6518 * incremental.cc (Incremental_inputs_header)
6519 (Incremental_inputs_header_write, Incremental_inputs_entry)
6520 (Incremental_inputs_entry_write): Move ...
6521 * incremental.h (Incremental_inputs_header)
6522 (Incremental_inputs_header_write, Incremental_inputs_entry)
6523 (Incremental_inputs_entry_write): here.
6524
3aec4f9c
RÁE
65252009-12-02 Rafael Avila de Espindola <espindola@google.com>
6526
6527 * incremental.cc (make_sized_incremental_binary): Set the target.
6528 Error if it is incompatible.
6529 * output.h (Output_file): Add filename method.
6530
9c0ae74d
RÁE
65312009-12-02 Rafael Avila de Espindola <espindola@google.com>
6532
6533 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6534 from the get_* methods.
6535
a45500ae
RÁE
65362009-12-02 Rafael Avila de Espindola <espindola@google.com>
6537
6538 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6539 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6540 Write 0 for the data_offset of scripts.
6541
325e6408
RÁE
65422009-12-02 Rafael Avila de Espindola <espindola@google.com>
6543
6544 * testsuite/Makefile.am: Add the incremental_test.sh test.
6545 * testsuite/incremental_test.sh: New.
6546 * testsuite/incremental_test_1.c: New.
6547 * testsuite/incremental_test_2.c: New.
6548
954c3e2e
RÁE
65492009-12-01 Rafael Avila de Espindola <espindola@google.com>
6550
6551 * incremental-dump.cc (main): Fix typos.
6552
f8086623
RÁE
65532009-11-27 Rafael Avila de Espindola <espindola@google.com>
6554
6555 PR gold/11025
6556 * incremental-dump.cc (main): Use llu to print 64 bit values.
6557
3b0dd6ac
L
65582009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6559 H.J. Lu <hongjiu.lu@intel.com>
6560
6561 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6562 $(LIBDL).
6563 (incremental_dump_LDADD): Likewise.
6564 * Makefile.in: Regenerated.
6565
a6d1ef57 65662009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 6567
a6d1ef57
DK
6568 Revert:
6569
6570 2009-11-25 Doug Kwan <dougkwan@google.com>
6571
6572 * arm.cc (Target_arm::Target_arm): Move method definition
6573 outside of class definition. Add code to handle
6574 --target1-rel, --target1-abs and --target2= options.
6575 (Target_arm::get_reloc_reloc_type): Change method to be
6576 non-static and const.
6577 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6578 New data member declaration.
6579 (Target_arm::Scan::local, Target_arm::Scan::global,
6580 Target_arm::Relocate::relocate,
6581 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6582 Adjust call to Target_arm::get_real_reloc_type.
6583 (Target_arm::get_real_reloc_type): Use command line options
6584 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6585 * options.h (--target1-rel, --target1-abs, --target2): New
6586 ARM-only options.
6587
50aeb7d4
DK
65882009-11-25 Doug Kwan <dougkwan@google.com>
6589
6590 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6591 class definition. Add code to handle --target1-rel, --target1-abs
6592 and --target2= options.
6593 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6594 and const.
6595 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6596 member declaration.
6597 (Target_arm::Scan::local, Target_arm::Scan::global,
6598 Target_arm::Relocate::relocate,
6599 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6600 call to Target_arm::get_real_reloc_type.
6601 (Target_arm::get_real_reloc_type): Use command line options to
6602 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6603 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6604 options.
6605
51938283
DK
66062009-11-25 Doug Kwan <dougkwan@google.com>
6607
6608 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6609 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6610 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6611 formatting.
6612 (Arm_relocate_functions::thm_call): Replace body with a call to
6613 Arm_relocate_functions::thumb_branch_common.
6614 (Arm_relocate_functions::thm_jump24,
6615 Arm_relocate_functions::thm_xpc22): New method definitions.
6616 (Arm_relocate_functions::thumb_branch_common): New method definition.
6617 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6618 operator.
6619 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6620 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6621
e2b8f3c4
RÁE
66222009-11-24 Rafael Avila de Espindola <espindola@google.com>
6623
6624 * Makefile.am: Build incremental-dump
6625 * Makefile.in: Regenerate.
6626 * incremental-dump.cc: New.
6627 * incremental.cc (Incremental_inputs_header_data,
6628 Incremental_inputs_entry_data): Move to incremental.h
6629 * incremental.h: (Incremental_inputs_header_data,
6630 Incremental_inputs_entry_data): Move from incremental.cc
6631
bcba9aec
RÁE
66322009-11-24 Rafael Avila de Espindola <espindola@google.com>
6633
6634 * incremental.cc (Incremental_inputs_header,
6635 Incremental_inputs_header_write, Incremental_inputs_entry,
6636 Incremental_inputs_entry_write): Add a typedef with the data type.
6637
7c3afe08
RÁE
66382009-11-24 Rafael Avila de Espindola <espindola@google.com>
6639
6640 * incremental.cc (Incremental_inputs_header,
6641 Incremental_inputs_header_write, Incremental_inputs_entry,
6642 Incremental_inputs_entry_write): Update comment about which
6643 type has the filed descriptions.
6644
d204b6e9
DK
66452009-11-15 Doug Kwan <dougkwan@google.com>
6646
6647 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6648 (Arm_relocate_functions::arm_branch_common): Change method defintion
6649 in class definition to a method declaration and update list of formal
6650 parameters.
6651 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6652 Arm_relocation_functions::jump24): Adjust call to
6653 Arm_relocate_functions::arm_branch_common. Update list of formal
6654 parameters.
6655 (Arm_relocate_functions::xpc25): New method definition.
6656 (Arm_relocate_functions::arm_branch_common): Move method defintion
6657 out from class definition. Use stubs for mode-switching and extending
6658 branch ranges.
6659 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6660 specially. Change code to enable use of stubs in ARM branches.
6661
43d12afe
DK
66622009-11-10 Doug Kwan <dougkwan@google.com>
6663
6664 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6665 in method declaration.
6666 (Target_arm::relocate_stub): New method declaration.
6667 (Target_arm::default_target): Change to return a pointer instead of
6668 a const reference.
6669 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
6670 Target_arm::default_target.
6671 (Arm_Relobj::do_relocate_sections): Remove options paramater in
6672 method definition.
6673 (Target_arm::relocate_section): Adjust view.
6674 (Target_arm::relocate_stub): New method definition.
6675
ac33a407
DK
66762009-11-10 Doug Kwan <dougkwan@google.com>
6677
6678 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
6679 a format warning.
6680 * incremental.cc (open_incremental_binary): Initialized local
6681 variables to avoid warnings.
6682 * object.cc (make_elf_object): Ditto.
6683 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6684 a format warning.
e1df38aa 6685
88ee28e9
L
6686009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6687
6688 PR gold/10930
6689 * testsuite/plugin_test.c: Include "config.h".
6690
2daedcd6
DK
66912009-11-09 Doug Kwan <dougkwan@google.com>
6692
6693 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6694 (arm_symbol_value): Remove.
6695 (Arm_relocate_functions::arm_branch_common,
6696 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6697 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6698 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6699 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6700 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6701 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
6702 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
6703 Arm_relocate_functions::thm_mobw_abs_nc,
6704 Arm_relocate_functions::thm_mov_abs,
6705 Arm_relocate_functions::movw_prel_nc,
6706 Arm_relocate_functions::thm_movt_abs,
6707 Arm_relocate_functions::movt_prel,
6708 Arm_relocate_functions::thm_movw_prel_nc,
6709 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
6710 (Target_arm::Relocate::relocate): Only decompose address into two
6711 parts if relocation type uses the thumb-bit and pass the actual
6712 bit instead of a flag indicating that the thumb-bit is used. Adjust
6713 calls to methods in Arm_relocate_functions for this change.
6714
1276bc89 67152009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
6716
6717 PR 10925
6718 * reloc.cc: Instantiate
6719 Sized_relobj::initialize_input_to_output_maps and
6720 Sized_relobj:free_input_to_output_maps.
6721
e53ad1b5
ILT
67222009-11-06 Ian Lance Taylor <iant@google.com>
6723
6724 PR 10876
6725 * defstd.cc (in_segment): Set only_if_ref true for "end".
6726
eb44217c
DK
67272009-11-06 Doug Kwan <dougkwan@google.com>
6728
6729 * arm.cc (class Reloc_stub): Correct a comment.
6730 (Target_arm::Target_arm): Initialize arm_input_section_map_.
6731 (Target_arm::scan_section_for_stubs): New method declaration.
6732 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
6733 Change methods from private to protected.
6734 (Target_arm::do_may_relax): New method definition.
6735 (Target_arm::do_relax, Target_arm::group_sections,
6736 Target_arm::scan_reloc_for_stub,
6737 Target_arm::scan_reloc_section_for_stubs): New method declarations.
6738 (Target_arm::arm_input_section_map_): New data member declaration.
6739 (Target_arm::scan_reloc_for_stub,
6740 Target_arm::scan_reloc_section_for_stubs,
6741 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
6742 Target_arm::do_relax): New method definitions.
6743
5d329b7d
ILT
67442009-11-06 Mikolaj Zalewski <mikolaj@google.com>
6745
6746 * configure.ac: Check for (struct stat)::st_mtim
6747 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
6748 * config.in: Regenerate.
6749 * configure: Regenerate.
6750
96a0d71b
ILT
67512009-11-05 Ian Lance Taylor <iant@google.com>
6752
6753 PR 10910
6754 * output.cc (Output_segment::add_output_section): Add missing
6755 return statement.
6756
594c8e5e
ILT
67572009-11-04 Ian Lance Taylor <iant@google.com>
6758
6759 PR 10880
6760 * object.h (class Object): Add is_needed and set_is_needed
6761 methods. Add is_needed_ field. Make bool fields into bitfields.
6762 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
6763 defined in a dynamic object and referenced by a regular object,
6764 set is_needed for the dynamic object.
6765 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
6766 if the file is marked with as_needed and it is not needed.
6767
22b127cc
ILT
67682009-11-04 Ian Lance Taylor <iant@google.com>
6769
6770 PR 10887
6771 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
6772 tags if data is discarded by linker script.
6773 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6774 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6775 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6776 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6777
f5c870d2
ILT
67782009-11-04 Ian Lance Taylor <iant@google.com>
6779
6780 * layout.cc (Layout::get_output_section): Add is_interp and
6781 is_dynamic_linker_section parameters. Change all callers.
6782 (Layout::choose_output_section): Likewise.
6783 (Layout::make_output_section): Likewise.
6784 (Layout::add_output_section_data): Add is_dynamic_linker_section
6785 parameter. Change all callers.
6786 * layout.h (class Layout): Update declarations.
6787 * output.h (class Output_section): Add is_interp, set_is_interp,
6788 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
6789 Add is_interp_, is_dynamic_linker_section_ fields. Change
6790 generate_code_fills_at_write_ to a bitfield.
6791 * output.cc (Output_section::Output_sections): Initialize new
6792 fields.
6793 (Output_segment::add_output_section): Add do_sort parameter.
6794 Change all callers.
6795
1ae4d23b
ILT
67962009-11-03 Ian Lance Taylor <iant@google.com>
6797
6798 PR 10860
6799 * options.h (class General_options): Add --warn-common.
6800 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
6801 merging two common symbols.
6802 (Symbol_table::should_override): Handle --warn-common when merging
6803 a common symbol with a defined symbol. Use report_resolve_problem
6804 for multiple definitions.
6805 (Symbol_table::report_resolve_problem): New function.
6806 * symtab.h (class Symbol_table): Declare report_resolve_problem.
6807
55da9579
DK
68082009-11-03 Doug Kwan <dougkwan@google.com>
6809
6810 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
6811 stub_factory_.
6812 (Target_arm::stub_factory): New method definition.
6813 (Target_arm::new_arm_input_section,
6814 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
6815 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 6816 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
6817 New type definitions.
6818 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
6819 member declarations.
6820 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
6821 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
6822 New method definitions.
6823
37a9ac43
ILT
68242009-11-03 Ian Lance Taylor <iant@google.com>
6825
6826 * options.h (class General_options): Add --warn_constructors.
6827
b3d6a3d4
ILT
68282009-11-03 Ian Lance Taylor <iant@google.com>
6829
6830 PR 10893
6831 * defstd.cc (in_section): Add entries for __rel_iplt_start,
6832 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
6833
934b01dd
ILT
68342009-11-03 Ian Lance Taylor <iant@google.com>
6835
6836 PR 10895
6837 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
6838 --msgid-bugs-address.
6839 (install-pdf): New target.
6840 (install-data_yes): Look up one directory to find mkinstalldirs.
6841
03c1939b
L
68422009-11-03 H.J. Lu <hongjiu.lu@intel.com>
6843
6844 * po/Make-in (.po.gmo): Don't generate .gmo files in source
6845 tree.
6846
ebd95253
DK
68472009-10-30 Doug Kwan <dougkwan@google.com>
6848
6849 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
6850
e9bbb538
DK
68512009-10-30 Doug Kwan <dougkwan@google.com>
6852
6853 * arm.cc (Stub_addend_reader): New struct template definition
6854 and partial specializations.
6855 (Stub_addend_reader::operator()): New method definition for a
6856 partially specialized template.
6857
d5b40221
DK
68582009-10-30 Doug Kwan <dougkwan@google.com>
6859
6860 * arm.cc (Arm_relobj::processor_specific_flags): New method
6861 definition.
6862 (Arm_relobj::do_read_symbols): New method declaration.
6863 (Arm_relobj::processor_specific_flags_): New data member declaration.
6864 (Arm_dynobj): New class definition.
6865 (Target_arm::do_finalize_sections): Add input_objects parameter.
6866 (Target_arm::do_adjust_elf_header): New method declaration.
6867 (Target_arm::are_eabi_versions_compatible,
6868 (Target_arm::merge_processor_specific_flags): New method declaration.
6869 (Target_arm::do_make_elf_object): New overloaded method definitions
6870 and declaration.
6871 (Arm_relobj::do_read_symbols): New method definition.
6872 (Arm_dynobj::do_read_symbols): Ditto.
6873 (Target_arm::do_finalize_sections): Add input_objects parameters.
6874 Merge processor-specific flags from all input objects.
6875 (Target_arm::are_eabi_versions_compatible,
6876 Target_arm::merge_processor_specific_flags,
6877 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
6878 New method definitions.
6879 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
6880 Input_objects pointer type parameter.
6881 * layout.cc (Layout::finalize): Pass input objects to target's.
6882 finalize_sections function.
6883 * output.cc (Output_file_header::do_sized_write): Set ELF file
6884 header's processor-specific flags.
6885 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
6886 Input_objects pointer type parameter.
6887 * sparc.cc (Target_sparc::do_finalize_sections): Same.
6888 * target.h (Input_objects): New forward class declaration.
6889 (Target::processor_specific_flags,
6890 Target::are_processor_specific_flags_sect): New method definitions.
6891 (Target::finalize_sections): Add input_objects parameter.
6892 (Target::Target): Initialize processor_specific_flags_ and
6893 are_processor_specific_flags_set_.
6894 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
6895 parameter.
6896 (Target::set_processor_specific_flags): New method definition.
6897 (Target::processor_specific_flags_,
6898 Target::are_processor_specific_flags_set_): New data member
6899 declarations.
6900 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
6901 Input_objects pointer type parameter.
6902
ebabffbd
DK
69032009-10-30 Doug Kwan <dougkwan@google.com>
6904
6905 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
6906
ad0f2072
ILT
69072009-10-28 Ian Lance Taylor <iant@google.com>
6908
6909 * object.h (class Relobj): Drop options parameter from
6910 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
6911 do_scan_relocs, do_relocate. Change all callers.
6912 (class Sized_relobj): Drop options parameters from
6913 do_gc_process_relocs, do_scan_relocs, do_relocate,
6914 do_relocate_sections, relocate_sections, emit_relocs_scan,
6915 emit_relocs_scan_reltype. Change all callers.
6916 (struct Relocate_info): Remove options field and all references to
6917 it.
6918 * reloc.h (class Read_relocs): Remove options constructor
6919 parameter and options_ field. Change all callers.
6920 (class Gc_process_relocs, class Scan_relocs): Likewise.
6921 (class Relocate_task): Likewise.
6922 * target-reloc.h (scan_relocs): Remove options parameter. Change
6923 all callers.
6924 (scan_relocatable_relocs): Likewise.
6925 * target.h (class Sized_target): Remove options parameter from
6926 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6927 all callers.
6928 * gc.h (gc_process_relocs): Remove options parameter. Change all
6929 callers.
6930 * arm.cc: Update functions to remove options parameters.
6931 * i386.cc: Likewise.
6932 * powerpc.cc: Likewise.
6933 * sparc.cc: Likewise.
6934 * x86_64.cc: Likewise.
6935 * testsuite/testfile.cc: Likewise.
6936
8ffa3667
DK
69372009-10-28 Doug Kwan <dougkwan@google.com>
6938
6939 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6940 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6941 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6942 New method definitions.
6943
40f36857
CC
69442009-10-28 Cary Coutant <ccoutant@google.com>
6945
6946 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6947 (Plugin::cleanup_done_): New member.
6948 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6949 (Plugin_manager::cleanup_done_): Remove.
6950 (Plugin_manager::add_input_file): Edit error message.
6951 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6952 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6953
2c849493
ILT
69542009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6955
6956 * fileread.cc: (File_read::View::~View): Use the new
6957 data_ownership_ filed.
6958 (File_read::~File_read): Dispose the new whole_file_view_.
6959 (File_read::open): Mmap the whole file if needed.
6960 (File_read::open): Use whole_file_view_ instead of contents_.
6961 (File_read::find_view): Use whole_file_view_ if applicable.
6962 (File_read::do_read): Use whole_file_view_ instead of contents_.
6963 (File_read::make_view): Use whole_file_view_ instead of contents_,
6964 update File_read::View::View call.
6965 (File_read::find_or_make_view): Update File_read::View::View
6966 call.
6967 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6968 remove contents_
6969 (File_read::View::Data_ownership): New enum.
6970 (File_read::View::View): Replace bool mapped_ with Data_ownership
6971 argument.
6972 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6973 (File_read::View::data_ownership_): New field.
6974 (File_read::contents_): Remove (replaced by whole_file_view_).
6975 (File_read::whole_file_view_): New field.
6976 * options.h (class General_options): Add --keep-files-mapped.
6977
24998053
CC
69782009-10-27 Cary Coutant <ccoutant@google.com>
6979
6980 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6981 * testsuite/Makefile.am (plugin_test_5): New test case.
6982 * testsuite/Makefile.in: Regenerate.
6983
72adc4fa
DK
69842009-10-25 Doug Kwan <dougkwan@google.com>
6985
6986 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6987 from private to protected to allow access by child class.
6988 (Sized_relobj::do_relocate_sections): New method declaration.
6989 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6990 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6991 Sized_relobj::relocate_sections. Instantiate template explicitly
6992 for different target sizes and endianity.
6993
07f508a2
DK
69942009-10-24 Doug Kwan <dougkwan@google.com>
6995
6996 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6997 (Arm_input_section::as_arm_input_section): New method.
6998 (Arm_output_section): New class definition.
6999 (Arm_output_section::create_stub_group,
7000 Arm_output_section::group_sections): New method definitions.
7001
10ad9fe5
DK
70022009-10-22 Doug Kwan <dougkwan@google.com>
7003
7004 * arm.cc (Arm_input_section): New class definition.
7005 (Arm_input_section::init, Arm_input_section:do_write,
7006 Arm_input_section::set_final_data_size,
7007 Arm_input_section::do_reset_address_and_file_offset): New method
7008 definitions.
7009
56ee5e00
DK
70102009-10-21 Doug Kwan <dougkwan@google.com>
7011
7012 * arm.cc (Stub_table, Arm_input_section): New forward class
7013 declarations.
7014 (Stub_table): New class defintion.
7015 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7016 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7017 New method definition.
7018
b569affa
DK
70192009-10-21 Doug Kwan <dougkwan@google.com>
7020
7021 * arm.cc: Update copyright comments.
7022 (Target_arm): New forward class template declaration.
7023 (Arm_address): New type.
7024 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7025 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7026 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7027 constants.
7028 (Insn_template): Same.
7029 (DEF_STUBS): New macro.
7030 (Stub_type): New enum type.
7031 (Stub_template): New class definition.
7032 (Stub): Same.
7033 (Reloc_stub): Same.
7034 (Stub_factory): Same.
7035 (Target_arm::Target_arm): Initialize may_use_blx_ and
7036 should_force_pic_veneer_.
7037 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7038 Target_arm::should_force_pic_veneer,
7039 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7040 Target_arm::using_thumb_only, Target_arm:;default_target): New
7041 method defintions.
7042 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7043 New data member declarations.
7044 (Insn_template::size, Insn_template::alignment): New method defintions.
7045 (Stub_template::Stub_template): New method definition.
7046 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7047 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7048 (Stub_factory::Stub_factory): New method definition.
7049 * gold.h (string_hash): New template.
7050 * output.h (Input_section_specifier::hash_value): Use
7051 gold::string_hash.
7052 (Input_section_specifier::string_hash): Remove.
7053 * stringpool.cc (Stringpool_template::string_hash): Use
7054 gold::string_hash.
7055
6c172549
DK
70562009-10-20 Doug Kwan <dougkwan@google.com>
7057
7058 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7059 symbols of relaxed input sections.
7060 * output.h (Output_section::find_relaxed_input_section): Make
7061 method public.
7062
c5617f2f
DK
70632009-10-16 Doug Kwan <dougkwan@google.com>
7064
7065 * dynobj.cc (Versions::Versions): Initialize version_script_.
7066 Only insert base version symbol definition for a shared object
7067 if version script defines any version versions.
7068 (Versions::define_base_version): New method definition.
7069 (Versions::add_def): Check that base version is not needed.
7070 (Versions::add_need): Define base version lazily.
7071 * dynobj.h (Versions::define_base_version): New method declaration.
7072 (Versions::needs_base_version_): New data member declaration.
7073 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7074 (check_DATA): Add no_version_test.stdout.
7075 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7076 New make rules.
7077 * testsuite/Makefile.in: Regenerate.
7078 * testsuite/no_version_test.c: New file.
7079 * testsuite/no_version_test.sh: Ditto.
7080
3c12dcdb
DK
70812009-10-16 Doug Kwan <dougkwan@google.com>
7082
7083 * expression.cc (class Segment_start_expression): New class definition.
7084 (Segment_start_expression::value): New method definition.
7085 (script_exp_function_segment_start): Return a new
7086 Segment_start_expression.
7087 * gold/script-c.h (script_saw_segment_start_expression): New function
7088 prototype.
7089 * script-sections.cc (Script_sections::Script_sections): Initialize
7090 SAW_SEGMENT_START_EXPRESSION_ to false.
7091 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7092 and -Tbbs options to specify section addresses if given in
7093 command line and no SEGMENT_START expression is seen in a script.
7094 * script-sections.h (Script_sections::saw_segment_start_expression,
7095 Script_sections::set_saw_segment_start_expression): New method
7096 definition.
7097 (Script_sections::saw_segment_start_expression_): New data member
7098 declaration.
7099 * script.cc (script_saw_segment_start_expression): New function.
7100 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7101 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7102 script_test_7.sh and script_test_8.sh.
7103 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7104 script_test_8.stdout.
7105 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7106 (script_test_6, script_test_6.stdout, script_test_7,
7107 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7108 * Makefile.in: Regenerate.
7109 * testsuite/script_test_6.sh: New file.
7110 * testsuite/script_test_6.t: Same.
7111 * testsuite/script_test_7.sh: Same.
7112 * testsuite/script_test_7.t: Same.
7113 * testsuite/script_test_8.sh: Same.
7114
64b1ae37
DK
71152009-10-16 Doug Kwan <dougkwan@google.com>
7116
7117 * output.cc (Output_segment::set_section_list_address): Cast
7118 expressions to unsigned long long type to avoid format warnings.
7119
661be1e2
ILT
71202009-10-15 Ian Lance Taylor <iant@google.com>
7121
12edd763 7122 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 7123 dot assignment to script_sections_.
12edd763
ILT
7124 * script-sections.cc (Script_sections::add_dot_assignment):
7125 Initialize if necessary.
7126
68b6574b
ILT
7127 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7128 program headers with no load segment if there is a linker script.
7129
661be1e2
ILT
7130 * layout.cc (Layout::set_segment_offsets): Align the file offset
7131 to the segment aligment for -N or -n with no load segment.
7132 * output.cc (Output_segment::add_output_section): Don't crash if
7133 the first section is a TLS section.
7134 (Output_segment::set_section_list_addresses): Print an error
7135 message if the address moves backward in a linker script.
7136 * script-sections.cc
7137 (Output_section_element_input::set_section_addresses): Don't
7138 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7139 (Orphan_output_section::set_section_addresses): Likewise.
7140
f15f61a7
DK
71412009-10-15 Doug Kwan <dougkwan@google.com>
7142
7143 * layout.cc (Layout::finish_dynamic_section): Generate tags
7144 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7145 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7146 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7147
82bb573a
ILT
71482009-10-14 Ian Lance Taylor <iant@google.com>
7149
7150 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7151 fields.
7152 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7153 data_shdr fields of relinfo.
7154 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7155 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7156 R_386_TLS_LDO_32, adjust based on section flags.
7157 (Target_i386::Relocate::fix_up_ldo): Remove.
7158
374ad285
ILT
71592009-10-13 Ian Lance Taylor <iant@google.com>
7160
7161 Add support for -pie.
7162 * options.h (class General_options): Add -pie and
7163 --pic-executable.
7164 (General_options::output_is_position_independent): Test -pie.
7165 (General_options::output_is_executable): Return true if not shared
7166 and not relocatable.
7167 (General_options::output_is_pie): Remove.
7168 * options.cc (General_options::finalize): Reject incompatible uses
7169 of -pie.
7170 * gold.cc (queue_middle_tasks): A -pie link is not static.
7171 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7172 * symtab.cc (Symbol::final_value_is_known): Return false if
7173 output_is_position_independent.
7174 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7175 output_is_position_independent.
7176 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7177 output_is_position_independent.
7178 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7179 output_is_position_independent.
7180 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7181 two_file_pie_test.
7182 (basic_pie_test.o, basic_pie_test): New targets.
7183 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7184 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7185 (two_file_pie_test): New target.
7186 * testsuite/Makefile.in: Rebuild.
7187 * README: Remove note saying that -pie is not supported.
7188
c6585162
ILT
71892009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7190
7191 * options.h (class General_options): Add -init and -fini.
7192 * layout.cc (Layout::finish_dynamic_section): Emit
7193 given init and fini functions.
7194
032ce4e9
ST
71952009-10-13 Sriraman Tallam <tmsriram@google.com>
7196
7197 * gc.h (gc_process_relocs): Check if icf is enabled using new
7198 function.
7199 * gold.cc (queue_initial_tasks): Likewise.
7200 (queue_middle_tasks): Likewise.
7201 * object.cc (do_layout): Likewise.
7202 * symtab.cc (is_section_folded): Likewise.
7203 * main.cc (main): Likewise.
7204 * reloc.cc (Read_relocs::run): Likewise.
7205 (Sized_relobj::do_scan_relocs): Likewise.
7206 * icf.cc (is_function_ctor_or_dtor): New function.
7207 (Icf::find_identical_sections): Check if function is ctor or dtor when
7208 safe icf is chosen.
7209 * options.h (General_options::icf): Change option to be an enum.
7210 (Icf_status): New enum.
7211 (icf_enabled): New method.
7212 (icf_safe_folding): New method.
7213 (set_icf_status): New method.
7214 (icf_status_): New variable.
7215 * (options.cc) (General_options::finalize): Set icf_status_.
7216 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7217 icf_test and icf_keep_unique_test to use the --icf enum flag.
7218 * testsuite/icf_safe_test.sh: New file.
e1df38aa 7219 * testsuite/icf_safe_test.cc: New file.
032ce4e9 7220
f345227a
ST
72212009-10-12 Sriraman Tallam <tmsriram@google.com>
7222
7223 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7224 includes to gc.h and icf.h.
7225 * arm.cc: Include gc.h.
7226 * gold.cc: Likewise.
7227 * i386.cc: Likewise.
7228 * powerpc.cc: Likewise.
7229 * sparc.cc: Likewise.
7230 * x86_64.cc: Likewise.
7231 * gc.h: Include icf.h.
7232
1c7814ed
ILT
72332009-10-11 Ian Lance Taylor <iant@google.com>
7234
7235 * plugin.cc: Include "gold.h" before other header files.
7236
ae3b5189
CD
72372009-10-10 Chris Demetriou <cgd@google.com>
7238
7239 * options.h (Input_file_argument::Input_file_type): New enum.
7240 (Input_file_argument::is_lib_): Replace with...
7241 (Input_file_argument::type_): New member.
7242 (Input_file_argument::Input_file_argument): Take Input_file_type
7243 'type' rather than boolean 'is_lib' as second argument.
7244 (Input_file_argument::is_lib): Use type_.
7245 (Input_file_argument::is_searched_file): New function.
7246 (Input_file_argument::may_need_search): Handle is_searched_file.
7247 * options.cc (General_options::parse_library): Support -l:filename.
7248 (General_options::parse_just_symbols): Update for Input_file_argument
7249 changes.
7250 (Command_line::process): Likewise.
7251 * archive.cc (Archive::get_file_and_offset): Likewise.
7252 * plugin.cc (Plugin_manager::release_input_file): Likewise.
7253 * script.cc (read_script_file, script_add_file): Likewise.
7254 * fileread.cc (Input_file::Input_file): Likewise.
7255 (Input_file::will_search_for): Handle is_searched_file.
7256 (Input_file::open): Likewise.
7257 * readsyms.cc (Read_symbols::get_name): Likewise.
7258 * testsuite/Makefile.am (searched_file_test): New test.
7259 * testsuite/Makefile.in: Regenerate.
7260 * testsuite/searched_file_test.cc: New file.
7261 * testsuite/searched_file_test_lib.cc: New file.
7262
f3048a1d
ILT
72632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7264 Ian Lance Taylor <iant@google.com>
7265
7266 * descriptor.cc: Include <cstdio> and "binary-io.h".
7267 (Descriptors::open): Open the files in binary mode always.
7268 * script.cc (Lex::get_token): Treat \r as whitespace.
7269
d4780e57
ILT
72702009-10-09 Ian Lance Taylor <iant@google.com>
7271
7272 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
7273
d9a893b8
ILT
72742009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7275 Ian Lance Taylor <iant@google.com>
7276
7277 * configure.ac: Check for readv function also.
7278 * fileread.cc (readv): Define if not HAVE_READV.
7279 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
7280 does not exist.
7281 * config.in: Regenerate.
7282 * configure: Regenerate.
7283
c0a62865
DK
72842009-10-09 Doug Kwan <dougkwan@google.com>
7285
7286 * layout.cc (Layout::make_output_section): Call target hook to make
7287 ordinary output section.
7288 (Layout::finalize): Adjust parameter list of call the
7289 Target::may_relax().
7290 * layout.h (class Layout::section_list): New method.
7291 * merge.h (Output_merge_base::entsize): Change visibility to public.
7292 (Output_merge_base::is_string, Output_merge_base::do_is_string):
7293 New methods.
7294 (Output_merge_string::do_is_string): New method.
7295 * object.cc (Sized_relobj::do_setup): renamed from
7296 Sized_relobj::set_up.
7297 * object.h (Sized_relobj::adjust_shndx,
7298 Sized_relobj::initializ_input_to_output_maps,
7299 Sized_relobj::free_input_to_output_maps): Change visibilities to
7300 protected.
7301 (Sized_relobj::setup): Virtualize.
7302 (Sized_relobj::do_setup): New method declaration.
7303 (Sized_relobj::invalidate_section_offset,
7304 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
7305 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
7306 * options.cc (parse_int): New function.
7307 * options.h (parse_int): New declaration.
7308 (DEFINE_int): New macro.
7309 (stub_group_size): New option.
7310 * output.cc (Output_section::Output_section): Initialize memebers
7311 merge_section_map_, merge_section_by_properties_map_,
7312 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
7313 (Output_section::add_input_section): Handled deferred code-fill
7314 generation and remove an old comment.
7315 (Output_section::add_relaxed_input_section): New method definition.
7316 (Output_section::add_merge_input_section): Use merge section by
7317 properties map to speed to search. Update merge section maps
7318 as appropriate.
7319 (Output_section::build_relaxation_map): New method definition.
7320 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7321 Same.
7322 (Output_section::relax_input_section): Renamed to
7323 Output_section::convert_input_sections_to_relaxed_sections and change
7324 interface to take a vector of pointers to relaxed sections.
7325 (Output_section::find_merge_section,
7326 Output_section::find_relaxed_input_section): New method definitions.
7327 (Output_section::is_input_address_mapped,
7328 Output_section::output_offset, Output_section::output_address):
7329 Use output section data maps to speed up searching.
7330 (Output_section::find_starting_output_address): Add comments.
7331 (Output_section::do_write,
7332 Output_section::write_to_postprocessing_buffer): Do code-fill
7333 generation as appropriate.
7334 (Output_section::get_input_sections): Invalidate relaxed input section
7335 map.
7336 (Output_section::restore_states): Adjust type of checkpoint .
7337 Invalidate relaxed input section map.
7338 * output.h (Output_merge_base): New class declaration.
7339 (Input_section_specifier): New class defintion.
7340 (class Output_relaxed_input_section) Change base class to
7341 Output_section_data_build.
7342 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
7343 base class initializer.
7344 (Output_section::add_relaxed_input_section): New method declaration.
7345 (Output_section::Input_section): Change visibility to protected.
7346 (Output_section::Input_section::relobj,
7347 Output_section::Input_section::shndx): Handle relaxed input sections.
7348 Output_section::input_sections) Change visibility to protected. Also
7349 define overload to return a non-const pointer.
7350 (Output_section::Merge_section_properties): New class defintion.
7351 (Output_section::Merge_section_by_properties_map,
7352 Output_section::Output_section_data_by_input_section_map,
7353 Output_section::Relaxation_map): New types.
7354 (Output_section::relax_input_section): Rename method to
7355 Output_section::convert_input_sections_to_relaxed_sections and change
7356 interface to take a vector of relaxed section pointers.
7357 (Output_section::find_merge_section,
7358 Output_section::find_relaxed_input_section,
7359 Output_section::build_relaxation_map,
7360 Output_section::convert_input_sections_in_list_to_relaxed_sections):
7361 New method declarations.
7362 (Output_section::merge_section_map_
7363 Output_section::merge_section_by_properties_map_,
7364 Output_section::relaxed_input_section_map_,
7365 Output_section::is_relaxed_input_section_map_valid_,
7366 Output_section::generate_code_fills_at_write_): New data members.
7367 * script-sections.cc
7368 (Output_section_element_input::set_section_addresses): Call
7369 current_data_size and addralign methods of relaxed input sections.
7370 (Orphan_output_section::set_section_addresses): Call current_data_size
7371 and addralign methods of relaxed input sections.
7372 * symtab.cc (Symbol_table::compute_final_value): Extract template
7373 from the body of Symbol_table::sized_finalize_symbol.
7374 (Symbol_table::sized_finalized_symbol): Call
7375 Symbol_table::compute_final_value.
7376 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
7377 (Symbol_table::compute_final_value): New templated method declaration.
7378 * target.cc (Target::do_make_output_section): New method defintion.
7379 * target.h (Target::make_output_section): New method declaration.
7380 (Target::relax): Add more parameters for input objects, symbol table
7381 and layout. Adjust call to do_relax.
7382 (Target::do_make_output_section): New method declaration.
7383 (Target::do_relax): Add parameters for input objects, symbol table
7384 and layout.
7385
d446d6c4
ILT
73862009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7387
7388 * pread.c: Include stdio.h.
7389
bc06c745
ILT
73902009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7391
7392 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
7393 defined.
7394
75aea3d0
ILT
73952009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7396
7397 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7398 Change read_shndx type to unsigned int.
7399 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7400 int.
7401 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7402 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7403 Change read_shndx type to unsigned int.
7404 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7405 int.
7406 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7407 * layout.cc (Layout::create_symtab_sections): Cast the result of
7408 local_symcount * symsize to off_t in the gold_assert.
7409
be8fcb75
ILT
74102009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7411
7412 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7413 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7414 R_ARM_BASE_ABS.
7415 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7416 (Arm_relocate_functions::thm_abs5): New function.
7417 (Arm_relocate_functions::abs12): New function.
7418 (Arm_relocate_functions::abs16): New function.
7419 (Arm_relocate_functions::base_abs): New function.
7420 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7421 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7422 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7423 R_ARM_BASE_ABS.
7424 (Scan::global): Likewise.
7425 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7426 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7427 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7428 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7429 R_ARM_BASE_ABS.
7430
c2a122b6
ILT
74312009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7432
7433 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7434 (Arm_relocate_functions::movt_prel): New function.
7435 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7436 (Arm_relocate_functions::thm_movt_prel): New function.
7437 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7438 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7439 (Scan::global, Relocate::relocate): Likewise.
7440 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7441
c4aa1e2d
ILT
74422009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7443
7444 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7445 Incremental_checker.
7446 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7447 unsigned int.
7448 (class Incremental_inputs_header): New class.
7449 (Incremental_inputs_header_writer): Edit comment.
7450 (Incremental_inputs_entry): New class.
7451 (Incremental_inputs_entry_writer): Edit comment.
7452 (Sized_incremental_binary::do_find_incremental_inputs_section):
7453 Add *strtab_shndx parameter, fill it.
7454 (Sized_incremental_binary::do_check_inputs): New method.
7455 (Incremental_checker::can_incrementally_link_output_file): Use
7456 Sized_incremental_binary::check_inputs.
7457 (Incremental_inputs::report_command_line): Save command line in
7458 command_line_.
7459 * incremental.h:
7460 (Incremental_binary::find_incremental_inputs_section): New
7461 method.
7462 (Incremental_binary::do_find_incremental_inputs_section): Add
7463 strtab_shndx parameter.
7464 (Incremental_binary::do_check_inputs): New pure virtual method.
7465 (Sized_incremental_binary::do_check_inputs): Declare.
7466 (Incremental_checker::Incremental_checker): Add incremental_inputs
7467 parameter, use it to initialize incremental_inputs_.
7468 (Incremental_checker::incremental_inputs_): New field.
7469 (Incremental_checker::command_line): New method.
7470 (Incremental_checker::inputs): New method.
7471 (Incremental_checker::command_line_): New field.
7472
c549a694
ILT
74732009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7474
7475 * incremental.cc: Include <cstdarg> and "target-select.h".
7476 (vexplain_no_incremental): New function.
7477 (explain_no_incremental): New function.
7478 (Incremental_binary::error): New method.
7479 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7480 method.
7481 (make_sized_incremental_binary): New function.
7482 (open_incremental_binary): New function.
7483 (can_incrementally_link_file): Add checks if output is ELF and has
7484 inputs section.
7485 * incremental.h: Include "elfcpp_file.h" and "output.h".
7486 (Incremental_binary): New class.
7487 (Sized_incremental_binary): New class.
7488 (open_incremental_binary): Declare.
7489 * object.cc (is_elf_object): Use
7490 elfcpp::Elf_recognizer::is_elf_file.
7491 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7492 * output.h (Output_file::filesize): New method.
7493
fd3c5f0b
ILT
74942009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7495
7496 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7497 New function.
7498 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7499 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7500 function.
7501 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7502 function.
7503 (Arm_relocate_functions::movw_abs_nc): New function.
7504 (Arm_relocate_functions::movt_abs): New function.
7505 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7506 (Arm_relocate_functions::thm_movt_abs): New function.
7507 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7508 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7509 (Scan::global): Likewise.
7510 (Relocate::relocate): Likewise.
7511 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7512
7f5309a5
ILT
75132009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7514
7515 * arm.cc (Arm_relocate_functions::got_prel) New function.
7516 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7517 (Relocate::relocate): Likewise.
7518 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7519
364c7fa5
ILT
75202009-10-06 Ian Lance Taylor <iant@google.com>
7521
7522 * options.h (class General_options): Define
7523 split_stack_adjust_size parameter.
7524 * object.h (class Object): Add uses_split_stack_ and
7525 has_no_split_stack_ fields. Add uses_split_stack and
7526 has_no_split_stack accessor functions. Declare
7527 handle_split_stack_section.
7528 (class Reloc_symbol_changes): Define.
7529 (class Sized_relobj): Define Function_offsets. Declare
7530 split_stack_adjust, split_stack_adjust_reltype, and
7531 find_functions.
7532 * object.cc (Object::handle_split_stack_section): New function.
7533 (Sized_relobj::do_layout): Call handle_split_stack_section.
7534 * dynobj.cc (Sized_dynobj::do_layout): Call
7535 handle_split_stack_section.
7536 * reloc.cc (Sized_relobj::relocate_sections): Call
7537 split_stack_adjust for executable sections in split_stack
7538 objects. Pass reloc_map to relocate_section.
7539 (Sized_relobj::split_stack_adjust): New function.
7540 (Sized_relobj::split_stack_adjust_reltype): New function.
7541 (Sized_relobj::find_functions): New function.
7542 * target-reloc.h: Include "object.h".
7543 (relocate_section): Add reloc_symbol_changes parameter. Change
7544 all callers.
7545 * target.h (class Target): Add calls_non_split method. Declare
7546 do_calls_non_split virtual method. Declare match_view and
7547 set_view_to_nop.
7548 * target.cc: Include "elfcpp.h".
7549 (Target::do_calls_non_split): New function.
7550 (Target::match_view): New function.
7551 (Target::set_view_to_nop): New function.
7552 * gold.cc (queue_middle_tasks): Give an error if mixing
7553 split-stack and non-split-stack objects with -r.
7554 * i386.cc (Target_i386::relocate_section): Add
7555 reloc_symbol_changes parameter.
7556 (Target_i386::do_calls_non_split): New function.
7557 * x86_64.cc (Target_x86_64::relocate_section): Add
7558 reloc_symbol_changes parameter.
7559 (Target_x86_64::do_calls_non_split): New function.
7560 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7561 parameter.
7562 * powerpc.cc (Target_powerpc::relocate_section): Add
7563 reloc_symbol_changes parameter.
7564 * sparc.cc (Target_sparc::relocate_section): Add
7565 reloc_symbol_changes parameter.
7566 * configure.ac: Call AM_CONDITIONAL for the default target.
7567 * configure: Rebuild.
7568 * testsuite/Makefile.am (TEST_AS): New variable.
7569 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7570 (check_DATA): Add split_i386 and split_x86_64 files.
7571 (SPLIT_DEFSYMS): Define.
7572 (split_i386_[1234n].o): New targets.
7573 (split_i386_[124]): New targets.
7574 (split_i386_[1234r].stdout): New targets.
7575 (split_x86_64_[1234n].o): New targets.
7576 (split_x86_64_[124]): New targets.
7577 (split_x86_64_[1234r].stdout): New targets.
7578 (MOSTLYCLEANFILES): Add new executables.
7579 * testsuite/split_i386.sh: New file.
7580 * testsuite/split_x86_64.sh: New file.
7581 * testsuite/split_i386_1.s: New file.
7582 * testsuite/split_i386_2.s: New file.
7583 * testsuite/split_i386_3.s: New file.
7584 * testsuite/split_i386_4.s: New file.
7585 * testsuite/split_i386_n.s: New file.
7586 * testsuite/split_x86_64_1.s: New file.
7587 * testsuite/split_x86_64_2.s: New file.
7588 * testsuite/split_x86_64_3.s: New file.
7589 * testsuite/split_x86_64_4.s: New file.
7590 * testsuite/split_x86_64_n.s: New file.
7591 * testsuite/testfile.cc (Target_test): Update relocation_section
7592 function.
7593 * testsuite/Makefile.in: Rebuild.
7594
e8a9fcda
ILT
75952009-10-06 Ian Lance Taylor <iant@google.com>
7596
7597 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7598 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7599 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7600 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7601 the address on ldo_addrs_.
7602 (Target_i386::Relocate::fix_up_ldo): New function.
7603
e99daf92
ILT
76042009-10-06 Rafael Espindola <espindola@google.com>
7605
7606 * plugin.cc (add_input_library): New.
7607 (Plugin::load): Add add_input_library to tv.
7608 (Plugin_manager::add_input_file): Add the is_lib argument.
7609 (add_input_file): Update call to Plugin_manager::add_input_file.
7610 (add_input_library): New.
7611 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7612
966d4097
DK
76132009-09-30 Doug Kwan <dougkwan@google.com>
7614
7615 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7616 symbol and call Symbol::may_need_copy_reloc to determine if
7617 a copy reloc is needed.
7618 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7619 nocopyreloc is given in command line.
7620 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7621 given in command line.
7622 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7623 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7624 of the removed Target_i386::may_need_copy_reloc.
7625 * options.h (copyreloc): New option with default value false.
7626 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7627 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7628 instead of the removed Target_powerpc::may_need_copy_reloc.
7629 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7630 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7631 instead of the removed Target_sparc::may_need_copy_reloc.
7632 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7633 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7634 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7635 instead of the removed Target_x86_64::may_need_copy_reloc.
7636
029ba973
ILT
76372009-09-30 Ian Lance Taylor <iant@google.com>
7638
7639 * object.h (class Object): Remove target_ field, and target,
7640 sized_target, and set_target methods.
7641 (Object::sized_target): Remove.
7642 (class Sized_relobj): Update declarations. Remove sized_target.
7643 * object.cc (Sized_relobj::setup): Remove target parameter.
7644 Change all callers.
7645 (Input_objects::add_object): Don't do anything with the target.
7646 (make_elf_sized_object): Add punconfigured parameter. Change all
7647 callers. Set or test parameter target.
7648 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7649 Change all callers.
7650 * parameters.cc (Parameters::set_target): Change parameter type to
7651 be non-const.
7652 (Parameters::default_target): Remove.
7653 (set_parameters_target): Change parameter type to be non-const.
7654 (parameters_force_valid_target): New function.
7655 (parameters_clear_target): New function.
7656 * parameters.h (class Parameters): Update declarations. Remove
7657 default_target method. Add sized_target and clear_target
7658 methods. Change target_ to be non-const.
7659 (set_parameters_target): Update declaration.
7660 (parameters_force_valid_target): Declare.
7661 (parameters_clear_target): Declare.
7662 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7663 as NULL if we aren't searching.
7664 (Add_symbols::run): Don't check for compatible target.
7665 * fileread.cc (Input_file::open_binary): Call
7666 parameters_force_valid_target.
7667 * gold.cc (queue_middle_tasks): Likewise.
7668 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
7669 set_target on object.
7670 * dynobj.h (class Sized_dynobj): Update declarations.
7671 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
7672 make_elf_object returns NULL.
7673 (Archive::include_member): Don't check whether object target is
7674 compatible.
7675 * output.cc (Output_section::add_input_section): Get target from
7676 parameters.
7677 (Output_section::relax_input_section): Likewise.
7678 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
7679 parameters.
7680 (Sized_relobj::do_scan_relocs): Likewise.
7681 (Sized_relobj::relocate_sections): Likewise.
7682 * resolve.cc (Symbol_table::resolve): Likewise.
7683 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7684 parameter. Change all callers.
7685 (Symbol_table::add_from_object): Get target from parameters.
7686 (Symbol_table::add_from_relobj): Don't check object target.
7687 (Symbol_table::add_from_dynobj): Likewise.
7688 (Symbol_table::define_special_symbol): Get target from
7689 parameters.
7690 * symtab.h (class Symbol_table): Update declaration.
7691 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7692 parameter. Change all callers. Clear parameter target.
7693 (Binary_test): Test target here.
7694 * testsuite/object_unittest.cc (gold_testsuite): Remove
7695 target_test_pointer parameter. Change all callers.
7696 (Object_test): Test target here.
7697
a6a22b83
ILT
76982009-09-26 Ian Lance Taylor <iant@google.com>
7699
7700 * testsuite/initpri1.c: Don't try to use constructor priorities if
7701 compiling with gcc before 4.3.
7702
6a8f49fe
ILT
77032009-09-22 Mikolaj Zalewski <mikolajz@google.com>
7704
7705 * testsuite/retain_symbols_file_test.sh (check_present): Change
7706 output file name to retain_symbols_file_test.stdout.
7707 (check_absent): Likewise.
7708
8c604651
CS
77092009-09-18 Craig Silverstein <csilvers@google.com>
7710
7711 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
7712 * options.cc: Include <cerrno> and <fstream>.
7713 (General_options::finalize): Parse -retain-symbols-file tag.
7714 * options.h: New flag.
7715 (General_options): New method should_retain_symbol, new
7716 variable symbols_to_retain.
7717 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
7718 should_retain_symbol map.
7719 * testsuite/Makefile.am (retain_symbols_file_test): New test.
7720 * testsuite/Makefile.in: Regenerate.
7721 * testsuite/retain_symbols_file_test.sh: New file.
7722
ca58b19f
NC
77232009-09-18 Nick Clifton <nickc@redhat.com>
7724
7725 * po/es.po: Updated Spanish translation.
7726
20e6d0d6
DK
77272009-09-17 Doug Kwan <dougkwan@google.com>
7728
7729 * debug.h (DEBUG_RELAXATION): New constant.
7730 (DEBUG_ALL): Add DEBUG_RELAXATION.
7731 (debug_string_to_enum): Add relaxation debug option.
7732 * layout.cc
7733 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
7734 Layout::Relaxation_debug_check::read_sections,
7735 Layout::Relaxation_debug_check::read_sections): New method definitions.
7736 (Layout::Layout): Initialize data members
7737 record_output_section_data_from_scrips_,
7738 script_output_section_data_list_ and relaxation_debug_check_.
7739 (Layout::save_segments, Layout::restore_segments,
7740 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7741 Layout::relaxation_loop_body): New method definitions.
7742 (Layout::finalize): Support relaxation. Move section layout code to
7743 Layout::relaxation_loop_body.
7744 (Layout::set_asection_address_from_script): Move code for orphan
7745 section placement out.
7746 (Layout::place_orphan_sections_in_script): New method definition.
7747 * layout.h (Output_segment_headers, Output_file_header):
7748 New forward class declarations.
7749 (Layout::~Layout): Define.
7750 (Layout::new_output_section_data_from_script): New method definition.
7751 (Layout::place_orphan_sections_in_script): New method declaration.
7752 (Layout::Segment_states): New type declaration.
7753 (Layout::save_segments, Layout::restore_segments,
7754 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7755 Layout::relaxation_loop_body): New method declarations.
7756 (Layout::Output_section_data_list): New type declaration.
7757 (Layout::Relaxation_debug_check): New class definition.
7758 (Layout::record_output_section_data_from_script_,
7759 Layout::script_output_section_data_list_, Layout::segment_states_,
7760 Layout::relaxation_debug_check_): New data members.
7761 * output.cc: (Output_section_headers::do_size): New method definition.
7762 (Output_section_headers::Output_section_headers): Move size
7763 computation to Output_section_headers::do_size.
7764 (Output_segment_headers::do_size): New method definition.
e1df38aa 7765 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
7766 Output_file_header::do_size and call it.
7767 (Output_file_header::do_size): New method definition.
7768 (Output_data_group::Output_data_group): Adjust call to
7769 Output_section_data.
7770 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
7771 (Output_symtab_xindex::do_write): Add array bound check.
7772 (Output_section::Input_section::print_to_mapfile): Handle
7773 RELAXED_INPUT_SECTION_CODE.
7774 (Output_section::Output_section): Initialize data member checkpoint_.
7775 (Output_section::~Output_section): Delete checkpoint object pointed
7776 by checkpoint_.
7777 (Output_section::add_input_section): Always add an Input_section if
7778 relaxing.
7779 (Output_section::add_merge_input_section): Add assert.
7780 (Output_section::relax_input_section): New method definition.
7781 (Output_section::set_final_data_size): Set load address to zero for
7782 an unallocated section.
7783 (Output_section::do_address_and_file_offset_have_reset_values):
7784 New method definition.
7785 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
7786 Handle relaxed input section.
7787 (Output_section::sort_attached_input_sections): Checkpoint input
7788 section list lazily.
7789 (Output_section::get_input_sections): Change type of input_sections to
7790 list of Simple_input_section pointers. Checkpoint input section list
7791 lazily. Also handle relaxed input sections.
7792 (Output_section::add_input_section_for_script): Take a reference to
7793 a Simple_input_section object instead of Relobj pointer and section
7794 index as parameter. Handle relaxed input sections.
7795 (Output_section::save_states, Output_section::restore_states): New
7796 method definitions.
7797 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
7798 (Output_data::is_data_size_fixed): New method definition.
7799 (Output_data::reset_addresss_and_file_offset): Do not reset data size
7800 if it is fixed.
7801 (Output_data::address_and_file_offset_have_reset_values): New method
7802 definition.
7803 (Output_data::do_address_and_file_offset_have_reset_values): New method
7804 definition.
7805 (Output_data::set_data_size): Check that data size is not fixed.
7806 (Output_data::fix_data_size): New method definition.
7807 (Output_data::is_data_size_fixed_): New data member.
7808 (Output_section_headers::set_final_data_size): New method definition.
7809 (Output_section_headers::do_size): New method declaration.
7810 (Output_segment_headers::set_final_data_size): New method definition.
7811 (Output_segment_headers::do_size): New method declaration.
7812 (Output_file_header::set_final_data_size)::New method definition.
7813 (Output_file_header::do_size)::New method declaration.
7814 (Output_section_data::Output_section_data): Add new parameter
7815 is_data_size_fixed and use it to fix data size.
7816 (Output_data_const::Output_data_const): Adjust call to base class
7817 constructor and fix data size.
7818 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
7819 base class constructor and fix data size.
7820 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
7821 base class constructor and fix data size.
7822 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
7823 class constructor and fix data size.
7824 (Output_data_group::set_final_data_size): New method definition.
7825 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
7826 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
7827 class constructor and fix data size.
7828 (Output_relaxed_input_section): New class definition.
7829 (Output_section::Simple_input_section): New class definition.
7830 (Output_section::get_input_sections): Adjust parameter list.
7831 (Output_section::add_input_section_for_script): Same.
7832 (Output_section::save_states, Output_section::restore_states,
7833 Output_section::do_address_and_file_offset_have_reset_values,
7834 (Output_section::Input_section::Input_section): Handle
7835 RELAXED_INPUT_SECTION_CODE. Add new overload for
7836 Output_relaxed_input_section.
7837 (Output_section::Input_section::is_input_section,
7838 Output_section::Input_section::set_output_section): Handle relaxed
7839 input section.
7840 (Output_section::Input_section::is_relaxed_input_section,
7841 Output_section::Input_section::output_section_data,
7842 Output_section::Input_section::relaxed_input_section): New method
7843 definitions.
7844 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
7845 value.
7846 (Output_section::Input_section::u1_): Update comments.
7847 (Output_section::Input_section::u2_): Add new union member poris.
7848 (Output_section::Checkpoint_output_section): New classs definition.
7849 (Output_section::relax_input_section): New method declaration.
7850 (Output_section::checkpoint_): New data member.
7851 (Output_segment): Update comments.
7852 (Output_segment::Output_segment): Un-privatize copy constructor.
7853 (Output_segment::operator=): Un-privatize.
7854 * script-sections.cc (Output_section_element::Input_section_list):
7855 Change element type to Output_section::Simple_input_section.
7856 (Output_section_element_dot_assignment::set_section_addresses):
7857 Register output section data for relaxation clean up.
7858 (Output_data_exression::Output_data_expression): Adjust call to base
7859 constructor to fix data size.
7860 (Output_section_element_data::set_section_addresses): Register
7861 Output_data_expression object for relaxation clean up.
7862 (struct Input_section_info): Replace Relobj pointer and section index
7863 pair with Output_section::Simple_input_section and Convert struct to a
7864 class.
7865 (Input_section_sorter::operator()): Adjust access to
e1df38aa 7866 Input_section_info data member to use accessors.
20e6d0d6
DK
7867 (Output_section_element_input::set_section_addresses): Use layout
7868 parameter. Adjust code to use Output_section::Simple_input_section
7869 and Input_secction_info classes. Register filler for relaxation
7870 clean up.
7871 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
7872 and section index pair with Output_section::Simple_input_section
7873 class. Adjust code accordingly.
7874 (Phdrs_element::release_segment): New method definition.
7875 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
7876 segment list.
7877 (Script_sections::release_segments): New method definition.
7878 * gold/script-sections.h (Script_sections::release_segments): New
7879 method declaration.
7880 * gold/target.h (Target::may_relax, Target::relax,
7881 Target::do_may_relax, Target::do_relax): New method definitions.
7882
5e445df6
ILT
78832009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7884
7885 * arm.cc (has_signed_unsigned_overflow): New function.
7886 (Arm_relocate_functions::abs8): New function.
7887 (Target_arm::Scan::local): Handle R_ARM_ABS8.
7888 (Target_arm::Scan::global): Likewise.
7889 (Target_arm::relocate::relocate): Likewise.
7890 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7891 Likewise.
7892
8c604651 78932009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
7894
7895 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
7896 * testsuite/Makefile.in: Regenerate.
7897
1e9cc1c2
NC
78982009-09-11 Nick Clifton <nickc@redhat.com>
7899
7900 * po/gold.pot: Updated by the Translation project.
7901
6a89f575
CC
79022009-09-08 Cary Coutant <ccoutant@google.com>
7903
7904 * output.cc (Output_file::open): Add execute permission to empty file.
7905 * testsuite/Makefile.am (permission_test): New test.
7906 * testsuite/Makefile.in: Regenerate.
7907
fdcac5af
ILT
79082009-09-02 Ian Lance Taylor <iant@google.com>
7909
7910 * output.cc (Output_file::resize): Call map_no_anonymous rather
7911 than map.
7912
44453f85
ILT
79132009-09-01 Mikolaj Zalewski <mikolajz@google.com>
7914
7915 * gold.cc: Include "incremental.h".
7916 (queue_initial_tasks): Call Incremental_checker methods.
7917 * incremental.cc: Include "output.h".
7918 (Incremental_checker::can_incrementally_link_output_file): New
7919 method.
7920 * incremental.h (Incremental_checker): New class.
7921
7922 * output.cc (Output_file::open_for_modification): New method.
7923 (Output_file::map_anonymous): Changed return type to bool. Record
7924 map in base_ field.
7925 (Output_file::map_no_anonymous): New method, broken out of map.
7926 (Output_file::map): Use map_no_anonymous and map_anonymous.
7927 * output.h (class Output_file): Update declarations.
7928
293c1386
CC
79292009-08-24 Cary Coutant <ccoutant@google.com>
7930
7931 * options.h (Command_line::Pre_options): New class.
7932 (Command_line::pre_options): New member.
7933 * options.cc (gold::options::ready_to_register): New variable.
7934 (One_option::register_option): Do nothing if not registering options.
7935 Assert if same short option registered twice.
7936 (General_options::General_options): Turn off option registration when
7937 done constructing.
7938 (Command_line::Pre_options::Pre_options): New constructor.
7939
f773f3d2
CC
79402009-08-24 Cary Coutant <ccoutant@google.com>
7941
06a73cfe
CC
7942 * options.h (General_options::no_keep_memory): Remove incorrect
7943 short option.
f773f3d2 7944
a15af8e2
RW
79452009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7946
7947 * Makefile.am (am__skiplex, am__skipyacc): New.
7948 * Makefile.in: Regenerate.
7949
c462b41b
RW
79502009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7951
14ec8efd
RW
7952 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7953 (INCLUDES): ... this.
7954 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7955 (AM_CPPFLAGS): Renamed from ...
7956 (INCLUDE): ... this.
7957 * Makefile.in, testsuite/Makefile.in: Regenerate.
7958
81ecdfbb
RW
7959 * Makefile.in: Regenerate.
7960 * aclocal.m4: Likewise.
7961 * config.in: Likewise.
7962 * configure: Likewise.
7963 * testsuite/Makefile.in: Likewise.
7964
c462b41b
RW
7965 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7966 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7967 * Makefile.in: Regenerate.
7968 * testsuite/Makefile.in: Regenerate.
7969
2da73f13
CC
79702009-08-19 Cary Coutant <ccoutant@google.com>
7971
7972 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7973 symbols in shared libraries overridden by hidden or internal symbols
7974 in the main program.
7975
2db70501
CD
79762009-08-19 Chris Demetriou <cgd@google.com>
7977
7978 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7979 checking source file names in error messages.
7980
f733487b
DK
79812009-08-18 Doug Kwan <dougkwan@google.com>
7982
7983 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7984 an elcpp::Ehdr as parameter. Adjust call to set_target.
7985 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7986 an elfcpp::Ehdr as parameter.
7987 * object.cc (Object::set_target): Remove the version that looks up
7988 a target and sets it.
7989 (Sized_relobj::setup): Take a Target object instead of
7990 an elfcpp::Ehdr as parameter. Adjust call to set_target.
7991 (make_elf_sized_object): Find target and ask target to
7992 make an ELF object.
7993 * object.h: (Object::set_target): Remove the version that looks up
7994 a target and sets it.
7995 (Sized_relobj::setup): Take a Target object instead of
7996 an elfcpp:Ehdr as parameter.
7997 * target.cc: Include dynobj.h.
7998 (Target::do_make_elf_object_implementation): New.
7999 (Target::do_make_elf_object): New.
8000 * target.h (Target::make_elf_object): New template declaration.
8001 (Target::do_make_elf_object): New method declarations.
8002 (Target::do_make_elf_object_implementation): New template declaration.
8003
cc70f101
ILT
80042009-08-14 Ian Lance Taylor <iant@google.com>
8005
8006 * gold.h (FUNCTION_NAME): Define.
8007 (gold_unreachable): Use FUNCTION_NAME.
8008
ef5e0cb1
ST
80092009-08-12 Sriraman Tallam <tmsriram@google.com>
8010
8011 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8012 symbol in the --keep-unique list is not found.
8013
48c187ce
ST
80142009-08-12 Sriraman Tallam <tmsriram@google.com>
8015
8016 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8017 been maked as --keep-unique.
8018 (Icf::unfold_section): New function.
8019 * icf.h (Icf::unfold_section): New function.
8020 * options.h (General_options::keep_unique): New option.
8021 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8022 * testsuite/Makefile.in: Regenerate.
8023 * testsuite/icf_keep_unique_test.sh: New file.
8024 * testsuite/icf_keep_unique_test.cc: New file.
8025
645afe0c
CC
80262009-08-12 Cary Coutant <ccoutant@google.com>
8027
8028 PR 10471
8029 * resolve.cc (Symbol_table::resolve): Check for references from
8030 dynamic objects to hidden and internal symbols.
8031 * testsuite/Makefile.am (hidden_test.sh): New test.
8032 * testsuite/Makefile.in: Regenerate.
8033 * testsuite/hidden_test.sh: New script.
8034 * testsuite/hidden_test_1.c: New test source.
8035 * testsuite/hidden_test_main.c: New test source.
8036
11af873f
DK
80372009-08-11 Doug Kwan <dougkwan@google.com>
8038
8039 * arm.cc: Update comments.
8040 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8041 segment to locate the .ARM.exidx section if present.
8042
b9f7d72d
DK
80432009-08-09 Doug Kwan <dougkwan@google.com>
8044
8045 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8046 patch.
8047
ddd3c53c
ST
80482009-08-07 Sriraman Tallam <tmsriram@google.com>
8049 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8050 compiler warnings.
8051
27721062
ST
80522009-08-06 Sriraman Tallam <tmsriram@google.com>
8053
8054 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8055 valid tls_segment only for non-debug-section relocations.
8056 * testsuite/Makefile.am: Add gc_tls_test.
8057 * testsuite/Makefile.in: Regenerate.
8058 * testsuite/gc_tls_test.cc: New file.
8059 * testsuite/gc_tls_test.sh: New file.
8060
ef15dade 80612009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 8062
ef15dade
ST
8063 * icf.cc: New file.
8064 * icf.h: New file.
8065 * Makefile.am (CCFILES): Add icf.cc.
8066 (HFILES): Add icf.h
8067 * Makefile.in: Regenerate.
8068 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8069 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8070 section, symbol and addend information for the relocs.
8071 * gold.cc (queue_middle_tasks): Call identical code folding.
8072 * gold.h: Add defines for multimap.
8073 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8074 to the call of finalize_local_symbols.
8075 * main.cc (main): Create object of class Icf.
8076 * object.cc (Sized_relobj::do_layout): Allow this function to be
8077 called twice during icf.
8078 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8079 to sections marked as identical by icf.
8080 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8081 when available.
8082 (Sized_relobj::do_section_entsize): New function.
8083 * object.h (Object::section_entsize): New function.
8084 (Object::do_section_entsize): New pure virtual function.
8085 (Relobj::finalize_local_symbols): Add new parameter.
8086 (Relobj::do_section_entsize): New function.
8087 * options.h (General_options::icf): New option.
8088 (General_options::icf_iterations): New option.
8089 (General_options::print_icf_sections): New option.
8090 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8091 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8092 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8093 icf.
8094 * symtab.cc (Symbol_table::is_section_folded): New function.
8095 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8096 to sections marked as identical by icf.
8097 * symtab.h (Symbol_table::set_icf): New function.
8098 (Symbol_table::icf): New function.
8099 (Symbol_table::is_section_folded): New function.
8100 (Symbol_table::icf_): New data member.
8101 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8102 * testsuite/Makefile.am: Add commands to build icf_test.
8103 * testsuite/Makefile.in: Regenerate.
8104 * testsuite/icf_test.sh: New file.
8105 * testsuite/icf_test.cc: New file.
8106
c3b65ac4
CD
81072009-07-24 Chris Demetriou <cgd@google.com>
8108
8109 * layout.cc (is_compressible_debug_section): Fix incorrect
8110 comment about compressed section names.
8111
1caf2c51
ILT
81122009-07-20 Ian Lance Taylor <ian@airs.com>
8113
8114 PR 10419
8115 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8116
1ef4d87f
ILT
81172009-07-16 Ian Lance Taylor <iant@google.com>
8118
8119 PR 10400
8120 * layout.h: #include <map>.
8121 (class Kept_section): Change from struct to class. Add accessors
8122 and setters. Add section size to Comdat_group mapping. Change
8123 Comdat_group to std::map. Add is_comdat_ field. Add
8124 linkonce_size field in union.
8125 (class Layout): Update declaration of find_or_add_kept_section.
8126 Don't declare find_kept_object.
8127 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8128 parameter. Add object, shndx, is_comdat, and is_group_name
8129 parameters. Change all callers. Adjust for new Kept_section.
8130 (Layout::find_kept_object): Remove.
8131 * object.cc (Sized_relobj::include_section_group): Update use of
8132 Kept_section. Rename secnum to shndx. Only record
8133 Kept_comdat_section if sections are the same size.
8134 (Sized_relobj::include_linkonce_section): Update use of
8135 Kept_section. Only record Kept_comdat_section if sections are the
8136 same size. Set size of linkonce section.
8137 (Sized_relobj::map_to_kept_section): Update call to
8138 get_kept_comdat_section.
8139 * object.h (class Sized_relobj): Rename fields in
8140 Kept_comdat_section to drop trailing underscores; change object
8141 field to Relobj*. Change Kept_comdat_section_table to store
8142 struct rather than pointer.
8143 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8144 Add kept_object and kept_shndx parameters. Change all callers.
8145 (Sized_relobj::get_kept_comdat_section): Change return type to
8146 bool. Add kept_object and kept_shndx parameters. Change all
8147 callers.
8148 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8149 Layout::find_or_add_kept_section.
8150
37c3b7b0
ILT
81512009-07-09 Ian Lance Taylor <iant@google.com>
8152
8153 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8154 Reserve space in the hash table.
8155
98fa85cb
ILT
81562009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8157
8158 * fileread.cc (File_read::get_mtime): New method.
8159 * fileread.h (Timespec): New structure.
8160 (File_read::get_mtime): New method.
8161 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8162 Renamed from timestamp_nsec.
8163 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8164 Elf_Xword.
e1df38aa 8165 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 8166 timestamp_nsec.
e1df38aa 8167 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
8168 (Incremental_inputs::report_obejct): Save mtime; style fix.
8169 (Incremental_inputs::report_script): Save mtime; style fix.
8170 (Incremental_inputs::finalize_inputs): Style fix.
8171 (Incremental_inputs::finalize): Style fix.
8172 (Incremental_inputs::create_input_section_data): Store inputs
8173 mtime.
8174 * incremental.h (Incremental_inputs::report_script): Add mtime
8175 argument.
8176 (Incremental_inputs::Input_info::Input_info): Intialize only one
8177 union member.
8178 (Incremental_inputs::Input_info::archive): Move to nameless
8179 union.
8180 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8181 (Incremental_inputs::Input_info::script): Move to nameless union.
8182 (Incremental_inputs::mtime): New field.
8183 * script.cc (read_input_script): Pass file mtime to
8184 Incremental_input.
8185 * script.h (Script_info::inputs): Style fix.
8186
c9d70757
ILT
81872009-07-01 Ian Lance Taylor <ian@airs.com>
8188
8189 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8190 instead of 32.
8191
9c547ec3
ILT
81922009-06-24 Ian Lance Taylor <iant@google.com>
8193
8194 PR 10156
8195 * layout.cc (Layout::choose_output_section): If we find an
8196 existing section, update the flags.
8197 (Layout::create_notes): New function, broken out of
8198 Layout::finalize.
8199 (Layout::finalize): Don't create note sections.
8200 (Layout::create_note): Don't crash if linker script discards
8201 section.
8202 (Layout::create_gold_note): Likewise.
8203 (Layout::create_build_id): Likewise. Don't set
8204 after_input_sections on the section.
8205 (Layout::create_executable_stack_info): Remove target parameter.
8206 Change caller.
8207 * layout.h (class Layout): Declare create_notes. Update
8208 declaration of create_executable_stack_info.
8209 * gold.cc (queue_middle_tasks): Call create_notes.
8210 * output.cc (Output_section::update_flags_for_input_section): Move
8211 here from output.h. If SHF_ALLOC flag is newly set, mark address
8212 invalid.
8213 * output.h (Output_data::mark_address_invalid): New function.
8214 (class Output_section): Only declare, not define,
8215 update_flags_for_input_section. Remove set_flags.
8216
55458500
ILT
82172009-06-24 Ian Lance Taylor <iant@google.com>
8218
8219 * script-sections.cc (Output_section_definition::
8220 set_section_addresses): Rename shadowing local load_address to
8221 laddr.
8222
1307d6cd
ILT
82232009-06-24 Ian Lance Taylor <iant@google.com>
8224
8225 PR 10244
8226 * reloc.cc (relocate_sections): Skip empty relocation sections.
8227
ec3f783e
ILT
82282009-06-23 Ian Lance Taylor <iant@google.com>
8229
8230 PR 10156
8231 * layout.cc (Layout::create_note): Use choose_output_section
8232 rather than make_output_section.
8233
459c9f1c
ILT
82342009-06-23 Ian Lance Taylor <iant@google.com>
8235
8236 PR 10237
8237 * options.cc (General_options::parse_V): Set printed_version_.
8238 (General_options::General_options): Initialize printed_version_.
8239 * options.h (class General_options): Add printed_version_ field.
8240 * gold.cc (queue_initial_tasks): If there are no input files,
8241 don't give a fatal error if we printed the version information.
8242 (queue_middle_tasks): If using -r with a shared object, give a
8243 fatal error rather than an ordinary error.
8244
1518dc8f
ILT
82452009-06-23 Ian Lance Taylor <iant@google.com>
8246
8247 PR 10219
8248 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
8249 (Layout::make_output_section): Set have_stabstr_section_ if we see
8250 a .stab*str section.
8251 (Layout::finalize): Call link_stabs_sections.
8252 (Layout::link_stabs_sections): New file.
8253 * layout.h (class Layout): Add have_stabstr_section_ field.
8254 Declare link_stabs_sections.
8255
3d857b98
DK
82562009-06-23 Doug Kwan <dougkwan@google.com>
8257
8258 * Makefile.am (libgold_a_LIBADD): New.
8259 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
8260 * Makefile.in: Regenerate.
8261 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
8262 * configure: Regenerate.
8263 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
8264 * fileread.cc: Include sys/state.h
8265 * gold.h: Declare memmem and strndup if found missing.
8266 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
8267
0639a6f6
ILT
82682009-06-23 Ian Lance Taylor <iant@google.com>
8269
8270 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
8271 * configure: Rebuild.
8272
8d63875c
ILT
82732009-06-23 Ian Lance Taylor <iant@google.com>
8274
8275 PR 10147
8276 * object.cc (Object::section_contents): Don't try to get a view if
8277 the section has length zero.
8278 (Object::handle_gnu_warning_section): If the section is empty, use
8279 the name of the section as the warning.
8280
f7c8a183
ILT
82812009-06-23 Ian Lance Taylor <iant@google.com>
8282
8283 PR 10133
8284 * stringpool.h (class Stringpool_template): Add optimize_ field.
8285 (Stringpool_template::set_optimize): New function.
8286 * stringpool.cc (Stringpool_template::Stringpool_template):
8287 Initialize optimize_ field.
8288 (Stringpool_template::set_string_offsets): Test local optimize
8289 fild rather than parameter.
8290 * layout.cc (Layout::Layout): Call set_optimize on the section
8291 name stringpool.
8292
e6a307ba
ILT
82932009-06-22 Ian Lance Taylor <iant@google.com>
8294
8295 PR 10030
8296 * yyscript.y: Parse TARGET.
8297 * script.cc (script_set_target): New function.
8298 * script-c.h (script_set_target): Declare.
8299 * options.cc (General_options::string_to_object_format): Rename
8300 from string_to_object_format in anonymous namespace. Change
8301 callers.
8302 * options.h (class General_options): Declare
8303 string_to_object_format.
8304
3ee173de
ILT
83052009-06-22 Ian Lance Taylor <iant@google.com>
8306
8307 * script-sections.cc (Script_sections::create_segments): Don't put
8308 program headers in a PT_LOAD segment if -n or -N.
8309
83102009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
8311
8312 PR 10141
8313 * options.h (class General_options): Add -z lazy and -z now. Sort
8314 -z options into alphabetical order.
8315 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
8316
cd6739a1 83172009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
8318
8319 * layout.cc (Layout::make_output_section): Call
8320 Target::new_output_section.
8321 (Layout::attach_allocated_section_to_segment): Put large section
8322 sections in a separate load segment with the large segment flag
8323 set.
8324 (Layout::segment_precedes): Sort large data segments after other
8325 load segments.
8326 (align_file_offset): New static function.
8327 (Layout::set_segment_offsets): Use align_file_offset.
8328 * output.h (class Output_section): Add is_small_section_ and
8329 is_large_section_ fields.
8330 (Output_section::is_small_section): New function.
8331 (Output_section::set_is_small_section): New function.
8332 (Output_section::is_large_section): New function.
8333 (Output_section::set_is_large_section): New function.
8334 (Output_section::is_large_data_section): New function.
8335 (class Output_segment): Add is_large_data_segment_ field.
8336 (Output_segment::is_large_data_segment): New function.
8337 (Output_segment::set_is_large_data_segment): New function.
8338 * output.cc (Output_section::Output_section): Initialize new
8339 fields.
8340 (Output_segment::Output_segment): Likewise.
8341 (Output_segment::add_output_section): Add assertion that large
8342 data sections always go in large data segments. Force small data
8343 sections to the end of the list of data sections. Force small BSS
8344 sections to the start of the list of BSS sections. For large BSS
8345 sections to the end of the list of BSS sections.
8346 * symtab.h (class Symbol): Declare is_common_shndx.
8347 (Symbol::is_defined): Check Symbol::is_common_shndx.
8348 (Symbol::is_common): Likewise.
8349 (class Symbol_table): Define enum Commons_section_type. Update
8350 declarations. Add small_commons_ and large_commons_ fields.
8351 * symtab.cc (Symbol::is_common_shndx): New function.
8352 (Symbol_table::Symbol_table): Initialize new fields.
8353 (Symbol_table::add_from_object): Put small and large common
8354 symbols in the right list.
8355 (Symbol_table::sized_finalized_symbol): Check
8356 Symbol::is_common_shndx.
8357 (Symbol_table::sized_write_globals): Likewise.
8358 * common.cc (Symbol_table::do_allocate_commons): Allocate new
8359 common symbol lists. Don't call do_allocate_commons_list if the
8360 list is empty.
8361 (Symbol_table::do_allocate_commons_list): Remove is_tls
8362 parameter. Add comons_section_type parameter. Change all
8363 callers. Handle small and large common symbols.
8364 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
8365 Symbol::is_common_shndx.
8366 * resolve.cc (symbol_to_bits): Likewise.
8367 * target.h (Target::small_common_shndx): New function.
8368 (Target::small_common_section_flags): New function.
8369 (Target::large_common_shndx): New function.
8370 (Target::large_common_section_flags): New function.
8371 (Target::new_output_section): New function.
8372 (Target::Target_info): Add small_common_shndx, large_common_shndx,
8373 small_common_section_flags, and large_common_section_flags
8374 fields.
8375 (Target::do_new_output_section): New virtual function.
8376 * arm.cc (Target_arm::arm_info): Initialize new fields.
8377 * i386.cc (Target_i386::i386_info): Likewise.
8378 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
8379 Likewise.
8380 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
8381 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8382 (Target_x86_64::do_new_output_section): New function.
8383 * configure.ac: Define conditional MCMODEL_MEDIUM.
8384 * testsuite/Makefile.am (check_PROGRAMS): Add large.
8385 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
8386 (large_LDFLAGS): Define.
8387 * testsuite/large.c: New file.
8388 * testsuite/testfile.cc (Target_test::test_target_info):
8389 Initialize new fields.
8390 * configure, testsuite/Makefile.in: Rebuild.
8391
bb04269c
DK
83922009-06-05 Doug Kwan <dougkwan@google.com>
8393
8394 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 8395 * Makefile.in: Regenerate.
bb04269c
DK
8396 * i386.cc (class Target_i386): Define new virtual method to
8397 override do_is_local_label_name in parent.
8398 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8399 local symbols if --discard-locals or -X is given.
8400 * options.h (class General_options): Declare new options
8401 '--discard-locals' and '-X' for discarding locals.
8402 * target.h (class Target): Define new methods is_local_label_name.
8403 Declare new virtual method do_is_local_label_name.
8404 * target.cc: New file.
8405 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8406 (check_SCRIPTS): Add discard_locals_test.sh.
8407 (check_DATA): Add discard_local_tests.syms.
8408 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8409 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8410 * testsuite/Makefile.in: Regenerate.
8411 * testsuite/discard_locals_test.c: New file.
8412 * testsuite/discard_locals_test.sh: Same.
8413
805bb01c
DK
84142009-06-05 Doug Kwan <dougkwan@google.com>
8415
8416 * object.cc (Sized_relobj::Sized_relobj): Initialize
8417 discarded_eh_frame_shndx_ to -1U.
8418 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8419 section.
8420 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8421 a discarded .eh_frame section.
8422 (Sized_relobj::do_finalize_local_symbols): Ditto.
8423 * object.h (class Sized_relobj): Declare new member
8424 discarded_eh_frame_shndx_.
8425 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8426 (local_labels_test.o, local_labels_test): New rules.
8427 * testsuite/Makefile.in: Regenerate.
8428
1dcd334d
DK
84292009-06-04 Doug Kwan <dougkwan@google.com>
8430
8431 * layout.cc (Layout::section_name_mapping): Add mapping for
8432 special ARM sections.
8433
96d49306
DK
84342009-06-03 Doug Kwan <dougkwan@google.com>
8435
8436 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8437 (utils::has_overflow): Same.
8438
dff16297
ILT
84392009-06-03 Ian Lance Taylor <iant@google.com>
8440
8441 * layout.cc (Layout::section_name_mapping): New array, replacing
8442 Layout::linkonce_mapping.
8443 (Layout::section_name_mapping_count): New variable, replacing
8444 Layout::linkonce_mapping_count.
8445 (Layout::linkonce_output_name): Remove.
8446 (Layout::output_section_name): Rewrite.
8447 * layout.h (class Layout): Rename Linkonce_mapping to
8448 Section_name_mapping, linkonce_mapping to section_name_mapping,
8449 linkonce_mapping_count to section_name_mapping_count. Don't
8450 declare linkonce_output_name.
8451
c121c671
DK
84522009-06-03 Doug Kwan <dougkwan@google.com>
8453
8454 * gold/arm.cc (namespace utils): New.
8455 (Target_arm::reloc_is_non_pic): Define new method.
8456 (class Arm_relocate_functions): New.
8457 (Target_arm::Relocate::relocate): Handle relocation types used by
8458 Android.
8459
07800fab
ILT
84602009-06-03 Ian Lance Taylor <iant@google.com>
8461
8462 * arm.cc (Target_arm::scan::global): Use || instead of |.
8463
c121c671
DK
84642009-06-02 Doug Kwan <dougkwan@google.com>
8465
8466 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8467 issued_non_pic_error_.
8468 (class Target_arm::Scan): Declare new method check_non_pic.
8469 Define new method symbol_needs_plt_entry.
8470 Declare new data member issued_non_pic_error_.
8471 (class Target_arm::Relocate): Declare new method
8472 should_apply_static_reloc.
8473 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8474 (Target_arm::Scan::check_non_pic): Define new method.
8475 (Target_arm::Scan::local): Handle a small subset of reloc types used
8476 by Android.
8477 (Target_arm::Scan::local): Same.
8478 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8479
b19b0c6d
ILT
84802009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8481
8482 * incremental.cc (Incremental_inputs::report_command_line): Filter
8483 out --incremental-* options.
8484
94cdfcff
DK
84852009-05-29 Doug Kwan <dougkwan@google.com>
8486
8487 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8488 template class.
8489 (class Target_arm): Update comment.
8490 (Target_arm::Target_arm): Initialize new data members GOT_,
8491 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8492 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8493 and Target_arm::rel_dyn_section.
8494 Declare new_enum Target_arm::Got_type.
8495 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8496 and DYNBSS_.
8497 Update commments for member do_dynsym_value.
8498 (Target_arm::got_size, Target_arm::plt_section,
8499 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8500 new methods inside class defintion.
8501 (Target_arm::got_section): Define new method.
8502 (Target_arm::rel_dyn_section): Same.
8503 (Output_data_plt_arm): New template class.
8504 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8505 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8506 (Output_data_plt_arm::add_entry): Same.
8507 (Output_data_plt_arm::first_plt_entry): Define new
8508 static data member for PLT instruction template.
8509 (Output_data_plt_arm::plt_entry): Same.
8510 (Output_data_plt_arm::do_write): Define new method.
8511 (Target_arm::make_plt_entry): Same.
8512 (Target_arm::do_finalize_sections): Same.
8513 (Target_arm::do_dynsym_value): Same.
8514
4a657b0d
DK
85152009-05-28 Doug Kwan <dougkwan@google.com>
8516
8517 * Makefile.am (TARGETSOURCES): Add arm.cc.
8518 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8519 * Makefile.in: Regenerate.
8520 * arm.cc: New file.
8521 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8522
e7ae8c36
DK
85232009-05-26 Doug Kwan <dougkwan@google.com>
8524
8525 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8526 (General_options::check_excluded_libs): Strip off directories in
8527 archive name before matching like GNU ld does.
8528 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8529 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8530 (exclude_libs_test_LDFLAGS): Add linker option
8531 -Wl,--exclude-libs,libexclude_libs_test_3
8532 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8533 an explicit archive without using -l.
8534 (alt/libexclude_libs_test_3.a): New make rule.
8535 * testsuite/Makefile.in: Regenerate.
8536 * testsuite/exclude_libs_test.c : Declare lib3_default().
8537 (main): Call it.
8538 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8539 * exclude_libs_test_3.c: New file.
8540
f12e7348
NC
85412009-05-26 Nick Clifton <nickc@redhat.com>
8542
8543 * po/id.po: New Indonesian translation.
8544 * po/gold.pot: Updated template file.
8545
4daadc0d
ST
85462009-05-22 Sriraman Tallam <tmsriram@google.com>
8547
e1df38aa 8548 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
8549 gc_comdat_test files. Add -Wl,--gc-sections to build
8550 gc_comdat_test.
8551 * testsuite/Makefile.in: Regenerate.
8552 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8553
531813ad
ST
85542009-05-21 Sriraman Tallam <tmsriram@google.com>
8555
8556 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8557 kept comdat section was garbage collected.
8558 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8559 * testsuite/Makefile.in: Regenerate.
8560 * testsuite/gc_comdat_test.sh: New file.
8561 * testsuite/gc_comdat_test_1.cc: New file.
8562 * testsuite/gc_comdat_test_2.cc: New file.
8563
65514900
CC
85642009-05-19 Doug Kwan <dougkwan@google.com>
8565
8566 * archive.cc (Archive::Archive): Move constructor from archive.h
8567 to here. Initialize no_export_.
8568 (Archive::get_elf_object_for_member): Set no_export flag of object.
8569 * archive.h (Archive::Archive): Move constructor body to
8570 archive.cc.
8571 (Archive::no_export): New method.
8572 (Archive::no_export_): New field.
8573 * object.h (Object::Object): Initialize no_export_ to false.
8574 (Object::no_export, Object::set_no_export): New methods.
8575 (Object::no_export_): New field.
8576 * options.cc (General_options::parse_exclude_libs): New method.
8577 (General_options::check_excluded_libs) Same.
8578 * options.h (exclude_libs): New option.
8579 (General_options::check_excluded_libs): New method declaration.
8580 (General_options::excluded_libs_): New field.
8581 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8582 default or protected visibility if an object has no-export flag set.
8583 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8584 (check_SCRIPTS): Add exclude_libs_test.sh.
8585 (check_DATA): Add exclude_libs_test.syms.
8586 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8587 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8588 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8589 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8590 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8591 libexclude_libs_test_2.a): New rules.
8592 * testsuite/Makefile.in: Regenerate.
8593 * testsuite/exclude_libs_test.c: New file.
8594 * testsuite/exclude_libs_test.sh: Ditto.
8595 * testsuite/exclude_libs_test_1.c: Ditto.
8596 * testsuite/exclude_libs_test_2.c: Ditto.
8597
1b77ea50
ILT
85982009-05-15 Ian Lance Taylor <iant@google.com>
8599
8600 * configure.ac: Check for declarations for cases where libiberty.h
8601 checks HAVE_DECL_xxx.
8602 * configure, config.in: Rebuild.
8603
072fe7ce
ILT
86042009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8605
8606 * gold.h (Incremental_argument_list): Remove (invalid) forward
8607 declaration.
8608 * incremental.cc (Incremental_inputs::report_achive): New method.
8609 (Incremental_inputs::report_object): New method.
8610 (Incremental_inputs::report_script): New method.
8611 (Incremental_inputs::finalize_inputs): New method.
8612 (Incremental_inputs::finalize): Call finalize_inputs().
8613 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8614 Create inputs entries.
8615 * incremental.h (Incremental_input_type): New enum.
8616 (Incremental_inputs::Incremental_input): Initialize new fields.
8617 (Incremental_inputs::report_inputs): New method.
8618 (Incremental_inputs::report_achive): New method.
8619 (Incremental_inputs::report_object): New method.
8620 (Incremental_inputs::report_script): New method.
8621 (Incremental_inputs::finalize_inputs): New method.
8622 (Incremental_inputs::Input_info): New struct.
8623 (Incremental_inputs::Input_info_map): New typedef.
8624 (Incremental_inputs::lock_): New field.
8625 (Incremental_inputs::Inputs_): New field.
8626 (Incremental_inputs::Inputs_map): New field.
8627 * main.cc (main): Call Incremental_input::report_inputs.
8628 * options.h (Input_argument_list): Typedef moved from
8629 Input_arguments.
8630 (Input_file_group::Files): Remove, use ::Input_argument_list.
8631 (Input_file_group::Input_argument_list): Remove, use
8632 ::Input_argument_list.
8633 * plugin.cc (Plugin_manager::add_input_file): Add error in
8634 incremental build.
8635 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8636 functions.
8637 * script.cc (read_input_script): Call
8638 Incremental_input::report_script.
8639 * script.h (Script_info): New class.
8640
b0481b0b
ILT
86412009-04-27 Ian Lance Taylor <iant@google.com>
8642
8643 * x86_64.cc (do_adjust_output_section): Set entsize to
8644 plt_entry_size.
8645
b22a5a41 86462009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
8647
8648 * output.cc (Output_file::close): After short writes, continue
8649 writing from the correct offset in the buffer being written.
8650
40fde488
CD
86512009-04-23 Chris Demetriou <cgd@google.com>
8652
8653 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8654 * configure: Regenerate.
8655 * config.in: Regenerate.
8656 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8657 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8658
3ce2c28e
ILT
86592009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8660
8661 * incremental.cc (Incremental_inputs_header_data): Renamed from
8662 Incremental_input_header_data.
8663 (Incremental_inputs_header_data::data_size): New field.
8664 (Incremental_inputs_header_data::put_input_file_count): Renamed
8665 from input_file_count.
8666 (Incremental_inputs_header_data::put_command_line_offset): Renamed
8667 from command_line_offset.
8668 (Incremental_inputs_header_data::put_reserved): Renamed from
8669 put_reserved.
8670 (Incremental_inputs_entry_data): Renamed from
8671 Incremental_input_entry_data.
8672 (Incremental_inputs_entry_data::data_size): New field.
8673 (Incremental_inputs::report_command_line): New method.
8674 (Incremental_inputs::finalize): New method.
8675 (Incremental_inputs::create_incremental_inputs_data): New method.
8676 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
8677 * incremental.h: New file.
8678 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
8679 (Layout::finalize): Create incremental inputs section in
8680 incremental builds.
8681 (Layout::create_incremental_info_sections): New method.
8682 * layout.h (Layout::incremental_inputs): New method.
8683 (Layout::create_incremental_info_sections): New method.
8684 (Layout::incremental_inputs_): New field.
8685 * main.cc (main): Notify Incremental_input of the command line.
8686
e55bde5e
ILT
86872009-04-01 Ian Lance Taylor <iant@google.com>
8688 Mikolaj Zalewski <mikolajz@google.com>
8689
8690 * gold.h (reserve_unordered_map): Define, three versions, one for
8691 each version of Unordered_map.
8692 * layout.cc (Layout::Layout): Remove options parameter. Add
8693 number_of_input_files parameter. Don't initialize options_.
8694 Initialize number_of_input_files_ and resized_signatures_. Move
8695 sections_are_attached_.
8696 (Layout::layout_group): Reserve space for group_signatures_.
8697 (Layout::find_or_add_kept_section): Change name parameter to be a
8698 reference. Resize signatures_ map when it gets large enough.
8699 (Layout::layout_eh_frame): Use parameters->options() instead of
8700 this->options_.
8701 (Layout::make_output_section): Likewise.
8702 (Layout::attach_allocated_section_to_segment): Likewise.
8703 (Layout::finalize, Layout::create_executable_stack): Likewise.
8704 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
8705 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
8706 * layout.h (class Layout): Update declarations. Remove options_
8707 field. Add number_of_input_files_ and resized_signatures_
8708 fields. Move sections_are_attached_ field.
8709 * main.cc (main): Pass number of input files to Layout
8710 constructor. Don't pass options.
8711
154b857c
ILT
87122009-03-30 Ian Lance Taylor <iant@google.com>
8713
8714 * ffsll.c (ffsll): Correct implementation.
8715
2f35ab9b
ILT
87162009-03-27 Ian Lance Taylor <iant@google.com>
8717
fd03461a
ILT
8718 * ffsll.c: New file.
8719 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
8720 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
8721 * ftruncate.c (ftruncate): Declare before definition.
8722 * mremap.c (mremap): Likewise.
8723 * pread.c (pread): Likewise.
8724 * configure, Makefile.in, config.in: Rebuild.
8725
2f35ab9b
ILT
8726 * mremap.c: New file.
8727 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
8728 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
8729 (mremap): Declare if HAVE_MREMAP is not defined.
8730 * configure, Makefile.in, config.in: Rebuild.
8731
33aea2fd
CC
87322009-03-27 Cary Coutant <ccoutant@google.com>
8733
8734 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
8735 position independent.
8736 * sparc.cc (Target_sparc::check_non_pic): Likewise.
8737 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
8738
6d479619
CC
87392009-03-24 Cary Coutant <ccoutant@google.com>
8740
8741 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
8742 an executable.
8743 (needs_dynamic_reloc): Likewise.
8744
afc06bb8
ILT
87452009-03-24 Ian Lance Taylor <iant@google.com>
8746
8747 * yyscript.y (file_cmd): Recognize EXTERN.
8748 (extern_name_list, extern_name_list_body): New nonterminals.
8749 * script.cc (script_add_extern): Define.
8750 * script-c.h (script_add_extern): Declare.
8751
f6060a4d
ILT
87522009-03-24 Rafael Avila de Espindola <espindola@google.com>
8753
8754 * object.cc (is_elf_object): Define.
8755 * object.h (is_elf_object): Declare.
8756 * archive.cc (Archive::get_elf_object_for_member): Call
8757 is_elf_object.
33aea2fd 8758 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 8759
26736d8e
ILT
87602009-03-24 Elliott Hughes <enh@google.com>
8761
8762 * output.cc (Output_file::map_anonymous): Define.
8763 (Output_file::map): Use map_anonymous. If the regular mmap fails,
8764 try an anonymous one. Report the size if the mmap fails.
8765 * output.h (class Output_file): Declare map_anonymous.
8766
22fd9730
ILT
87672009-03-24 Ian Lance Taylor <iant@google.com>
8768
8769 * target-select.cc (instantiate_target): Don't acquire the lock if
8770 the instantiated_target_ field has already been set.
8771
cb010894
ILT
87722009-03-23 Ian Lance Taylor <iant@google.com>
8773
7f055c20
ILT
8774 * gold-threads.h (class Initialize_lock): Define.
8775 * gold-threads.cc (class Initialize_lock_once): Define.
8776 (initialize_lock_control): New static variable.
8777 (initialize_lock_pointer): New static variable.
8778 (initialize_lock_once): New static function.
8779 (Initialize_lock::Initialize_lock): Define.
8780 (Initialize_lock::initialize): Define.
8781 * target-select.h: Include "gold-threads.h".
8782 (class Target_selector): Add lock_ and initialize_lock_ fields.
8783 Don't define instantiate_target, just declare it.
8784 * target-select.cc (Target_selector::Target_selector): Initialize
8785 new fields.
8786 (Target_selector::instantiate_target): Define.
8787 * descriptors.h: Include "gold-threads.h".
8788 (class Descriptors): Add initialize_lock_ field.
8789 * descriptors.cc (Descriptors::Descriptors): Initialize new
8790 field.
8791 (Descriptors::open): Use initialize_lock_ field
8792 * errors.h (class Errors): Add initialize_lock_ field.
8793 * errors.cc (Errors::Errors): Initialize new field.
8794 (Errors::initialize_lock): Use initialize_lock_ field.
8795 * powerpc.cc (class Target_selector_powerpc): Remove
8796 instantiated_target_ field. In do_recognize call
8797 instantiate_target rather than do_instantiate_target. In
8798 do_instantiate_target just allocate a new target.
8799 * sparc.cc (class Target_selector_sparc): Likewise.
8800
36959681
ILT
8801 * freebsd.h: New file.
8802 * i386.cc: Include "freebsd.h".
8803 (Target_i386): Derive from Target_freebsd rather than
8804 Sized_target.
8805 (Target_selector_i386): Derive from Target_selector_freebsd rather
8806 than Target_selector.
8807 * x86_64.cc: Include "freebsd.h".
8808 (Target_x86_64): Derive from Target_freebsd rather than
8809 Sized_target.
8810 (Target_selector_x86_64): Derive from Target_selector_freebsd
8811 rather than Target_selector.
8812 * target.h (class Target): Add adjust_elf_header and
8813 do_adjust_elf_header.
8814 * output.cc (Output_file_header:: do_sized_write): Call target
8815 adjust_elf_header routine.
8816 * configure.tgt: Set targ_osabi.
8817 * configure.ac: Define GOLD_DEFAULT_OSABI.
8818 * parameters.cc (Parameters::default_target): Pass
8819 GOLD_DEFAULT_OSABI to select_target.
8820 * target-select.h (class Target_selector): Make instantiate_target
8821 protected rather than private.
8822 * Makefile.am (HFILES): Add freebsd.h.
8823 * configure, Makefile.in, config.in: Rebuild.
8824
cb010894
ILT
8825 * merge.cc (do_add_input_section): Correct pend value. Change
8826 message about last entry not being null terminated from error to
8827 warning.
8828
0e879927
ILT
88292009-03-20 Mikolaj Zalewski <mikolajz@google.com>
8830
8831 * incremental.cc: New file.
8832 * Makefile.am (CCFILES): Add incremental.cc.
8833 * Makefile.in: Rebuild.
8834
41105937
PP
88352009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
8836
8837 * layout.cc (Layout::output_section_name): Preserve names
8838 of '.note.' sections.
e1df38aa 8839
60439920
ILT
88402009-03-19 Ian Lance Taylor <iant@google.com>
8841
8842 * descriptors.cc (Descriptors::open): Check that the options are
8843 valid before using them.
8844
0d371ad3
ILT
88452009-03-18 Ian Lance Taylor <iant@google.com>
8846
8847 * script-sections.h: Include <list>.
8848 (class Script_sections): Change Sections_elements from std::vector
8849 to std::list. Typedef public Elements_iterator. Add
8850 orphan_section_placement_, data_segment_align_start_, and
8851 saw_data_segment_align_ fields. Remove data_segment_align_index_
8852 field.
8853 * script-sections.cc (class Orphan_section_placement): New class.
8854 (class Sections_element): Add virtual functions is_relro and
8855 orphan_section_init. Remove virtual function place_orphan_here.
8856 (class Output_section_definition): Add is_relro and
8857 orphan_section_init. Remove place_orphan_here.
8858 (class Orphan_output_section): Likewise.
8859 (Script_sections::Script_sections): Update for field changes.
8860 (Script_sections::data_segment_align): Set saw_data_segment_align_
8861 and data_segment_align_start_, not data_segment_align_index.
8862 (Script_sections::data_segment_relro_end): Check
8863 saw_data_segment_align_. Use data_segment_align_start_ rather
8864 than data_segment_align_index_.
8865 (Script_sections::place_orphan): Rewrite to use
8866 Orphan_section_placement.
8867
9201d894
ILT
88682009-03-17 Ian Lance Taylor <iant@google.com>
8869
9c5b8369
ILT
8870 * archive.cc (Archive::add_symbols): Check for a version attached
8871 to the symbol name in the archive map.
8872 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
8873 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
8874 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
8875 (ver_test_11.a): New target.
8876 * testsuite/Makefile.in: Rebuild.
8877
9201d894
ILT
8878 * configure.ac: Check for chsize and posix_fallocate. Replace
8879 ftruncate.
8880 * ftruncate.c: New file, from gnulib.
8881 * output.cc (posix_fallocate): Define dummy version if not
8882 HAVE_POSIX_FALLOCATE.
8883 (Output_file::map): Call posix_fallocate rather than lseek and
8884 write.
8885 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
8886 * configure, Makefile.in, config.in: Rebuild.
8887
ef4ab7a8 88882009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 8889
ef4ab7a8
PP
8890 * layout.h (Layout::create_note): Add section_name parameter.
8891 * layout.cc (Layout::create_note): Likewise.
8892 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 8893
8c500701
ILT
88942009-03-17 Ian Lance Taylor <iant@google.com>
8895
e85b18e1
ILT
8896 * descriptors.cc: Include "options.h".
8897 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
8898 (Descriptors::open): Always use O_CLOEXEC when opening a new
8899 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
8900 then set FD_CLOEXEC.
8901
9efe6174
ILT
8902 * sparc.cc (class Target_sparc): Add has_got_section.
8903 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
8904 make sure we have a GOT section.
8905
8906 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
8907 (Target_sparc::Scan::local): Likewise.
8908 (Target_sparc::Scan::global): Likewise.
8909 (Target_sparc::Relocate::relocate): Likewise.
8910 (Target_sparc::Relocate::relocate_tls): Likewise.
8911
8c500701
ILT
8912 * symtab.cc (Symbol_table::define_default_version): New function,
8913 broken out of add_from_object.
8914 (Symbol_table::add_from_object): Call define_default_version.
8915 (Symbol_table::define_special_symbol): Add resolve_oldsym
8916 parameter. Change all callers. If the version for a symbol comes
8917 from a version script, resolve it with the symbol with the same
8918 name with no version. Also add the symbol without a version if
8919 appropriate.
8920 (do_define_in_output_data): If resolving with oldsym, don't delete
8921 sym.
8922 (do_define_in_output_segment): Likewise.
8923 (do_define_as_constant): Likewise.
8924 * symtab.h (class Symbol_table): Update declarations.
8925
f1ed28fb
ILT
89262009-03-13 Ian Lance Taylor <iant@google.com>
8927
15f8229b
ILT
8928 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8929 (Read_symbols::requeue): New function.
8930 (Read_symbols::do_read_symbols): If make_elf_object fails because
8931 the target type is not configured, and the file was searched for,
8932 issue a warning and retry with the next directory.
8933 (Add_symbols::run): If the file has an incompatible format, and
8934 it was searched for, requeue the Read_symbols task. On error,
8935 release the object.
8936 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8937 dirindex parameter to constructor. Change all callers. Declare
8938 incompatible_warning and requeue.
8939 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8940 input_argument_ and input_group_ fields. Add them to
8941 constructor. Change all callers.
8942 (class Read_script): Add dirindex_ field. Add it to constructor.
8943 Change all callers.
8944 * archive.cc (Archive::setup): Remove input_objects parameter.
8945 Change all callers.
8946 (Archive::get_file_and_offset): Likewise.
8947 (Archive::read_all_symbols): Likewise.
8948 (Archive::read_symbols): Likewise.
8949 (Archive::get_elf_object_for_member): Remove input_objects
8950 parameter. Add punconfigured parameter. Change all callers.
8951 (Archive::add_symbols): Change return type to bool. Check return
8952 value of include_member.
8953 (Archive::include_all_members): Likewise.
8954 (Archive::include_member): Change return type to bool. Return
8955 false if first included object has incompatible target. Set
8956 included_member_ field.
8957 (Add_archive_symbols::run): If add_symbols returns false, requeue
8958 Read_symbols task.
8959 * archive.h (class Archive): Add included_member_ field.
8960 Initialize it in constructor. Add input_file and searched_for
8961 methods. Update declarations.
8962 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8963 input_argument_ fields. Add them to constructor. Change all
8964 callers.
8965 * script.cc: Include "target-select.h".
8966 (class Parser_closure): Add skip_on_incompatible_target_ and
8967 found_incompatible_target_ fields. Add
8968 skip_on_incompatible_target parameter to constructor. Change all
8969 callers. Add methods skip_on_incompatible_target,
8970 clear_skip_on_incompatible_target, found_incompatible_target, and
8971 set_found_incompatible_target.
8972 (read_input_script): Add dirindex parameter. Change all callers.
8973 If parser finds an incompatible target, requeue Read_symbols
8974 task.
8975 (script_set_symbol): Clear skip_on_incompatible_target in
8976 closure.
8977 (script_add_assertion, script_parse_option): Likewise.
8978 (script_start_sections, script_add_phdr): Likewise.
8979 (script_check_output_format): New function.
8980 * script.h (read_input_script): Update declaration.
8981 * script-c.h (script_check_output_format): Declare.
8982 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8983 (ignore_cmd): Remove OUTPUT_FORMAT.
8984 * fileread.cc (Input_file::Input_file): Add explicit this.
8985 (Input_file::will_search_for): New function.
8986 (Input_file::open): Add pindex parameter. Change all callers.
8987 * fileread.h (class Input_file): Add input_file_argument method.
8988 Declare will_search_for. Update declarations.
8989 * object.cc (make_elf_object): Add punconfigured parameter.
8990 Change all callers.
8991 * object.h (class Object): Make input_file public. Add
8992 searched_for method.
8993 (make_elf_object): Update declaration.
8994 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8995 restart search.
8996 * dirsearch.h (class Dirsearch): Update declaration.
8997 * options.h (class General_options): Add --warn-search-mismatch.
8998 * parameters.cc (Parameters::is_compatible_target): New function.
8999 * parameters.h (class Parameters): Declare is_compatible_target.
9000 * workqueue.cc (Workqueue::add_blocker): New function.
9001 * workqueue.h (class Workqueue): Declare add_blocker.
9002
f1ed28fb
ILT
9003 * fileread.cc (Input_file::open): Remove options parameter.
9004 Change all callers.
9005 (Input_file::open_binary): Likewise.
9006 * script.cc (read_input_script): Likewise.
9007 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9008 options parameter from constructor. Change all callers.
9009 (class Read_script): Likewise.
9010 * fileread.h (class Input_file): Update declarations.
9011 * script.h (read_input_script): Update declaration.
9012
34dd024a
NC
90132009-03-10 Nick Clifton <nickc@redhat.com>
9014
9015 * po/es.po: New Spanish translation.
9016
6d71b17c
CC
90172009-03-06 Cary Coutant <ccoutant@google.com>
9018
9019 * options.cc (parse_short_option): Keep dash_z from registering itself.
9020
031cdbed
ILT
90212009-03-03 Ian Lance Taylor <iant@google.com>
9022
9023 PR 9918
9024 * target-reloc.h (relocate_section): Pass output_section to
9025 relocate.
9026 * i386.cc (Target_i386::should_apply_static_reloc): Add
9027 output_section parameter. Change all callers.
9028 (Target_i386::Relocate::relocate): Add output_section parameter.
9029 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9030 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9031 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9032 * testsuite/two_file_shared.sh: New script.
9033 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9034 (check_DATA): Add two_file_shared.dbg.
9035 (two_file_shared.dbg): New target.
9036 * testsuite/Makefile.in: Rebuild.
9037
15d5fa16
ILT
90382009-03-01 Ian Lance Taylor <iant@google.com>
9039
9040 * configure.ac: Check for byteswap.h.
9041 * configure: Rebuild.
9042 * config.in: Rebuild.
9043
8a4c0b0d
ILT
90442009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9045
9046 * layout.cc (Layout::find_or_add_kept_section): New function.
9047 (Layout::add_comdat): Removed.
9048 * layout.h (struct Kept_section): Move out of class Layout.
9049 Remove trailing underscores from field names. Add group_sections
9050 field. Rename group_ field to is_group. Change all uses.
9051 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9052 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9053 comdat_groups_ field.
9054 (Sized_relobj::include_section_group): Use
9055 find_or_add_kept_section and Kept_section::group_sections.
9056 (Sized_relobj::include_linkonce_section): Likewise.
9057 * object.cc (class Sized_relobj): Don't define Comdat_group or
9058 Comdat_group_table. Remove find_comdat_group and
9059 add_comdat_group. Remove comdat_groups_ field.
9060 * plugin.cc (include_comdat_group): Use
9061 Layout::find_or_add_kept_section.
9062
b4ecf66b
ILT
90632009-02-28 Ian Lance Taylor <iant@google.com>
9064
14359ca0
ILT
9065 * README: --gc-sections and map files are now supported. Document
9066 some build requirements.
9067
b4ecf66b
ILT
9068 PR 6992
9069 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9070 relocatable link set the value of the section symbol to zero.
9071 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9072 relocatable link don't include the section address in the local
9073 symbol value.
9074
0602e05a
ILT
90752009-02-27 Ian Lance Taylor <iant@google.com>
9076
fd9d194f
ILT
9077 PR 6811
9078 * options.h (class Search_directory): Add is_system_directory.
9079 (class General_options): Declare is_in_system_directory.
9080 * options.cc (get_relative_sysroot): Make static.
9081 (get_default_sysroot): Make static.
9082 (General_optoins::is_in_system_directory): New function.
9083 * fileread.cc (Input_file::is_in_system_directory): New function.
9084 * fileread.h (class Input_file): Declare is_in_system_directory.
9085 * object.h (class Object): Add is_in_system_directory.
9086 (class Input_objects): Remove system_library_directory_ field.
9087 * object.cc (Input_objects::add_object): Don't set
9088 system_library_directory_.
9089 (input_objects::found_in_system_library_directory): Remove.
9090 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9091 parameter. Change all callers.
9092 (Symbol_table::sized_write_globals): Likewise.
9093 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9094 Call Object::is_in_system_directory.
9095 * symtab.h (class Symbol_table): Update declarations.
9096
61edd21f
ILT
9097 PR 5990
9098 * descriptors.h (Open_descriptor): Add is_on_stack field.
9099 * descriptors.cc (Descriptors::open): If the descriptor is on the
9100 top of the stack, remove it. Initialize is_on_stack field.
9101 (Descriptors::release): Only add pod to stack if it is not on the
9102 stack already.
9103 (Descriptors::close_some_descriptor): Clear stack_next and
9104 is_on_stack fields.
9105
e29e076a
ILT
9106 PR 7091
9107 * output.cc (Output_section::find_starting_output_address): Rename
9108 from starting_output_address; add PADDR parameter; change return
9109 type.
9110 * output.h (class Output_section): Declare
9111 find_starting_output_address instead of starting_output_address.
9112 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9113 section symbol for which we can't find a merge section.
9114
0602e05a
ILT
9115 PR 9836
9116 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9117 hidden or internal, force the symbol to be local.
9118 * resolve.cc (Symbol::override_visibility): Define.
9119 (Symbol::override_base): Use override_visibility.
9120 (Symbol_table::resolve): Likewise.
9121 (Symbol::override_base_with_special): Likewise.
9122 (Symbol_table::override_with_special): If the visibility is hidden
9123 or internal, force the symbol to be local.
9124 * symtab.h (class Symbol): Add set_visibility and
9125 override_visibility.
9126 * testsuite/ver_test_1.sh: New file.
9127 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9128 (check_DATA): Add ver_test_1.syms.
9129 (ver_test_1.syms): New target.
9130 * testsuite/Makefile.in: Rebuild.
9131
401a9a73
CC
91322009-02-25 Cary Coutant <ccoutant@google.com>
9133
9134 * layout.cc (Layout::choose_output_section): Don't rename sections
9135 when using a linker script that has a SECTIONS clause.
9136 * Makefile.in: Regenerate.
9137
9138 * testsuite/Makefile.am (script_test_5.sh): New test case.
9139 * testsuite/Makefile.in: Regenerate.
9140 * testsuite/script_test_5.cc: New file.
9141 * testsuite/script_test_5.sh: New file.
9142 * testsuite/script_test_5.t: New file.
9143
f488e4b0
CC
91442009-02-13 Rafael Avila de Espindola <espindola@google.com>
9145
9146 * archive.cc (Archive::include_member): Update calls to add_symbols.
9147 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9148 the Layout argument.
9149 * dynobj.h (do_add_symbols): Add the Layout argument.
9150 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9151 Layout argument.
9152 * object.h (Object::add_symbols): Add the Layout argument.
9153 (Object::do_add_symbols): Add the Layout argument.
9154 (Sized_relobj::do_add_symbols): Add the Layout argument.
9155 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9156 Unify the two versions.
9157 (Add_plugin_symbols): Remove.
9158 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9159 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9160 (Add_plugin_symbols): Remove.
9161 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9162 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9163 (Add_symbols::run): Make it work with Pulginobj.
9164
89dd1680
ILT
91652009-02-06 Ian Lance Taylor <iant@google.com>
9166
9167 * object.cc (Sized_relobj::do_layout): Make info message start
9168 with lower case letter.
9169
266d0a74
ILT
91702009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9171
602b464e
ILT
9172 * binary.cc: Fix file comment.
9173
266d0a74
ILT
9174 * options.h (enum Incremental_disposition): Define.
9175 (class General_options): Add new options: --incremental,
9176 --incremental_changed, --incremental_unchanged,
9177 --incremental_unknown. Add incremental_disposition_ and
9178 implicit_incremental_ fields.
9179 (General_options::incremental_disposition): New function.
9180 (class Position_dependent_options): Add incremental_disposition
9181 option.
9182 (Position_dependent_options::copy_from_options): Set incremental
9183 dispositions.
9184 * options.cc (General_options::parse_incremental_changed): New
9185 function.
9186 (General_options::parse_incremental_unchanged): New function.
9187 (General_options::parse_incremental_unknown): New function.
9188 (General_options::General_options): Initialize new fields
9189 incremental_disposition_ and implicit_incremental_.
9190 (General_options::finalize): Check for uasge of --incremental-*
9191 without --incremental.
9192
f073bbf7
CD
91932009-02-06 Chris Demetriou <cgd@google.com>
9194
9195 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9196 pointer and to report location as the file name associated with
9197 the symbol.
9198 (gold_undefined_symbol_at_location): New function to replace the
9199 old gold_undefined_symbol functionality.
9200 * target-reloc.h (relocate_section): Update to use
9201 gold_undefined_symbol_at_location.
9202 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9203 Call gold_undefined_symbol function rather than gold_error.
9204 * errors.h (Errors::undefined_symbol): Take location as a
9205 string, rather than calculating it from a relocation.
9206 * errors.cc (Errors::fatal): Print "fatal error:" before the
9207 formatted message.
9208 (Errors::error, Errors::error_at_location): Print "error: "
9209 before the formatted message.
9210 (Errors::undefined_symbol): Take location as a string, rather
9211 than calculating it from a relocation.
9212 (gold_undefined_symbol_at_location): New function akin to
9213 old gold_undefined_symbol, calculates location from relocation.
9214 (gold_undefined_symbol): Change to take only a Symbol pointer
9215 and to report location as the file name associated with the symbol.
9216 * testsuite/debug_msg.sh: Update for changed error messages.
9217 * testsuite/undef_symbol.sh: Likewise.
9218
8e94a90c
ILT
92192009-02-04 Duncan Sands <baldrick@free.fr>
9220
9221 PR 9812
9222 * reduced_debug_output.h
9223 (Output_reduced_debug_abbrev_section::failed): Use format for
9224 gold_warning.
9225 (Output_reduced_debug_info_section::faild): Likewise.
9226
88a0e15b
ILT
92272009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9228
9229 * script.cc (Lazy_demangler): New class.
9230 (Version_script_info::get_symbol_version_helper): Demangle a
9231 symbol only once.
9232
5efc7cd2
CC
92332009-01-29 Cary Coutant <ccoutant@google.com>
9234
9235 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9236 to __tls_get_addr.
9237 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9238
e0ebcf42
ILT
92392009-01-28 Ian Lance Taylor <iant@google.com>
9240
5efc7cd2 9241 * version.cc (version_string): Bump to 1.9.
75fe7426 9242
e0ebcf42
ILT
9243 * gold.h: Include <cstring> and <stdint.h>.
9244 * version.cc: Include <cstdio>.
9245 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
9246 warning.
9247 * reduced_debug_output.cc (insert_into_vector): Rename from
9248 Insert_into_vector; change all callers. Use Swap_unaligned to
9249 avoid aliasing issue; remove union since it is unnecessary.
9250
8e2813be 92512009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
9252
9253 * Makefile.am (CCFILES): Add gc.cc.
9254 (HFILES): Add gc.h.
9255 * Makefile.in: Regenerate.
9256 * gold.cc (Gc_runner): New class.
9257 (queue_initial_tasks): Call garbage collection related tasks
9258 when corresponding options are invoked.
9259 (queue_middle_gc_tasks): New function.
9260 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
9261 processed early before laying out sections during garbage collection.
9262 * gold.h (queue_middle_gc_tasks): New function.
9263 (is_prefix_of): Move from "layout.cc".
9264 * i386.cc (Target_i386::gc_process_relocs): New function.
9265 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
9266 * main.cc (main): Create object of class "Garbage_collection".
9267 * object.cc (Relobj::copy_symbols_data): New function.
9268 (Relobj::is_section_name_included): New function.
e1df38aa
NC
9269 (Sized_relobj::do_layout): Allow this function to be called twice
9270 during garbage collection and defer layout of section during the
6d03d481
ST
9271 first call.
9272 * object.h (Relobj::get_symbols_data): New function.
9273 (Relobj::is_section_name_included): New function.
9274 (Relobj::copy_symbols_data): New function.
9275 (Relobj::set_symbols_data): New function.
9276 (Relobj::get_relocs_data): New function.
9277 (Relobj::set_relocs_data): New function.
9278 (Relobj::is_output_section_offset_invalid): New pure virtual function.
9279 (Relobj::gc_process_relocs): New function.
9280 (Relobj::do_gc_process_relocs): New pure virtual function.
9281 (Relobj::sd_): New data member.
9282 (Sized_relobj::is_output_section_offset_invalid): New function.
9283 (Sized_relobj::do_gc_process_relocs): New function.
9284 * options.h (General_options::gc_sections): Modify to not be a no-op.
9285 (General_options::print_gc_sections): New option.
9286 * plugin.cc (Plugin_finish::run): Remove function call to
9287 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
9288 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
9289 * reloc.cc (Read_relocs::run): Add task to process relocs and
9290 determine unreferenced sections when doing garbage collection.
9291 (Gc_process_relocs): New class.
9292 (Sized_relobj::do_gc_process_relocs): New function.
9293 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
9294 sections that are garbage collected.
9295 * reloc.h (Gc_process_relocs): New class.
9296 * sparc.cc (Target_sparc::gc_process_relocs): New function.
9297 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
9298 symbols whose corresponding sections are garbage collected.
9299 (Symbol_table::Symbol_table): Add new parameter for the garbage
9300 collection object.
9301 (Symbol_table::gc_mark_undef_symbols): New function.
9302 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9303 (Symbol_table::gc_mark_dyn_syms): New function.
9304 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
9305 as garbage.
9306 (Symbol_table::add_from_object): Likewise.
9307 (Symbol_table::add_from_relobj): When building shared objects, do not
9308 treat externally visible symbols as garbage.
9309 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
9310 table information for static and relocatable links.
9311 * symtab.h (Symbol_table::set_gc): New function.
9312 (Symbol_table::gc): New function.
9313 (Symbol_table::gc_mark_undef_symbols): New function.
9314 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9315 (Symbol_table::gc_mark_dyn_syms): New function.
9316 (Symbol_table::gc_): New data member.
e1df38aa 9317 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
9318 function.
9319 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
9320 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
9321
3b293544
CF
93222009-01-20 Chris Faylor <me.sourceware@sourceware.org>
9323
9324 * options.h (General_options::gc_sections): Define as a no-op for now.
9325 (General_options::no_keep_memory): Ditto.
9326 (General_options::Bshareable): Define.
9327 * options.cc (General_options::finalize): Honor -Bshareable.
9328
83d22aa8
AS
93292009-01-20 Andreas Schwab <schwab@suse.de>
9330
9331 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
9332 read the value in the contents, since we don't use it. Use the
9333 template endianness when writing.
9334 (Relocate::relocate): Use it for R_PPC_REL16_HA.
9335
cd536b21
AS
93362009-01-19 Andreas Schwab <schwab@suse.de>
9337
9338 * configure.tgt (powerpc64-*): Fix targ_obj.
9339
99e9a495
ILT
93402009-01-15 Ian Lance Taylor <iant@google.com>
9341
9342 * object.cc (Sized_relobj::write_local_symbols): Don't write out
9343 local symbols when stripping all symbols.
9344
bbbfea06
CC
93452009-01-14 Cary Coutant <ccoutant@google.com>
9346
99e9a495 9347 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 9348
0f7c0701
CC
93492009-01-14 Cary Coutant <ccoutant@google.com>
9350
9351 * archive.cc (Archive::get_elf_object_for_member): Remove call
9352 to File_read::claim_for_plugin.
9353 * descriptors.cc (Descriptors::open): Remove reference to
9354 is_claimed.
9355 (Descriptors::claim_for_plugin): Remove.
9356 * descriptors.h (Descriptors::claim_for_plugin): Remove.
9357 (Descriptors::is_claimed): Remove.
9358 (claim_descriptor_for_plugin): Remove.
9359 * fileread.cc (File_read::claim_for_plugin): Remove.
9360 * fileread.h (File_read::claim_for_plugin): Remove.
9361 (File_read::descriptor): Reopen descriptor if necessary.
9362 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
9363 (Plugin_manager::all_symbols_read): Add task parameter. Change
9364 all callers.
9365 (Plugin_manager::get_input_file): New function.
9366 (Plugin_manager::release_input_file): New function.
9367 (Pluginobj::Pluginobj): Add filesize parameter and initialize
9368 corresponding data member.
9369 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
9370 and pass to base constructor. Change all callers.
9371 (get_input_file, release_input_file): New functions.
9372 (make_sized_plugin_object): Add filesize parameter. Change all callers.
9373 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
9374 (Plugin_manager::all_symbols_read): Add task parameter.
9375 (Plugin_manager::get_input_file): New function.
9376 (Plugin_manager::release_input_file): New function.
9377 (Plugin_manager::task_): New data member.
9378 (Pluginobj::Pluginobj): Add filesize parameter.
9379 (Pluginobj::filename): New function.
9380 (Pluginobj::descriptor): New function.
9381 (Pluginobj::filesize): New function.
9382 (Pluginobj::filesize_): New data member.
9383 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
9384 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
9385 File_read::claim_for_plugin; use Object::unlock to unlock the file.
9386
9387 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
9388 with archive libraries.
9389 * testsuite/Makefile.in: Regenerate.
9390 * testsuite/plugin_test.c (struct sym_info): New type.
9391 (get_input_file, release_input_file): New static variables.
9392 (onload): Capture new transfer vector entries.
9393 (claim_file_hook): Stop reading at end of file according to filesize.
9394 Factor out parsing of readelf output into separate function.
9395 (all_symbols_read_hook): Exercise get_input_file and release_input_file
9396 APIs and get the source file name from the symbol table. Convert
9397 source file name to corresponding object file name. Print info
9398 message when adding new input files.
9399 (parse_readelf_line): New function.
9400 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9401 * testsuite/plugin_test_2.sh: Likewise.
9402 * testsuite/plugin_test_3.sh: Likewise.
9403 * testsuite/plugin_test_4.sh: New test case.
9404
62a6d109
ILT
94052009-01-07 Ian Lance Taylor <iant@google.com>
9406
9407 * version.cc (version_string): Bump to 1.8.
9408
483620e8
CC
94092008-12-23 Cary Coutant <ccoutant@google.com>
9410
9411 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9412 * plugin.cc (Plugin_manager::finish): Rename as
9413 layout_deferred_objects. Move cleanup to separate function.
9414 (Plugin_manager::cleanup): New function.
9415 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9416 separately.
9417 * plugin.h (Plugin_manager::finish): Rename as
9418 layout_deferred_objects.
9419 (Plugin_manager::cleanup): New function.
9420 (Plugin_manager::cleanup_done): New field.
9421
d66a9eb3
CC
94222008-12-23 Cary Coutant <ccoutant@google.com>
9423
9424 * plugin.cc (is_visible_from_outside): New function.
9425 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9426 so we don't return "IR only" status for exported symbols or -r links.
9427
9428 * testsuite/Makefile.am (plugin_test_3): New test case.
9429 * testsuite/Makefile.in: Regenerate.
9430 * testsuite/plugin_test_3.sh: New file.
9431
5995b570
CC
94322008-12-22 Cary Coutant <ccoutant@google.com>
9433
9434 * object.cc (Sized_relobj::layout_section): New function.
9435 (Sized_relobj::do_layout): Defer layout of input sections until after
9436 plugin has provided replacement files.
9437 (Sized_relobj::do_layout_deferred_sections): New function.
9438 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9439 (Relobj::layout_deferred_sections): New function.
9440 (Relobj::do_layout_deferred_sections): New function.
9441 (Sized_relobj::do_layout_deferred_sections): New function.
9442 (Sized_relobj::layout_section): New function.
9443 (Sized_relobj::Deferred_layout): New structure.
9444 (Sized_relobj::deferred_layout_): New field.
9445 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9446 Change all callers. Layout deferred sections.
9447 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9448 references.
9449 (Plugin_hook::run): Move code from do_plugin_hook inline.
9450 (Plugin_hook::do_plugin_hook): Remove.
9451 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9452 (Plugin_manager::finish): Renamed, was cleanup.
9453 (Plugin_manager::should_defer_layout): New function.
9454 (Plugin_manager::add_deferred_layout_object): New function.
9455 (Plugin_manager::Deferred_layout_list): New type.
9456 (Plugin_manager::deferred_layout_objects_): New field.
9457 (Plugin_hook::do_plugin_hook): Remove.
9458
ee769c88
ILT
94592008-12-17 Ian Lance Taylor <iant@google.com>
9460
9461 * options.h (class General_options): Add --no case for
9462 --export-dynamic.
9463
abc8dcba
CC
94642008-12-16 Cary Coutant <ccoutant@google.com>
9465
9466 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9467 vector.
9468 (Plugin_manager::claim_file): Create plugin object even if
9469 plugin did not call the add_symbols callback.
9470 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9471 asking for more symbols than were added.
9472 * testsuite/Makefile.am (plugin_test_1): Add test case with
9473 no global symbols.
9474 (empty.syms): New target.
9475 * testsuite/Makefile.in: Regenerate.
9476 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9477 message. Don't call add_symbols if no globals.
9478 (all_symbols_read_hook): Don't provide replacement for empty
9479 claimed file.
9480
b0074644
ILT
94812008-12-12 Ian Lance Taylor <iant@google.com>
9482
68943102
ILT
9483 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9484 r_type == 0 for a local symbol with r_sym == 0.
9485 (scan_relocatable_relocs): Pass r_sym to
9486 local_non_section_strategy.
9487 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9488 r_sym parameter.
9489
b0074644
ILT
9490 * configure.ac: Update test for TLS descriptors: they are
9491 supported as of glibc 2.9.
9492 * configure: Rebuild.
9493
c2508178
ILT
94942008-12-11 Ian Lance Taylor <iant@google.com>
9495
9496 PR 7091
9497 * target-reloc.h (Default_scan_relocatable_relocs): For each
9498 function, map r_type == 0 to RELOC_DISCARD.
9499
2756a258
CC
95002008-12-10 Cary Coutant <ccoutant@google.com>
9501
9502 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9503 object to override a kept COMDAT group from a plugin object.
9504
bb6f53d3
ILT
95052008-12-09 Ian Lance Taylor <iant@google.com>
9506
fbc558e1
ILT
9507 PR 7088
9508 * yyscript.y (file_cmd): Handle INPUT.
9509
bb6f53d3
ILT
9510 * testsuite/initpri1.c: Change all declarations to be full
9511 prototypes by adding void, to avoid compiler warnings.
9512
4674ecfc
CC
95132008-12-05 Rafael Avila de Espindola <espindola@google.com>
9514
9515 * options.cc (General_options::parse_plugin_opt): New.
9516 (General_options::add_plugin): The argument now is just the filename.
9517 (General_options::add_plugin_option): New.
9518 * options.h (plugin_opt): New.
9519 (add_plugin): Change argument name.
9520 (add_plugin_option): New.
9521 * plugin.cc (Plugin::load): Don't parse the plugin option.
9522 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9523 (Plugin::add_option): New.
9524 (Plugin::args_): Change type.
9525 (Plugin::filename_): New.
9526 (Plugin_manager::add_plugin_option): New.
9527 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9528 * testsuite/Makefile.in: Regenerate.
9529
fd06b4aa
CC
95302008-12-05 Cary Coutant <ccoutant@google.com>
9531
9532 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9533 Handle --strip-lto-sections option.
9534 * options.h (strip_lto_sections): New option.
9535
6c52134c
CC
95362008-12-01 Cary Coutant <ccoutant@google.com>
9537
9538 * plugin.cc (ld_plugin_message): Change format parameter to const.
9539 Fix mismatch between new[] and delete.
9540
a45248e0
CC
95412008-11-14 Cary Coutant <ccoutant@google.com>
9542
9543 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9544 instead of -1U.
9545
c82fbeee
CS
95462008-11-05 Craig Silverstein <csilvers@google.com>
9547
9548 * options.cc (General_options::parse_dynamic_list): New function.
9549 * options.h (General_options): New flags dynamic_list,
9550 dynamic_list_data, dynamic_list_cpp_new, and
9551 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9552 (General_options::in_dynamic_list): New function.
9553 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9554 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9555 (Lex::can_continue_name): Likewise.
9556 (yylex): Likewise.
9557 (read_script_file): New parameter script_options.
9558 (read_dynamic_list): New function.
9559 (Script_options::define_dynamic_list): New function.
9560 (dynamic_list_keyword_parsecodes): New variable.
9561 (dynamic_list_keywords): New variable.
9562 * script.h (Script_options::define_dynamic_list): New function
9563 prototype.
9564 (read_dynamic_list): New function prototype.
9565 * symtab.cc (strprefix): New macro.
9566 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9567 dynamic_list_data, dynamic_list_cpp_new, and
9568 dynamic_list_cpp_typeinfo.
9569 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9570 (dynamic_list_expr): New rule.
9571 (dynamic_list_nodes): Likewise.
9572 (dynamic_list_node): Likewise.
9573 * testsuite/Makefile.am (dynamic_list): New test.
9574 * testsuite/Makefile.in: Regenerated.
9575 * testsuite/dynamic_list.t: New file.
9576 * testsuite/dynamic_list.sh: New file.
9577
e0bb29a5
CS
95782008-11-05 Craig Silverstein <csilvers@google.com>
9579
9580 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9581 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9582 (t11_last): Likewise.
9583 * testsuite/ver_test_6.c (main): Likewise.
9584
4e1e25e0
CC
95852008-10-07 Cary Coutant <ccoutant@google.com>
9586
9587 * options.c (General_options::finalize): Add check for -static and
9588 -shared.
9589 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9590 is not empty.
9591
92f03fcb
CC
95922008-10-02 Cary Coutant <ccoutant@google.com>
9593
9594 * plugin.cc (make_sized_plugin_object): Fix conditional
9595 compilation to work when not all targets are enabled.
9596
fbd8a257
CC
95972008-09-29 Cary Coutant <ccoutant@google.com>
9598
9599 * archive.cc (Archive::get_file_and_offset): Use filename instead
9600 of name to get library path.
9601 (Archive::include_member): Unlock external member of a thin archive.
9602
9603 * testsuite/Makefile.am (TEST_AR): New variable.
9604 (thin_archive_test_1): New test.
9605 (thin_archive_test_2): New test.
81636b3f
CC
9606 * testsuite/Makefile.in: Regenerate.
9607 * testsuite/thin_archive_main.cc: New file.
9608 * testsuite/thin_archive_test_1.cc: New file.
9609 * testsuite/thin_archive_test_2.cc: New file.
9610 * testsuite/thin_archive_test_3.cc: New file.
9611 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 9612
eff45813
CC
96132008-09-29 Cary Coutant <ccoutant@google.com>
9614
9615 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9616 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9617 instead of -1U.
9618 (Sized_relobj::do_finalize_local_symbols): Likewise.
9619 (Sized_relobj::map_to_kept_section): Likewise.
9620 * object.h (Sized_relobj::invalid_address): New constant.
9621 (Sized_relobj::do_output_section_offset): Check for invalid_address
9622 and return -1ULL.
9623 * output.cc (Output_reloc::local_section_offset): Use constant
9624 invalid_address instead of -1U.
9625 (Output_reloc::get_address): Likewise.
9626 (Output_section::output_address): Change -1U to -1ULL.
9627 * output.h (Output_reloc::invalid_address): New constant.
9628 * reloc.cc (Sized_relobj::write_sections): Use constant
9629 invalid_address instead of -1U.
9630 (Sized_relobj::relocate_sections): Likewise.
9631 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9632 values for merge sections.
9633 * target-reloc.h (relocate_for_relocatable): Use constant
9634 invalid_address instead of -1U.
9635
89fc3421
CC
96362008-09-19 Cary Coutant <ccoutant@google.com>
9637
9638 Add plugin functionality for link-time optimization (LTO).
9639 * configure.ac (plugins): Add --enable-plugins option.
9640 * configure: Regenerate.
9641 * config.in: Regenerate.
9642 * Makefile.am (LIBDL): New variable.
9643 (CCFILES): Add plugin.cc.
9644 (HFILES): Add plugin.h.
9645 (ldadd_var): Add LIBDL.
9646 * Makefile.in: Regenerate.
9647
9648 * archive.cc: Include "plugin.h".
9649 (Archive::setup): Don't preread archive symbols when using a plugin.
9650 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9651 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9652 files.
9653 (Archive::include_member): Add symbols from plugin objects.
9654 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9655 * descriptors.cc (Descriptors::open): Check for file descriptors
9656 abandoned by plugins.
9657 (Descriptors::claim_for_plugin): New function.
9658 * descriptors.h (Descriptors::claim_for_plugin): New function.
9659 (Open_descriptor::is_claimed): New field.
9660 (claim_descriptor_for_plugin): New function.
9661 * fileread.cc (File_read::claim_for_plugin): New function.
9662 * fileread.h (File_read::claim_for_plugin): New function.
9663 (File_read::descriptor): New function.
9664 * gold.cc: Include "plugin.h".
9665 (queue_initial_tasks): Add task to call plugin hooks for generating
9666 new object files.
9667 * main.cc: Include "plugin.h".
9668 (main): Load plugin libraries.
9669 * object.h (Pluginobj): Declare.
9670 (Object::pluginobj): New function.
9671 (Object::do_pluginobj): New function.
9672 (Object::set_target): New function.
9673 * options.cc: Include "plugin.h".
9674 (General_options::parse_plugin): New function.
9675 (General_options::General_options): Initialize plugins_ field.
9676 (General_options::add_plugin): New function.
9677 * options.h (Plugin_manager): Declare.
9678 (General_options): Add --plugin option.
9679 (General_options::has_plugins): New function.
9680 (General_options::plugins): New function.
9681 (General_options::add_plugin): New function.
9682 (General_options::plugins_): New field.
9683 * plugin.cc: New file.
9684 * plugin.h: New file.
9685 * readsyms.cc: Include "plugin.h".
9686 (Read_symbols::do_read_symbols): Check for archive before checking
9687 for ELF file. Call plugin hooks to claim files.
9688 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9689 from a real object file; force override when processing replacement
9690 files.
9691 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9692 (Symbol::init_base_object): Likewise.
9693 (Symbol::init_base_output_data): Likewise.
9694 (Symbol::init_base_output_segment): Likewise.
9695 (Symbol::init_base_constant): Likewise.
9696 (Symbol::init_base_undefined): Likewise.
9697 (Symbol::output_section): Assert that object is not a plugin.
9698 (Symbol_table::add_from_pluginobj): New function.
9699 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9700 undefined.
9701 (Symbol_table::sized_write_globals): Likewise.
9702 (Symbol_table::add_from_pluginobj): Instantiate template.
9703 * symtab.h (Sized_pluginobj): Declare.
9704 (Symbol::in_real_elf): New function.
9705 (Symbol::set_in_real_elf): New function.
9706 (Symbol::in_real_elf_): New field.
9707 (Symbol_table::add_from_pluginobj): New function.
9708
9709 * testsuite/Makefile.am (AM_CFLAGS): New variable.
9710 (LIBDL): New variable.
9711 (LDADD): Add LIBDL.
9712 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
9713 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
9714 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
9715 (MOSTLYCLEANFILES): Likewise.
9716 * testsuite/Makefile.in: Regenerate.
9717 * testsuite/plugin_test.c: New file.
9718 * testsuite/plugin_test_1.sh: New file.
9719 * testsuite/plugin_test_2.sh: New file.
9720
de31bda5
ILT
97212008-09-16 Ian Lance Taylor <iant@google.com>
9722
9c2d0ef9
ILT
9723 * target-reloc.h (relocate_section): Check whether a symbol is
9724 defined by the ABI before reporting an undefined symbol error.
9725 * target.h (Target::is_defined_by_abi): Make parameter const.
9726 (Target::do_is_defined_by_abi): Likewise.
9727 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
9728 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
9729 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
9730 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
9731 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
9732 * testsuite/Makefile.in: Rebuild.
9733
de31bda5
ILT
9734 * fileread.cc (make_view): Add casts to avoid warning.
9735
9fa33bee
AO
97362008-09-16 Alexandre Oliva <aoliva@redhat.com>
9737
9738 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
9739 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9740
183fd0e3
AO
97412008-09-16 Alexandre Oliva <aoliva@redhat.com>
9742
9743 * options.h (General_options::output_is_executable): New.
9744 (General_options::output_is_pie): New.
9745 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
9746 for shared libraries.
9747 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9748
7be8330a
CD
97492008-09-11 Chris Demetriou <cgd@google.com>
9750
9751 * options.h (origin): New -z option.
9752 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
9753 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
9754 in DT_FLAGS_1.
9755
a9caad02
CC
97562008-09-05 Cary Coutant <ccoutant@google.com>
9757
9758 * fileread.cc (File_read::make_view): Add check for attempt to map
9759 beyond end of file.
9760
ae6dce4d
CC
97612008-09-05 Cary Coutant <ccoutant@google.com>
9762
9763 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
9764 explicit instantiations.
9765
d7ab2a47
KVH
97662008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
9767
9768 PR gold/6858
9769 * options.cc (General_options::finalize): Allow undefined symbols
9770 in shlibs if linking -shared.
9771
9772 PR gold/6859
9773 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
9774 symbols as not needing a dynsym entry.
9775
1e52a9c1
CS
97762008-08-20 Craig Silverstein <csilvers@google.com>
9777
9778 * fileread.cc (File_read::open): Do not lock the file unless it
9779 was successfully opened.
9780
d85c80a3
CC
97812008-08-14 Cary Coutant <ccoutant@google.com>
9782
9783 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
9784 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
9785 * testsuite/tls_test.cc (struct int128): 128-bit struct
9786 for testing TLS relocs with non-zero addend.
9787 (v12): New TLS variable.
9788 (t12): New test.
9789 (t_last): Add check for v12.
9790 * testsuite/tls_test.h (t12): New function.
9791 * testsuite/tls_test_main.cc (thread_routine): Call new test.
9792
2d924fd9
ILT
97932008-08-13 Ian Lance Taylor <iant@google.com>
9794
9795 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
9796 set tls_segment_ or relro_segment_.
9797 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
9798 when appropriate.
9799 * output.h (Output_section::clear_is_relro): New function.
9800 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
9801 sections specially even when output_data_ is empty.
9802 (Output_segment::maximum_alignment): When first section is relro,
9803 only force alignment for PT_LOAD segments.
9804 * script.cc (script_data_segment_align): New function.
9805 (script_data_segment_relro_end): New function.
9806 * script-c.h (script_data_segment_align): Declare.
9807 (script_data_segment_relro_end): Declare.
9808 * script-sections.h (class Script_sections): Declare
9809 data_segment_align and data_segment_relro_end. Add fields
9810 segment_align_index_ and saw_relro_end_.
9811 * script-sections.cc (class Sections_element): Add set_is_relro
9812 virtual function. Add new bool* parameter to place_orphan_here.
9813 Add get_output_section virtual function.
9814 (class Output_section_definition): Add set_is_relro. Add new
9815 bool* parameter to place_orphan_here. Add get_output_section.
9816 Add is_relro_ field.
9817 (Output_section_definition::Output_section_definition): Initialize
9818 evaluated_address_, evaluated_load_address, evaluated_addralign_,
9819 and is_relro_ fields.
9820 (Output_section_definition::place_orphan_here): Add is_relro
9821 parameter.
9822 (Output_section_definition::set_section_addresses): Set relro for
9823 output section.
9824 (Output_section_definition::alternate_constraint): Likewise.
9825 (class Orphan_output_section): Add new bool* parameter to
9826 place_orphan_here. Add get_output_section.
9827 (Orphan_output_section::place_orphan_here): Add is_relro
9828 parameter.
9829 (Script_sections::Script_sections): Initialize
9830 data_segment_align_index_ and saw_relro_end_.
9831 (Script_sections::data_segment_align): New function.
9832 (Script_sections::data_segment_relro_end): New function.
9833 (Script_sections::place_orphan): Set or clear is_relro.
9834 (Script_sections::set_section_addresses): Force alignment of first
9835 TLS section.
9836 * yyscript.y (exp): Call script_data_segment_align and
9837 script_data_segment_relro_end.
9838 * testsuite/relro_script_test.t: New file.
9839 * testsuite/relro_test.cc (using_script): Declare.
9840 (t1, t2): Test using_script.
9841 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
9842 (relro_script_test_SOURCES): Define.
9843 (relro_script_test_DEPENDENCIES): Define.
9844 (relro_script_test_LDFLAGS): Define.
9845 (relro_script_test_LDADD): Define.
9846 (relro_script_test.so): New target.
9847 * testsuite/Makefile.in: Rebuild.
9848
f827c9a9
CC
98492008-08-06 Cary Coutant <ccoutant@google.com>
9850
9851 * archive.cc (Archive::total_archives, Archive::total_members)
9852 (Archive::total_members_loaded): New variables.
9853 (Archive::setup): Add parameter. Add option to preread
9854 archive symbols.
9855 (Archive::read_armap): Add counter.
9856 (Archive::get_file_and_offset): New function.
9857 (Archive::get_elf_object_for_member): New function.
9858 (Archive::read_all_symbols): New function.
9859 (Archive::read_symbols): New function.
9860 (Archive::add_symbols): Add counters.
9861 (Archive::include_all_members): Use armap to find members if it's
9862 already built.
9863 (Archive::include_member): Skip reading symbols if already read.
9864 Factored code into Archive::get_file_and_offset and
9865 Archive::get_elf_object_for_member. Changed call to
9866 Mapfile::report_include_archive_member.
9867 (Archive::print_stats): New function.
9868 * archive.h: Declare Object and Read_symbols_data classes.
9869 (Archive::Archive): Add initializers for new members.
9870 (Archive::setup): Add parameter.
9871 (Archive::print_stats): New function.
9872 (Archive::total_archives, Archive::total_members)
9873 (Archive::total_members_loaded): New variables.
9874 (Archive::get_file_and_offset): New function.
9875 (Archive::get_elf_object_for_member): New function.
9876 (Archive::read_all_symbols): New function.
9877 (Archive::read_symbols): New function.
9878 (Archive::Archive_member): New class.
9879 (Archive::members_): New member.
9880 (Archive::num_members_): New member.
9881 * main.cc: Include archive.h.
9882 (main): Call Archive::print_stats.
9883 * mapfile.cc (Mapfile::report_include_archive_member): Delete
9884 archive parameter; member_name is now the fully-decorated name.
9885 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
9886 * options.h: (General_options): Add --preread-archive-symbols option.
9887 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
9888 Archive::setup.
9889
de4c45bd
ILT
98902008-08-04 Ian Lance Taylor <iant@google.com>
9891
9892 * symtab.h (Symbol::use_plt_offset): New function.
9893 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
9894 * powerpc.cc (Relocate::relocate): Likewise.
9895 * sparc.cc (Relocate::relocate): Likewise.
9896 * x86_64.cc (Relocate::relocate): Likewise.
9897 * testsuite/weak_plt.sh: New test.
9898 * testsuite/weak_plt_main.cc: New test.
9899 * testsuite/weak_plt_shared.cc: New test.
9900 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
9901 (check_PROGRAMS): Add weak_plt.
9902 (check_DATA): Add weak_plt_shared.so.
9903 (weak_plt_main_pic.o, weak_plt): New targets.
9904 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
9905 * testsuite/Makefile.in: Rebuild.
9906
9907 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
9908 gcctestdir/ld.
9909 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
9910 * testsuite/Makefile.in: Rebuild.
9911
323ee3f4
AM
99122008-08-04 Alan Modra <amodra@bigpond.net.au>
9913
9914 * Makefile.am (POTFILES.in): Set LC_ALL=C.
9915 * Makefile.in: Regenerate.
9916 * po/POTFILES.in: Regenerate.
9917
7c07ecec
ILT
99182008-07-29 Ian Lance Taylor <iant@google.com>
9919
9920 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
9921 symbols before other symbols.
9922 * testsuite/script_test_2.cc (test_addr): Declare.
9923 (test_addr_alias): Declare.
9924 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9925 values.
7c07ecec
ILT
9926 * testsuite/script_test_2.t: Define test_addr_alias and
9927 test_addr.
9928
5778530e
ILT
99292008-07-24 Ian Lance Taylor <iant@google.com>
9930
2a00e4fb
ILT
9931 PR 5990
9932 * descriptors.cc: New file.
9933 * descriptors.h: New file.
9934 * gold-threads.h (class Hold_optional_lock): New class.
9935 * fileread.cc: Include "descriptors.h".
9936 (File_read::~File_read): Release descriptor rather than closing
9937 it.
9938 (File_read::open) [file]: Call open_descriptor rather than open.
9939 Set is_descriptor_opened_.
9940 (File_read::open) [memory]: Assert that descriptor is not open.
9941 (File_read::reopen_descriptor): New function.
9942 (File_read::release): Release descriptor.
9943 (File_read::do_read): Make non-const. Reopen descriptor.
9944 (File_read::read): Make non-const.
9945 (File_read::make_view): Reopen descriptor.
9946 (File_read::do_readv): Likewise.
9947 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9948 Update declarations.
9949 * layout.cc: Include "descriptors.h".
9950 (Layout::create_build_id): Use open_descriptor rather than open.
9951 * output.cc: Include "descriptors.h".
9952 (Output_file::open): Use open_descriptor rather than open.
9953 * archive.cc (Archive::const_iterator): Change Archive to be
9954 non-const.
9955 (Archive::begin, Archive::end): Make non-const.
9956 (Archive::count_members): Likewise.
9957 * archive.h (class Archive): Update declarations.
9958 * object.h (Object::read): Make non-const.
9959 * Makefile.am (CCFILES): Add descriptors.cc.
9960 (HFILES): Add descriptors.h.
9961 * Makefile.in: Rebuild.
9962
801647d1
ILT
9963 PR 6716
9964 * gold.h: Always include <clocale>. Add Solaris workarounds
9965 following code in binutils/sysdep.h.
9966
5edd166e
ILT
9967 PR 6048
9968 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9969 this->eh_frame_hdr_ is NULL before using it.
9970
c89ad728
ILT
9971 * dynobj.cc (Versions::Versions): Update comment.
9972
aa86f06b
ILT
9973 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9974 the base version name.
9975
5778530e
ILT
9976 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9977 array size plus one.
9978 (Stringpool_template::set_string_offsets): Subtract one from key
9979 before using it as an array index.
9980 (Stringpool_template::get_offset_with_length): Likewise.
9981 (Stringpool_template::write_to_buffer): Likewise.
9982 * stringpool.h (Stringpool_template::get_offset_from_key):
9983 Likewise.
9984
057ead22
ILT
99852008-07-23 Ian Lance Taylor <iant@google.com>
9986
7f649c59
ILT
9987 PR 6658
9988 * object.h (Merged_symbol_value::value): Do our best to handle a
9989 negative addend.
9990
057ead22
ILT
9991 PR 6647
9992 * script.cc (Version_script_info::get_versions): Don't add empty
9993 version tag to return value.
9994 (Version_script_info::get_symbol_version_helper): Change return
9995 type to bool. Add pversion parameter. Change all callers.
9996 (script_register_vers_node): Don't require a non-NULL tag.
9997 * script.h (class Version_script_info): Update declarations.
9998 (Version_script_info::get_symbol_version): Change return type to
9999 bool. Add version parameter. Change all callers.
10000 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10001 handling. Handle an empty version from a version script.
10002 (Symbol_table::define_special_symbol): Likewise.
10003 * testsuite/ver_test_10.script: New file.
10004 * testsuite/ver_test_10.sh: New file.
10005 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10006 (check_DATA): Add ver_test_10.syms.
10007 (ver_test_10.syms, ver_test_10.so): New target.
10008 * testsuite/Makefile.in: Rebuild.
10009
58e54ac2
CD
100102008-07-23 Simon Baldwin <simonb@google.com>
10011
10012 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10013 to zero for undefined symbols from dynamic libraries.
10014
95d14cd3
ILT
100152008-07-23 Ian Lance Taylor <iant@google.com>
10016
10017 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10018 Change all callers.
10019 * symtab.h (class Symbol_table): Update declaration.
10020 * testsuite/ver_test_9.cc: New file.
10021 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10022 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10023 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10024 (ver_test_9.so, ver_test_9.o): New targets.
10025 * testsuite/Makefile.in: Rebuild.
10026
92de84a6
ILT
100272008-07-22 Ian Lance Taylor <iant@google.com>
10028
34810851
ILT
10029 * options.h (class General_options): Define --check-sections.
10030 * layout.cc (Layout::set_segment_offsets): Handle
10031 --check-sections.
10032
af6156ef
ILT
10033 * options.h (class General_options): Define -n/--nmagic and
10034 -N/--omagic.
10035 * options.cc (General_options::finalize): For -n/--nmagic or
10036 -N/--omagic, set -static.
10037 * layout.cc (Layout::attach_allocated_section_to_segment): If
10038 -N/--omagic, don't put read-only and read-write sections in
10039 different segments.
10040 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10041 finding a read-only segment.
10042 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10043 don't set the minimum segment alignment to the common page size,
10044 and don't set the file offset to the address modulo the page size.
10045 * script-sections.cc (Script_sections::create_segments): If
10046 -n/--omagic, don't put read-only and read-write sections in
10047 different segments.
10048
92de84a6
ILT
10049 * cref.cc: New file.
10050 * cref.h: New file.
10051 * options.h (class General_options): Add --print-symbol-counts.
10052 * main.cc (main): Issue defined symbol report if requested.
10053 * archive.cc (Archive::interpret_header): Make into a const member
10054 function.
10055 (Archive::add_symbols): Call Input_objects::archive_start and
10056 archive_stop.
10057 (Archive::const_iterator): Define new class.
10058 (Archive::begin, Archive::end): New functions.
10059 (Archive::include_all_members): Rewrite to use iterator.
10060 (Archive::count_members): New function.
10061 * archive.h (class Archive): Update declarations.
10062 (Archive::filename): New function.
10063 * object.cc: Include "cref.h".
10064 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10065 (Sized_relobj::do_get_global_symbol_counts): New function.
10066 (Input_objects::add_object): Add object to cross-referencer.
10067 (Input_objects::archive_start): New function.
10068 (Input_objects::archive_stop): New function.
10069 (Input_objects::print_symbol_counts): New function.
10070 * object.h: Declare Cref and Archive.
10071 (Object::get_global_symbol_counts): New function.
10072 (Object::do_get_global_symbol_counts): New pure virtual function.
10073 (class Sized_relobj): Add defined_count_ field. Update
10074 declarations.
10075 (class Input_objects): Add cref_ field. Update constructor.
10076 Update declarations.
10077 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10078 defined_count_.
10079 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10080 symbol counts.
10081 (Sized_dynobj::do_get_global_symbol_counts): New function.
10082 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10083 defined_count_. Update declarations. Define Symbols typedef.
10084 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10085 parameter. Change all callers.
10086 (Symbol_table::add_from_dynobj): Add sympointers and defined
10087 parameters. Change all callers.
10088 * symtab.h (class Symbol_table): Update declarations.
10089 * Makefile.am (CCFILES): Add cref.cc.
10090 (HFILES): Add cref.h.
10091 * Makefile.in: Rebuild.
10092
3f7c5e1d
CD
100932008-07-22 Simon Baldwin <simonb@google.com>
10094
10095 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10096 to zero when writing undefined symbols.
10097
e0b64032
ILT
100982008-07-22 Ian Lance Taylor <iant@google.com>
10099
10100 * output.cc (Output_section::add_input_section): Don't try to
10101 merge empty merge sections.
10102
096b02cf
CS
101032008-07-21 Craig Silverstein <csilvers@google.com>
10104
10105 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10106 Include symbol version in error message.
cd536b21 10107
1d1f116d
CD
101082008-07-20 Chris Demetriou <cgd@google.com>
10109
cd536b21 10110 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
10111 (RANDOM_SEED_CFLAGS): New substituted variable.
10112 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10113 * configure: Rebuild.
10114 * Makefile.in: Likewise.
10115 * testsuite/Makefile.in: Likewise.
10116
a18f591e
ILT
101172008-07-18 Ian Lance Taylor <iant@google.com>
10118
10119 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10120 where we see NAME/NULL and NAME/VERSION as separate symbols.
10121 * testsuite/ver_test_main.cc (main): Call t4.
10122 (t4, t4_2a): Define.
10123 * testsuite/ver_test_2.cc (t4_2): Define.
10124 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10125 * testsuite/ver_test_4.cc (t4_2a): Define.
10126 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10127 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10128
c6e3f6ed
ILT
101292008-07-17 Ian Lance Taylor <iant@google.com>
10130
10131 * dynobj.cc (Versions::add_def): If we give an error about a
10132 missing version, go ahead and create the version anyhow.
10133
ef9beddf
ILT
101342008-07-10 Ian Lance Taylor <iant@google.com>
10135
10136 Handle output sections with more than 0x7fffffff bytes.
10137 * object.h (class Relobj): Change map_to_output_ to
10138 output_sections_, and just keep a section pointer. Change all
10139 uses. Move comdat group support to Sized_relobj.
10140 (Relobj::is_section_specially_mapped): Remove.
10141 (Relobj::output_section): Remove poff parameter. Change all
10142 callers.
10143 (Relobj::output_section_offset): New function.
10144 (Relobj::set_section_offset): Rewrite.
10145 (Relobj::map_to_output): Remove.
10146 (Relobj::output_sections): New function.
10147 (Relobj::do_output_section_offset): New pure virtual function.
10148 (Relobj::do_set_section_offset): Likewise.
10149 (class Sized_relobj): Add section_offsets_ field. Add comdat
10150 group support from Relobj. Update declarations.
10151 (Sized_relobj::get_output_section_offset): New function.
10152 (Sized_relobj::do_output_section_offset): New function.
10153 (Sized_relobj::do_set_section_offset): New function.
10154 * object.cc (Relobj::output_section_address): Remove.
10155 (Sized_relobj::Sized_relobj): Initialize new fields.
10156 (Sized_relobj::include_section_group): Cast find_kept_object to
10157 Sized_relobj.
10158 (Sized_relobj::include_linkonce_section): Likewise.
10159 (Sized_relobj::do_layout): Use separate arrays for output section
10160 and output offset.
10161 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10162 output_sections.
10163 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10164 output_sections and section_offsets.
10165 (Sized_relobj::write_local_symbols): Likewise.
10166 (map_to_kept_section): Compute output address directly.
10167 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10168 output_sections and section_offsets.
10169 (Sized_relobj::write_sections): Likewise.
10170 (Sized_relobj::relocate_sections): Likewise.
10171 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10172 * output.h (class Output_reloc): Update declarations. Change
10173 u2_.relobj to Sized_relobj*.
10174 (class Output_data_reloc): Change add functions to use
10175 Sized_relobj*.
10176 * output.cc (Output_reloc::Output_reloc): Change relobj to
10177 Sized_relobj*.
10178 (Output_reloc::local_section_offset): Change return type to
10179 Elf_Addr. Use get_output_section_offset.
10180 (Output_reloc::get_address): Likewise.
10181 (Output_section::is_input_address_mapped): Don't call
10182 is_section_specially_mapped.
10183 (Output_section::output_offset): Likewise.
10184 (Output_section::output_address): Likewise.
10185 (Output_section::starting_output_address): Likewise.
10186 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10187 parameter to Sized_relobj*.
10188 (Copy_relocs::need_copy_reloc): Likewise.
10189 (Copy_relocs::save): Likewise.
10190 * copy-relocs.h (class Copy_relocs): Update declarations.
10191 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10192 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10193 * target-reloc.h (relocate_for_relocatable): Change
10194 offset_in_output_section type to Elf_Addr. Change code that uses
10195 it as well.
10196 * layout.cc (Layout::layout): Always set *off.
10197 * mapfile.cc (Mapfile::print_input_section): Use
10198 output_section_offset.
10199 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10200 Sized_relobj*.
10201 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10202 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10203 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10204
5cb66f97
ILT
102052008-07-03 Ian Lance Taylor <iant@google.com>
10206
10207 * layout.cc (Layout::include_section): Do not discard unrecognized
10208 SHT_STRTAB sections.
10209
afe47622
CS
102102008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10211
10212 * script.cc (Lex::can_continue_name): Make '?' allowable in
10213 version-script names.
10214 * testsuite/version_script.map: Change glob pattern to use '?'
10215
5adf9721
ILT
102162008-06-30 Manish Singh <yosh@gimp.org>
10217
10218 PR 6585
10219 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10220 Correct typo.
10221
e6fde208
ILT
102222008-06-30 Ian Lance Taylor <iant@google.com>
10223
10224 PR 6660
10225 PR 6682
10226 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10227 versions]: Don't try to read the value in the contents, since we
10228 don't use it. Use the template endianness when writing.
10229
3f2e6a2d
CC
102302008-06-25 Cary Coutant <ccoutant@google.com>
10231
10232 * fileread.cc (File_read::make_view): Assert on zero-length view.
10233 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10234 symbol table when there are no symbols to read.
10235
c43d3a48
CS
102362008-06-23 Craig Silverstein <csilvers@google.com>
10237
10238 * version.cc (version_string): Bump to 1.7
10239
5f494ea0
CS
102402008-06-18 Craig Silverstein <csilvers@google.com>
10241
10242 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10243 constant 0xFFFF to type Valtype.
10244 (Powerpc_relocate_functions::rel16_ha): Likewise.
10245
c42e122e
ILT
102462008-06-17 Ian Lance Taylor <iant@google.com>
10247
f34787f8
ILT
10248 * output.h (Output_section::Input_section): Initialize p2align_ to
10249 zero for Output_section_data constructors.
10250 (Output_section::Input_section::addralign): If not an input
10251 section, return the alignment of the Output_section_data.
10252 * testsuite/copy_test.cc: New file.
10253 * testsuite/copy_test_1.cc: New file.
10254 * testsuite/copy_test_2.cc: New file.
10255 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
10256 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
10257 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
10258 (copy_test_1_pic.o, copy_test_1.so): New targets.
10259 (copy_test_2_pic.o, copy_test_2.so): New targets.
10260 * testsuite/Makefile.in: Rebuild.
10261
c42e122e
ILT
10262 * script-sections.cc (Script_sections::place_orphan): Initialize
10263 local variable exact.
10264
ce3ac18a
DE
102652008-06-13 David Edelsohn <edelsohn@gnu.org>
10266
10267 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
10268
42cacb20
DE
102692008-06-12 David Edelsohn <edelsohn@gnu.org>
10270 David S. Miller <davem@davemloft.net>
10271
10272 * powerpc.cc: New file.
10273 * Makefile.am (TARGETSOURCES): Add powerpc.cc
10274 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
10275 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
10276 * Makefile.in: Rebuild.
10277
7b308235
ILT
102782008-06-09 Ian Lance Taylor <iant@google.com>
10279
10280 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
10281 <exception>.
10282 (throwing, orig_terminate): New static variables.
10283 (terminate_handler): New static function.
10284 (t2): Set terminate handler.
10285
f0b886e3
ILT
102862008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
10287
10288 PR 6584
cd536b21 10289 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
10290 alignment.
10291
3e90f135
CC
102922008-05-30 Cary Coutant <ccoutant@google.com>
10293
10294 * archive.cc (Archive::include_all_members) Correct to step
10295 over symbol table and extended name table in thin archives.
10296
e09ad04a
ILT
102972008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
10298
10299 PR 6407
10300 * target-reloc.h (relocate_for_relocatable): Fix new_offset
10301 calculation.
10302
62b01cb5
ILT
103032008-05-28 Caleb Howe <cshowe@google.com>
10304
10305 * reduced_debug_output.cc: New file.
10306 * reduced_debug_output.h: New file.
92de84a6 10307 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
10308 * options.cc (General_options::finalize): Add strip_debug_non_line
10309 to the strip heirarchy.
10310 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
10311 fields.
10312 * layout.cc: Include "reduced_debug_output.h".
10313 (Layout::Layout): Initialize new fields.
10314 (line_only_debug_sections): New static array.
10315 (is_lines_only_debug_sections): New static inline function.
10316 (Layout::include_section): Handle --strip-debug-non-line.
10317 (Layout::make_output_section): If --strip-debug-non-line, build
10318 new output sections for .debug_abbrev and .debug_info.
10319 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
10320 gold. Warn about possible overflow.
10321 (read_signed_LEB_128): Likewise.
10322 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
10323 (read_signed_LEB_128): Declare.
10324 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
10325 (HFILES): Add reduced_debug_output.h.
10326 * Makefile.in: Rebuild.
10327
7d9e3d98
ILT
103282008-05-21 Ian Lance Taylor <iant@google.com>
10329
10330 * mapfile.cc: New file.
10331 * mapfile.h: New file.
10332 * options.h (class General_options): Add -M/--print-map and -Map.
10333 * options.cc (General_options::finalize): Make -M equivalent to
10334 -Map -.
10335 * main.cc: Include <cstdio> and "mapfile.h".
10336 (main): Open mapfile if requested.
10337 * gold.cc (class Middle_runner): Add mapfile_ field. Update
10338 constructor. Change caller.
10339 (queue_initial_tasks): Add mapfile parameter. Change caller.
10340 (queue_middle_tasks): Likewise.
10341 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
10342 declarations.
10343 * archive.cc: Include "mapfile.h".
10344 (Archive::add_symbols): Add mapfile parameter. Change all
10345 callers. Pass mapfile, symbol, and reason to include_member.
10346 (Archive::include_all_members): Add mapfile parameter. Change all
10347 callers.
10348 (Archive::include_member): Add mapfile, sym, and why parameters.
10349 Change all callers. Report inclusion to map file.
10350 * archive.h: Include "fileread.h".
10351 (class Archive): Update declarations.
10352 (Archive::file): New const method.
10353 (class Add_archive_symbols): Add mapfile_ field. Update
10354 constructor. Change all callers.
10355 * readsyms.h (class Read_symbols): Likewise.
10356 (class Finish_group): Likewise.
10357 (class Read_script): Likewise.
10358 * common.cc: Include "mapfile.h".
10359 (Symbol_table::allocate_commons): Add mapfile parameter. Change
10360 all callers.
10361 (Symbol_table::do_allocate_commons): Likewise.
10362 (Symbol_table::do_allocate_commons_list): Likewise. Report common
10363 symbol allocation to mapfile.
10364 * common.h (class Allocate_commons_task): Add mapfile_ field.
10365 Update constructor. Change all callers.
10366 * symtab.h (class Symbol_table): Update declarations.
10367 * layout.cc: Include "mapfile.h".
10368 (Layout_task_runner::run): Print information to mapfile.
10369 (Layout::create_gold_note): Change Output_data_fixed_space to
10370 Output_data_zero_fill.
10371 (Layout::create_build_id): Likewise.
10372 (Layout::print_to_mapfile): New function.
10373 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
10374 constructor. Change caller.
10375 (class Layout): Declare print_to_mapfile.
10376 * output.cc (Output_section::Input_section::print_to_mapfile): New
10377 function.
10378 (Output_section::add_input_section): If producing a map, always
10379 add to input_sections_ list.
10380 (Output_section::do_print_to_mapfile): New function.
10381 (Output_segment::print_sections_to_mapfile): New function.
10382 (Output_segment::print_section_list_to_mapfile): New function.
10383 * output.h: Include "mapfile.h".
10384 (Output_data::print_to_mapfile): New function.
10385 (Output_data::do_print_to_mapfile): New virtual function.
10386 (Output_segment_headers::do_print_to_mapfile): New function.
10387 (Output_file_header::do_print_to_mapfile): New function.
10388 (Output_data_const::do_print_to_mapfile): New function.
10389 (class Output_data_const_buffer): Add map_name_ field. Update
10390 constructor. Change all callers. Add do_print_to_mapfile
10391 function.
10392 (class Output_data_fixed_space): Likewise.
10393 (class Output_data_space): Likewise.
10394 (class Output_data_zero_fill): New class.
10395 (Output_data_strtab::do_print_to_mapfile): New function.
10396 (Output_data_reloc_base::do_print_to_mapfile): New function.
10397 (Output_relocatable_relocs::do_print_to_mapfile): New function.
10398 (Output_data_group::do_print_to_mapfile): New function.
10399 (Output_data_got::do_print_to_mapfile): New function.
10400 (Output_data_dynamic::do_print_to_mapfile): New function.
10401 (Output_symtab_xindex::do_print_to_mapfile): New function.
10402 (class Output_section): Declare do_print_to_mapflie. Declare
10403 print_to_mapfile in Input_section.
10404 (class Output_segment): Declare new functions.
10405 * object.h (Sized_relobj::symbol_count): New function.
10406 * script-sections.cc
10407 (Output_section_element_dot_assignment::set_section_addresses):
10408 Change Output_data_fixed_space to Output_data_zero_fill.
10409 (Output_data_expression::do_print_to_mapfile): New function.
10410 * script.cc (read_input_script): Add mapfile parameter. Change
10411 all callers.
10412 * script.h (read_input_script): Update declaration.
10413 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10414 (Eh_frame::do_print_to_mapfile): New function.
10415 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10416 (Output_merge_string::do_print_to_mapfile): New function.
10417 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10418 function.
10419 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10420 function.
10421 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10422 function.
10423 * Makefile.am (CCFILES): Add mapfile.cc.
10424 (HFILES): Add mapfile.h.
10425 * Makefile.in: Rebuild.
10426
9f1d377b
ILT
104272008-05-19 Ian Lance Taylor <iant@google.com>
10428
10429 * options.h (class General_options): Add -z relro.
10430 * layout.cc (Layout::Layout): Initialize relro_segment_.
10431 (Layout::add_output_section_data): Return the output section.
10432 (Layout::make_output_section): Rcognize relro sections and mark
10433 them appropriately.
10434 (Layout::attach_allocated_section_to_segment): Put relro sections
10435 in a PT_GNU_RELRO segment.
10436 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10437 section as relro.
10438 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10439 PT_TLS segments.
10440 (Layout::linkonce_mapping): Map d.rel.ro.local to
10441 .data.rel.ro.local.
10442 (Layout::output_section_name): Us .data.rel.ro.local for any
10443 section which begins with that.
10444 * layout.h (class Layout): Update add_output_section_data
10445 declaration. Add relro_segment_ field.
10446 * output.cc (Output_section::Output_section): Initialize is_relro_
10447 and is_relro_local_ fields.
10448 (Output_segment::add_output_section): Group relro sections.
10449 (Output_segment::is_first_section_relro): New function.
10450 (Output_segment::maximum_alignment): If there is a relro section,
10451 align the segment to the common page size.
10452 (Output_segment::set_section_addresses): Track whether we are
10453 looking at relro sections. If the last section is a relro
10454 section, align to the common page size.
10455 (Output_segment::set_section_list_addresses): Add in_relro
10456 parameter. Change all callers. Align to the page size when
10457 moving from relro to non-relro section.
10458 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10459 segment.
10460 * output.h (class Output_section): Add is_relro_ and
10461 is_relro_local_ fields.
10462 (Output_section::is_relro): New function.
10463 (Output_section::set_is_relro): New function.
10464 (Output_section::is_relro_local): New function.
10465 (Output_section::set_is_relro_local): New function.
10466 (class Output_segment): Update declarations.
10467 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10468 * sparc.cc (Target_sparc::got_section): Likewise.
10469 * x86_64.cc (Target_x86_64::got_section): Likewise.
10470 * testsuite/relro_test_main.cc: New file.
10471 * testsuite/relro_test.cc: New file.
10472 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10473 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10474 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10475 (relro_test.so, relro_test_pic.o): New targets.
10476 * testsuite/Makefile.in: Rebuild.
10477
a984ee1d
ILT
104782008-05-16 Ian Lance Taylor <iant@google.com>
10479
01676dcd
ILT
10480 * output.cc (Output_segment::add_output_section): Remove front
10481 parameter.
10482 * output.h (class Output_segment): Remove
10483 add_initial_output_section and overloaded add_output_section.
10484 Update declaration of remaining add_output_section.
10485 * layout.cc (Layout::create_interp): Call add_output_section
10486 rather than add_initial_output_section.
10487 (Layout::finish_dynamic_section): Likewise.
10488
497897f9
ILT
10489 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10490 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10491 know the dynamic type.
10492 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10493 field. Initialize it in constructor.
10494 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10495 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10496 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10497 reloc.
10498
a984ee1d
ILT
10499 * output.cc (Output_reloc::get_address): Change return type to
10500 Elf_Addr.
10501 * output.h (class Output_reloc): Update get_address declaration.
10502 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10503 for section addresses.
10504
55ba0940
ILT
105052008-05-09 Ian Lance Taylor <iant@google.com>
10506
10507 PR 6493
10508 * gold.cc (gold_nomem): Use return value of write.
10509
75517b77
ILT
105102008-05-08 Ian Lance Taylor <iant@google.com>
10511
10512 * symtab.c (Symbol::init_base_output_data): Add version
10513 parameter. Change all callers.
10514 (Symbol::init_base_output_segment): Likewise.
10515 (Symbol::init_base_constant): Likewise.
10516 (Symbol::init_base_undefined): Likewise.
10517 (Sized_symbol::init_output_data): Likewise.
10518 (Sized_symbol::init_output_segment): Likewise.
10519 (Sized_symbol::init_constant): Likewise.
10520 (Sized_symbol::init_undefined): Likewise.
10521 (Symbol_table::do_define_in_output_data): If the new symbol has a
10522 version, mark it as the default.
10523 (Symbol_table::do_define_in_output_segment): Likewise.
10524 (Symbol_table::do_define_as_constant): Likewise.
10525 * symtab.h (class Symbol): Update declarations.
10526 (class Sized_symbol): Likewise.
10527 * resolve.cc (Symbol::override_version): New function.
c42e122e 10528 (Symbol::override_base): Call override_version.
75517b77
ILT
10529 (Symbol::override_base_with_special): Likewise.
10530 * testsuite/ver_script_8.script: New file.
10531 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10532 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10533 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10534 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10535
f1f70eae
ILT
105362008-05-06 Ian Lance Taylor <iant@google.com>
10537
f3e9c5c5
ILT
10538 PR 6049
10539 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10540 functions.
10541 (class General_options): Remove existing --undefined, and add
10542 --no-undefined instead. Add new --undefined as synonym for -u.
10543 * archive.cc (Archive::add_symbols): Check whether symbol was
10544 named with -u.
10545 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10546 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10547 all uses. Add IS_UNDEFINED. Update declarations to split
10548 different versions of init_base. Declare init_base_undefined.
10549 (Symbol::is_defined): Handle IS_UNDEFINED.
10550 (Symbol::is_undefined): Likewise.
10551 (Symbol::is_weak_undefined): Call is_undefined.
10552 (Symbol::is_absolute): Handle IS_CONSTANT.
10553 (class Sized_symbol): Update declarations to split different
10554 versions of init. Declare init_undefined.
10555 (class Symbol_table): Declare new functions.
10556 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10557 Change all callers.
10558 (Symbol::init_base_output_data): Likewise.
10559 (Symbol::init_base_output_segment): Likewise.
10560 (Symbol::init_base_constant): Likewise.
10561 (Symbol::init_base_undefined): New function.
10562 (Sized_symbol::init_object): Rename from init. Change all
10563 callers.
10564 (Sized_symbol::init_output_data): Likewise.
10565 (Sized_symbol::init_output_segment): Likewise.
10566 (Sized_symbol::init_constant): Likewise.
10567 (Sized_symbol::init_undefined): New function.
10568 (Symbol_table::add_undefined_symbols_from_command_line): New
10569 function.
10570 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10571 function.
10572 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10573 (Symbol::output_section): Likewise.
10574 (Symbol::set_output_section): Likewise.
10575 (Symbol_table::sized_finalize_symbol): Likewise.
10576 (Symbol_table::sized_write_globals): Likewise.
10577 * resolve.cc (Symbol_table::should_override): Likewise.
10578 (Symbol::override_base_with_special): Likewise.
10579
8bdcdf2c
ILT
10580 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10581 symbol, change it to have default visibility.
10582 * testsuite/protected_1.cc: New file.
10583 * testsuite/protected_2.cc: New file.
10584 * testsuite/protected_3.cc: New file.
10585 * testsuite/protected_main_1.cc: New file.
10586 * testsuite/protected_main_2.cc: New file.
10587 * testsuite/protected_main_3.cc: New file.
10588 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10589 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10590 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10591 (protected_1.so): New target.
10592 (protected_1_pic.o, protected_2_pic.o): New targets.
10593 (protected_3_pic.o): New target.
10594 (check_PROGRAMS): Add protected_2.
10595 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10596 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10597 * testsuite/Makefile.in: Rebuild.
10598
2b706932
ILT
10599 * options.h (DEFINE_var): Add set_user_set_##varname__.
10600 (DEFINE_bool_alias): New macro.
10601 (class General_options): Define -Bstatic using DEFINE_bool_alias
10602 rather than DEFINE_special. Add --undefined as an alias for -z
10603 defs.
10604 * options.cc (General_options::parse_Bstatic): Remove.
10605
d82a5bcc
ILT
10606 * options.h (class General_options): Add --fatal-warnings.
10607 * main.cc (main): Implement --fatal-warnings.
10608 * errors.h (Errors::warning_count): New function.
10609
f1f70eae
ILT
10610 * options.h (class General_options): Add -Bsymbolic-functions.
10611 * symtab.h (Symbol::is_preemptible): Check for
10612 -Bsymbolic-functions.
10613
8825ac63
ILT
106142008-05-05 Ian Lance Taylor <iant@google.com>
10615
d98bc257
ILT
10616 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10617 as noVARNAME rather than no-VARNAME.
10618 (class General_options): Add option -z combreloc.
10619 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10620 get_address.
10621 (Output_reloc::sort_before) [SHT_REL]: New function.
10622 (Output_reloc::sort_before) [SHT_RELA]: New function.
10623 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10624 Sort_relocs_comparison.
10625 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10626 parameter. Change all callers.
10627 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10628 sort_relocs parameter. Change all callers.
10629 * output.cc (Output_reloc::get_address): New function, broken out
10630 of write_rel.
10631 (Output_reloc::write_rel): Call it.
10632 (Output_reloc::compare): New function.
10633 (Output_data_reloc_base::do_write): Optionally sort relocs.
10634
60b2b4e7
ILT
10635 * configure.ac: If targ_extra_obj is set, link it in.
10636 * configure.tgt: Initialize all variables.
10637 (x86_64*): Set targ_extra_obj and targ_extra_size.
10638 * configure: Rebuild.
10639
8825ac63
ILT
10640 * object.cc (Sized_relobj::include_section_group): Adjust section
10641 indexes read from group data. Build vector to pass to
10642 layout_group.
10643 * layout.cc (Layout::layout_group): Add flags and shndxes
10644 parameters. Remove contents parameter. Change caller. Update
10645 explicit instantiations.
10646 * layout.h (class Layout): Update layout_group declaration.
10647 * output.cc (Output_data_group::Output_data_group): Add flags and
10648 input_shndxes parameters. Remove contents parameter. Change
10649 caller.
10650 (Output_data_group::do_write): Change input_sections_ to
10651 input_shndxes_.
10652 * output.h (class Output_data_group): Update constructor
10653 declaration. Rename input_sections_ to input_shndxes_.
10654 * testsuite/many_sections_test.cc: Add template.
10655
e94cf127
CC
106562008-04-30 Cary Coutant <ccoutant@google.com>
10657
4418b2d5
CC
10658 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10659
e94cf127
CC
10660 * layout.cc (Layout::include_section): Refactored check for debug
10661 info section.
10662 (Layout::add_comdat): Add new parameters. Change type
10663 of signature parameter. Add object and shndx to signatures table.
10664 (Layout::find_kept_object): New function.
10665 * layout.h: Include <cstring>.
10666 (Layout::is_debug_info_section): New function.
10667 (Layout::add_comdat): Add new parameters.
10668 (Layout::find_kept_object): New function.
10669 (Layout::Kept_section): New struct.
10670 (Layout::Signatures): Change type of map range.
10671 * object.cc (Relobj::output_section_address): New function.
10672 (Sized_relobj::include_section_group): Add new parameters. Change
10673 calls to Layout::add_comdat. Change to build table of kept comdat
10674 groups and table mapping discarded sections to kept sections.
10675 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
10676 (Sized_relobj::do_layout): Change calls to include_section_group and
10677 include_linkonce_section.
10678 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
10679 value to zero when section is discarded.
10680 (Sized_relobj::map_to_kept_section): New function.
10681 * object.h (Relobj::output_section_address): New function.
10682 (Relobj::Comdat_group): New type.
10683 (Relobj::find_comdat_group): New function.
10684 (Relobj::Comdat_group_table): New type.
10685 (Relobj::Kept_comdat_section): New type.
10686 (Relobj::Kept_comdat_section_table): New type.
10687 (Relobj::add_comdat_group): New function.
10688 (Relobj::set_kept_comdat_section): New function.
10689 (Relobj::get_kept_comdat_section): New function.
10690 (Relobj::comdat_groups_): New field.
10691 (Relobj::kept_comdat_sections_): New field.
10692 (Symbol_value::input_value): Update comment.
10693 (Sized_relobj::map_to_kept_section) New function.
10694 (Sized_relobj::include_linkonce_section): Add new parameter.
10695 * target-reloc.h (Comdat_behavior): New type.
10696 (get_comdat_behavior): New function.
10697 (relocate_section): Add code to map a discarded section to the
10698 corresponding kept section when applying a relocation.
10699
e4e5049b
CS
107002008-04-30 Craig Silverstein <csilvers@google.com>
10701
10702 * dwarf_reader.cc (next_generation_count): New static var.
10703 (Addr2line_cache_entry): New struct.
10704 (addr2line_cache): New static var.
10705 (Dwarf_line_info::one_addr2line): Added caching.
10706 (Dwarf_line_info::clear_addr2line_cache): New function.
10707 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
10708 cache-size parameter.
10709 (Dwarf_line_info::one_addr2line_cache): New function.
10710 * symtab.cc (Symbol_table::detect_odr_violations): Pass
10711 new cache-size argument to one_addr2line(), and clear cache.
10712
d09e9154
CC
107132008-04-28 Cary Coutant <ccoutant@google.com>
10714
10715 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
10716 R_386_PC8 relocations.
10717
7ef73768
ILT
107182008-04-23 Ian Lance Taylor <iant@google.com>
10719
55438702
ILT
10720 * object.cc (Sized_relobj::include_section_group): Check for
10721 invalid section group.
10722
c165fb93
ILT
10723 * object.cc (make_elf_object): Correct test for 64-bit ELF file
10724 header size.
10725
7ef73768
ILT
10726 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
10727 than read for file header.
10728 * archive.cc (Archive::include_member): Likewise.
10729
6194aaab
L
107302008-04-23 Paolo Bonzini <bonzini@gnu.org>
10731
10732 * aclocal.m4: Regenerate.
10733 * configure: Regenerate.
10734
d491d34e
ILT
107352008-04-19 Ian Lance Taylor <iant@google.com>
10736
5ea2bac6
ILT
10737 * version.cc (version_string): Bump to 1.6.
10738
7bc3e21a
ILT
10739 * testsuite/Makefile.am (many_sections_r_test): New target.
10740 (many_sections_r_test_SOURCES): Remove.
10741 (many_sections_r_test_DEPENDENCIES): Remove.
10742 (many_sections_r_test_LDFLAGS): Remove.
10743 (many_sections_r_test_LDADD): Remove.
10744
7fcd3aa9
ILT
10745 * object.cc (Sized_relobj::do_add_symbols): Always pass
10746 local_symbol_count_ to add_from_relobj.
10747
4c94d6ae
ILT
10748 * testsuite/Makefile.am (many_sections_check.h): Only check one in
10749 every thousand variables.
10750 * testsuite/Makefile.in: Rebuild.
10751
d491d34e
ILT
10752 * object.cc (Xindex::initialize_symtab_xindex): New function.
10753 (Xindex::read_symtab_xindex): New function.
10754 (Xindex::sym_xindex_to_shndx): New function.
10755 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
10756 available.
10757 (Sized_relobj::do_initialize_xindex): New function.
10758 (Sized_relobj::do_read_symbols): Adjust section links.
10759 (Sized_relobj::symbol_section_and_value): Add is_ordinary
10760 parameter. Change all callers.
10761 (Sized_relobj::include_section_group): Adjust section links and
10762 symbol section indexes.
10763 (Sized_relobj::do_layout): Adjust section links.
10764 (Sized_relobj::do_count_local_symbols): Adjust section links and
10765 symbol section indexes.
10766 (Sized_relobj::do_finalize_local_symbols): Distinguish between
10767 ordinary and special symbols.
10768 (Sized_relobj::write_local_symbols): Add symtab_xindex and
10769 dynsym_xindex parameters. Change all callers. Adjust section
10770 links. Use SHN_XINDEX when needed.
10771 (Sized_relobj::get_symbol_location_info): Adjust section links.
10772 Don't get fooled by special symbols.
10773 * object.h (class Xindex): Define.
10774 (class Object): Add xindex_ parameter. Declare virtual functoin
10775 do_initialize_xindex.
10776 (Object::adjust_sym_shndx): New function.
10777 (Object::set_xindex): New protected function.
10778 (class Symbol_value): Add is_ordinary_shndx_ field.
10779 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
10780 (Symbol_value::value): Assert ordinary section.
10781 (Symbol_value::initialize_input_to_output_map): Likewise.
10782 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
10783 Change all callers.
10784 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
10785 all callers.
10786 (class Sized_relobj): Update declarations.
10787 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
10788 parameter. Change all callers.
10789 (Sized_relobj::adjust_shndx): New function.
10790 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
10791 field.
10792 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
10793 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
10794 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
10795 (Sized_dynobj::read_dynsym_section): Adjust section links.
10796 (Sized_dynobj::read_dynamic): Likewise.
10797 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
10798 section links.
10799 (Sized_dynobj::do_initialize_xindex): New function.
10800 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
10801 do_initialize_xindex.
10802 (Sized_dynobj::adjust_shndx): New function.
10803 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
10804 dynsym_xindex_ fields.
10805 (Layout::finalize): Add a call to set_section_indexes before
10806 creating the symtab sections.
10807 (Layout::set_section_indexes): Don't do anything if the section
10808 already has a section index.
10809 (Layout::create_symtab_sections): Add shnum parameter. Change
10810 caller. Create .symtab_shndx section if needed.
10811 (Layout::create_shdrs): Add shstrtab_section parameter. Change
10812 caller.
10813 (Layout::allocated_output_section_count): New function.
10814 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
10815 needed.
10816 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
10817 fields. Update declarations.
10818 (Layout::symtab_xindex): New function.
10819 (Layout::dynsym_xindex): New function.
10820 (class Write_symbols_task): Add layout_ field.
10821 (Write_symbols_task::Write_symbols_task): Add layout parameter.
10822 Change caller.
10823 * output.cc (Output_section_headers::Output_section_headers): Add
10824 shstrtab_section parameter. Change all callers.
10825 (Output_section_headers::do_sized_write): Store overflow values
10826 for section count and section string table section index in
10827 section header zero.
10828 (Output_file_header::do_sized_write): Check for overflow of
10829 section count and section string table section index.
10830 (Output_symtab_xindex::do_write): New function.
10831 (Output_symtab_xindex::endian_do_write): New function.
10832 * output.h (class Output_section_headers): Add shstrtab_section_.
10833 Update declarations.
10834 (class Output_symtab_xindex): Define.
10835 (Output_section::has_out_shndx): New function.
10836 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
10837 field.
10838 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
10839 Change all callers.
10840 (Sized_symbol::init): Likewise.
10841 (Symbol::output_section): Check for ordinary symbol.
10842 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
10843 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
10844 callers.
10845 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
10846 Change all callers. Simplify handling of symbols from sections
10847 not included in the link.
10848 (Symbol_table::add_from_dynobj): Handle ordinary symbol
10849 distinction.
10850 (Weak_alias_sorter::operator()): Assert that symbols are
10851 ordinary.
10852 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
10853 distinction.
10854 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
10855 parameters. Change all callers.
10856 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
10857 symbol distinction. Use SHN_XINDEX when needed.
10858 (Symbol_table::write_section_symbol): Add symtab_xindex
10859 parameter. Change all callers.
10860 (Symbol_table::sized_write_section_symbol): Likewise. Use
10861 SHN_XINDEX when needed.
10862 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
10863 declarations.
10864 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
10865 (Symbol::is_defined): Check is_ordinary.
10866 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
10867 (Symbol::is_absolute, Symbol::is_common): Likewise.
10868 (class Sized_symbol): Update declarations.
10869 (class Symbol_table): Update declarations.
10870 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
10871 parameters. Change all callers.
10872 (Sized_symbol::override): Likewise.
10873 (Symbol_table::override): Likewise.
10874 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
10875 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
10876 is_ordinary, and orig_st_shndx parameters. Change all callers.
10877 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
10878 to be in an ordinary section.
10879 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
10880 object and is_ordinary parameters. Change all callers.
10881 (Sized_dwarf_line_info::read_relocs): Add object parameter.
10882 Change all callers. Don't add undefined or non-ordinary symbols
10883 to reloc_map_.
10884 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
10885 Change all callers.
10886 * dwarf_reader.h (class Sized_dwarf_line_info): Update
10887 declarations.
10888 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
10889 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
10890 (Sized_relobj::relocate_sections): Likewise.
10891 * target-reloc.h (scan_relocs): Adjust section symbol index.
10892 (scan_relocatable_relocs): Likewise.
10893 * i386.cc (Scan::local): Check for ordinary symbols.
10894 * sparc.cc (Scan::local): Likewise.
10895 * x86_64.cc (Scan::local): Likewise.
10896 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
10897 to symbol_section_and_value.
10898 * testsuite/many_sections_test.cc: New file.
10899 * testsuite/Makefile.am (BUILT_SOURCES): Define.
10900 (check_PROGRAMS): Add many_sections_test.
10901 (many_sections_test_SOURCES): Define.
10902 (many_sections_test_DEPENDENCIES): Define.
10903 (many_sections_test_LDFLAGS): Define.
10904 (BUILT_SOURCES): Add many_sections_define.h.
10905 (many_sections_define.h): New target.
10906 (BUILT_SOURCES): Add many_sections_check.h.
10907 (many_sections_check.h): New target.
10908 (check_PROGRAMS): Add many_sections_r_test.
10909 (many_sections_r_test_SOURCES): Define.
10910 (many_sections_r_test_DEPENDENCIES): Define.
10911 (many_sections_r_test_LDFLAGS): Define.
10912 (many_sections_r_test_LDADD): Define.
10913 (many_sections_r_test.o): New target.
10914 * testsuite/Makefile.in: Rebuild.
10915
c5818ff1
CC
109162008-04-17 Cary Coutant <ccoutant@google.com>
10917
10918 * errors.cc (Errors::info): New function.
10919 (gold_info): New function.
10920 * errors.h (Errors::info): New function.
10921 * gold.h (gold_info): New function.
10922 * object.cc (Input_objects::add_object): Print trace output.
10923 * options.cc (options::parse_set): New function.
10924 (General_options::parse_wrap): Deleted.
10925 (General_options::General_options): Deleted initializer.
10926 * options.h (options::String_set): New typedef.
10927 (options::parse_set): New function.
10928 (DEFINE_set): New macro.
10929 (General_options::wrap): Changed to use DEFINE_set. Changed
10930 callers of any_wrap_symbols and is_wrap_symbol.
10931 (General_options::trace, General_options::trace_symbol):
10932 New options.
10933 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10934 (General_options::wrap_symbols_): Deleted.
10935 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10936
b5be4a7c
DM
109372008-04-17 David S. Miller <davem@davemloft.net>
10938
10939 * options.cc (General_options::parse_V): New function.
10940 * options.h: Add entries for -V and -Qy.
10941
155a0dd7
ILT
109422008-04-17 Ian Lance Taylor <iant@google.com>
10943
10944 * common.cc (Symbol_table::allocate_commons): Remove options
10945 parameter. Change caller.
10946 (Symbol_table::do_allocate_commons): Remove options parameter.
10947 Change caller. Just call do_allocate_commons_list twice.
10948 (Symbol_table::do_allocate_commons_list): New function, broken out
10949 of do_allocate_commons.
10950 * common.h (class Allocate_commons_task): Remove options_ field.
10951 Update constructor.
10952 * symtab.cc (Symbol_table::Symbol_table): Initialize
10953 tls_commons_.
10954 (Symbol_table::add_from_object): Put TLS common symbols on
10955 tls_commons_ list.
10956 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10957 which are IN_OUTPUT_DATA.
10958 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10959 allocate_commons and do_allocate_commons declarations. Declare
10960 do_allocate_commons_list.
10961 * gold.cc (queue_middle_tasks): Update creation of
10962 Allocate_commons_task to not pass options.
10963 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10964 (TLS_TEST_C_FLAGS): New variable.
10965 (tls_test_c_pic.o): New target.
10966 (tls_test_shared.so): Link in tls_test_c_pic.o.
10967 (tls_test_c_pic_ie.o): New target.
10968 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10969 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10970 (tls_test_c.o): New target.
10971 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10972 (tls_pic_test_LDADD): Likewise.
10973 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10974 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10975 (tls_test_c_gnu2.o): New target.
10976 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10977 tls_test_c_gnu2.o.
10978 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10979 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10980 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10981 * testsuite/tls_test.cc: Include "config.h".
10982 (t_last): Call t11_last.
10983 * testsuite/tls_test.h (t11, t11_last): Declare.
10984 * testsuite/tls_test_c.c: New file.
10985 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10986 * configure.ac: Check for OpenMP support.
10987 * configure, config.in, Makefile.in: Rebuild.
10988 * testsuite/Makefile.in: Rebuild.
10989
edfbb029
CC
109902008-04-16 Cary Coutant <ccoutant@google.com>
10991
10992 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10993 (Target_i386::tls_base_symbol_defined_): New field.
10994 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10995 (Target_i386::Scan::global): Likewise.
10996 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10997 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10998 (Target_x86_64::tls_base_symbol_defined_): New field.
10999 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11000 (Target_x86_64::Scan::global): Likewise.
11001
f3c69fca
CC
110022008-04-16 Cary Coutant <ccoutant@google.com>
11003
11004 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11005 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11006 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11007 building shared libraries.
11008 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11009 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11010 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11011 * testsuite/Makefile.in: Rebuild.
11012 * testsuite/weak_undef.h: New file.
11013 * testsuite/weak_undef_file1.cc: Add extra test cases.
11014 * testsuite/weak_undef_file2.cc: Likewise.
11015 * testsuite/weak_undef_test.cc: Likewise.
11016
7c414435
DM
110172008-04-16 David S. Miller <davem@davemloft.net>
11018
32b769e1
DM
11019 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11020 Add issued_non_pic_error_ field. Declare check_non_pic.
11021 (Target_sparc::Scan::check_non_pic): New function.
11022 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11023 (Target_sparc::Scan::global): Likewise.
11024
11936fb1
DM
11025 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11026 * configure: Rebuild.
11027
7c414435
DM
11028 * options.h (DEFINE_enable): New macro.
11029 (new_dtags): New enable option.
11030 (initfirst, interpose, loadfltr, nodefaultlib,
11031 nodelete, nodlopen, nodump): New -z options.
11032 * layout.cc (Layout:finish_dynamic_section): If new
11033 dtags enabled, emit DT_RUNPATH. Also, emit a
11034 DT_FLAGS_1 containing any specified -z flags.
11035
85c7bf8b
ILT
110362008-04-16 Ian Lance Taylor <iant@google.com>
11037
12c0daef
ILT
11038 * copy-relocs.cc: New file.
11039 * copy-relocs.h: New file.
11040 * reloc.cc: Remove Copy_relocs code.
11041 * reloc.h: Likewise.
11042 * reloc-types.h (struct Reloc_types) [both versions]: Add
11043 get_reloc_addend_noerror.
11044 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11045 variants of add_global which take an addend which must be zero.
11046 * i386.cc: Include "copy-relocs.h".
11047 (class Target_i386): Change type of copy_relocs_ to variable,
11048 update initializer.
11049 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11050 Change all callers.
11051 (Target_i386::do_finalize_sections): Change handling of
11052 copy_relocs_.
11053 * sparc.cc: Include "copy-relocs.h".
11054 (class Target_sparc): Change type of copy_relocs_ to variable,
11055 update initializer.
11056 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11057 Change all callers.
11058 (Target_sparc::do_finalize_sections): Change handling of
11059 copy_relocs_.
11060 * x86_64.cc: Include "copy-relocs.h".
11061 (class Target_x86_64): Change type of copy_relocs_ to variable,
11062 update initializer.
11063 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11064 class. Change all callers.
11065 (Target_x86_64::do_finalize_sections): Change handling of
11066 copy_relocs_.
11067 * Makefile.am (CCFILES): Add copy-relocs.cc.
11068 (HFILES): Add copy-relocs.h.
11069
4f4995b6
ILT
11070 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11071
85c7bf8b
ILT
11072 * testsuite/script_test_4.sh: Permit leading zeroes.
11073
4f2a9edd
ILT
110742008-04-15 Ian Lance Taylor <iant@google.com>
11075
e6188289
ILT
11076 * script-sections.cc (Script_sections::create_segments): Use
11077 header_size_adjustment even when there is enough room for the
11078 headers.
11079 * testsuite/script_test_4.sh: New file.
11080 * testsuite/script_test_4.t: New file.
11081 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11082 (check_DATA): Add script_test_4.stdout.
11083 (MOSTLYCLEANFILES): Likewise.
11084 (script_test_4): New target.
11085 (script_test_4.stdout): New target.
11086 * testsuite/Makefile.in: Rebuild.
11087
4f2a9edd
ILT
11088 * sparc.cc: Add definitions for Output_data_plt_sparc class
11089 constants.
11090
f5314dd5
DM
110912008-04-14 David S. Miller <davem@davemloft.net>
11092
11093 * sparc.cc: New file.
11094 * Makefile.am (TARGETSOURCES): Add sparc.cc
11095 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11096 * configure.tgt: Document targ_extra_size and
11097 targ_extra_big_endian. Add entries for sparc-* and
11098 sparc64-*.
11099 * configure.ac: Handle targ_extra_size and
11100 targ_extra_big_endian.
11101 * Makefile.in: Rebuild.
11102 * configure: Likewise.
11103 * po/POTFILES.in: Likewise.
11104 * po/gold.pot: Likewise.
11105
154e0e9a
ILT
111062008-04-14 Ian Lance Taylor <iant@google.com>
11107
11108 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11109 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11110 in the name/type/flags to section mapping. Don't call
11111 allocate_output_section.
11112 (Layout::choose_output_section): Change parameter from adjust_name
11113 to is_input_section. Don't permit input sections after sections
11114 are attached to segments. Don't call allocate_output_section.
11115 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11116 not write_enable_output_section.
11117 (Layout::make_output_section): Don't push to
11118 unattached_section_list_ nor call attach_to_segment. Call
11119 attach_section_to_segment if sections are attached.
11120 (Layout::attach_sections_to_segments): New function.
11121 (Layout::attach_section_to_segment): New function.
11122 (Layout::attach_allocated_section_to_segment): Rename from
11123 attach_to_segment. Remove flags parameter.
11124 (Layout::allocate_output_section): Remove function.
11125 (Layout::write_enable_output_section): Remove function.
11126 * layout.h (class Layout): Update for above changes. Add new
11127 field sections_are_attached_.
11128 * output.h (Output_section::update_flags_for_input_section): New
11129 function.
11130 * output.cc (Output_section::add_input_section): Call
11131 update_flags_for_input_section.
11132 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11133
009a67a2
CC
111342008-04-11 Cary Coutant <ccoutant@google.com>
11135
11136 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11137 thought unnecessary.
11138 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11139
759b1a24
ILT
111402008-04-11 Ian Lance Taylor <iant@google.com>
11141
11142 * output.h (class Output_section_data): Remove inline definition
11143 of set_addralign.
11144 * output.cc (Output_section_data::set_addralign): New function.
11145
c2b45e22
CC
111462008-04-11 Cary Coutant <ccoutant@google.com>
11147
11148 Add support for TLS descriptors for i386 and x86_64.
11149 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11150 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11151 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11152 GOT_TYPE_TLS_DESC.
11153 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11154 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11155 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11156 relocations.
11157 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11158 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11159 Fix problem with initial-exec relocations.
11160 (Target_i386::Relocate::relocate_tls): Likewise.
11161 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11162 relaxation.
11163 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11164 support for section-plus-offset dynamic table entries.
11165 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11166 (Output_data_dynamic::Dynamic_entry): Add support for
11167 section-plus-offset dynamic table entries.
11168 (Output_data_dynamic::Classification): Likewise.
11169 (Output_data_dynamic::classification_): Renamed offset_.
11170 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11171 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11172 (Target_x86_64::make_plt_section): New function.
11173 (Target_x86_64::reserve_tlsdesc_entries): New function.
11174 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11175 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11176 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11177 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11178 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11179 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11180 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11181 add extra PLT entry for TLS descriptors.
11182 (Output_data_plt_x86_64::got_): New field.
11183 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11184 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11185 fields.
11186 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11187 descriptors.
11188 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11189 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11190 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11191 R_386_TLS_DESC_CALL relocations.
11192 (Target_x86_64::Scan::global): Likewise.
11193 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11194 for TLS descriptors.
11195 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11196 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11197 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11198 GD-to-IE relaxation.
11199 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11200 and TLS_DESCRIPTORS.
11201 * Makefile.in: Rebuild.
11202 * configure: Rebuild.
11203 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11204 (tls_test_shared2.so): New target.
11205 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11206 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11207 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11208 (tls_shared_gd_to_ie_test_LDADD): New variable.
11209 (tls_shared_gnu2_gd_to_ie_test): New target.
11210 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11211 New targets.
11212 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11213 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11214 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11215 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11216 (tls_shared_gnu2_test): New target.
11217 (tls_test_gnu2_shared.so): New target.
11218 (tls_shared_gnu2_test_SOURCES): New variable.
11219 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11220 (tls_shared_gnu2_test_LDFLAGS): New variable.
11221 (tls_shared_gnu2_test_LDADD): New variable.
11222 * testsuite/Makefile.in: Rebuild.
11223 * testsuite/Makefile.
11224
83bfb6b7
ILT
112252008-04-11 Ian Lance Taylor <iant@google.com>
11226
11227 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11228 justsyms.t.
11229 * testsuite/Makefile.in: Rebuild.
11230
11231 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11232 long.
11233 * testsuite/script_test_2.cc (main): Adjust test.
11234
706e1f5e
ILT
112352008-04-11 David S. Miller <davem@davemloft.net>
11236 Ian Lance Taylor <iant@google.com>
11237
11238 * options.h (General_options): Add entries for '-Y' and
11239 '-relax'.
11240 * options.cc (General_options:finalize): If -Y was used, add those
11241 entries to the library path instead of the default "/lib" and
11242 "/usr/lib".
11243
7c98e6bb
DM
112442008-04-11 David S. Miller <davem@davemloft.net>
11245
11246 * testsuite/justsyms.t: Start at 0x100.
11247 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
11248 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
11249 long.
11250 * testsuite/script_test_2.cc: Adjust string and section length
11251 checks.
7c98e6bb 11252
99a37bfd
ILT
112532008-04-09 Ian Lance Taylor <iant@google.com>
11254
2cefc357
ILT
11255 PR gold/5996
11256 * script-sections.cc (Sections_element::allocate_to_segment): Add
11257 orphan parameter.
11258 (Output_section_definition::allocate_to_segment): Likewise.
11259 (Orphan_output_section::allocate_to_segment): Likewise.
11260 (Script_sections::attach_sections_using_phdrs_clause): Don't
11261 propagate non-PT_LOAD segments to orphan sections.
11262 * testsuite/Makefile.am (script_test_3.stdout): Generate using
11263 readelf rather than objdump.
11264 * testsuite/script_test_3.sh: Adjust accordingly. Test that
11265 .interp section and PT_INTERP segment are the same size.
11266 * testsuite/Makefile.in: Rebuild.
11267
99a37bfd
ILT
11268 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
11269 aliases for symbols defined in the same object.
11270 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
11271 (weak_alias_test_SOURCES): New variable.
11272 (weak_alias_test_DEPENDENCIES): New variable.
11273 (weak_alias_test_LDFLAGS): New variable.
11274 (weak_alias_test_LDADD): New variable.
11275 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
11276 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
11277 (weak_alias_test_3.o): New target.
11278 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
11279 * testsuite/weak_alias_test_main.cc: New file.
11280 * testsuite/weak_alias_test_1.cc: New file.
11281 * testsuite/weak_alias_test_2.cc: New file.
11282 * testsuite/weak_alias_test_3.cc: New file.
11283
780e49c5
ILT
112842008-04-08 Ian Lance Taylor <iant@google.com>
11285
cdb0b8f5
ILT
11286 * options.h (class General_options): Add --noinhibit-exec option.
11287 * main.cc (main): Check --noinhibit-exec.
11288
0864d551
ILT
11289 * options.h (class General_options): Define --wrap as a special
11290 option. Add wrap_symbols_ field.
11291 (General_options::any_wrap_symbols): New function.
11292 (General_options::is_wrap_symbol): New function.
11293 * options.cc (General_options::parse_wrap): New function.
11294 (General_options::General_options): Initialize wrap_symbols_.
11295 * symtab.cc (Symbol_table::wrap_symbol): New function.
11296 (Symbol_table::add_from_object): Handle --wrap.
11297 * symtab.h (class Symbol_table): Declare wrap_symbol.
11298 * target.h (Target::wrap_char): New function.
11299 (Target::Target_info): Add wrap_char field.
11300 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
11301 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11302 * testsuite/testfile.cc (Target_test::test_target_info):
11303 Likewise.
11304
789aa6de
ILT
11305 * errors.cc (Errors::undefined_symbol): Mention symbol version if
11306 there is one.
11307
2c38906f
ILT
11308 * layout.h (class Layout): Add added_eh_frame_data_ field.
11309 * layout.cc (Layout::Layout): Initialize new field.
11310 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
11311 output section until we find a section we merged successfully.
11312 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
11313 that the size be non-zero.
11314
780e49c5
ILT
11315 * merge.cc (Object_merge_map::get_output_offset): Remove inline
11316 qualifier.
11317
7fcd0256
ILT
113182008-04-08 Craig Silverstein <csilvers@google.com>
11319
11320 * configure.ac: Export new conditional variable HAVE_ZLIB.
11321 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
11322 on HAVE_ZLIB.
11323 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
11324 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11325
6835af53
ILT
113262008-04-07 Ian Lance Taylor <iant@google.com>
11327
e24f324c
ILT
11328 * version.cc (version_string): Set to "1.5".
11329
a036edd8
ILT
11330 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
11331 Add issued_non_pic_error_ field. Declare check_non_pic.
11332 (Target_x86_64::Scan::check_non_pic): New function.
11333 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
11334 (Target_x86_64::Scan::global): Likewise.
11335
624f8810
ILT
11336 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
11337 addend parameter. Change caller. Handle merge sections.
11338 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
11339 Address to Addend. Don't add in the result of
11340 local_section_offset, pass down the addend and use the returned
11341 value.
11342 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
11343 Update declarations of local_section_offset and symbol_value.
11344 * testsuite/two_file_test_1.cc (t18): New function.
11345 * testsuite/two_file_test_2.cc (f18): New function.
11346 * testsuite/two_file_test_main.cc (main): Call t18.
11347 * testsuite/two_file_test.h (t18, f18): Declare.
11348
6835af53
ILT
11349 * configure.ac: Don't test for objdump, c++filt, or readelf.
11350 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
11351 conditionals.
11352 (TEST_READELF): New variable.
11353 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
11354 (check_PROGRAMS): Add two_file_strip_test.
11355 (two_file_strip_test): New target.
11356 (check_PROGRAMS): Add two_file_same_shared_strip_test.
11357 (two_file_same_shared_strip_test_SOURCES): New variable.
11358 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
11359 (two_file_same_shared_strip_test_LDFLAGS): New variable.
11360 (two_file_same_shared_strip_test_LDADD): New variable.
11361 (two_file_shared_strip.so): New target.
11362 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
11363 (ver_test_5.syms, ver_test_7.syms): Likewise.
11364 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
11365 (strip_test_3.stdout): Use TEST_OBJDUMP.
11366 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11367
86925eef
CC
113682008-04-04 Cary Coutant <ccoutant@google.com>
11369
11370 * symtab.h (Symbol::is_weak_undefined): New function.
11371 (Symbol::is_strong_undefined): New function.
11372 (Symbol::is_absolute): New function.
11373 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
11374 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
11375 absolute symbols.
11376 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
11377 (weak_undef_test): New target.
11378 * testsuite/Makefile.in: Rebuild.
11379 * testsuite/weak_undef_file1.cc: New file.
11380 * testsuite/weak_undef_file2.cc: New file.
11381 * testsuite/weak_undef_test.cc: New file.
11382
126f3ece
ILT
113832008-04-03 Craig Silverstein <csilvers@google.com>
11384
11385 * compressed_output.h (class Output_compressed_section): Use
11386 unsigned buffer.
11387 * compressed_output.cc (zlib_compress): Use unsigned buffers,
11388 add zlib header.
11389 (zlib_compressed_suffix): Removed.
11390 (Output_compressed_section::set_final_data_size): Use unsigned
11391 buffers.
11392 * testsuite/Makefile.am (flagstest_compress_debug_sections):
11393 Fix linker invocation.
11394 (flagstest_o_specialfile_and_compress_debug_sections):
11395 Likewise.
11396 * testsuite/Makefile.in: Regenerated.
11397
deae2a14
DM
113982008-04-02 David S. Miller <davem@davemloft.net>
11399
11400 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11401 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11402
70752818
ILT
114032008-04-02 Craig Silverstein <csilvers@google.com>
11404
11405 * TODO: New file.
11406
39d0cb0e
ILT
114072008-04-02 Ian Lance Taylor <iant@google.com>
11408
11409 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11410 parameters. Update for new key type to views_. Change all
11411 callers.
11412 (File_read::read): Adjust for byteshift in returned view.
11413 (File_read::add_view): New function, broken out of
11414 find_and_make_view.
11415 (File_read::make_view): New function, broken out of
11416 find_and_make_view.
11417 (File_read::find_or_make_view): Add offset and aligned
11418 parameters. Rewrite accordingly. Change all callers.
11419 (File_read::get_view): Add offset and aligned parameters. Adjust
11420 for byteshift in return value.
11421 (File_read::get_lasting_view): Likewise.
11422 * fileread.h (class File_read): Update declarations.
11423 (class File_read::View): Add byteshift_ field. Add byteshift to
11424 constructor. Add byteshift method.
11425 * archive.h (Archive::clear_uncached_views): New function.
11426 (Archive::get_view): Add aligned parameter. Change all callers.
11427 * object.h (Object::get_view): Add aligned parameter. Change all
11428 callers.
11429 (Object::get_lasting_view): Likewise.
11430
11431 * fileread.cc (File_read::release): Don't call clear_views if
11432 there are multiple objects.
11433 * fileread.h (File_read::clear_uncached_views): New function.
11434 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11435 on the archive.
11436
a1207466
CC
114372008-03-31 Cary Coutant <ccoutant@google.com>
11438
11439 Add thin archive support.
11440 * archive.cc (Archive::armagt): New const.
11441 (Archive::setup): Remove task parameter and calls to unlock.
11442 (Archive::unlock_nested_archives): New function.
11443 (Archive::read_header): Add nested_off parameter. Change
11444 all callers.
11445 (Archive::interpret_header): Likewise.
11446 (Archive::include_all_members): Change to handle thin
11447 archives.
11448 (Archive::include_member): Likewise.
11449 * archive.h (Archive::Archive): Add new parameters and
11450 initializers.
11451 (Archive::armagt): New const.
11452 (Archive::setup): Remove task parameter.
11453 (Archive::unlock_nested_archives): New function.
11454 (Archive::read_header): Add nested_off parameter.
11455 (Archive::interpret_header): Likewise.
11456 (Archive::Nested_archive_table): New typedef.
11457 (Archive::is_thin_archive_): New field.
11458 (Archive::nested_archives_): New field.
11459 (Archive::options_): New field.
11460 (Archive::dirpath_): New field.
11461 (Archive::task_): New field.
11462 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11463 for thin archives. Pass additional parameters to
11464 Archive::Archive. Unlock the archive file after calling
11465 Archive::setup.
cd536b21 11466
479f6503
ILT
114672008-03-29 Ian Lance Taylor <iant@google.com>
11468
686c8caf
ILT
11469 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11470 version symbol to be local.
11471 * testsuite/ver_test_4.sh: New file.
11472 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11473 (check_DATA): Add ver_test_4.syms.
11474 (ver_test_4.syms): New target.
11475 * testsuite/Makefile.in: Rebuild.
11476
ab794b6b
ILT
11477 * output.cc
11478 (Output_section::Input_section_sort_entry::has_priority): New
11479 function.
11480 (Output_section::Input_section_sort_entry::match_file_name): New
11481 function.
11482 (Output_section::Input_section_sort_entry::match_section_name):
11483 Remove.
11484 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11485 Remove.
11486 (Output_section::Input_section_sort_entry::match_section_file):
11487 Remove.
11488 (Output_section::Input_section_sort_compare::operator()): Rewrite
11489 using new Input_section_sort_entry functions. Sort crtbegin and
11490 crtend first. Sort sections with no priority before sections with
11491 a priority.
11492 * testsuite/initpri1.c (d3): Check j != 4.
11493 (cd5): New constructor/destructor function.
11494 (main): Check j != 2.
11495
479f6503
ILT
11496 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11497 new symbol when resolving, don't call set_is_default.
11498 * testsuite/ver_test_7.cc: New file.
11499 * testsuite/ver_test_7.sh: New file.
11500 * testsuite/Makefile.am (ver_test_7.so): New target.
11501 (ver_test_7.o): New target.
11502 (check_SCRIPTS): Add ver_test_7.sh.
11503 (check_DATA): Add ver_test_7.syms.
11504 (ver_test_7.syms): New target.
11505
2fd32231
ILT
115062008-03-28 Ian Lance Taylor <iant@google.com>
11507
11508 * layout.cc (Layout::layout): If we see an input section with a
11509 name that needs sorting, set the must_sort flag for the output
11510 section.
11511 (Layout::make_output_section): If the name of the output section
11512 indicates that it might require sorting, set the may_sort flag.
11513 * output.h (Output_section::may_sort_attached_input_sections): New
11514 function.
11515 (Output_section::set_may_sort_attached_input_sections): New
11516 function.
11517 (Output_section::must_sort_attached_input_sections): New
11518 function.
11519 (Output_section::set_must_sort_attached_input_sections): New
11520 function.
11521 (class Output_section): Declare Input_section_sort_entry. Define
11522 Input_section_sort_compare. Declare
11523 sort_attached_input_sections. Add new fields:
11524 may_sort_attached_input_sections_,
11525 must_sort_attached_input_sections_,
11526 attached_input_sections_are_sorted_.
11527 * output.cc (Output_section::Output_section): Initialize new
11528 fields.
11529 (Output_section::add_input_section): Add an entry to
11530 input_sections_ if may_sort or must_sort are true.
11531 (Output_section::set_final_data_size): Call
11532 sort_attached_input_sections if necessary.
11533 (Output_section::Input_section_sort_entry): Define new class.
11534 (Output_section::Input_section_sort_compare::operator()): New
11535 function.
11536 (Output_section::sort_attached_input_sections): New function.
11537 * configure.ac: Check whether the compiler supports constructor
11538 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11539 * testsuite/initpri1.c: New file.
11540 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11541 CONSTRUCTOR_PRIORITY.
11542 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11543 (initpri1_LDFLAGS): New variable.
11544 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11545
18e6b24e
ILT
115462008-03-27 Ian Lance Taylor <iant@google.com>
11547
49bdd526
ILT
11548 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11549 * testsuite/common_test_1.c: New file.
11550 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11551 (common_test_1_SOURCES): New variable.
11552 (common_test_1_DEPENDENCIES): New variable.
11553 (common_test_1_LDFLAGS): New variable.
11554
18e6b24e
ILT
11555 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11556 and commons_ correctly when NAME/VERSION does not override
11557 NAME/NULL.
11558 * testsuite/ver_test_6.c: New file.
11559 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11560 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11561 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11562
04bf7072
ILT
115632008-03-26 Ian Lance Taylor <iant@google.com>
11564
5871526f
ILT
11565 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11566 of an undefined symbol from a version script.
11567 * testsuite/Makefile.am (ver_test_5.so): New target.
11568 (ver_test_5.o): New target.
11569 (check_SCRIPTS): Add ver_test_5.sh.
11570 (check_DATA): Add ver_test_5.syms.
11571 (ver_test_5.syms): New target.
11572 * testsuite/ver_test_5.cc: New file.
11573 * testsuite/ver_test_5.script: New file.
11574 * testsuite/ver_test_5.sh: New file.
11575 * Makefile.in, testsuite/Makefile.in: Rebuild.
11576
04bf7072
ILT
11577 PR gold/5986
11578 Fix problems building gold with gcc 4.3.0.
11579 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11580 (gold_error_at_location, gold_warning_at_location): Use it.
11581 * configure.ac: Check whether we can compile and use a template
11582 function with a printf attribute.
11583 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11584 when jumping over bytes.
11585 * object.cc: Instantiate Object::read_section_data.
11586 * debug.h: Include <cstring>
11587 * dwarf_reader.cc: Include <algorithm>
11588 * main.cc: Include <cstring>.
11589 * options.cc: Include <cstring>.
11590 * output.cc: Include <cstring>.
11591 * script.cc: Include <cstring>.
11592 * script.h: Include <string>.
11593 * symtab.cc: Include <cstring> and <algorithm>.
11594 * target-select.cc: Include <cstring>.
11595 * version.cc: Include <string>.
11596 * testsuite/testmain.cc: Include <cstdlib>.
11597 * configure, config.in: Rebuild.
11598
874c5b28
ILT
115992008-03-25 Ian Lance Taylor <iant@google.com>
11600
819d6c3a
ILT
11601 * options.cc: Include "../bfd/bfdver.h".
11602 (options::help): Print bug reporting address.
11603
f4b2c6f5
ILT
11604 * version.cc (print_version): Adjust output for current value of
11605 BFD_VERSION_STRING.
11606
11607 * NEWS: New file.
11608
e96caa79
ILT
11609 * options.cc (options::help): Print list of supported targets.
11610 * target-select.h: Include <vector>.
11611 (class Target_selector): Make machine_, size_, and is_big_endian_
11612 fields const. Add bfd_name_ and instantiated_target_ fields.
11613 (Target_selector::Target_selector): Add bfd_name parameter.
11614 (Target_selector::recognize): Make non-virtual, call
11615 do_recognize.
11616 (Target_selector::recognize_by_name): Make non-virtual, call
11617 do_recognize_by_name.
11618 (Target_selector::supported_names): New function.
11619 (Target_selector::bfd_name): New function.
11620 (Target_selector::do_instantiate_target): New pure virtual
11621 function.
11622 (Target_selector::do_recognize): New virtual function.
11623 (Target_selector::do_recognize_by_name): New virtual function.
11624 (Target_selector::instantiate_target): New private function.
11625 (supported_target_names): Declare.
11626 * target-select.cc (Target_selector::Target_selector): Update for
11627 new parameter and fields.
11628 (select_target_by_name): Check that the name matches before
11629 calling recognize_by_name.
11630 (supported_target_names): New function.
11631 * i386.cc (class Target_selector_i386): Update Target_selector
11632 constructor call. Remove recognize and recognize_by_name. Add
11633 do_instantiate_target.
11634 * x86_64.cc (class Target_selector_x86_64): Likewise.
11635 * testsuite/testfile.cc (class Target_selector_test): Update for
11636 changes to Target_selector.
11637
874c5b28
ILT
11638 * README: Rewrite, with some notes on unsupported features.
11639
0a65a3a7
CC
116402008-03-24 Cary Coutant <ccoutant@google.com>
11641
11642 * i386.cc (Target_i386::Got_type): New enum declaration.
11643 (Target_i386::Scan::local): Updated callers of Output_data_got
11644 member functions.
11645 (Target_i386::Scan::global): Likewise.
11646 (Target_i386::Relocate::relocate): Likewise.
11647 (Target_i386::Relocate::relocate_tls): Likewise.
11648 * object.h (Got_offset_list): New class.
11649 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11650 (Sized_relobj::local_got_offset): Likewise.
11651 (Sized_relobj::set_local_got_offset): Likewise.
11652 (Sized_relobj::local_has_tls_got_offset): Removed.
11653 (Sized_relobj::local_tls_got_offset): Removed.
11654 (Sized_relobj::set_local_tls_got_offset): Removed.
11655 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11656 * output.cc (Output_data_got::add_global): Added got_type parameter.
11657 (Output_data_got::add_global_with_rel): Likewise.
11658 (Output_data_got::add_global_with_rela): Likewise.
11659 (Output_data_got::add_global_pair_with_rel): New function.
11660 (Output_data_got::add_global_pair_with_rela): New function.
11661 (Output_data_got::add_local): Added got_type parameter.
11662 (Output_data_got::add_local_with_rel): Likewise.
11663 (Output_data_got::add_local_with_rela): Likewise.
11664 (Output_data_got::add_local_pair_with_rel): New function.
11665 (Output_data_got::add_local_pair_with_rela): New function.
11666 (Output_data_got::add_global_tls): Removed.
11667 (Output_data_got::add_global_tls_with_rel): Removed.
11668 (Output_data_got::add_global_tls_with_rela): Removed.
11669 (Output_data_got::add_local_tls): Removed.
11670 (Output_data_got::add_local_tls_with_rel): Removed.
11671 (Output_data_got::add_local_tls_with_rela): Removed.
11672 * output.h (Output_data_got::add_global): Added got_type parameter.
11673 (Output_data_got::add_global_with_rel): Likewise.
11674 (Output_data_got::add_global_with_rela): Likewise.
11675 (Output_data_got::add_global_pair_with_rel): New function.
11676 (Output_data_got::add_global_pair_with_rela): New function.
11677 (Output_data_got::add_local): Added got_type parameter.
11678 (Output_data_got::add_local_with_rel): Likewise.
11679 (Output_data_got::add_local_with_rela): Likewise.
11680 (Output_data_got::add_local_pair_with_rel): New function.
11681 (Output_data_got::add_local_pair_with_rela): New function.
11682 (Output_data_got::add_global_tls): Removed.
11683 (Output_data_got::add_global_tls_with_rel): Removed.
11684 (Output_data_got::add_global_tls_with_rela): Removed.
11685 (Output_data_got::add_local_tls): Removed.
11686 (Output_data_got::add_local_tls_with_rel): Removed.
11687 (Output_data_got::add_local_tls_with_rela): Removed.
11688 * resolve.cc (Symbol::override_base_with_special): Removed
11689 reference to has_got_offset_ field.
11690 * symtab.cc (Symbol::init_fields): Replaced initialization
11691 of got_offset_ with got_offsets_. Removed initialization
11692 of has_got_offset_
53fcba31 11693 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
11694 (Symbol::got_offset): Likewise.
11695 (Symbol::set_got_offset): Likewise.
11696 (Symbol::has_tls_got_offset): Removed.
11697 (Symbol::tls_got_offset): Removed.
11698 (Symbol::set_tls_got_offset): Removed.
11699 (Symbol::got_offset_): Removed.
11700 (Symbol::tls_mod_got_offset_): Removed.
11701 (Symbol::tls_pair_got_offset_): Removed.
11702 (Symbol::got_offsets_): New field.
11703 (Symbol::has_got_offset): Removed.
11704 (Symbol::has_tls_mod_got_offset): Removed.
11705 (Symbol::has_tls_pair_got_offset): Removed.
11706 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
11707 (Target_x86_64::Scan::local): Updated callers of Output_data_got
11708 member functions.
11709 (Target_x86_64::Scan::global): Likewise.
11710 (Target_x86_64::Relocate::relocate): Likewise.
11711 (Target_x86_64::Relocate::relocate_tls): Likewise.
11712
bd52eafb
BE
117132008-03-25 Ben Elliston <bje@au.ibm.com>
11714
11715 * yyscript.y: Fix spelling error in comment.
11716
8b105e34
ILT
117172008-03-24 Ian Lance Taylor <iant@google.com>
11718
8ed814a9
ILT
11719 * options.h (class General_options): Define build_id option.
11720 * layout.h (class Layout): Declare write_build_id, create_note,
11721 create_build_id. Add build_id_note_ member.
11722 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
11723 "libiberty.h", "md5.h", "sha1.h".
11724 (Layout::Layout): Initialize eh_frame_data_,
11725 eh_frame_hdr_section_, and build_id_note_.
11726 (Layout::finalize): Call create_build_id.
11727 (Layout::create_note): New function, broken out of
11728 Layout::create_gold_note.
11729 (Layout::create_gold_note): Call create_note.
11730 (Layout::create_build_id): New function.
11731 (Layout::write_build_id): New function.
11732 (Close_task_runner::run): Call write_build_id.
11733
8b105e34
ILT
11734 * x86_64.cc: Correct license to GPLv3.
11735
086a1841
ILT
117362008-03-23 Ian Lance Taylor <iant@google.com>
11737
11738 * options.cc: Include "demangle.h".
11739 (parse_optional_string): New function.
11740 (parse_long_option): Handle takes_optional_argument.
11741 (parse_short_option): Update dash_z initializer. Handle
11742 takes_optional_argument.
11743 (General_options::General_options): Initialize do_demangle_.
11744 (General_options::finalize): Set do_demangle_. Handle demangling
11745 style.
11746 * options.h (parse_optional_string): Declare.
11747 (struct One_option): Add optional_arg field. Update constructor.
11748 Update call constructor calls. Add takes_optional_argument
11749 function.
11750 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
11751 (DEFINE_optional_string): Define.
11752 (General_options::demangle): Change from DEFINE_bool to
11753 DEFINE_optional_string.
11754 (General_options::no_demangle): New function.
11755 (General_options::do_demangle): New function.
11756 (General_options::set_do_demangle): New function.
11757 (General_options::execstack_status_): Move definition to end of
11758 class definition.
11759 (General_options::static_): Likewise.
11760 (General_options::do_demangle_): New field.
11761 * object.cc (big_endian>::get_symbol_location_info): Call
11762 Options::do_demangle, not Options::demangle.
11763 * symtab.cc (demangle): Likewise.
11764
cbb93e63
ILT
117652008-03-22 Ian Lance Taylor <iant@google.com>
11766
11767 * gold.h: Include <cstddef> and <sys/types.h>
11768 * options.h: Include <cstring>.
11769
ec531623
ILT
117702008-03-21 Ian Lance Taylor <iant@google.com>
11771
11772 * Added source code to GNU binutils.
This page took 0.707958 seconds and 4 git commands to generate.