Fix a race condition when setting default target for ARM targets.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
48c73428
CC
12015-03-04 Cary Coutant <ccoutant@google.com>
2
3 * parameters.cc (Parameters::set_target_once): Call
4 Target::select_as_default_target just once from here...
5 (set_parameters_target): ...instead of from here.
6
72015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
8
9 * ehframe.cc (Cie::set_output_offset): Pass in and use a
10 Output_section_data instead of a Merge_map.
11 (Eh_frame::Eh_frame): Don't initialize merge_map_.
12 (Eh_frame::read_cie): Use add_merge_mapping instead of
13 Merge_map::add_mapping.
14 (Eh_frame::read_fde): Ditto.
15 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
16 (Eh_frame::do_output_offset): Use merge_output_offset istead of
17 merge_map_->get_output_offset.
18 (Eh_frame::do_is_merge_section_for): Delete.
19 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
20 instead of a Merge_map.
21 (Cie::set_output_offset): Pass in a Output_section_data instead of a
22 Merge_map.
23 (Eh_frame::do_is_merge_section_for): Delete.
24 (Eh_frame::merge_map_): Delete.
25 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
26 and use a Output_section_data instead of a Merge_map.
27 (Object_merge_map::add_mapping): Ditto.
28 (Object_merge_map::get_output_offset): Remove the merge_map argument.
29 (Object_merge_map::is_merge_section_for): Pass in and use a
30 Output_section_data instead of a Merge_map.
31 (Merge_map): Delete.
32 (Output_merge_base::do_output_offset): Use merge_output_offset instead
33 of merge_map_.get_output_offset.
34 (Output_merge_base::do_is_merge_section_for): Delete.
35 (Output_merge_data::do_add_input_section): Use
36 object->add_merge_mapping instead of add_mapping.
37 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
38 * merge.h (Merge_map): Delete forward declaration.
39 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
40 instead of a Merge_map.
41 (Object_merge_map::get_output_offset): Remove the merge_map argument.
42 (Object_merge_map::is_merge_section_for): Pass in and use a
43 Output_section_data instead of a Merge_map.
44 (Input_merge_map::Object_merge_map::merge_map): Replace with
45 output_data.
46 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
47 Output_section_data instead of a Merge_map.
48 (Merge_map): Delete.
49 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
50 (Output_merge_base::do_is_merge_section_for): Delete.
51 (Output_merge_base::add_mapping): Delete.
52 (Output_merge_base::merge_map_): Delete.
53 * object.cc (Relobj::initialize_input_to_output_map): New.
54 (Relobj::initialize_input_to_output_map): New.
55 (Relobj::merge_output_offset): New.
56 (Relobj::is_merge_section_for): New.
57 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
58 bits.
59 * object.h (Relobj::merge_map): Delete.
60 (initialize_input_to_output_map): New.
61 (set_merge_map): Delete.
62 (add_merge_mapping): New.
63 (merge_output_offset): New.
64 (is_merge_section_for): New.
65 * output.cc (Output_section::Input_section::is_merge_section_for):
66 Use object->is_merge_section_for.
67 * output.h (Output_section_data::is_merge_section_for): Delete.
68 (Output_section_data::do_is_merge_section_for): Delete.
69 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
70 Use object->initialize_input_to_output_map.
71 (Merged_symbol_value<size>::value_from_output_section): Use
72 object->merge_output_offset.
73
48c73428 742015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
75 Cary Coutant <ccoutant@google.com>
76
77 * output.cc (Output_section::add_merge_input_section): Do not
78 attempt to merge sections with an entsize of 0.
79
48c73428 802015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
81
82 * attributes.h (class Output_attributes_section_data ): Add
83 do_print_to_mapfile function.
84
ec86f434
AM
852015-02-24 Alan Modra <amodra@gmail.com>
86
87 PR 18010
88 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
89 complain if value is not a multiple of four.
90 (Target_powerpc::Relocate::relocate): Correct handling of
91 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
92
be66981e
L
932015-02-21 H.J. Lu <hongjiu.lu@intel.com>
94
95 * configure.ac (default_size): Set to 32 for x32.
96 * configure: Regenerated.
97
e3ee8ed4
AM
982015-02-18 Alan Modra <amodra@gmail.com>
99
100 PR 17954
101 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
102 visibility.
103
3a935c6c
RÁE
1042015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
105
106 * gc.h (Garbage_collection::add_reference): Don't use find.
107
e0a1e121
RÁE
1082015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
109
110 * object.cc (write_local_symbols): avoid std::vector copy.
111
45a4fb1a
RÁE
1122015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
113
114 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
115
2d9afefe
MW
1162015-02-09 Mark Wielaard <mjw@redhat.com>
117
118 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
119 DW_LANG_Fortran03 and DW_LANG_Fortran08.
120
e9c1bdad
CC
1212015-02-16 Cary Coutant <ccoutant@google.com>
122
123 PR gold/13577
124 PR gold/16992
125 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
126 DF_SYMBOLIC if --dynamic-list option is used.
127 * options.cc (General_options::finalize): --dynamic-list is not
128 mutually exclusive with -Bsymbolic.
129 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
130 listed in --dynamic-list.
131 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
132 -Bsymbolic-functions.
133 * testsuite/Makefile.in: Regenerate.
134
0ed4b0bf
CC
1352015-02-16 Cary Coutant <ccoutant@google.com>
136
137 PR gold/17971
138 * incremental.cc: Remove redundant include of "output.h".
139
1a920511
JY
1402015-02-12 Jing Yu <jingyu@google.com>
141
142 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
143 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
144 New relocation.
145 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
146 TLSLE_MOVW_* relocations.
147 (Target_aarch64::Scan::global): Likewise.
148 (Target_aarch64::Relocate::relocate): Likewise.
149 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
150 for new TLSLE_MOVW_* relocations.
151
07f107f3
WN
1522015-02-11 Will Newton <will.newton@linaro.org>
153
154 PR gold/13321
155 * arm.cc (Target_arm::make_plt_section): Create an ARM
156 state mapping symbol at the start of the PLT.
157
e051a5b5
L
1582015-02-09 H.J. Lu <hongjiu.lu@intel.com>
159
160 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
161 Replace two_file_shared_2.so with two_file_shared_1.so.
162 * testsuite/Makefile.in: Regenerated.
163
dddcc5b9
AM
1642015-02-09 Alan Modra <amodra@gmail.com>
165
166 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
167 plugin_test_thin.a and defsym_test.
168 * testsuite/Makefile.in: Regenerate.
169
b39b8b9d
RÁE
1702015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
171
172 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
173 body.
174
b66d1c52
CC
1752015-02-04 Peter Collingbourne <pcc@google.com>
176
177 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
178 forwarding symbols when computing symbol resolution info for plugins.
179 * plugin.h (Plugin_manager::symtab): New method.
180 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
181
23081de0
CC
1822015-02-03 Cary Coutant <ccoutant@google.com>
183 Peter Collingbourne <pcc@google.com>
184
185 PR gold/15660
186 * archive.cc (Thin_archive_object_unlocker): New class.
187 (Archive::include_member): Unlock external members of thin archives.
188 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
189 (plugin_test_2): Likewise.
190 (plugin_test_3): Likewise.
191 (plugin_test_4): Likewise.
192 (plugin_test_5): Likewise.
193 (plugin_test_6): Likewise.
194 (plugin_test_7): Likewise.
195 (plugin_test_8): Likewise.
196 (plugin_test_9): Likewise.
197 (plugin_test_10): Likewise.
198 (plugin_test_11): New test case.
199 * testsuite/Makefile.in: Regenerate.
200 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
201 file to decide whether to claim file.
202 (all_symbols_read_hook): Likewise.
203 * testsuite/plugin_test_1.sh: Adjust expected output.
204 * testsuite/plugin_test_2.sh: Likewise.
205 * testsuite/plugin_test_3.sh: Likewise.
206 * testsuite/plugin_test_6.sh: Likewise.
207 * testsuite/plugin_test_tls.sh: Likewise.
208 * testsuite/plugin_test_11.sh: New testcase.
209
2102015-02-03 Cary Coutant <ccoutant@google.com>
211
212 * descriptors.cc (Descriptors::open): Set artificially-low limit for
213 file descriptors when debugging enabled. Add debug output.
214 (Descriptors::release): Add debug output.
215 (Descriptors::close_some_descriptor): Likewise.
216 (Descriptors::close_all): Likewise.
217 * fileread.cc (File_read::lock): Likewise.
218 (File_read::unlock): Likewise.
219
24dd5808
CC
2202015-02-02 Cary Coutant <ccoutant@google.com>
221
222 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
223 executable output file.
224
fa89cc82
HS
2252015-01-22 Han Shen <shenhan@google.com>
226
227 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
228 (Target_arm::do_plt_address_for_global): New method.
229 (Target_arm::do_plt_address_for_local): New method.
230 (Target_arm::rel_irelative_section): New method.
231 (Target_arm::make_data_plt): Add more parameters for plt ctor.
232 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
233 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
234 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
235 (Target_arm::Scan::check_non_pic): Add ifunc support.
236 (Target_arm::Scan::local): Add ifunc support.
237 (Target_arm::Scan::global): Add ifunc support.
238 (Target_arm::make_plt_section): New method.
239 (Target_arm::make_plt_entry): Change to call to make_plt_section.
240 (Target_arm::make_local_ifunc_plt_entry): New method.
241 (Target_arm::got_irelative_): New member.
242 (Target_arm::rel_irelative_): New member.
243 (Target_arm::got_section): Add creation for got_irelative_.
244 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
245 (Target_arm::Relocate::relocate): Properly set local ifunc address.
246 (Target_arm::do_dynsym_value): Properly set global ifunc address.
247 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
248 (Output_data_plt_arm::IRelative_data): New type.
249 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
250 (Output_data_plt_arm::add_entry): Add more parameters.
251 (Output_data_plt_arm::add_relocation): New method.
252 (Output_data_plt_arm::add_local_ifunc_entry): New method.
253 (Output_data_plt_arm::rel_irelative): New method.
254 (Output_data_plt_arm::entry_count): Modified.
255 (Output_data_plt_arm::address_for_global): New method.
256 (Output_data_plt_arm::address_for_local): New method.
23081de0 257gold/
fa89cc82
HS
258 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
259 (Output_data_plt_arm::insert_irelative_data): New method.
260 (Output_data_plt_arm::irelative_rel_): New member.
261 (Output_data_plt_arm::got_): New member.
262 (Output_data_plt_arm::got_irelative_): New member.
263 (Output_data_plt_arm::irelative_count_): New member.
264 (Output_data_plt_arm::IRelative_data_vec): New typedef.
265 (Output_data_plt_arm::irelative_data_vec_): New member.
266 (Output_data_plt_arm::do_write): Write out irelative entries.
267 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
268 more parameters to ctor.
269 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
270 more parameters to ctor.
271 * output.h (Output_data_reloc::add_local_relative): New method.
272 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
273
0f81d3f0
AM
2742015-01-29 Alan Modra <amodra@gmail.com>
275
276 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
277 and GOT_TLSGD to LE optimization.
278
65d92137
CC
2792015-01-28 Cary Coutant <ccoutant@google.com>
280
281 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
282 for undef TLS symbols.
283 (Target_x86_64::Relocate::relocate_tls): Likewise.
284 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
285
5485698a
CC
2862015-01-25 Cary Coutant <ccoutant@google.com>
287
288 * output.cc (Output_segment::set_section_addresses): Fix calculation
289 of size of relro segment.
290
b01a4b04
AM
2912015-01-22 Alan Modra <amodra@gmail.com>
292
293 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
294 condition for need of ifunc plt entry.
295 (Target_powerpc::Scan::global <got relocs>): Likewise.
296
3d0064a9
CC
2972015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
298
299 * mips.cc (reloc_high): Add r_sym.
300 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
301 reloc_high constructor.
302 (Mips_relocate_functions::relgot16_local): Likewise.
303 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
304 r_type to decide whether LO16 matches HI16.
305 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
306 rello16 and relgot16_local.
307
a5cd8f05
CC
3082015-01-09 Cary Coutant <ccoutant@google.com>
309
310 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
311 unless alignment is larger than page size.
312
4fc1b9d4
L
3132015-01-06 H.J. Lu <hongjiu.lu@intel.com>
314 Cary Coutant <ccoutant@google.com>
315
316 PR gold/17729
317 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
318 (DEFAULT_TARGET_X32): Set for x32.
319 * x86_64.cc (cmp_insn_32): New.
320 (lea_r10_insn_32): Likewise.
321 (lea_r11_insn_32): Likewise.
322 (cmp_insn_64): Likewise.
323 (lea_r10_insn_64): Likewise.
324 (lea_r11_insn_64): Likewise.
325 (Target_x86_64<size>::do_calls_non_split): Handle x32.
326 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
327 (check_DATA): Add split_x32 files.
328 (split_x32_[1234n].o): New targets.
329 (split_x32_[124]): New targets.
330 (split_x32_[1234r].stdout): New targets.
331 * testsuite/split_x32.sh: New file.
332 * testsuite/split_x32_1.s: Likewise.
333 * testsuite/split_x32_2.s: Likewise.
334 * testsuite/split_x32_3.s: Likewise.
335 * testsuite/split_x32_4.s: Likewise.
336 * testsuite/split_x32_n.s: Likewise.
337 * configure: Regenerated.
338 * testsuite/Makefile.in: Likewise.
339
e749cab8
L
3402015-01-06 H.J. Lu <hongjiu.lu@intel.com>
341
342 PR gold/17809
343 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
344 x32.
345
af759df0
AM
3462015-01-02 Alan Modra <amodra@gmail.com>
347
348 * version.cc (print_version): Just print current year.
349 * dwp.cc (print_version): Likewise.
350
b90efa5b
AM
3512015-01-01 Alan Modra <amodra@gmail.com>
352
353 Update year range in copyright notice of all files.
354
f12d1e8a
AM
3552014-12-25 Alan Modra <amodra@gmail.com>
356
357 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
358 new enums.
359 (Target_arm::merge_object_attributes, ): Likewise.
360
5c294fee
TG
3612014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
362
363 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
364 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
365 AEABI_VFP_args_vfp to check that.
366 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
367 value and replace hardcoded values by enum values.
368
e30880c2
CC
3692014-12-22 Cary Coutant <ccoutant@google.com>
370
371 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
372
bd040da1
L
3732014-12-20 H.J. Lu <hongjiu.lu@intel.com>
374
375 PR gold/14608
376 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
377 to "return i * i * 3;".
378
e02a4046
CC
3792014-12-16 Cary Coutant <ccoutant@google.com>
380
381 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
382 (Mapfile::print_output_data): Use current_data_size() to avoid
383 assert for sections requiring postprocessing; if address is not valid,
384 print 0.
385 (Mapfile::print_output_section): Use current_data_size(); print note
386 that addresses and sizes are before compression.
387
add6016b
L
3882014-12-14 H.J. Lu <hongjiu.lu@intel.com>
389
390 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
391 Cast current_group_size to unsigned long when reporting error.
392
0bf32ea9
JY
3932014-12-10 Jing Yu <jingyu@google.com>
394
395 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
396 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
397 Update error message.
398 (Target_aarch64::do_relax): Use absolute value of option
399 stub_group_size. Replace local variable with class member
400 stub_group_size_.
401
cbcb23fa
AM
4022014-12-04 Alan Modra <amodra@gmail.com>
403
404 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
405 addend of PLTREL24 reloc when not generating a plt stub. Make
406 max_branch_offset an "Address".
fbad6518 407 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
408 (Target_powerpc::Relocate::relocate): Likewise.
409
1611bc4a
AM
4102014-12-04 Alan Modra <amodra@gmail.com>
411
412 PR 17670
413 * symtab.cc (Symbol::set_undefined): Remove assertion.
414 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
415 on symbols defined in discarded sections, instead return false.
416 Rearrange params, update all callers.
417 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
418 branches to syms in discarded sections.
419 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
420 undefined and flag as discarded.
421 (Target_powerpc::Relocate::relocate): Localize variable.
422
4759c34e
L
4232014-12-03 H.J. Lu <hongjiu.lu@intel.com>
424
425 PR gold/17675
426 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
427 * testsuite/Makefile.in: Regenerated.
428
1f98a074
AM
4292014-12-03 Alan Modra <amodra@gmail.com>
430
431 PR 17566
432 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
433 when adding dynamic relocations against section symbols.
434
fb257835
DI
4352014-12-01 Dimitry Ivanov <dimitry@google.com>
436
437 * layout.cc (Layout::finish_dynamic_section): When '-z global'
438 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
439 * options.h (General_options): New -z option (global).
440
d8e60314
CC
4412014-12-01 Cary Coutant <ccoutant@google.com>
442
443 PR gold/17578
444 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
445 is given.
446 (Layout::create_executable_stack_info): Warn when -z noexecstack is
447 given but some inputs require executable stack.
448
982bbd97
CC
4492014-11-26 Cary Coutant <ccoutant@google.com>
450
451 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
452 .debug_str_offsets; strip .debug_gnu_pubnames and
453 .debug_gnu_pubtypes.
454 (lines_only_debug_sections): Strip all four new sections.
455
bb779192
HS
4562014-11-26 Jing Yu <jingyu@google.com>
457
458 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
459 register to be x0 when to relax TLSDESC_LD64_LO12.
460
a3e60ddb
AM
4612014-11-26 Alan Modra <amodra@gmail.com>
462
463 * powerpc.cc (struct Stub_table_owner): New.
464 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
465 unsigned int vector. Update all references.
466 (powerpc_relobj::set_stub_table): Take an unsigned int param
467 rather than a Stub_table. Update callers.
468 (Powerpc_relobj::clear_stub_table): New function.
469 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
470 stub_group_size_ vars.
471 (Target_powerpc::new_stub_table): Delete.
472 (max_branch_delta): New function, extracted from..
473 (Target_powerpc::Relocate::relocate): ..here..
474 (Target_powerpc::Branch_info::make_stub): ..and here. Return
475 status on whether stub created successfully.
476 (Stub_control::Stub_control): Add "no_size_errors" param. Move
477 default sizing to..
478 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
479 reduce on relax failure.
480 (Target_powerpc::group_sections): Add "no_size_errors" param.
481 Use stub_group_size_. Set up group info in a temp vector,
482 before building Stub_table vector. Account for input sections
483 possibly already converted to relaxed sections.
484 (Stub_table::init): Delete. Merge into..
485 (Stub_table::Stub_table): ..here.
486 (Stub_table::can_reach_stub): New function.
487 (Stub_table::add_plt_call_entry): Add "from" parameter and
488 return true iff stub could be reached.
489 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
490 param too.
491 (Stub_table::clear_stubs): Add "all" param.
492
a20605cf
AM
4932014-11-26 Alan Modra <amodra@gmail.com>
494
495 * powerpc.cc (Stub_control::set_output_and_owner): New function.
496 (Target_powerpc::group_sections): Use it.
497
43b64deb
CC
4982014-11-25 Cary Coutant <ccoutant@google.com>
499
500 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
501 (Binary_to_elf::write_symbol): Add st_size parameter.
502 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
503
c924eb67
CC
5042014-11-25 Cary Coutant <ccoutant@google.com>
505
506 PR gold/17639
507 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
508 (Sized_relobj_file::do_layout): Handle deferred sections properly
509 during GC pass 1. Don't add reloc sections to deferred list twice.
510 * object.h (Sized_relobj_file::is_deferred_layout): New function.
511 (Sized_relobj_file::is_deferred_layout_): New data member.
512
9d585188
L
5132014-11-21 H.J. Lu <hongjiu.lu@intel.com>
514
515 PR gold/17619
516 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
517 Check PC-relative offset overflow in PLT entry.
518
3ffaac20
AM
5192014-11-21 Alan Modra <amodra@gmail.com>
520
521 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
522 for undefined weaks.
523
0cfb0717
AM
5242014-11-20 Alan Modra <amodra@gmail.com>
525
526 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
527 from --stub-group-size parameter divided by 1024.
528 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
529 template parameter. Update all uses.
530 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
531 has_stub_value. Set for long branches. Don't report overflow for
532 branch to undefined weak symbols. Print info message on
533 overflowing branch to stub.
534
f9dffbf0
AM
5352014-11-20 Alan Modra <amodra@gmail.com>
536
537 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
538
e88ba8d5
L
5392014-11-13 H.J. Lu <hongjiu.lu@intel.com>
540
541 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
542 entry for R_X86_64_GOTPLT64.
543 (Target_x86_64<size>::Relocate::relocate): Update comments for
544 R_X86_64_GOTPLT64.
545
d37ffe25
ED
5462014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
547
548 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
549 * plugin.h: add lock definition
550
9726c3c1
HS
5512014-10-29 Han Shen <shenhan@google.com>
552 Jing Yu <jingyu@google.com>
553
554 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
555 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
556 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
557 Symbol::TLS_REF.
558 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
559 method.
560 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
561 (Target_aarch64::tls_ld_to_le): New method.
562 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
563 for 64bit targets.
564 (Output_data_plt_aarch64::irelative_rel_): New data member.
565 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
566 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
567 (Output_data_plt_aarch64::add_relocation): New method.
568 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
569 offset. Add got_irelative size to got size.
570 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
571 type string with the new typename.
572 (AArch64_relocate_functions::update_adr): Replace parameter x with
573 immed.
574 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
575 (AArch64_relocate_functions::reloc_common): New method.
576 (AArch64_relocate_funcsions::rela_general): Extract common part out
577 into reloc_common method.
578 (AArch64_relocate_functions::rela_general): Likewise.
579 (AArch64_relocate_functions::pcrela_general): Likewise.
580 (AArch64_relocate_functions::adr): New method.
581 (AArch64_relocate_functions::adrp): Calculate immed before calling
582 update_adr.
583 (AArch64_relocate_functions::adrp): Likewise.
584 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
585 comparing x to 0. Calculate immed from ~x when x < 0.
586 (Target_aarch64::optimize_tls_reloc): Add new cases for
587 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
588 TLSLD_MOVW_DTPREL_G0_NC.
589 (Target_aarch64::possible_function_pointer_reloc): Implement this
590 method.
591 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
592 comment.
593 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
594 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
595 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
596 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
597 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
598 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
599 (Target_aarch64::make_plt_entry): Call add_entry with two more
600 parameters.
601 (Target_aarch64::make_local_ifunc_plt_entry): New method.
602 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
603 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
604 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
605 (Target_aarch64::Relocate::relocate_tls): Add cases for
606 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
607 TLSLD_MOVW_DTPREL_G0_NC.
608 * testsuite/icf_safe_so_test.cc: Correct test comment.
609 * testsuite/icf_safe_test.sh: Add AArch64 arch.
610
80272b8c
AM
6112014-10-22 Alan Modra <amodra@gmail.com>
612
613 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
614 thread_starter.
615
998a69f4
AS
6162014-10-18 Andreas Schwab <schwab@linux-m68k.org>
617
618 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
619
aed56ec5
CC
6202014-10-17 Cary Coutant <ccoutant@google.com>
621
622 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
623 Add "typename" keyword.
624
bb779192 6252014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
626 Jing Yu <jingyu@google.com>
627
628 Patch for gold aarch64 backend to support relaxation.
629 * aarch64-reloc.def: Change format.
630 * aarch64.cc (class Reloc_stub): New class.
631 (class Stub_table): New class.
632 (class AArch64_relobj): New class.
633 (class AArch64_input_section): New class.
634 (class AArch64_output_section): New class.
635 (Target_aarch64::new_stub_table): New method.
636 (Target_aarch64::new_aarch64_input_section): New method.
637 (Target_aarch64::find_aarch64_input_section): New method.
638 (Target_aarch64::scan_section_for_stubs): New method.
639 (Target_aarch64::scan_reloc_section_for_stubs): New method.
640 (Target_aarch64::relocate_stub): New method.
641 (Target_aarch64::current_target): New method.
642 (Target_aarch64::do_make_elf_object): New method.
643 (Target_aarch64::do_may_relax): New method.
644 (Target_aarch64::do_relax): New method.
645 (Target_aarch64::group_sections): New method.
646 (Target_aarch64::scan_reloc_for_stub): New method.
647 (Target_aarch64::do_make_output_section): New method.
648 (Target_aarch64::stub_tables_): New data member.
649 (Target_aarch64::aarch64_input_section_map_): New data member.
650 (AArch64_relocate_functions::maybe_apply_stub): New method.
651
db4c9594
CC
6522014-09-30 Cary Coutant <ccoutant@google.com>
653
654 PR gold/17432
655 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
656
cd6da036
KC
6572014-09-30 Kito Cheng <kito@0xlab.org>
658
659 PR gold/13597
660 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
661 hash table before sysv-style hash table.
662
5f772412
ST
6632014-09-29 Sriraman Tallam <tmsriram@google.com>
664
665 * options.h (--pic-executable): Add negative to alias to -no-pie.
666
5efeedf6
CC
6672014-09-26 Cary Coutant <ccoutant@google.com>
668
669 PR gold/16773
670 * object.cc (Sized_relobj_file): Compute value of section symbols
671 for TLS sections the same as TLS symbols.
672
1707f183
CC
6732014-09-25 Cary Coutant <ccoutant@google.com>
674
675 PR gold/17432
676 * resolve.cc (Symbol_table::resolve): Override common placeholder
677 symbols, but adjust sizes.
678 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
679 symbols to common lists.
680
00cac886
AM
6812014-09-24 Alan Modra <amodra@gmail.com>
682
683 * po/POTFILES.in: Regenerate.
684
635aa30e
CC
6852014-09-23 Taiju Tsuiki <tzik@google.com>
686 Cary Coutant <ccoutant@google.com>
687
71b9b91b 688 PR gold/14860
635aa30e
CC
689 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
690 on input_sections_blocker.
691 * layout.cc (Write_sections_task::locks): Unblock
692 input_sections_blocker_.
693 * layout.h (Write_sections_task::Write_sections_task): Add
694 input_sections_blocker.
695 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
696 to DEPENDENCIES.
697 * testsuite/Makefile.in: Regenerate.
698
c0c71592
RÁE
6992014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
700
701 * testsuite/Makefile.am (plugin_test_10): New test.
702 * testsuite/Makefile.in: Regenerate
703 * testsuite/plugin_common_test_2.c (c1): Align to 8.
704 * testsuite/plugin_test_10.sh: New file.
705
6168c2a1
RÁE
7062014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
707
708 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
709 * resolve.cc (Symbol_table::resolve): Don't override common symbols
710 during the replacement phase.
711
3a531937
JY
7122014-09-17 Han Shen <shenhan@google.com>
713 Jing Yu <jingyu@google.com>
714
715 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
716 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
717 * aarch64.cc (Target_aarch64): Add data members
718 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
719 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
720 constructor.
721 (Target_aarch64::do_reloc_symbol_index): New method.
722 (Target_aarch64::do_reloc_addend): New method.
723 (Target_aarch64::add_tlsdesc_info): New method.
724 (Target_aarch64::do_dynsym_value): New method.
725 (Target_aarch64::do_make_data_plt): Add new parameters: got,
726 got_irelative. Pass them to Output_data_plt_aarch64_standard.
727 (Target_aarch64::make_data_plt): Add new parameters: got,
728 got_irelative. Pass them to do_make_data_plt.
729 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
730 (Target_aarch64::Relocate:tls_gd_to_le): New method.
731 (Target_aarch64::Relocate:tls_ie_to_le): New method.
732 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
733 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
734 (Target_aarch64::got_tlsdesc_section): New method.
735 (Target_aarch64::make_local_ifunc_plt_entry): New method.
736 (Target_aarch64::define_tls_base_symbol): New method.
737 (Target_aarch64::reserve_tlsdesc_entries): New method.
738 (Target_aarch64::got_mod_index_entry): New method.
739 (Target_aarch64::rela_tlsdesc_section): New method.
740 (Target_aarch64::rela_irelative_section): New method.
741 (Target_aarch64::Tlsdesc_info): New struct.
742 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
743 relocations and tlsdesc relocations.
744 (Target_aarch64::optimize_tls_reloc): Implement method.
745 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
746 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
747 in constructor.
748 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
749 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
750 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
751 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
752 (Output_data_plt_aarch64::rela_tlsdesc): New method.
753 (Output_data_plt_aarch64::rela_irelative): New method.
754 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
755 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
756 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
757 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
758 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
759 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
760 (Output_data_plt_aarch64_standard): New member variables:
761 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
762 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
763 New parameter: got, got_irelative.
764 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
765 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
766 (Output_data_plt_aarch64::do_write): Replace got_address with
767 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
768 (AArch64_relocate_functions::update_movnz): New method.
769 (AArch64_relocate_functions): Correct format.
770 (AArch64_relocate_functions::movnz): New method.
771 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
772 before the switch. Add new cases to switch.
00cac886 773 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
774 tlsgd tlsdesc cases.
775 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
776 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
777 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
778 Call reloc_name_in_error_message to print unsupported reloc.
779 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
780 make_data_plt.
781 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
782 relocs. Fill in some more dynamic tags.
783 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
784 Skip call tls_get_addr when tlsgd is relaxed.
785 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
786 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
787 tlsdesc->ie relaxation.
788
62661c93
SS
7892014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
790
791 * mips.cc (Target_mips_nacl): New class.
792 (Target_selector_mips_nacl): New class.
793 (target_selector_mips32): Rename from target_selector_mips32be and use
794 Target_selector_mips_nacl instead of Target_selector_mips.
795 (target_selector_mips32el): Rename from target_selector_mips32 and use
796 Target_selector_mips_nacl instead of Target_selector_mips.
797 (target_selector_mips64): Rename from target_selector_mips64be and use
798 Target_selector_mips_nacl instead of Target_selector_mips.
799 (target_selector_mips64el): Rename from target_selector_mips64 and use
800 Target_selector_mips_nacl instead of Target_selector_mips.
801 (Target_mips::mips_info): Add const attribute.
802
54674d38
CC
8032014-09-02 Cary Coutant <ccoutant@google.com>
804
805 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
806 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
807 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
808 (Sized_incr_dynobj::do_section_name): Likewise.
809 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
810 (Sized_incr_dynobj::do_section_name): Likewise.
811 * object.h (Object::section_name): Likewise.
812 (Object::do_section_name): Likewise.
813 (Sized_relobj_file::do_section_name): Likewise.
814 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
815 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
816
9860cbcf
CC
8172014-09-02 Cary Coutant <ccoutant@google.com>
818
819 PR gold/17005
820 * ehframe.cc (Fde::write): Add output_offset parameter.
821 (Cie::write): Likewise.
822 (Eh_frame::set_final_data_size): Account for offset within output
823 section.
824 (Eh_frame::do_sized_write): Likewise.
825 * ehframe.h (Fde::write): Add output_offset parameter.
826 (Cie::write): Likewise.
827 * output.cc (Output_section::Input_section_sort_entry): Remove
828 section_has_name_; add output_section_name parameter. Use
829 output section name for non-input sections.
830 (Output_section::Input_section_sort_entry::section_has_name): Remove.
831 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
832 (Output_section::Input_section_sort_compare): Remove logic for
833 sections without names.
834 (Output_section::Input_section_sort_init_fini_compare): Likewise.
835 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
836 Likewise.
837 (Output_section::Input_section_sort_section_name_compare): Likewise.
838
8e33481e
HS
8392014-08-29 Han Shen <shenhan@google.com>
840 Jing Yu <jingyu@google.com>
841
842 * aarch64-reloc-property.cc
843 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
844 reference reloc property in the table.
845 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
846 3 other entries.
847 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
848 2 new overloaded methods.
849 (Output_data_got_aarch64::do_write): Add code to write out
850 static relocs.
851 (class Output_data_got_aarch64::Static_reloc): New class to wrap
852 static relocs.
853 (Output_data_got_aarch64::static_relocs): New vector to
854 hold static relocs.
855 (Target_aarch64::TCB_SIZE): New const static memeber.
856 (Target_aarch64::tcb_size): New method.
857 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
858 (Target_aarch64::Relocate::relocate_tls): New method.
859 (Target_aarch64::Scan::local): Add code handling new reloc types.
860 (Target_aarch64::Scan::global): Add code handling new reloc types.
861
81233653
ST
8622014-08-13 Sriraman Tallam <tmsriram@google.com>
863
864 * options.h (-no-pie): Add option.
865
9363c7c3
JY
8662014-08-08 Jing Yu <jingyu@google.com>
867 Han Shen <shenhan@google.com>
868
869 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
870 (DEFFILES): add aarch64-reloc.def.
871 (TARGETSOURCES): Add aarch64-reloc-property.cc.
872 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
873 * Makefile.in: Regenerate.
874 * aarch64-reloc-property.cc: New file.
875 * aarch64-reloc-property.h: New file.
876 * aarch64-reloc.def: New file.
877 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
878 with tab to make the format consistent.
879 (Output_data_got_aarch64::symbol_table_): New method.
880 (Target_aarch64::do_plt_address_for_global): New method.
881 (Target_aarch64::do_plt_address_for_local): New method.
882 (Target_aarch64::do_select_as_default_target): New method.
883 (Target_aarch64::do_make_data_plt): New method.
884 (Target_aarch64::make_data_plt): New method.
885 (Output_data_plt_aarch64::has_irelative_section): New method.
886 (Output_data_plt_aarch64::address_for_global): New method.
887 (Output_data_plt_aarch64::address_for_local): New method.
888 (Output_data_plt_aarch64::irelative_rel_): New parameter.
889 (Output_data_plt_aarch64::add_entry): Implement contents.
890 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
891 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
892 the got_pov entry to plt0.
893 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
894 Implement contents.
895 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
896 (AArch64_howto): New struct.
897 (aarch64_howto[]): New static const array.
898 (AArch64_relocate_functions): New class.
899 (Target_aarch64::Scan::get_reference_flags): Remove method.
900 (Target_aarch64::Scan::local): Implement to support a few relocations.
901 (Target_aarch64::Scan::global): Implement to support a few relocations.
902 (Target_aarch64::make_plt_section): Implement contents.
903 (Target_aarch64::make_plt_entry): Implement contents.
904 (Target_aarch64::do_finalize_sections): Implement contents.
905 (Target_aarch64::Relocate::relocate): Implement a few relocations.
906 (Target_aarch64::relocate_section): Implement contents.
907
ad9fe6c1
AM
9082014-08-06 Alan Modra <amodra@gmail.com>
909
910 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
911
7cd4e5b7
AM
9122014-08-06 Alan Modra <amodra@gmail.com>
913
914 PR 13227
915 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
916
5ad9b0a7
ST
9172014-07-21 Sriraman Tallam <tmsriram@google.com>
918
919 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 920 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 921
e051745c
CC
9222014-07-08 Cary Coutant <ccoutant@google.com>
923
924 * expression.cc (struct Expression::Expression_eval_info): Add
925 new fields type_pointer, vis_pointer, and nonvis_pointer.
926 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
927 nonvis_pointer parameters. Adjust all calls.
928 (Symbol_expression::value): Update type, visibility, and nonvis bits
929 in caller.
930 * script.cc (Symbol_assignment::sized_finalize): Update type,
931 visibility, and remaining st_other bits for new symbol.
932 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
933 vis_pointer, and nonvis_pointer parameters.
934 * symtab.h (Symbol::set_type): New method.
935
936 * testsuite/Makefile.am (defsym_test): New test.
937 * testsuite/Makefile.in: Regenerate.
938 * testsuite/defsym_test.c: New file.
939 * testsuite/defsym_test.sh: New file.
940
f35c4853
CC
9412014-07-08 Cary Coutant <ccoutant@google.com>
942
943 PR gold/15639
944 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
945 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
946 (Sized_dynobj::base_read_symbols): ...new method.
947 * object.h (Sized_relobj_file::base_read_symbols): New method.
948 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
949 (Sized_relobj_file::base_read_symbols): ...new method.
950 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
951 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
952 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
953
2900af2d
AM
9542014-07-04 Alan Modra <amodra@gmail.com>
955
956 * po/POTFILES.in: Regenerate.
957
053a4d68
JY
9582014-07-02 Jing Yu <jingyu@google.com>
959
960 * aarch64.cc: New file
961 * Makefile.am (TARGETSOURCES): Add aarch64.cc
962 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
963 * Makefile.in: Regenerate.
964 * configure.tgt: Add entries for aarch64*.
965 * configure.ac: Likewise.
966 * configure: Likewise.
967
7b549045
AM
9682014-06-27 Alan Modra <amodra@gmail.com>
969
970 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
971
cb818dbf
CC
9722014-06-24 Cary Coutant <ccoutant@google.com>
973
974 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
975 sections.
976 (Dwo_file::sized_read_unit_index): Likewise.
977
9810d34d
SS
9782014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
979
980 * mips.cc: New file.
981 * Makefile.am (TARGETSOURCES): Add mips.cc
982 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
983 * configure.tgt: Add entries for mips*.
984 * configure.ac: Likewise.
985 * Makefile.in: Regenerate.
986 * configure: Likewise.
987
9baa787b
CC
9882014-06-09 Cary Coutant <ccoutant@google.com>
989
990 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
991 unit_length is within section bounds.
992
8f89af0a
CC
9932014-06-09 Cary Coutant <ccoutant@google.com>
994
995 PR gold/16980
996 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
997 map.
998
a47622ac
AM
9992014-06-07 Alan Modra <amodra@gmail.com>
1000
1001 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1002
4320c691
CC
10032014-06-06 Cary Coutant <ccoutant@google.com>
1004
1005 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1006 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1007 (Dwarf_pubnames_table::read_header): Likewise.
1008 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1009 .debug_gnu_pubtypes.
1010
270c9937
JB
10112014-06-05 Joel Brobecker <brobecker@adacore.com>
1012
1013 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1014 * Makefile.in, configure: Regenerate.
1015
397998fc
AM
10162014-06-03 Alan Modra <amodra@gmail.com>
1017
1018 * powerpc.cc (addis_12_2): Define.
1019 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1020
61f5c66f
AM
10212014-06-03 Alan Modra <amodra@gmail.com>
1022
1023 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1024 st_other output.
1025
f6971787
AM
10262014-06-02 Alan Modra <amodra@gmail.com>
1027
1028 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1029 Only ignore relocs on ELFv1.
1030 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1031
f6fb8322
CC
10322014-05-30 Cary Coutant <ccoutant@google.com>
1033
1034 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1035 * testsuite/Makefile.in: Regenerate.
1036 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1037
c23dd342
L
10382014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1039
1040 PR gold/16945
1041 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1042 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1043
5fe7ffdc
AM
10442014-05-15 Alan Modra <amodra@gmail.com>
1045
1046 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1047 Compare FDE contents with DW_CFA_nop rather than 0.
1048
a82bef93
ST
10492014-05-13 Sriraman Tallam <tmsriram@google.com>
1050
1051 * symtab.h (may_need_copy_reloc): Remove check for position independent
1052 code.
1053 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1054 position independence before pc absolute may_need_copy_reloc call.
1055 Add check for executable output befor pc relative may_need_copy_reloc
1056 call.
1057 * i386.cc: Ditto.
1058 * arm.cc: Ditto.
1059 * sparc.cc: Ditto.
1060 * tilegx.cc: Ditto.
1061 * powerpc.cc: Add check for no position independence before
1062 may_need_copy_reloc calls.
1063 * testsuite/pie_copyrelocs_test.cc: New file.
1064 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1065 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1066 * Makefile.in: Regenerate.
a82bef93 1067
53c66605
ML
10682014-05-08 Martin Liška <mliska@suse.cz>
1069
1070 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1071
57b2284c
CC
10722014-05-06 Cary Coutant <ccoutant@google.com>
1073
1074 PR gold/16900
1075 * i386.cc (Output_data_got_plt_i386): New class.
1076 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1077 parameter. Change all callers.
1078 (Output_data_plt_i386::layout_): Remove.
1079 (Output_data_plt_i386::got_plt_): Change type.
1080 (Target_i386::got_plt_): Change type. Change all references.
1081 (Target_i386::got_section): Create instance of new class.
1082 (Output_data_got_plt_i386::do_write): New function.
1083 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1084 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1085 parameter. Change all callers.
1086 (Output_data_plt_x86_64::layout_): Remove.
1087 (Output_data_plt_x86_64::got_plt_): Change type.
1088 (Target_x86_64::got_plt_): Change type. Change all references.
1089 (Target_x86_64::got_section): Create instance of new class.
1090 (Output_data_got_plt_x86_64::do_write): New function.
1091 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1092 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1093 class.
1094
6b97515d 10952014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1096
6b97515d
CC
1097 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1098 if we have pubnames/pubtypes.
1099
d1bddd3c
CC
11002014-05-02 Cary Coutant <ccoutant@google.com>
1101
5fe7ffdc
AM
1102 * defstd.cc (in_segment): Define __ehdr_start here...
1103 * layout.cc (Layout::finalize): ...Instead of here. Set the
1104 output segment when known.
1105 * resolve.cc (Symbol::override_base_with_special): Remember
1106 the original binding.
1107 * symtab.cc (Symbol::set_output_segment): New function.
1108 (Symbol::set_undefined): New function.
1109 * symtab.h (Symbol::is_weak_undefined): Check original undef
1110 binding.
1111 (Symbol::is_strong_undefined): New function.
1112 (Symbol::set_output_segment): New function.
1113 (Symbol::set_undefined): New function.
1114 * target-reloc.h (is_strong_undefined): Remove.
1115 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1116 Check for hidden undefs.
1117 (relocate_section): Call Symbol::is_strong_undefined.
1118
1119 * testsuite/Makefile.am (ehdr_start_test_1)
1120 (ehdr_start_test_2, ehdr_start_test_3)
1121 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1122 * testsuite/Makefile.in: Regenerate.
1123 * testsuite/ehdr_start_def.cc: New source file.
1124 * testsuite/ehdr_start_test.cc: New source file.
1125 * testsuite/ehdr_start_test.t: New linker script.
1126 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1127
7849f6d8
CC
11282014-04-23 Cary Coutant <ccoutant@google.com>
1129
bf2cc635 1130 PR gold/16870
7849f6d8
CC
1131 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1132
99fd8cff
CC
11332014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1134
1135 * layout.cc (Layout::include_section): Allow a target to decide
1136 whether to include a section.
1137 * target.h (Target::should_include_section): New function.
1138 (Target::do_should_include_section): New function.
1139
91f43acd
CC
11402014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1141
1142 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1143 inline into ...
1144 (Copy_relocs::emit): ... here.
1145 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1146 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1147 (Copy_reloc_entry::entries_): Change from private to protected.
1148
c4eb27e1
ST
11492014-04-02 Sriraman Tallam <tmsriram@google.com>
1150
1151 * icf.cc (get_section_contents): Replace copies of reloc
1152 vectors with const references.
1153
ae447ddd
CC
11542014-04-02 Cary Coutant <ccoutant@google.com>
1155
1156 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1157 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1158 * configure: Regenerate.
1159 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1160 -fno-use-linker-plugin.
1161 (LINK1, CXXLINK1): Add it to the link command.
1162 * testsuite/Makefile.in: Regenerate.
1163
fa47fa92
AM
11642014-03-12 Alan Modra <amodra@gmail.com>
1165
1166 * Makefile.in: Regenerate.
1167
9b12c500
CC
11682014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1169
1170 * symtab.h (Symbol::set_nonvis): New function.
1171
beacaa96
CC
11722014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1173
1174 * symtab.cc (Sized_symbol<32>::init_output_data):
1175 Instantiate the template.
1176 (Sized_symbol<64>::init_output_data): Likewise.
1177
800d9823
CC
11782014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1179
1180 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1181 adjust dynamic symbol value.
1182 * target.h (Target::adjust_dyn_symbol): New function.
1183 (Target::do_adjust_dyn_symbol): New function.
1184
918fc1f8 11852014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1186
918fc1f8
CC
1187 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1188 Get the value of DYNAMIC_CUSTOM dynamic entry.
1189 * output.h (Output_data_dynamic::add_custom): New function.
1190 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1191 dynamic entry.
1192 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1193 * target.h (Target::dynamic_tag_custom_value): New function.
1194 (Target::do_dynamic_tag_custom_value): New function.
1195
98ff9231
CC
11962014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1197
1198 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1199 dynsym indexes.
1200 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1201 (Target::do_has_custom_set_dynsym_indexes): New function.
1202 (Target::set_dynsym_indexes): New function.
1203 (Target::do_set_dynsym_indexes): New function.
1204
b80eed39
AM
12052014-03-07 Alan Modra <amodra@gmail.com>
1206
1207 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1208 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1209 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1210 (Powerpc_relocate_functions::has_overflow_bitfield,
1211 overflowed): Use the above.
1212 (Target_powerpc::Relocate::relocate): Correct overflow checking
1213 for a number of relocations. Modify overflow test for 16-bit
1214 fields in instructions to signed/unsigned according to whether
1215 the field takes a signed or unsigned value.
1216
4b95cf5c
AM
12172014-03-05 Alan Modra <amodra@gmail.com>
1218
1219 Update copyright years.
1220
45965137
AM
12212014-03-05 Alan Modra <amodra@gmail.com>
1222
1223 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1224 R_PPC64_ADDR64_LOCAL.
1225 (Target_powerpc::Relocate::relocate): Likewise.
1226
2c80b753
AM
12272014-03-03 Alan Modra <amodra@gmail.com>
1228
1229 * dwp.cc (print_version): Update copyright year to current.
1230
c1c69e83
AM
12312014-02-10 Alan Modra <amodra@gmail.com>
1232
1233 * po/gold.pot: Regenerate.
1234
dd0c4e70
CC
12352014-02-06 Cary Coutant <ccoutant@google.com>
1236
1237 Fix problem where -u is ignored when a weak undef is seen.
1238
1239 * archive.cc (Library_base::should_include_member): Reorder
1240 code to check for -u option if a weak undef has already been seen.
1241 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1242 * testsuite/Makefile.in: Regenerate.
1243 * testsuite/weak_undef_file3.cc: New file.
1244 * testsuite/weak_undef_file4.cc: New file.
1245 * testsuite/weak_undef_test_2.cc: New file.
1246
1a221d3d
CC
12472014-02-05 Cary Coutant <ccoutant@google.com>
1248
1249 Fix issues with gold undefined symbol diagnostics.
1250
1251 PR binutils/15435
1252 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1253 check to here.
1254 * target-reloc.h (is_strong_undefined): New function.
1255 (relocate_section): Move undef vtable symbol check from here.
1256 Check for is_strong_undefined.
1257
e889f0a4 12582014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1259
e889f0a4
CC
1260 Fix problems with the --dynamic-list option.
1261
1262 PR gold/13577
1263 * options.cc (General_options::parse_dynamic_list):
1264 Set have_dynamic_list_.
1265 (General_options::General_options): Initialize have_dynamic_list_.
1266 (General_options::finalize): Turn off -Bsymbolic and
1267 -Bsymbolic-functions if --dynamic-list provided.
1268 * options.h (General_options::have_dynamic_list): New function.
1269 (General_options::have_dynamic_list_): New data member.
1270 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1271 correctly.
5fe7ffdc 1272
e889f0a4
CC
1273 PR gold/16530
1274 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1275 in --dynamic-list, mark it.
5fe7ffdc 1276
e889f0a4
CC
1277 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1278 (dynamic_list_2): New test case.
1279 * testsuite/Makefile.in: Regenerate.
1280 * testsuite/dynamic_list_2.cc: New file.
1281 * testsuite/dynamic_list_2.t: New file.
1282 * testsuite/dynamic_list_lib1.cc: New file.
1283 * testsuite/dynamic_list_lib2.cc: New file.
1284 * testsuite/gc_dynamic_list_test.c: New file.
1285 * testsuite/gc_dynamic_list_test.sh: New file.
1286 * testsuite/gc_dynamic_list_test.t: New file.
1287
ec673e64
CC
12882014-01-28 Cary Coutant <ccoutant@google.com>
1289
1290 Add .gdb_index version 7 support.
1291
1292 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1293 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1294 debug sections.
1295 (Dwarf_ranges_table::read_ranges_table): Likewise.
1296 (Dwarf_pubnames_table::read_section): Check for GNU-style
1297 sections, and for compressed debug sections.
1298 (Dwarf_pubnames_table::read_header): Compute end address of table.
1299 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1300 for end of list by offset, not by offset == 0.
1301 (Dwarf_info_reader::do_read_string_table): Check for compressed
1302 debug sections.
1303 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1304 Initialize new data members.
1305 (Dwarf_pubnames_table::next_name): return flag_byte.
1306 (Dwarf_pubnames_table::end_of_table_): New data member.
1307 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1308 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1309 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1310 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1311 read skeleton type unit DIEs.
1312 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1313 (Gdb_index::do_write): Write flag_byte.
1314 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1315 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1316 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1317 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1318
221fd5d5
L
13192014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1320
1321 * version.cc (print_version): Update copyright year to 2014.
1322
6c09fb0b
ILT
13232013-12-19 Dimitry Andric <dimitry@andric.com>
1324
1325 * stringpool.cc (Stringpool_template::reserve): Add
1326 HAVE_UNORDERED_MAP case.
1327 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1328
8356f2d0
CC
13292013-12-18 Cary Coutant <ccoutant@google.com>
1330
1331 * configure.ac: Check for <unordered_set> and <unordered_map>.
1332 * config.in: Regenerate.
1333 * configure: Regenerate.
1334 * system.h: Use <unordered_set> and <unordered_map> if available.
1335
f2c7d7ee
RM
13362013-12-10 Roland McGrath <mcgrathr@google.com>
1337
1338 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1339 with $(INSTALL_PROGRAM_ENV).
1340 * Makefile.in: Regenerate.
1341
6632e8cc
CC
13422013-11-22 Cary Coutant <ccoutant@google.com>
1343
1344 * configure.ac: Add check for which library is needed for
1345 dlopen.
1346 * configure: Regenerate.
1347
0c075858
CC
13482013-11-22 Cary Coutant <ccoutant@google.com>
1349
1350 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1351 assembler.
1352 * testsuite/Makefile.in: Regenerate.
1353
f49fe902
L
13542013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1355
1356 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1357 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1358 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1359 (Target_x86_64<size>::Scan::local): Likewise.
1360 (Target_x86_64<size>::Scan::global): Likewise.
1361 (Target_x86_64<size>::Relocate::relocate): Likewise.
1362 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1363 Likewise.
1364 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1365 R_X86_64_PC32_BND.
1366
1367 * testsuite/Makefile.am (check_PROGRAMS): Add
1368 exception_x86_64_bnd_test.
1369 (exception_x86_64_bnd_test_SOURCES): New macro.
1370 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1371 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1372 (exception_x86_64_bnd_test_LDADD): Likewise.
1373 (exception_x86_64_bnd_1.o): New rule.
1374 (exception_x86_64_bnd_2.o): Likewise.
1375 * testsuite/Makefile.in: Regenerated.
1376
9055360d
AM
13772013-11-15 Alan Modra <amodra@gmail.com>
1378
1379 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1380 accessor.
1381 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1382 Only call ppc64_local_entry_offset for 64-bit. Restrict
1383 symval_for_branch lookup to ELFv1.
1384 (Stub_table::add_plt_call_entry): Use unsigned int off.
1385 (Output_data_glink::Address, invalid_address): New.
1386 (Output_data_glink::add_eh_frame): Move out of line. Add
1387 support for ELFv2.
1388 (Output_data_glink::add_global_entry, find_global_entry,
1389 global_entry_address): New functions.
1390 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1391 ge_size): New variables.
1392 (Output_data_glink::set_final_data_size): Add global entry
1393 stub sizing.
1394 (Output_data_glink::do_write): Write global entry stubs.
1395 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1396 parameter. Return true for ELFv2. Adjust callers.
1397 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1398 ELFv1. Similarly for ifunc and dynamic relocation processing
1399 specific to ELFv1. Recognize that symbols are defined on
1400 their plt entries for ELFv2.
1401 (Target_powerpc::symval_for_branch): Assert if called for
1402 ELFv2 or ppc32.
1403 (Target_powerpc::Relocate::relocate): Use global entry plt
1404 stub for symbol value if such exists on ELFv2.
1405 (Target_powerpc::Relocate::relocate): Don't call
1406 symval_for_branch when ELFv2. Do adjust for local entry
1407 offset when ELFv2.
1408 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1409 plt stub for ELFv2.
1410 (Target_powerpc::do_plt_address_for_global): Similarly.
1411
cafdd569
CC
14122013-11-14 Cary Coutant <ccoutant@google.com>
1413
1414 Revert patch -- this did not fix the problem, and there is
1415 no race there.
1416
1417 2013-11-14 Cary Coutant <ccoutant@google.com>
1418
1419 PR gold/14860
1420 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1421 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1422 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1423 updating fde_offsets_.
1424 (Eh_frame_hdr::lock_): New data member.
1425
94e49e16
CC
14262013-11-14 Cary Coutant <ccoutant@google.com>
1427
1428 * dwp.cc (Dwo_file_entry): New type.
1429 (File_list): Use Dwo_file_entry.
1430 (Dwo_file::verify): New function.
1431 (Dwo_file::verify_dwo_list): New function.
1432 (Dwo_file::sized_verify_dwo_list): New function.
1433 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1434 list.
1435 (Dwp_options): New enum type.
1436 (dwp_options): Add --verify-only.
1437 (usage): Likewise.
1438 (main): Likewise.
1439 * dwp.h (gold_info): Add declaration.
1440
7cdd7d57
CC
14412013-11-14 Cary Coutant <ccoutant@google.com>
1442
1443 PR gold/14860
1444 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1445 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1446 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1447 updating fde_offsets_.
1448 (Eh_frame_hdr::lock_): New data member.
1449
1d946cb3
CC
14502013-11-06 Cary Coutant <ccoutant@google.com>
1451
1452 PR gold/15758
1453 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1454 before reloc sections.
1455
4f65b40e
AM
14562013-11-04 Alan Modra <amodra@gmail.com>
1457
1458 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1459 (Symbol::needs_dynamic_reloc): Test new flag.
1460 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1461 (Target_powerpc::Scan::get_reference_flags): Add target param.
1462 Return FUNC_DESC_ABI for 64-bit ELFv1.
1463 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1464 call.
1465 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1466 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1467
908794a9
CC
14682013-10-31 Cary Coutant <ccoutant@google.com>
1469
1470 Restore support for dwp v2 DWARF package file format.
1471
1472 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1473 tu_length parameter. Adjust all callers.
1474 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1475 * dwp.cc: Include dwarf.h.
1476 (Section_bounds): New struct type.
1477 (Unit_set): New struct type.
1478 (Dwo_file::Dwo_file): Initialize new data member.
1479 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1480 Combine and rename to...
1481 (Dwo_file::read_unit_index): ...this.
1482 (Dwo_file::sized_read_compunit_index)
1483 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1484 (Dwo_file::sized_read_unit_index): ...this.
1485 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1486 parameters; add section_id parameter.
1487 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1488 (Dwo_file::add_unit_set): ...this.
1489 (Dwo_file::shndx_map_): Remove.
1490 (Dwo_file::sect_offsets_): New data member.
1491 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1492 (Dwp_output_file::add_section): Rename to...
1493 (Dwp_output_file::add_contribution): ...this.
1494 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1495 (Dwp_output_file::add_tu_set): Likewise.
1496 (Dwp_output_file::Contribution): New type.
1497 (Dwp_output_file::Section::contributions): New data member.
1498 (Dwp_output_file::Cu_or_tu_set): Remove.
1499 (Dwp_output_file::Section::Section): New ctor.
1500 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1501 (Dwp_output_file::Dwp_index::Section_table): New type.
1502 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1503 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1504 parameter.
1505 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1506 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1507 (Dwp_output_file::Dwp_index::section_table): New member function.
1508 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1509 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1510 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1511 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1512 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1513 (Dwp_output_file::Dwp_index::section_table_): New data member.
1514 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1515 (Dwp_output_file::add_output_section): New member function.
1516 (Dwp_output_file::write_new_section): New member function.
1517 (Dwp_output_file::write_contributions): New member function.
1518 (Dwp_output_file::section_id_map_): New data member.
1519 (class Dwo_id_info_reader): Remove.
1520 (class Unit_reader): New class.
1521 (get_dwarf_section_name): New function.
1522 (Dwo_file::read_executable): Adjust initializations of class data.
1523 (Dwo_file::read): Add support for v2 package file format.
1524 (Dwo_file::read_unit_index): Likewise.
1525 (Dwo_file::sized_read_unit_index): Likewise.
1526 (Dwo_file::copy_section): Likewise.
1527 (Dwo_file::add_unit_set): Likewise.
1528 (Dwp_output_file::add_output_section): Likewise.
1529 (Dwp_output_file::add_contribution): Likewise.
1530 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1531 for empty slot.
1532 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1533 file format.
1534 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1535 slot.
1536 (Dwp_output_file::initialize): Remove unused function.
1537 (Dwp_output_file::finalize): Add support for v2 package file format.
1538 (Dwp_output_file::write_index): Likewise.
1539 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1540 function prototype.
1541
2500c017
CC
15422013-10-31 Cary Coutant <ccoutant@google.com>
1543
1544 * configure.ac: Fix check for -fmerge-constants.
1545 * configure.ac: Regenerate.
1546
dd0845d7
RM
15472013-10-30 Roland McGrath <mcgrathr@google.com>
1548
1549 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1550 Correct 9-byte nop sequence to match what the assembler generates.
1551
b4f7960d
AM
15522013-10-30 Alan Modra <amodra@gmail.com>
1553
1554 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1555 ppc64_local_entry_offset, ppc64_local_entry_offset,
1556 do_read_symbols): New functions.
1557 (Powerpc_relobj::e_flags_, st_other_): New vars.
1558 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1559 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1560 (Powerpc_relobj::e_flags_): New var.
1561 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1562 and adjust for ELFv2.
1563 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1564 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1565 (Powerpc_dynobj::do_find_special_sections): Likewise.
1566 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1567 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1568 to ELFv2 local entry.
1569 (Target_powerpc::do_relax): No thread safe barriers needed for
1570 ELFv2.
1571 (Output_data_plt_powerpc::initial_plt_entry_size_,
1572 plt_entry_size): Delete. Replace all uses with
1573 first_plt_entry_offset() and plt_entry_size().
1574 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1575 reserved_size parm. Update callers.
1576 (Output_data_plt_powerpc::entry_count): Update.
1577 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1578 and use Target_powerpc::first_plt_entry_offset().
1579 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1580 rename to plt_entry_size.
1581 (Output_data_plt_powerpc::add_ifunc_entry,
1582 add_local_ifunc_entry): Adjust reloc for ELFv2.
1583 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1584 (glink_eh_frame_fde_64v2): New.
1585 (Stub_table::plt_call_size): Support ELFv2 sizing.
1586 (Output_data_glink::add_eh_frame): Use the new FDE.
1587 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1588 (Stub_table::do_write): Write ELFv2 stubs and glink.
1589 (Target_powerpc::Relocate::relocate): Replaces nop after call
1590 with ld 2,24(1) and adjust local offset destination for ELFv2.
1591
f9c6b907
AM
15922013-10-30 Alan Modra <amodra@gmail.com>
1593
1594 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1595 (Target_powerpc::Scan::global, local): Likewise.
1596 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1597 on all ppc64 @h and @ha relocs.
1598
e84fe78f
AM
15992013-10-14 Alan Modra <amodra@gmail.com>
1600
1601 * output.h (Output_data_got::add_constant): Tidy.
1602 (Output_data_got::add_constant_pair): New function.
1603 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1604 methods used so as to first call reserve_ent().
1605
679e4abf
RM
16062013-10-11 Roland McGrath <mcgrathr@google.com>
1607
44dcb735
RM
1608 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1609 add_got_entry and add_got_entry_pair.
1610
13323c49
RM
1611 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1612 (HAVE_PUBNAMES): Likewise.
1613 * configure: Regenerate.
1614
1496b446
RM
1615 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1616 * testsuite/Makefile.in: Regenerate.
1617
cc84c10b
RM
1618 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1619 Remove const from declaration.
1620 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1621 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1622 * output.h (Output_file_header): Remove const from member target_
1623 and corresponding constructor argument.
1624 * output.cc (Output_file_header::Output_file_header): Update prototype.
1625 (Output_file_header::do_sized_write): Use this->target_ in place
1626 of parameters()->target().
1627
52f66a2c
RM
1628 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1629
2b64b551
RM
1630 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1631 * configure: Regenerate.
1632 * Makefile.in: Regenerate.
1633 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1634 * testsuite/merge_string_literals_2.c: Likewise.
1635 * testsuite/Makefile.am
1636 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1637 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1638 literal -fmerge-constants.
1639 * testsuite/Makefile.in: Regenerate.
1640
43819297
RM
1641 * i386.cc (Target_i386): Remove unused member dynbss_.
1642 * arm.cc (Target_arm): Likewise.
1643 * powerpc.cc (Target_powerpc): Likewise.
1644 * sparc.cc (Target_sparc): Likewise.
1645 * tilegx.cc (Target_tilegx): Likewise.
1646 * x86_64.cc (Target_x86_64): Likewise.
1647 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1648 type_signature_, type_offset_.
1649 * plugin.h (Plugin_hook): Remove unused member layout_.
1650 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1651 mapfile_.
1652 (Read_member): Remove unused members input_objects_, symtab_,
1653 mapfile_, layout_.
1654 (Check_library): Remove unused member symtab_.
1655 * archive.h (Lib_group): Remove unused member lib_.
1656 * archive.cc (Lib_group::Lib_group): Update initializer.
1657 * incremental.h (Incremental_binary): Remove unused member target_.
1658 (Incremental_script_entry): Removed unused member script_.
1659 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1660 * icf.h (Icf): Remove unused member num_tracked_relocs.
1661
39d9ead7
RM
1662 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1663 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1664 its only use.
1665 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1666
679e4abf
RM
1667 * archive.h: Use struct rather than class for forward declaration
1668 of Read_symbols_data.
1669
54de2ea6
CC
16702013-10-07 Cary Coutant <ccoutant@google.com>
1671
1672 PR gold/16010
1673 * testsuite/Makefile.am (icf_test): Fix dependencies.
1674 (icf_safe_test): Likewise.
1675 (icf_safe_so_test): Likewise.
1676 (large_symbol_alignment): Add empty _LDADD rule.
1677 * testsuite/Makefile.in: Regenerate.
1678
b14016f0
L
16792013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1680
1681 PR gold/15927
1682 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1683 relocation for R_X86_64_32 on x32.
1684
eb426534
RM
16852013-08-27 Roland McGrath <mcgrathr@google.com>
1686
1687 * output.cc (Output_segment::set_section_addresses): Take new
1688 Target* argument. If target->isolate_execinstr() and the segment
1689 is executable and starts at a target->abi_pagesize() boundary,
1690 pad its end out to a target->abi_pagesize() boundary with code fill.
1691 * output.h (Output_segment::set_section_addresses): Update decl.
1692 * layout.h (Layout::check_output_data_for_reset_values): Take new
1693 argument RELAX_OUTPUTS.
1694 (Layout): New member relax_output_list_.
1695 (Layout::add_relax_output): New method.
1696 * layout.cc (Layout::Layout): Update constructor.
1697 (Layout::reset_relax_output): New method.
1698 (Layout::clean_up_after_relaxation): Call it.
1699 (Layout::prepare_for_relaxation): Update caller.
1700 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1701 Call reset_relax_output before re-processing segments for
1702 isolate_execinstr case.
1703 (Layout::write_data): Handle relax_output_list_.
1704 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1705 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1706
9aff4b7a
NC
17072013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1708
1709 PR binutils/15834
1710 * object.h: Fix typos.
1711
93f8221c
RM
17122013-08-16 Roland McGrath <mcgrathr@google.com>
1713
1714 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1715 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1716
e44c3715
CC
17172013-08-07 Cary Coutant <ccoutant@google.com>
1718
1719 Revert support for v2 DWP files:
1720
1721 2013-03-01 Cary Coutant <ccoutant@google.com>
1722
1723 Add dwp support for v2 DWARF package file format.
1724 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1725 tu_length parameter. Adjust all callers.
1726 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1727 * dwp.cc: Include dwarf.h.
1728 (Section_bounds): New struct type.
1729 (Unit_set): New struct type.
1730 (Dwo_file::Dwo_file): Initialize new data member.
1731 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1732 Combine and rename to...
1733 (Dwo_file::read_unit_index): ...this.
1734 (Dwo_file::sized_read_compunit_index)
1735 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1736 (Dwo_file::sized_read_unit_index): ...this.
1737 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1738 parameters; add section_id parameter.
1739 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1740 (Dwo_file::add_unit_set): ...this.
1741 (Dwo_file::shndx_map_): Remove.
1742 (Dwo_file::sect_offsets_): New data member.
1743 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1744 (Dwp_output_file::add_section): Rename to...
1745 (Dwp_output_file::add_contribution): ...this.
1746 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1747 (Dwp_output_file::add_tu_set): Likewise.
1748 (Dwp_output_file::Contribution): New type.
1749 (Dwp_output_file::Section::contributions): New data member.
1750 (Dwp_output_file::Cu_or_tu_set): Remove.
1751 (Dwp_output_file::Section::Section): New ctor.
1752 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1753 (Dwp_output_file::Dwp_index::Section_table): New type.
1754 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1755 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1756 parameter.
1757 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1758 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1759 (Dwp_output_file::Dwp_index::section_table): New member function.
1760 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1761 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1762 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1763 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1764 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1765 (Dwp_output_file::Dwp_index::section_table_): New data member.
1766 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1767 (Dwp_output_file::add_output_section): New member function.
1768 (Dwp_output_file::write_new_section): New member function.
1769 (Dwp_output_file::write_contributions): New member function.
1770 (Dwp_output_file::section_id_map_): New data member.
1771 (class Dwo_id_info_reader): Remove.
1772 (class Unit_reader): New class.
1773 (get_dwarf_section_name): New function.
1774 (Dwo_file::read_executable): Adjust initializations of class data.
1775 (Dwo_file::read): Add support for v2 package file format.
1776 (Dwo_file::read_unit_index): Likewise.
1777 (Dwo_file::sized_read_unit_index): Likewise.
1778 (Dwo_file::copy_section): Likewise.
1779 (Dwo_file::add_unit_set): Likewise.
1780 (Dwp_output_file::add_output_section): Likewise.
1781 (Dwp_output_file::add_contribution): Likewise.
1782 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1783 for empty slot.
1784 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1785 file format.
1786 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1787 slot.
1788 (Dwp_output_file::initialize): Remove unused function.
1789 (Dwp_output_file::finalize): Add support for v2 package file format.
1790 (Dwp_output_file::write_index): Likewise.
1791 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1792 function prototype.
1793
c6905c28
CC
17942013-07-31 Cary Coutant <ccoutant@google.com>
1795
1796 * object.cc (Sized_relobj::do_output_section_address): New function.
1797 (Sized_relobj): Instantiate explicitly.
1798 * object.h (Object::output_section_address): New function.
1799 (Object::do_output_section_address): New function.
1800 (Sized_relobj::do_output_section_address): New function.
1801 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1802
18032013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1804 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1805
1806 * parameters.cc (Parameters::entry): Return target-specific entry
1807 symbol name.
1808 * target.h (Target::entry_symbol_name): New function.
1809 (Target_info::entry_symbol_name): New data member.
1810
1811 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1812 * i386.cc (Target_i386::i386_info): Likewise.
1813 (Target_i386_nacl::i386_nacl_info): Likewise.
1814 * sparc.cc (Target_sparc::sparc_info): Likewise.
1815 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1816 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1817 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1818 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1819
234d4ab8
SA
18202013-07-22 Sterling Augustine <saugustine@google.com>
1821
1822 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1823 Convert parameter shndx to local variable. Add parameters symtab
1824 and symtab_size. Scan over section names. Find relocation
1825 section corresponding to current section. Create and initialize
1826 reloc_mapper_ and reloc_type_.
1827 (Dwarf_pubnames_table::read_header): Add assertion. Change
1828 unit_length to off_t. Initialize member unit_length_. Fill in field
1829 cu_offset_.
1830 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1831 Initialize new fields unit_length_ and cu_offset_.
1832 (Dwarf_pubnames_table::read_section): Update prototype.
1833 (Dwarf_pubnames_table::cu_offset): New member function.
1834 (Dwarf_pubnames_table::subsection_size): Likewise.
1835 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1836 New fields.
1837 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1838 member functions public.
1839 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1840 Update comment. Rework logic. Move repeated parts to...
1841 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1842 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1843 pubtypes_table_, and stmt_list_offset.
1844 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1845 Gdb_index::find_pubtype_offset,
1846 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1847 (Gdb_index::pubnames_read): Update prototype and rework logic.
1848 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1849 Forward declare.
1850 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1851 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1852 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1853 Gdb_index::map_pubtable_to_dies):
1854 Declare functions.
1855 (Gdb_index::pubnames_read): Update declaration.
1856 (Gdb_index::Pubname_offset_map): New type.
1857 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1858 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1859 Gdb_index::stmt_list_offset): Declare.
1860 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1861 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1862 Gdb_index::pubtypes_offset_): Remove.
1863
a3ed37d8
RM
18642013-07-19 Roland McGrath <mcgrathr@google.com>
1865
1866 * options.h (General_options): Add -Trodata-segment option.
1867 * parameters.cc (Parameters::check_rodata_segment): New function.
1868 (Parameters::set_target_once): Call it.
1869 * parameters.h (Parameters): Declare it (private member function).
1870 * layout.cc (load_seg_unusable_for_headers): New function, broken
1871 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1872 then validate rodata segment rather than text segment.
1873 (relaxation_loop_body): Call that.
1874 (is_text_segment): New function. Don't admit a non-executable
1875 segment if TARGET->isolate_execinstr().
1876 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1877
eb5b4ded
CC
18782013-07-15 Shawn Landden <shawnlandden@gmail.com>
1879
1880 PR gold/15070
1881 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1882 * nacl.h (Sniff_file::View::View): Request aligned view.
1883
4d5effb9
CC
18842013-07-11 Cary Coutant <ccoutant@google.com>
1885
1886 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1887 correct BRLT entry size.
1888
ba8ca3e7
AM
18892013-07-03 Alan Modra <amodra@gmail.com>
1890
1891 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1892 comment.
1893
267257d2
CC
18942013-07-01 Cary Coutant <ccoutant@google.com>
1895
1896 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1897 reloc_type_.
1898 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1899 (Dwarf_ranges_table::lookup_reloc): New function.
1900 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1901 reloc_type_.
1902 (Dwarf_ranges_table::lookup_reloc): New function.
1903 (Dwarf_ranges_table::reloc_type_): New data member.
1904
06f30c9d
CC
19052013-06-27 Jing Yu <jingyu@google.com>
1906
1907 PR gold/15662
1908 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1909 function.
1910 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1911 (Target_powerpc::do_relax): Call the above.
1912
a2d7bf59
AM
19132013-06-27 Cary Coutant <ccoutant@google.com>
1914
1915 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1916 on garbage collected .opd section.
1917
19182013-06-27 Alan Modra <amodra@gmail.com>
1919
1920 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1921 is non-zero.
1922 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1923 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1924
32364e50
CC
19252013-06-14 Cary Coutant <ccoutant@google.com>
1926
1927 * resolve.cc (Symbol::override_base): Don't override st_type
1928 from plugin placeholder symbols.
1929 (Symbol_table::resolve): Likewise.
1930 (Symbol_table::should_override): Don't complain about TLS mismatch
1931 if the TO symbol is a plugin placeholder.
1932 * testsuite/Makefile.am (plugin_test_tls): New test.
1933 * testsuite/Makefile.in: Regenerate.
1934 * testsuite/plugin_test_tls.sh: New test script.
1935 * testsuite/two_file_test_2_tls.cc: New test source.
1936 * testsuite/two_file_test_tls.cc: New test source.
1937
7fb47cc9
CC
19382013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1939
1940 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1941 the maximum segment alignment is larger than the page size.
1942 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1943 correctly aligns the symbols with large alignemnt.
1944 * testsuite/Makefile.in: Regenerate.
1945 * testsuite/large_symbol_alignment.cc: New file.
1946
6934001a
CC
19472013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1948 Sriraman Tallam <tmsriram@google.com>
1949
1950 * options.h (sort_section): New option.
1951 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1952 Rename from Input_section_sort_section_name_special_ordering_compare.
1953 (Input_section_sort_section_name_compare): New struct.
1954 * output.cc (Output_section::Input_section_sort_section_name_compare::
1955 operator()): New function.
1956 (Output_section::sort_attached_input_sections): Use new sort function
1957 for .text if --sort-section=name is specified.
1958 * layout.cc (Layout::make_output_section):
1959 Add sorting by name when --sort-section=name is specified.
1960 * testsuite/Makefile.am (text_section_grouping): Test option
1961 --sort-section=name.
1962 * testsuite/Makefile.in: Regenerate.
1963 * testsuite/section_sorting_name.cc: New file.
1964 * testsuite/section_sorting_name.sh: New file.
1965
93acabad
CC
19662013-05-21 Cary Coutant <ccoutant@google.com>
1967
1968 * symtab.h (Symbol::is_cxx_vtable): New function.
1969 * target-reloc.h (relocate_section): Check for vtable symbol.
1970 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1971 * testsuite/Makefile.in: Regenerate.
1972 * testsuite/missing_key_func.cc: New test source.
1973 * testsuite/missing_key_func.sh: New test script.
1974
60e8b3fc
CC
19752013-05-21 Cary Coutant <ccoutant@google.com>
1976
2b64b551
RM
1977 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1978 type of enclosing symbol.
1979 (Relocate_info::location): Check symbol type when describing symbol.
1980 * object.h (Symbol_location_info): Remove unused line_number;
1981 add enclosing_symbol_type.
1982 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1983
9df9de2c
CC
19842013-05-13 Cary Coutant <ccoutant@google.com>
1985
2b64b551
RM
1986 * configure.ac: Export DEFAULT_TARGET.
1987 * configure: Regenerate.
1988 * Makefile.in: Regenerate.
1989 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1990 * testsuite/Makefile.in: Regenerate.
1991 * testsuite/debug_msg.sh: Delete duplicate tests.
1992 Don't check undef_int error message match for powerpc where the
1993 source file and line number aren't available.
9df9de2c 1994
bbc5ae17
RM
19952013-05-10 Roland McGrath <mcgrathr@google.com>
1996
1997 * options.h (General_options): Add --rosegment-gap option.
1998 * options.cc (finalize): --rosegment-gap implies --rosegment.
1999 * layout.cc (set_segment_offsets): Let user option override
2000 target->rosegment_gap().
2001
0c6e6c39
RM
20022013-05-10 Roland McGrath <mcgrathr@google.com>
2003
2004 * options.h (General_options): Remove leading space from help
2005 messages for -nostdlib and --rosegment.
2006
cde7cb01
MR
20072013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2008
2009 PR ld/15365
2010 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2011
f31ae5b8
AM
20122013-05-03 Alan Modra <amodra@gmail.com>
2013
2014 * merge.cc (Output_merge_string::do_add_input_section): Correct
2015 scan for number of strings. Rename vars to avoid shadowing.
2016 Include missing terminator in input_size_.
2017
d3a7cd45
L
20182013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2019
2020 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2021 Restore empty string handling.
2022
6ad3daba
CC
20232013-05-01 Cary Coutant <ccoutant@google.com>
2024
2025 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2026 uninitialized warning.
2027
e31908b6
CC
20282013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2029
2030 * output.cc (Output_section::add_merge_input_section): Allow
2031 to merge sections if the alignment is more than character size.
2032 * merge.h (Output_merge_string::Output_merge_string): Remove
2033 assert.
2034 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2035 only not-null strings. Check the alignment of strings.
2036 * stringpool.h
2037 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2038 alignment as the argument.
2039 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2040 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2041 Align non-zero length strings according to the addralign_.
2042 (Stringpool_template<Stringpool_char>::set_string_offsets):
2043 Updating offsets according to the given alignment.
2044 * testsuite/Makefile.am (text_section_grouping): Test if string
2045 literals are getting merged.
2046 * testsuite/Makefile.in: Regenerate.
2047 * testsuite/merge_string_literals_1.c: New file.
2048 * testsuite/merge_string_literals_2.c: Ditto.
2049 * testsuite/merge_string_literals.sh: Ditto.
2050
0e804863
ILT
20512013-04-26 Ian Lance Taylor <iant@google.com>
2052
2053 * target-reloc.h (relocate_section): If the reloc offset is out of
2054 range, pass VIEW as NULL to relocate.relocate.
2055 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2056 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2057 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2058 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2059 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2060 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2061
e7c5ea40
CC
20622013-04-26 Geoff Pike <gpike@chromium.org>
2063
2064 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2065 * layout.cc (Hash_task): New class.
2066 (Layout::queue_build_id_tasks): New function.
2067 (Layout::write_build_id): Handle single-thread portion of build ID
2068 computation. (In some cases, all of it is single-threaded.) Replace
2069 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2070 functionality in fewer lines of code.
2071 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2072 * options.h (General_options): make "--build-id" default to tree
2073 rather than sha1. Add two new options related to --build-id=tree:
2074 --build-id-chunk-size-for-treehash and
2075 --build-id-min-file-size-for-treehash.
2076 * Makefile.am: add testing of --build-id=tree and related new options
2077 (these tests will be invoked by "make check").
2078 * Makefile.in: Regenerate.
2079
49926cd0
AM
20802013-04-25 Alan Modra <amodra@gmail.com>
2081
2082 * configure.tgt: Add powerpcle and powerpc64le.
2083
a4034750
AM
20842013-04-22 Alan Modra <amodra@gmail.com>
2085
2086 PR gold/15355
2087 * layout.cc (Layout::segment_precedes): Allow more than one
2088 segment with the same type and flags.
2089
e79c84aa
CC
20902013-04-15 Cary Coutant <ccoutant@google.com>
2091
2092 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2093 allocate space in file for BSS sections.
2094
2199fbe7
CC
20952013-04-15 Cary Coutant <ccoutant@google.com>
2096
2097 * script-sections.cc (Orphan_output_section): Reset address
2098 to zero after each orphaned section for relocatable links.
2099
502e8a84
CC
21002013-04-15 Cary Coutant <ccoutant@google.com>
2101
a4034750
AM
2102 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2103 section starting address for relocatable link.
2104 * testsuite/Makefile.am (script_test_11): New test.
2105 * testsuite/Makefile.in: Regenerate.
2106 * testsuite/script_test_11.c: New source file.
2107 * testsuite/script_test_11.t: New linker script.
502e8a84 2108
0cfdc767
AM
21092013-04-13 Alan Modra <amodra@gmail.com>
2110
2111 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2112 owner when sections are not adjacent and exceed group size.
2113 (Target_powerpc::group_sections): Handle corner case.
2114 (Target_powerpc::Branch_info::make_stub): Handle case where
2115 stub table doesn't exist due to branches in non-exec sections.
2116 (Target_powerpc::Relocate::relocate): Likewise.
2117
6830ee24
AM
21182013-04-11 Alan Modra <amodra@gmail.com>
2119
2120 PR gold/15354
2121 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2122 .branch_lt to match bfd ld. Adjust comments throughout file.
2123
54a3d865
ILT
21242013-04-04 Ian Lance Taylor <iant@google.com>
2125
2126 GCC PR c++/56840
2127 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2128 sections before checking whether they are included in the link.
2129
9993ba11
ST
21302013-03-29 Sriraman Tallam <tmsriram@google.com>
2131
2132 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2133 object before calling the plugin claim_file handler. Pass the elf
2134 object of the archive to the plugin. Delete the elf object if the
2135 plugin claims the file.
2136
ebacd51e
AM
21372013-03-21 Alan Modra <amodra@gmail.com>
2138
2139 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2140 segment when omagic.
2141
117be58f
AM
21422013-03-21 Alan Modra <amodra@gmail.com>
2143
2144 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2145 comparison warning.
2146 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2147 uninitialized" warning.
2148
32e2b61d
AM
21492013-03-20 Alan Modra <amodra@gmail.com>
2150
2151 * symtab.h (Symbol::clear_version): New function.
2152 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2153 is_needed by weak references. Clear version for symbols defined
2154 in as-needed objects that are not needed.
2155
b3ccdeb5
AM
21562013-03-15 Alan Modra <amodra@gmail.com>
2157
2158 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2159 static and public. Add report_err param. Return false for data refs.
2160 (Target_powerpc::rela_dyn_section): New overloaded function.
2161 (Target_powerpc::plt_, iplt_): Elucidate.
2162 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2163 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2164 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2165 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2166 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2167 push_branch and make_plt_entry for ifunc syms when
2168 reloc_needs_plt_for_ifunc.
2169 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2170 for ifunc unless reloc_needs_plt_for_ifunc.
2171
ad3d8a2f
AM
21722013-03-15 Alan Modra <amodra@gmail.com>
2173
2174 * gc.h (gc_process_relocs): Don't look through function descriptors.
2175 * icf.cc (get_section_contents): Do so here instead.
2176
4d9aa155
AM
21772013-03-13 Alan Modra <amodra@gmail.com>
2178
2179 * powerpc.cc (is_branch_reloc): Forward declare.
2180 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2181 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2182 false for 64-bit, true for 32-bit non-branch relocs.
2183 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2184 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2185 nm output.
2186 (icf_safe_test): Generate linker map file as well as nm output.
2187 (icf_safe_so_test): Likewise.
2188 * testsuite/Makefile.in: Regenerate.
2189 * testsuite/icf_test.sh: Parse linker map file to determine
2190 section folding.
2191 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2192 * testsuite/icf_safe_so_test.sh: Likewise.
2193 (X86_32_or_ARM_specific_safe_fold): Merge into..
2194 (arch_specific_safe_fold): ..this.
2195 (X86_64_specific_safe_fold): Delete unused function.
2196
57420c20
AM
21972013-03-12 Alan Modra <amodra@gmail.com>
2198
2199 * gc.h (gc_process_relocs): Look through function descriptors
2200 to determine shndx, symvalue and addend used by ICF. Tidy
2201 variable duplication.
2202
dc3714f3
AM
22032013-03-11 Alan Modra <amodra@gmail.com>
2204
2205 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2206 * layout.cc (Layout_task_runner::run): ..to here.
2207 * symtab.h (struct Symbol_location): Extract from..
2208 (class Symbol_table): ..here.
2209 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2210 * target.h (class Target): Add function_location and
2211 do_function_location functions.
2212 (class Sized_target): Add do_function_location.
2213 * object.h (class Sized_relobj_file): Move find_shdr..
2214 (class Object): ..to here.
2215 * object.cc: Likewise. Update to suit. Instantiate.
2216 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2217 * powerpc.cc (class Powerpc_dynobj): New.
2218 (Target_powerpc::do_function_location): New function.
2219 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2220 (Powerpc_dynobj::do_read_symbols): New function.
2221 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2222
956b03bb
ILT
22232013-03-08 Ian Lance Taylor <iant@google.com>
2224
2225 * options.cc (General_options::string_to_object_format): Accept
2226 "default".
2227
4bead2d5
AM
22282013-03-08 Alan Modra <amodra@gmail.com>
2229
2230 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2231 pointer to Post_fde.
2232 (struct Post_fde): Move definition to here..
2233 * ehframe.cc (struct Post_fde): ..from here.
2234 (Cie::write): Don't alloc Post_fde.
2235 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2236
02e60bf7
AM
22372013-03-07 Alan Modra <amodra@gmail.com>
2238
2239 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2240 relocation referencing .LC0.
2241 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2242
8343f03a
AM
22432013-03-07 Alan Modra <amodra@gmail.com>
2244
2245 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2246 always_inline. Add assembly for powerpc to avoid GOT.
2247
3366d57c
AM
22482013-03-07 Alan Modra <amodra@gmail.com>
2249
2250 * testsuite/script_test_10.sh: Don't test .bss section
2251 header number.
2252
6c77229c
AM
22532013-03-06 Alan Modra <amodra@gmail.com>
2254
2255 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2256 (Target_powerpc::symval_for_branch): Add symtab param. Update
2257 all callers. Handle folded sections.
2258 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2259 to Powerpc_relobj.
2260 (Global_symbol_visitor_opd::operator()): Likewise.
2261
a39e4af6
AM
22622013-03-04 Alan Modra <amodra@gmail.com>
2263
2264 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2265 * testsuite/Makefile.in: Regenerate.
2266
d5834edb
CC
22672013-03-01 Cary Coutant <ccoutant@google.com>
2268
2269 Add dwp support for v2 DWARF package file format.
2270 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2271 tu_length parameter. Adjust all callers.
2272 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2273 * dwp.cc: Include dwarf.h.
2274 (Section_bounds): New struct type.
2275 (Unit_set): New struct type.
2276 (Dwo_file::Dwo_file): Initialize new data member.
2277 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2278 Combine and rename to...
2279 (Dwo_file::read_unit_index): ...this.
2280 (Dwo_file::sized_read_compunit_index)
2281 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2282 (Dwo_file::sized_read_unit_index): ...this.
2283 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2284 parameters; add section_id parameter.
2285 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2286 (Dwo_file::add_unit_set): ...this.
2287 (Dwo_file::shndx_map_): Remove.
2288 (Dwo_file::sect_offsets_): New data member.
2289 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2290 (Dwp_output_file::add_section): Rename to...
2291 (Dwp_output_file::add_contribution): ...this.
2292 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2293 (Dwp_output_file::add_tu_set): Likewise.
2294 (Dwp_output_file::Contribution): New type.
2295 (Dwp_output_file::Section::contributions): New data member.
2296 (Dwp_output_file::Cu_or_tu_set): Remove.
2297 (Dwp_output_file::Section::Section): New ctor.
2298 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2299 (Dwp_output_file::Dwp_index::Section_table): New type.
2300 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2301 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2302 parameter.
2303 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2304 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2305 (Dwp_output_file::Dwp_index::section_table): New member function.
2306 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2307 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2308 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2309 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2310 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2311 (Dwp_output_file::Dwp_index::section_table_): New data member.
2312 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2313 (Dwp_output_file::add_output_section): New member function.
2314 (Dwp_output_file::write_new_section): New member function.
2315 (Dwp_output_file::write_contributions): New member function.
2316 (Dwp_output_file::section_id_map_): New data member.
2317 (class Dwo_id_info_reader): Remove.
2318 (class Unit_reader): New class.
2319 (get_dwarf_section_name): New function.
2320 (Dwo_file::read_executable): Adjust initializations of class data.
2321 (Dwo_file::read): Add support for v2 package file format.
2322 (Dwo_file::read_unit_index): Likewise.
2323 (Dwo_file::sized_read_unit_index): Likewise.
2324 (Dwo_file::copy_section): Likewise.
2325 (Dwo_file::add_unit_set): Likewise.
2326 (Dwp_output_file::add_output_section): Likewise.
2327 (Dwp_output_file::add_contribution): Likewise.
2328 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2329 for empty slot.
2330 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2331 file format.
2332 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2333 slot.
2334 (Dwp_output_file::initialize): Remove unused function.
2335 (Dwp_output_file::finalize): Add support for v2 package file format.
2336 (Dwp_output_file::write_index): Likewise.
2337 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2338 function prototype.
2339
a68a081d
CC
23402013-03-01 Cary Coutant <ccoutant@google.com>
2341
2342 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2343 function into class definition in header file.
2344 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2345 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2346 New function.
2347 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2348
9d5781f8
AM
23492013-02-28 Alan Modra <amodra@gmail.com>
2350
2351 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2352 * target.cc (Target::do_plt_fde_location): New function.
2353 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2354 accessor function, and constructor param.
2355 (struct Post_fde, Post_fdes): Declare.
2356 (Cie::write): Add post_fdes param.
2357 * ehframe.cc (Fde::write): Use plt_fde_location.
2358 (struct Post_fde): Define.
2359 (Cie::write): Stash FDEs added post merge mapping.
2360 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2361 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2362 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2363 other FDEs.
2364 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2365 (Target_powerpc::has_glink): New function.
2366 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2367 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2368 glink_eh_frame_fde_32, default_fde): New data.
2369 (Stub_table::eh_frame_added_): New var.
2370 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2371 Make const.
2372 (Stub_table::add_eh_frame): New function.
2373 (Output_data_glink::add_eh_frame): New function.
2374 (Target_powerpc::make_glink_section): Call add_eh_frame.
2375
214383dd
ILT
23762013-02-15 Ian Lance Taylor <iant@google.com>
2377
2378 * options.h (DEFINE_uint64_alias): Define.
2379 (class General_options): Add -Ttext-segment as an alias for
2380 -Ttext.
2381
91c2b899
AM
23822013-02-15 Alan Modra <amodra@gmail.com>
2383
2384 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2385 (Stub_table::do_write): ..here, two places.
2386 (Stub_table::plt_call_size): Use it here too.
2387
20e2a8aa
ILT
23882013-02-11 Ian Lance Taylor <iant@google.com>
2389
2390 * descriptors.cc (Descriptors::close_all): New function.
2391 * descriptors.h (class Descriptors): Declare close_all.
2392 (close_all_descriptors): New inline function.
2393 * plugin.cc: Include "descriptors.h".
2394 (Plugin_manager::cleanup): Call close_all_descriptors.
2395
8952bc69
AM
23962013-02-06 Alan Modra <amodra@gmail.com>
2397
2398 * README: Update coding style link.
2399
29bd8b6b
CC
24002013-01-28 Cary Coutant <ccoutant@google.com>
2401
a4034750
AM
2402 * dwp.cc (File_list): New typedef.
2403 (Dwo_name_info_reader): New class.
2404 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2405 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2406 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2407 (Dwo_file::read_executable): New function.
2408 (Dwo_file::read): Move common setup code to ...
2409 (Dwo_file::make_object): ... here.
2410 (dwp_options): Add --exec/-e.
2411 (usage): Likewise.
2412 (main): Likewise.
29bd8b6b 2413
c6ac678d
ST
24142013-01-24 Sriraman Tallam <tmsriram@google.com>
2415
2416 * layout.cc (Layout::layout): Check for option text_reorder.
2417 (Layout::make_output_section): Ditto.
2418 * options.h (text_reorder): New option.
2419 * output.cc (Input_section_sort_compare): Remove special ordering
2420 of section names.
2421 (Output_section::
2422 Input_section_sort_section_name_special_ordering_compare::
2423 operator()): New function.
2424 (Output_section::sort_attached_input_sections): Use new sort function
2425 for .text.
2426 * output.h (Input_section_sort_section_name_special_ordering_compare):
2427 New struct.
2428 * testsuite/Makefile.am (text_section_grouping): Test option
2429 --no-text-reorder
2430 * testsuite/Makefile.in: Regenerate.
2431 * testsuite/text_section_grouping.sh: Check order of functions without
2432 default text reordering.
2433
50701cc1
MF
24342013-01-18 Mike Frysinger <vapier@gentoo.org>
2435
2436 * options.h (General_options): Change default to true for new_dtags.
2437
b1b00fcc
MF
24382013-01-18 Mike Frysinger <vapier@gentoo.org>
2439
2440 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2441 when enable_new_dtags is false. Only add DT_RUNPATH when
2442 enable_new_dtags is true.
2443
ec5b8187
AM
24442013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2445
2446 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2447 used in declaration and definition consistent.
2448 (Target_powerpc::symval_for_branch): Ditto.
2449
a880d4c4
ST
24502013-01-16 Sriraman Tallam <tmsriram@google.com>
2451
2452 * testsuite/plugin_final_layout.cc: Fix comment.
2453
7c381248
ST
24542013-01-16 Sriraman Tallam <tmsriram@google.com>
2455
2456 * layout.cc (Layout::layout): Do not do default sorting for
2457 text sections when section ordering is specified.
2458 (make_output_section): Ditto.
2459 * testsuite/plugin_final_layout.cc: Name the function sections
2460 to catch reordering issues.
2461
e2458743
AM
24622013-01-15 Alan Modra <amodra@gmail.com>
2463
2464 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2465 plt-thread-safe.
2466
431ed302
AM
24672013-01-15 Alan Modra <amodra@gmail.com>
2468
2469 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2470 * testsuite/Makefile.in: Regenerate.
2471
0ec6429b
AM
24722013-01-14 Alan Modra <amodra@gmail.com>
2473
2474 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2475 * testsuite/Makefile.in: Regenerate.
2476
0bf402d5
ILT
24772013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2478
36af3926 2479 PR bfd/14430
0bf402d5
ILT
2480 Fix mingw gold build with plugins enabled
2481 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2482 * configure.ac: Export DLOPEN_LIBS and add headers check.
2483 * plugin.cc: Handle non-dlfcn case.
2484 * Makefile.in: Regenerate.
2485 * config.in: Regenerate.
2486 * configure: Regenerate.
2487 * testsuite/Makefile.in: Regenerate.
2488
9e9143bc
ST
24892013-01-09 Sriraman Tallam <tmsriram@google.com>
2490
2491 * output.h (sort_attached_input_sections): Change to be public.
2492 * script-sections.cc
2493 (Output_section_definition::set_section_addresses): Sort
2494 attached input sections according to section order before linker
2495 script assigns section addresses.
2496 (Orphan_output_section::set_section_addresses): Sort
2497 attached input sections according to section order before linker
2498 script assigns section addresses.
2499 * Makefile.am (final_layout.sh): Use a simple linker script to
2500 check if section ordering still works.
2501 * Makefile.in: Regenerate.
2502
679af368
ILT
25032013-01-09 Ben Cheng <bccheng@google.com>
2504
2505 * arm.cc (Target_arm::attributes_accept_div): New function.
2506 (Target_arm::attributes_forbid_div): New function.
2507 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2508 attribute using the same new functions as what bfd/elf32_arm.c
2509 does.
2510
3136a00e
CC
25112013-01-07 Cary Coutant <ccoutant@google.com>
2512
2513 PR gold/14993
2514 * output.cc (Output_section::add_input_section): For incremental
2515 updates, don't track input sections that are allocated from patch
2516 space.
2517
f2a6224b
L
25182013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2519 Ian Lance Taylor <iant@google.com>
2520
2521 PR gold/14897
2522 * configure.ac (--enable-ld): Removed.
2523 (install_as_default): Set to yes only for --enable-gold=default
2524 or --disable-ld.
2525 * configure: Regenerated.
2526
4f46f626
L
25272013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2528
2529 * options.h (General_options): Add -fuse-ld= for GCC linker
2530 option compatibility.
2531
26e4ef59
CC
25322013-01-04 Cary Coutant <ccoutant@google.com>
2533
2534 * configure.ac: Fix typo restoring CXXFLAGS.
2535 * configure: Regenerate.
2536
3d587466
CC
25372013-01-04 Cary Coutant <ccoutant@google.com>
2538
4f46f626
L
2539 * testsuite/Makefile.am (CXXLINK_S): New macro.
2540 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2541 * testsuite/Makefile.in: Regenerate.
3d587466 2542
44db6695
L
25432013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2544
2545 * version.cc (print_version): Update copyright year to 2013.
2546
edcac0c1
ILT
25472012-12-20 Ian Lance Taylor <iant@google.com>
2548
2549 * layout.cc (Layout::special_ordering_of_input_section): New
2550 function.
2551 (Layout::layout): If input section requires special ordering, must
2552 sort input sections.
2553 (Layout::make_output_section): May sort .text input sections.
2554 (Layout::is_section_name_prefix_grouped): Remove.
2555 * layout.h (class Layout): Declare
2556 special_ordering_of_input_section. Don't declare
2557 is_section_name_prefix_grouped.
2558 * output.cc (Output_section::add_input_section): Revert last
2559 change.
2560 (Output_section::Input_section_sort::match_file_name): Don't crash
2561 if called on output section data.
2562 (Output_section::Input_section_sort_compare): Sort based on
2563 special ordering.
2564 (Output_section::Input_section_sort_section_order_index_compare):
2565 Revert last patch.
2566 (Output_section::sort_attached_input_sections): Likewise.
2567
28f2a4ac
ST
25682012-12-18 Sriraman Tallam <tmsriram@google.com>
2569
edcac0c1 2570 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2571 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2572 * output.cc (Output_section::add_input_section): Check if section
2573 name contains special prefix. Keep input sections to sort such
2574 sections.
2575 (Output_section::Input_section_sort_section_order_index_compare
2576 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2577 (Output_section::sort_attached_input_sections): Add condition to
2578 Input_section_entry constructor call.
28f2a4ac
ST
2579 * testsuite/Makefile.am (text_section_grouping): New test.
2580 * testsuite/Makefile.in: Regenerate.
2581 * testsuite/text_section_grouping.cc: New file.
2582 * testsuite/text_section_grouping.sh: New file.
2583
5bf135a7
NC
25842012-12-17 Nick Clifton <nickc@redhat.com>
2585
2586 * Makefile.am: Add copyright notice.
2587 * NEWS: Likewise.
2588 * README: Likewise.
2589 * configure.ac: Likewise.
2590 * ftruncate.c: Likewise.
2591 * Makefile.in: Regenerate.
2592
59965708
CC
25932012-12-14 Cary Coutant <ccoutant@google.com>
2594
a4034750
AM
2595 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2596 --no-as-needed flag.
2597 (exception_separate_shared_12_test): Likewise.
2598 (incremental_copy_test): Likewise.
2599 * testsuite/Makefile.in: Regenerate.
59965708 2600
2a77e2ab
CC
26012012-12-14 Cary Coutant <ccoutant@google.com>
2602
2603 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2604 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2605
e3deeb9c
AM
26062012-12-12 Alan Modra <amodra@gmail.com>
2607
2608 * powerpc.cc (class Track_tls): New.
2609 (class Relocate, class Scan): Inherit Track_tls.
2610 (Target_powerpc::Scan::local, global): Track tls optimization
2611 and avoid creating plt entry for __tls_get_addr if all uses
2612 are optimized away.
2613 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2614
d8f5a274
AM
26152012-12-12 Alan Modra <amodra@gmail.com>
2616
2617 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2618 Replace no_toc_optimize with toc_optimize.
2619 * output.h (Output_section::input_sections): Provide non-const variant.
2620 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2621 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2622 accessors.
2623 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2624 (class Sort_toc_sections): New.
2625 (Target_powerpc::do_finalize_sections): Sort toc sections.
2626 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2627
4c8a1de1
RM
26282012-12-10 Roland McGrath <mcgrathr@google.com>
2629
2630 * testsuite/binary_unittest.cc (read_all): New function.
2631 (Sized_binary_test): Use it instead of ::read.
2632 * fileread.cc (do_read): Don't assume pread always reads the whole
2633 amount in a single call.
2634
edc27beb
AM
26352012-12-10 Alan Modra <amodra@gmail.com>
2636
2637 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2638 Set EM_PPC64 or EM_PPC here.
2639 (Target_selector_powerpc::do_recognize): Delete.
2640
906b9150
AM
26412012-12-10 Alan Modra <amodra@gmail.com>
2642
2643 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2644 stub_table_.
2645 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2646
418c15ae
RM
26472012-12-07 Roland McGrath <mcgrathr@google.com>
2648
2649 * testsuite/binary_unittest.cc (Sized_binary_test):
2650 Use open_descriptor rather than ::open.
2651
decdd3bc
AM
26522012-12-07 Alan Modra <amodra@gmail.com>
2653
2654 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2655 typedef and invalid_address constant.
2656 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2657 instantiate constants.
2658
db399005
ILT
26592012-12-06 Roland McGrath <mcgrathr@google.com>
2660
2661 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2662 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2663 * aclocal.m4: Regenerate.
2664 * configure: Regenerate.
2665 * Makefile.in: Regenerate.
2666 * testsuite/Makefile.in: Regenerate.
2667
aba6bc71
AM
26682012-12-07 Alan Modra <amodra@gmail.com>
2669
2670 * options.h (General_options): Add no_toc_optimize.
2671 * powerpc.cc (ok_lo_toc_insn): New function.
2672 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2673
9e69ed50
AM
26742012-12-06 Alan Modra <amodra@gmail.com>
2675
2676 * options.h (General_options): Add plt_align, plt_static_chain,
2677 plt_thread_safe. Update stub_group_size help text.
2678 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2679 for new plt_thread_safe_ var.
2680 (use_plt_offset): Correct comments.
2681 (Target_powerpc::do_relax): Look for thread creation symbols to
2682 determine default plt_thread_safe value. Clear plt call stubs
2683 as well as branch stubs each iteration.
2684 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2685 insn constants.
2686 (l, hi, ha, write_insn): Move earlier.
2687 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2688 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2689 plt stubs too.
2690 (Stub_table::update_size): Adjust.
2691 (Stub_table::prev_size, set_prev_size): Delete.
2692 (Stub_table::stub_align): Let --plt-align affect result.
2693 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2694 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2695 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2696 (Stub_table::do_write): Support more stub variants.
2697
f43ba157
AM
26982012-12-04 Alan Modra <amodra@gmail.com>
2699
2700 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2701 (Target_powerpc::do_define_standard_symbols): New function.
2702
34171bc5
AM
27032012-12-03 Alan Modra <amodra@gmail.com>
2704
2705 * output.h: Formatting, whitespace.
2706
dc9589e9 27072012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2708
2709 * layout.h (Layout::get_executable_sections): Declare.
2710 * layout.cc (Layout::get_executable_sections): New function.
2711 * arm.cc (Target_arm::group_sections): Use it.
2712 (Arm_output_section::group_sections): Delete now redundant test.
2713 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2714 param to handle relative relocs.
2715 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2716 (Output_data_reloc::add_absolute): Adjust.
2717 (Output_data_reloc::add_relative): New function.
2718 (Output_data::reset_data_size): New function.
2719 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2720 (Output_section::set_addralign): New function.
2721 (Output_section::checkpoint_set_addralign): New function.
2722 (Output_section::clear_section_offsets_need_adjustment): New function.
2723 (Output_section::input_sections): Make public.
2724 * powerpc.cc (class Output_data_brlt_powerpc): New.
2725 (class Stub_table, class Stub_control): New.
2726 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2727 stub_table_, set_stub_table, stub_table): New vectors and accessor
2728 functions.
2729 (Target_powerpc::do_may_relax, do_relax, push_branch,
2730 new_stub_table, stub_tables, brlt_section, group_sections,
2731 add_branch_lookup_table, find_branch_lookup_table,
2732 write_branch_lookup_table, make_brlt_section): New functions.
2733 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2734 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2735 branch_info_): New vars.
2736 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2737 make call stubs here.
2738 (Output_data_glink): Remove all call stub handling from this class.
2739 (Target_powerpc::Scan::local, global): Save interesting branch
2740 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2741 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2742 functions on final link.
2743 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2744 Handle long branch destinations too.
2745 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2746 do_plt_address_for_local): Adjust lookup of plt call stubs.
2747
627b30b7
AM
27482012-11-30 Alan Modra <amodra@gmail.com>
2749
2750 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2751 relocs against protected symbols when building 32-bit shared libs.
2752
40b469d7
AM
27532012-11-30 Alan Modra <amodra@gmail.com>
2754
2755 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2756 param. Call got_section() to make .got. Update all callers
2757 and their callers and so on.
2758
bb66a627
AM
27592012-11-30 Alan Modra <amodra@gmail.com>
2760
2761 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2762 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2763 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2764 value if it already exists.
2765
d2cf1c6c
L
27662012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2767
2768 PR gold/14858
2769 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2770
edccdf7c
RM
27712012-11-14 Roland McGrath <mcgrathr@google.com>
2772
2773 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2774 than bfc instruction for data sandboxing.
2775
6febeb74
AM
27762012-11-08 Alan Modra <amodra@gmail.com>
2777
2778 * po/POTFILES.in: Regenerate.
2779
0a6f1bf2
AM
27802012-11-05 Alan Modra <amodra@gmail.com>
2781
2782 * configure.ac: Apply 2012-09-10 change to config.in here.
2783 * configure: Regenerate.
2784
26a4e9cb
AM
27852012-11-05 Alan Modra <amodra@gmail.com>
2786
2787 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2788 (struct Opd_ent): Use "Address" rather than "Offset".
2789 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2790 (Target_powerpc::got_section): Make public.
2791 (Target_powerpc::scan_relocs): Move code setting symbols..
2792 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2793 Create _SDA_BASE_ only when referenced.
2794
cc928013
RM
27952012-11-02 Roland McGrath <mcgrathr@google.com>
2796
2797 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2798 from last change.
2799
50ed5eb1
RM
28002012-11-01 Roland McGrath <mcgrathr@google.com>
2801
62fe925a
RM
2802 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2803 for offset_in_output_section parameter.
2804 (Sized_target::relocate_special_relocatable): Likewise.
2805 * arm.cc (Target_arm::relocate_relocs): Likewise.
2806 (Target_arm::relocate_special_relocatable): Likewise.
2807 * i386.cc (Target_i386::relocate_relocs): Likewise.
2808 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2809 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2810 * target-reloc.h (relocate_relocs): Likewise.
2811 * testsuite/testfile.cc (Target_test): Likewise.
2812 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2813 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2814
2815 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2816 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2817
2818 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2819 parameter, which is unused in the [!F_SETFD] case.
2820
50ed5eb1
RM
2821 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2822 SYMNDX to off_t before comparing it to this->data_size().
2823 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2824 * incremental.cc (Output_section_incremental_inputs::do_write):
2825 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2826
2cadc0bf
RM
2827 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2828
3bfcb652
NC
28292012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2830
2831 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2832 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2833 in EABI_VER5.
2834
c1a8d56e
CC
28352012-10-29 Cary Coutant <ccoutant@google.com>
2836
2837 * dwp.cc (usage): Add file and exit status parameters;
2838 add --help and --version options.
2839 (print_version): New function.
2840 (main): Add --help and --version options.
2841
b2490a7b
L
28422012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2843
2844 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2845 final_layout_sequence.txt.
2846 * testsuite/Makefile.in: Regenerated.
2847
aa543512
L
28482012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2849
2850 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2851 COMPILE generated by automake.
2852 (LINK1): Likewise.
2853 (CXXCOMPILE1): Likewise.
2854 (CXXLINK1): Likewise.
2855 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2856 (LINK): Likewise.
2857 (CXXCOMPILE): Likewise.
2858 (CXXLINK): Likewise.
2859 * testsuite/Makefile.in: Regenerated.
2860
d361fafb
L
28612012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2862
2863 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2864 on bad fwrite return.
2865
598c7410
L
28662012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2867
2868 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2869 on val.
2870
35c813e2
CC
28712012-10-23 Cary Coutant <ccoutant@google.com>
2872
2873 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2874 * testsuite/Makefile.in: Regenerate.
2875 * testsuite/dwp_test.h: New source file.
2876 * testsuite/dwp_test_1.cc: New source file.
2877 * testsuite/dwp_test_1.s: New source file.
2878 * testsuite/dwp_test_1.sh: New source file.
2879 * testsuite/dwp_test_1b.cc: New source file.
2880 * testsuite/dwp_test_1b.s: New source file.
2881 * testsuite/dwp_test_2.cc: New source file.
2882 * testsuite/dwp_test_2.s: New source file.
2883 * testsuite/dwp_test_2.sh: New source file.
2884 * testsuite/dwp_test_main.cc: New source file.
2885 * testsuite/dwp_test_main.s: New source file.
2886
77429909
CC
28872012-10-23 Cary Coutant <ccoutant@google.com>
2888
2889 * dwp.h: New header file.
2890 * dwp.cc: New source file.
2891 * gold.h: Move shared declarations to system.h.
2892 * system.h: New header file.
2893 * Makefile.am: Add dwp.
2894 * Makefile.in: Regenerate.
2895
ed5d6712
CC
28962012-10-23 Cary Coutant <ccoutant@google.com>
2897
2898 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2899 Dwarf_info_reader::read_from_pointer.
2900 (Dwarf_pubnames_table::read_header): Likewise.
2901 (Dwarf_pubnames_table::next_name): Likewise.
2902 (Dwarf_die::read_attributes): Likewise.
2903 (Dwarf_die::skip_attributes): Likewise.
2904 (Dwarf_info_reader::read_from_pointer): New function template.
2905 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2906 (Dwarf_pubnames_table): Likewise.
2907 (Dwarf_info_reader::read_from_pointer): New function template.
2908 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2909 Dwarf_pubnames_table ctor.
2910
8787852d
CC
29112012-10-23 Cary Coutant <ccoutant@google.com>
2912
2913 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2914 abbrev_shndx.
2915 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2916 abbrev_shndx_.
2917 (Dwarf_info_reader::set_abbrev_shndx): New method.
2918 (Dwarf_info_reader::abbrev_shndx_): New data member.
2919
9fc236f3
CC
29202012-10-23 Cary Coutant <ccoutant@google.com>
2921
2922 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2923 from object, not parameters.
2924 (Dwarf_info_reader::parse): Likewise.
2925 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2926 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2927 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2928 methods.
2929
effe8365
CC
29302012-10-23 Cary Coutant <ccoutant@google.com>
2931
2932 * fileread.cc (Input_file::Input_file): New constructor.
2933 * fileread.h (class Input_file): Add new constructor.
2934
1698990d
AM
29352012-10-18 Alan Modra <amodra@gmail.com>
2936
2937 PR gold/14727
2938 * object.cc (Relobj::is_section_name_included): Also match
2939 .sdata personality section.
2940
168a4726
AM
29412012-10-18 Alan Modra <amodra@gmail.com>
2942
2943 * target-reloc.h (class Default_comdat_behavior): New, package up..
2944 (get_comdat_behaviour): ..this.
2945 (relocate_section): Add Relocate_comdat_behavior template arg,
2946 adjust code to suit.
2947 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2948 (Target_arm::scan_reloc_section): Likewise.
2949 * i386.cc (Target_i386::relocate_section): Likewise.
2950 * sparc.cc (Target_sparc::relocate_section): Likewise.
2951 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2952 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2953 * powerpc.cc (class Relocate_comdat_behavior): New.
2954 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2955 gold::relocate_section with new template arg.
2956
acc276d8
AM
29572012-10-18 Alan Modra <amodra@gmail.com>
2958
2959 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2960 dynamic relocs for GOT_TPREL got entries, without symbol if
2961 resolving locally.
2962 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2963 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2964 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2965
e10f9870
AM
29662012-10-17 Alan Modra <amodra@gmail.com>
2967
2968 PR gold/14726
2969 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2970
ae034989
ST
29712012-10-16 Sriraman Tallam <tmsriram@google.com>
2972
2973 * layout.cc (Layout::include_section): Keep sections marked
2974 SHF_EXCLUDE when doing relocatable links.
2975
f3a0ed29
AM
29762012-10-16 Alan Modra <amodra@gmail.com>
2977
2978 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2979 (Target_powerpc::do_finalize_sections): Call it.
2980 (Output_data_save_res): New class and supporting functions.
2981 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2982 normal symbols defined in object files.
2983
c6de8ed4
AM
29842012-10-12 Alan Modra <amodra@gmail.com>
2985
2986 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2987 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2988 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2989 section if scan_opd_relocs not yet called.
2990 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2991
03e25981
AM
29922012-10-12 Alan Modra <amodra@gmail.com>
2993
2994 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2995 add_local_ifunc_entry): Revert last change.
2996 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2997
c9824451
AM
29982012-10-05 Alan Modra <amodra@gmail.com>
2999
3000 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3001 do_plt_address_for_global): New functions.
3002 (Output_data_got_powerpc::do_write): Don't segfault when linking
3003 statically.
3004 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3005 add_local_ifunc_entry): Return true on adding entry..
3006 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3007 glink->add_entry call. Remove unused symtab param. Adjust calls.
3008 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3009 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3010 set up symbols here.
3011 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3012 syms here. Do so even when no .iplt. Don't segfault when linking
3013 statically.
3014 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3015 new variants without reloc param.
3016 (Glink_sym_ent::Glink_sym_ent): Likewise.
3017 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3018 reloc when refs will resolve to plt call stub.
3019 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3020 R_PPC_PLTREL24 to resolve locally.
3021 (Target_powerpc::Scan::global): Correct ifunc handling.
3022 (Target_powerpc::Relocate::relocate): Correct local sym glink
3023 lookup. Don't destroy "value" when we have a plt call stub,
3024 and when checking plt call validity.
3025 (Target_powerpc::do_dynsym_value): Simplify.
3026
19fec8c1
AM
30272012-10-05 Alan Modra <amodra@gmail.com>
3028
3029 * i386.cc (Output_data_plt_i386::address_for_global,
3030 address_for_local): Add plt offset to returned value. Adjust uses.
3031 * sparc.cc (Output_data_plt_sparc::address_for_global,
3032 address_for_local): Likewise.
3033 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3034 address_for_local): Likewise.
3035 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3036 address_for_local): Likewise.
3037 * target.h (Target::plt_address_for_global, plt_address_for_local):
3038 Update comment.
3039 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3040 (Output_data_got::Got_entry::write): Nor here.
3041 * output.h: Comment fix.
3042
e867b647
WL
30432012-10-02 Jiong Wang <jiwang@tilera.com>
3044
3045 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3046 global_offset_table_ value for larget got.
3047 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3048
e5d5f5ed
AM
30492012-09-29 Alan Modra <amodra@gmail.com>
3050
3051 * powerpc.cc (Target_powerpc::iplt_): New output section.
3052 (Target_powerpc::iplt_section, make_iplt_section,
3053 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3054 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3055 Target_powerpc::plt_entry_count): Count iplt entries too.
3056 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3057 reloc section in constructor. New params.
3058 (Target_powerpc::make_plt_section): Create reloc section here instead.
3059 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3060 functions.
3061 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3062 (Output_data_glink::add_entry, find_entry): New functions to
3063 deal with local syms.
3064 (Glink_sym_ent): Add support for local syms.
3065 (Output_data_glink::do_write): Handle ifunc plt entries.
3066 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3067 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3068 (Target_powerpc::Relocate::relocate): Likewise.
3069 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3070
ec4dbad3
AM
30712012-09-25 Alan Modra <amodra@gmail.com>
3072
3073 * object.h (Sized_relobj_file::adjust_local_symbol,
3074 do_adjust_local_symbol): New functions.
3075 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3076 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3077 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3078 and irregular opd entry spacing.
3079 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3080 (Global_symbol_visitor_opd): New functor.
3081 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3082 on deleted opd entries.
3083
5c0b3823
WL
30842012-09-15 Jiong Wang <jiwang@tilera.com>
3085
3086 * tilegx.cc: New file.
3087 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3088 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3089 * configure.tgt: Add entries for tilegx*.
3090 * configure.ac: Likewise.
3091 * Makefile.in: Rebuild.
3092 * configure: Likewise.
3093 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3094 tilegx.
3095
bfdfa4cd
AM
30962012-09-13 Alan Modra <amodra@gmail.com>
3097
3098 * target-reloc.h (scan_relocs): Call scan.local for relocs
3099 against symbols in discarded sections. Pass is_discarded
3100 param.
3101 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3102 Add is_discarded param.
3103 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3104 is_discarded to flag opd entry as discarded. Don't emit dyn
3105 relocs on such entries.
3106 (Target_powerpc::Scan::global): Similarly detect and handle
3107 such opd entries.
3108 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3109 opd_ent_. Update all uses.
3110 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3111 (Target_powerpc::relocate_section): Zero out discarded opd
3112 entry relocs.
3113
d77a0555
ILT
31142012-09-12 Ian Lance Taylor <iant@google.com>
3115
3116 PR gold/14570
3117 * output.cc: Rename Output_data_got template parameter from size
3118 to got_size for all functions. Compile all variants of
3119 Output_data_got.
3120 (Output_data_got::Got_entry::write): Correct use of size for
3121 symbol value. Use local_is_tls rather than casting to
3122 Sized_relobj_file.
3123 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3124 (class Sized_relobj_file): Add do_local_is_tls.
3125 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3126
815a1205
AM
31272012-09-11 Alan Modra <amodra@gmail.com>
3128
3129 PR gold/14566
3130 * layout.cc (Layout::set_segment_offsets): When using
3131 common-page-size alignment, ensure we are on a new max-page-size
3132 page.
3133 * output.cc (Output_segment::set_section_addresses): Use
3134 abi_pagesize, not common_pagesize for relro boundary.
3135 (Output_segment::set_offset): Likewise.
3136
bd73a62d
AM
31372012-09-11 Alan Modra <amodra@gmail.com>
3138
3139 * output.h (Output_data_got::add_global_tls, add_local_tls,
3140 add_local_tls_pair): New functions.
3141 (Output_data_got::add_local_pair_with_rel): Remove second
3142 reloc param. Expand comment.
3143 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3144 use_plt_or_tls_offset_, similarly for constructor param.
3145 (Output_data_got::Got_entry::write): Add got_index param.
3146 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3147 add_local_tls_pair): New functions.
3148 (Output_data_got::Got_entry::write): Handle tls symbols
3149 with use_plt_or_tls_offset_ set specially.
3150 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3151 (Output_data_got::do_write): Replace iterator with index, pass
3152 index to entry write function.
3153 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3154 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3155 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3156 call.
3157 * i386.cc (Target_i386::Scan::local): Likewise.
3158 * sparc.cc (Target_sparc::Scan::local): Likewise.
3159 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3160 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3161 do_tls_offset_for_global): New functions.
3162 (Target_powerpc::Scan::local): Correct TLS relocations and got
3163 entry values.
3164 (Target_powerpc::Scan::global): Don't emit unnecessary
3165 dynamic relocations on TLS GOT entries.
3166
00716ab1
AM
31672012-09-10 Matthias Klose <doko@ubuntu.com>
3168
3169 * config.in: Disable sanity check for kfreebsd.
3170
c891b3f9
SA
31712012-09-10 Sterling Augustine <saugustine@google.com>
3172
3173 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3174 (Gdb_index::pubtypes_read): New parameter.
3175 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3176 to calls.
3177 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3178 pubtypes_object_.
3179
e81fea4d
AM
31802012-09-09 Alan Modra <amodra@gmail.com>
3181
3182 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3183 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3184 * gc.h (gc_process_relocs): Call target gc_add_reference.
3185 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3186 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3187 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3188 unnecessary cast.
3189 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3190 to cater for when we don't need code offset. Update use.
3191 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3192 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3193 set_opd_valid): New functions.
3194 (Target_powerpc::do_gc_add_reference): New function.
3195 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3196 stashed refs.
3197 (Target_powerpc::do_gc_mark_symbol): New function.
3198
d2d60eef
CC
31992012-09-06 Cary Coutant <ccoutant@google.com>
3200
3201 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3202 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3203 (Dwarf_die::skip_attributes): Likewise.
3204 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3205 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3206 (main): Call it.
3207 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3208
32ed4573
L
32092012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3210
3211 * testsuite/script_test_3.t: Add .got.plt output section
3212 statement.
3213 * testsuite/script_test_4.t: Likewise.
3214
f4baf0d4
AM
32152012-09-05 Alan Modra <amodra@gmail.com>
3216
3217 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3218 update all uses and lose "enum" when using type.
3219
864a1b56
AM
32202012-09-05 Alan Modra <amodra@gmail.com>
3221
3222 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3223 * configure: Regenerate.
3224 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3225 (plugin_final_layout.stdout): Likewise.
3226 (memory_test): Set page sizes to 0x1000.
3227 * testsuite/Makefile.in: Regenerate.
3228 * testsuite/discard_locals_test.sh: Add FIXME comment.
3229 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3230 * testsuite/pr14265.t: Add .got output section statement.
3231 * testsuite/script_test_2.t: Likewise.
3232 * testsuite/script_test_3.t: Likewise.
3233 * testsuite/script_test_4.t: Likewise.
3234 * testsuite/script_test_5.t: Likewise.
3235 * testsuite/script_test_6.t: Likewise.
3236 * testsuite/script_test_7.t: Likewise.
3237 * testsuite/script_test_9.t: Likewise.
3238
3ea0a085
AM
32392012-09-05 Alan Modra <amodra@gmail.com>
3240
3241 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3242 (Powerpc_relocate_functions::Status): New typedef.
3243 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3244 (Target_powerpc::Scan::local): Handle REL64.
3245 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3246 for REL32 and REL64.
3247 (Target_powerpc::symval_for_branch): New function, extracted from..
3248 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3249 checks. Report overflow errors.
3250
7404fe1b
AM
32512012-09-05 Alan Modra <amodra@gmail.com>
3252
3253 * object.h (Sized_relobj_file::emit_relocs): Delete.
3254 (Sized_relobj_file::emit_relocs_reltype): Delete.
3255 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3256 relocate_relocs for --emit-relocs.
3257 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3258 * output.h: Update comment.
3259 (Output_segment::first_section): New function.
3260 (Output_segment::first_section_load_address): Use first_section.
3261 * output.cc (Output_segment::first_section): New function extracted..
3262 (Output_segment::first_section_load_address): ..from here. Delete.
3263 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3264 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3265 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3266 adjust call to target.h function.
3267 * i386.cc (Target_i386): Likewise.
3268 * sparc.cc (Target_sparc): Likewise.
3269 * x86_64.cc (Target_x86_64): Likewise.
3270 * powerpc.cc (Target_powerpc): Likewise.
3271 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3272 first tls section has section symbol for optimised local dynamic
3273 output relocs.
3274 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3275 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3276 optimised tls code.
3277 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3278 Rename to relocate_relocs. Update error message.
3279
957564c9
AS
32802012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3281
3282 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3283 --just-symbols.
3284
dd93cd0a
AM
32852012-08-31 Alan Modra <amodra@gmail.com>
3286
3287 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3288 (Powerpc_relobj::toc_base_offset): New stub function.
3289 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3290 got_mod_index_offset to tlsld_got_offset. Update all refs.
3291 (Target_powerpc::Relocate::enum skip_tls): New.
3292 (Target_powerpc::call_tls_get_addr_): New var.
3293 (Target_powerpc::is_branch_reloc): Move to file scope.
3294 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3295 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3296 New functions.
3297 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3298 (powerpc_info): Correct common_pagesize for ppc64.
3299 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3300 (Powerpc_relocate_functions): Add overflow check enums and functions.
3301 Add non-shift version of rela, rela_ua. Delete all rel public
3302 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3303 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3304 addr16_ha3, addr14 functions.
3305 (Output_data_got_powerpc::add_constant_pair): New function.
3306 (Output_data_got_powerpc::got_base_offset): Likewise.
3307 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3308 (instruction constants): Sort, add some more.
3309 (Output_data_glink::do_write): Add and use Address typedef. Use
3310 object->toc_base_offset() stub for 64-bit.
3311 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3312 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3313 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3314 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3315 Always treat .opd relocs as against locally defined symbol.
3316 Correct condition for RELATIVE relocs.
3317 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3318 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3319 for 32-bit syms with a plt entry. Correct ppc64 toc base
3320 calculations. Handle TLS relocs, and more. Add overflow
3321 checking and adjust for Powerpc_relocate_functions changes.
3322 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3323 Reinstate --emit-relocs code with FIXME.
3324
a1373b60
AM
33252012-08-30 Alan Modra <amodra@gmail.com>
3326
3327 * layout.cc (Layout::set_segment_offsets): Set p_align to
3328 abi_pagesize, not common_pagesize.
3329 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3330 to determine whether file header can go in segment.
3331
703d02da
AM
33322012-08-30 Alan Modra <amodra@gmail.com>
3333
3334 * output.h (Output_reloc::Output_reloc <output section>): Add
3335 is_relative param. Adjust calls.
3336 (Output_reloc::add_output_section_relative): New functions.
3337 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3338 is_relative.
3339 (Output_reloc::symbol_value): Handle SECTION_CODE.
3340
16164a6b
ST
33412012-08-24 Sriraman Tallam <tmsriram@google.com>
3342
3343 * gold.cc (queue_middle_tasks): Call layout again when unique
3344 segments for sections is desired.
3345 * layout.cc (Layout::Layout): Initialize new members.
3346 (Layout::get_output_section_flags): New function.
3347 (Layout::choose_output_section): Call get_output_section_flags.
3348 (Layout::layout): Make output section for mapping to a unique segment.
3349 (Layout::insert_section_segment_map): New function.
3350 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3351 output sections marked so.
16164a6b
ST
3352 (Layout::segment_precedes): Check for unique segments when sorting.
3353 * layout.h (Layout::Unique_segment_info): New struct.
3354 (Layout::Section_segment_map): New typedef.
3355 (Layout::insert_section_segment_map): New function.
3356 (Layout::get_output_section_flags): New function.
3357 (Layout::is_unique_segment_for_sections_specified): New function.
3358 (Layout::set_unique_segment_for_sections_specified): New function.
3359 (Layout::unique_segment_for_sections_specified_): New member.
3360 (Layout::section_segment_map_): New member.
3361 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3362 Rename is_gc_pass_one to is_pass_one.
3363 Rename is_gc_pass_two to is_pass_two.
3364 Rename is_gc_or_icf to is_two_pass.
3365 Check for which pass based on whether symbols data is present.
3366 Make it two pass when unique segments for sections is desired.
3367 * output.cc (Output_section::Output_section): Initialize new
3368 members.
3369 * output.h (Output_section::is_unique_segment): New function.
3370 (Output_section::set_is_unique_segment): New function.
3371 (Output_section::is_unique_segment_): New member.
3372 (Output_section::extra_segment_flags): New function.
3373 (Output_section::set_extra_segment_flags): New function.
3374 (Output_section::extra_segment_flags_): New member.
3375 (Output_section::segment_alignment): New function.
3376 (Output_section::set_segment_alignment): New function.
3377 (Output_section::segment_alignment_): New member.
3378 (Output_segment::Output_segment): Initialize is_unique_segment_.
3379 (Output_segment::is_unique_segment): New function.
3380 (Output_segment::set_is_unique_segment): New function.
3381 (Output_segment::is_unique_segment_): New member.
3382 * plugin.cc (allow_unique_segment_for_sections): New function.
3383 (unique_segment_for_sections): New function.
3384 (Plugin::load): Add new functions to transfer vector.
3385 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3386 * Makefile.in: Regenerate.
3387 * testsuite/plugin_final_layout.sh: Check if unique segment
3388 functionality works.
3389 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3390 are available.
3391 (allow_unique_segment_for_sections): New global.
3392 (unique_segment_for_sections): New global.
3393 (claim_file_hook): Call allow_unique_segment_for_sections.
3394 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3395
1e2bee4f
CC
33962012-08-22 Cary Coutant <ccoutant@google.com>
3397
3398 * layout.cc (Layout::include_section): Don't assert on GROUP
3399 sections with --emit-relocs.
3400
1d5dfe78
CC
34012012-08-21 Cary Coutant <ccoutant@google.com>
3402
3403 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3404 if --export-dynamic-symbol names an undef symbol.
3405
c9269dff
AM
34062012-08-18 Alan Modra <amodra@gmail.com>
3407
3408 * powerpc.cc: Formatting and white space.
3409 (Powerpc_relobj): Rename got2_section_ to special_.
3410 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3411 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3412 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3413 (Target_powerpc): Add Address typedef and invalid_address. Use
3414 throughout.
3415 (Target_powerpc::is_branch_reloc): New function.
3416 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3417 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3418 for dst_mask, value and addend.
3419 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3420 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3421 (Output_data_glink::do_write): Correct toc base. Don't try to use
3422 uint16_t for 24-bit offset. Use get_output_section_offset and
3423 check return.
3424 (Target_powerpc::Scan::local): Handle more relocs.
3425 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3426 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3427 Plug in toc restoring insn after plt calls. Translate branches
3428 to function descriptor symbols to corresponding entry point.
3429 (Target_powerpc::relocate_for_relocatable): Check return from
3430 get_output_section_offset.
3431 * symtab.h: Comment typo.
3432
b1759dce
ILT
34332012-08-14 Ian Lance Taylor <iant@google.com>
3434
3435 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3436 unsupported_relocal_local to call unsupported_reloc_global.
3437
b9b2ae8b
NC
34382012-08-14 Nick Clifton <nickc@redhat.com>
3439
3440 PR ld/14265
3441 * script-sections.cc (Sections_element::output_section_name): Add
3442 keep return parameter.
3443 (Output_section_element::match_name): Add keep return parameter.
3444 Return the value of the keep_ member.
3445 * script-sections.h (class Output_section): Update
3446 output_section_name prototype.
3447 * layout.cc (Layout::keep_input_section): New public member
3448 function.
3449 (Layout::choose_output_section): Pass keep parameter to
3450 output_section_name.
3451 * layout.h (class Layout): Add keep_input_section.
3452 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3453 sections.
3454 * testsuite/Makefile.am: Add a test.
3455 * testsuite/Makefile.in: Regenerate.
3456 * testsuite/pr14265.c: Source file for the test.
3457 * testsuite/pr14265.t: Linker script for the test.
3458 * testsuite/pr14265.sh: Shell script for the test.
3459
921b5322
AM
34602012-08-14 Alan Modra <amodra@gmail.com>
3461
3462 * target.h (Target::output_section_name): New function.
3463 (Target::do_output_section_name): New function.
3464 * layout.cc (Layout::choose_output_section): Call the above.
3465 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3466
6ce78956
AM
34672012-08-14 Alan Modra <amodra@gmail.com>
3468
3469 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3470 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3471 for replace_constant call.
3472 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3473 (Output_data_glink::do_print_to_mapfile): New function.
3474 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3475 (Target_powerpc::Relocate::relocate): Likewise.
3476
d1a8cabd
AM
34772012-08-14 Alan Modra <amodra@gmail.com>
3478
3479 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3480 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3481 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3482 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3483 all references to shndx_. Handle special case for R_PPC_PLTREL24
3484 here.
3485 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3486 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3487 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3488 here.
3489 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3490 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3491
d83ce4e3
AM
34922012-08-12 Alan Modra <amodra@gmail.com>
3493
3494 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3495 (glink insn constants): Use uint32_t.
3496 (Output_data_glink::add_entry): Use insert, not [] operator.
3497
cf43a2fe
AM
34982012-08-11 Alan Modra <amodra@gmail.com>
3499
3500 * object.h (Sized_relobj_file::find_shdr): New function.
3501 (Sized_relobj_file::find_special_sections): New function.
3502 * object.cc (Sized_relobj_file::find_shdr): New function.
3503 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3504 (Sized_relobj_file::find_special_sections): New function, split out..
3505 (Sized_relobj_file::do_read_symbols): ..from here.
3506 * output.h (Output_data_got::replace_constant): New function.
3507 (Output_data_got::num_entries): New function.
3508 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3509 (Output_data_got::got_offset): Protected rather than private.
3510 (Output_data_got::replace_got_entry): New function.
3511 * output.cc (Output_data_got::replace_got_entry): New function.
3512 * powerpc.cc (class Powerpc_relobj): New.
3513 (class Powerpc_relocate_functions): Delete all psymval variants or
3514 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3515 Implement _ha functions using corresponding _hi function.
3516 (Powerpc_relobj::find_special_sections): New function.
3517 (Target_powerpc::do_make_elf_object): New function.
3518 (class Output_data_got_powerpc): New.
3519 (class Output_data_glink): New.
3520 (class Powerpc_scan_relocatable_reloc): New.
3521 Many more changes througout file.
3522
3c892704
NC
35232012-08-09 Nick Clifton <nickc@redhat.com>
3524
3525 * po/vi.po: Updated Vietnamese translation.
3526
82435b3b
ILT
35272012-08-07 Ian Lance Taylor <iant@google.com>
3528
3529 * layout.cc (Layout::add_target_dynamic_tags): If
3530 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3531 plt_rel.
3532
a6dc81d2
NC
35332012-07-30 Nick Clifton <nickc@redhat.com>
3534
3535 * po/gold.pot: Updated template.
3536 * po/es.po: Updated Spanish translation.
3537
f1415016
CC
35382012-07-18 Cary Coutant <ccoutant@google.com>
3539
3540 PR gold/14344
3541 * configure.ac: Add check for -gpubnames support.
3542 * configure: Regenerate.
3543 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3544 support; force -gno-pubnames.
3545 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3546 support.
3547 (gdb_index_test_4): New test.
3548 * testsuite/Makefile.in: Regenerate.
3549 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3550 * testsuite/gdb_index_test_2.sh: Likewise.
3551 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3552 * testsuite/gdb_index_test_4.sh: New script.
3553 * testsuite/gdb_index_test_comm.sh: New script with common code;
3554 don't look for space after colon.
3555
b7fd7c37
ST
35562012-07-16 Sriraman Tallam <tmsriram@google.com>
3557
3558 * gold.cc (queue_middle_tasks): Update function order only after
3559 deferred objects due to plugins are processed.
3560
1f3212db
ILT
35612012-07-11 Ian Lance Taylor <iant@google.com>
3562
3563 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3564 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3565 (Target_arm::scan_reloc_for_stub): Likewise.
3566 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3567 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3568 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3569 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3570 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3571
81c82a68
ILT
35722012-07-10 Dodji Seketeli <dodji@redhat.com>
3573 Ian Lance Taylor <iant@google.com>
3574
3575 PR gold/14309
3576 * configure.ac: Test whether std::tr1::hash<off_t> works.
3577 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3578 needed.
3579 * output.h (class Output_fill): Add virtual destructor.
3580 * configure, config.in: Rebuild.
3581
eabc84f4
RM
35822012-06-22 Roland McGrath <mcgrathr@google.com>
3583
3584 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3585
370e30b6
RÁE
35862012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3587
3588 * plugin.cc (Plugin::load): Handle position independent executables.
3589
fb1b895d
CC
35902012-06-06 Cary Coutant <ccoutant@google.com>
3591
3592 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3593 add .debug_macro.
3594 (lines_only_debug_sections): Likewise.
3595 (gdb_fast_lookup_sections): New static array.
3596 (is_gdb_debug_section): Rename formal parameter.
3597 (is_lines_only_debug_section): Likewise.
3598 (is_gdb_fast_lookup_section): New function.
3599 (Layout::include_section): Check for ".zdebug_" prefix; pass
3600 section name suffix to is_gdb_debug_section, et al.; check for
3601 fast-lookup sections when building .gdb_index.
3602 * options.h (--strip-debug-gdb): Update GDB version number.
3603
7c0640fa
CC
36042012-06-06 Cary Coutant <ccoutant@google.com>
3605
3606 * configure.ac: Add check for fallocate.
3607 * configure: Regenerate.
3608 * config.in: Regenerate.
3609
3610 * options.h (class General_options): Add --mmap-output-file and
3611 --posix-fallocate options.
3612 * output.cc: (posix_fallocate): Remove; replace with...
3613 (gold_fallocate): New function.
3614 (Output_file::map_no_anonymous): Call gold_fallocate.
3615 (Output_file::map): Check --mmap-output-file option.
3616
2a49eb69
DK
36172012-06-05 Jing Yu <jingyu@google.com>
3618
3619 * gold.h (textdomain): Add do {} to empty while(0).
3620 (bindtextdomain): Likewise.
3621
fad072ac
CC
36222012-06-04 Cary Coutant <ccoutant@google.com>
3623
3624 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3625 has_dynsym_index.
3626
8cc69fb6
ST
36272012-05-25 Sriraman Tallam <tmsriram@google.com>
3628
3629 * symtab.cc (Symbol_table::define_special_symbol):
3630 Initialize *poldsym to prevent uninitialized variable errors.
3631
1be75daa
CC
36322012-05-23 Cary Coutant <ccoutant@google.com>
3633
3634 * layout.cc (Layout::section_name_mapping): Add rules to handle
3635 exact match on .data.rel.ro.local or .data.rel.ro.
3636 (Layout::output_section_name): Check for exact matches.
3637
9b689de0
CC
36382012-05-23 Cary Coutant <ccoutant@google.com>
3639
3640 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3641 more carefully.
3642
b24fdbf5
CC
36432012-05-22 Cary Coutant <ccoutant@google.com>
3644
3645 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3646 object before exporting symbol.
3647
e550e1a2
L
36482012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3649
3650 * testsuite/tls_test.cc: Include "config.h" first.
3651 * testsuite/tls_test_c.c: Likewise.
3652
df7b86aa
NC
36532012-05-17 Daniel Richard G. <skunk@iskunk.org>
3654 Nick Clifton <nickc@redhat.com>
3655
3656 PR 14072
3657 * configure.in: Add check that sysdep.h has been included before
3658 any system header files.
3659 * configure: Regenerate.
3660 * config.in: Regenerate.
3661
1007b503
CC
36622012-05-14 Cary Coutant <ccoutant@google.com>
3663
3664 * layout.cc (Layout::make_output_section): Mark .tdata section
3665 as RELRO.
3666 * testsuite/relro_test.cc: Add a TLS variable.
3667
fd885f3a
L
36682012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3669
3670 PR gold/14091
3671 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3672 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3673 R_X86_64_64.
3674
80f5885c
CC
36752012-05-08 Cary Coutant <ccoutant@google.com>
3676
3677 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3678 (lines_only_debug_sections): Likewise.
3679
2e702c99
RM
36802012-05-02 Roland McGrath <mcgrathr@google.com>
3681
3682 * nacl.cc: New file.
3683 * nacl.h: New file.
3684 * Makefile.am (CCFILES, HFILES): Add them.
3685 * Makefile.in: Regenerate.
3686 * i386.cc (Output_data_plt_i386_nacl): New class.
3687 (Output_data_plt_i386_nacl_exec): New class.
3688 (Output_data_plt_i386_nacl_dyn): New class.
3689 (Target_i386_nacl): New class.
3690 (Target_selector_i386_nacl): New class.
3691 (target_selector_i386): Use it instead of Target_selector_i386.
3692 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3693 (Target_x86_64_nacl): New class.
3694 (Target_selector_x86_64_nacl): New class.
3695 (target_selector_x86_64, target_selector_x32): Use it instead of
3696 Target_selector_x86_64.
3697 * arm.cc (Output_data_plt_arm_nacl): New class.
3698 (Target_arm_nacl): New class.
3699 (Target_selector_arm_nacl): New class.
3700 (target_selector_arm, target_selector_armbe): Use it instead of
3701 Target_selector_arm.
3702
3703 * target-select.cc (select_target): Take new Input_file* and off_t
3704 arguments, pass them on to recognize method of selector.
3705 * object.cc (make_elf_sized_object): Update caller.
3706 * parameters.cc (parameters_force_valid_target): Likewise.
3707 * incremental.cc (make_sized_incremental_binary): Likewise.
3708 * target-select.h: Update decl.
3709 (Target_selector::recognize): Take new Input_file* argument,
3710 pass it on to do_recognize.
3711 (Target_selector::do_recognize): Take new Input_file* argument.
3712 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3713 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3714 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3715 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3716
3717 * target.h (Target::Target_info): New members isolate_execinstr
3718 and rosegment_gap.
3719 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3720 * arm.cc (Target_arm::arm_info): Update initializer.
3721 * i386.cc (Target_i386::i386_info): Likewise.
3722 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3723 * sparc.cc (Target_sparc::sparc_info): Likewise.
3724 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3725 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3726 * layout.cc (Layout::attach_allocated_section_to_segment):
3727 Take new const Target* argument. If target->isolate_execinstr(), act
3728 like --rosegment.
3729 (Layout::find_first_load_seg): Take new const Target* argument;
3730 if target->isolate_execinstr(), reject PF_X segments.
3731 (Layout::relaxation_loop_body): Update caller.
3732 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3733 reset file offset to zero when we hit LOAD_SEG, and then do a second
3734 loop over the segments before LOAD_SEG to reassign offsets after
3735 addresses have been determined. Handle target->rosegment_gap().
3736 (Layout::attach_section_to_segment): Take new const Target* argument;
3737 pass it to attach_allocated_section_to_segment.
3738 (Layout::make_output_section): Update caller.
3739 (Layout::attach_sections_to_segments): Take new const Target* argument;
3740 pass it to attach_section_to_segment.
3741 * gold.cc (queue_middle_tasks): Update caller.
3742 * layout.h (Layout): Update method decls with new arguments.
3743
3744 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3745 Target_info pointer to use.
3746 (Target_arm::do_make_data_plt): New virtual method.
3747 (Target_arm::make_data_plt): New method that calls it.
3748 (Target_arm::make_plt_entry): Use it.
3749 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3750 for the section alignment.
3751 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3752 method.
3753 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3754 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3755 method.
3756 (Output_data_plt_arm::get_plt_entry_size): Call it.
3757 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3758 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3759 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3760 method.
3761 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3762 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3763 method instead of sizeof(plt_entry).
3764 (Output_data_plt_arm::add_entry): Likewise.
3765 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3766 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3767 than static method.
3768 (Target_arm::plt_entry_size): Likewise.
3769 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3770 Move to ...
3771 (Output_data_plt_arm_standard): ... here, new class.
3772 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3773 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3774 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3775
3776 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3777 Take additional argument for the PLT entry size.
3778 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3779 Use get_plt_entry_size method rather than plt_entry_size variable.
3780 (Output_data_plt_x86_64::reserve_slot): Likewise.
3781 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3782 (Output_data_plt_x86_64::add_entry): Likewise.
3783 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3784 (Output_data_plt_x86_64::address_for_global): Likewise.
3785 (Output_data_plt_x86_64::address_for_local): Likewise.
3786 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3787 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3788 Make method non-static.
3789 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3790 method.
3791 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3792 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3793 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3794 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3795 virtual method.
3796 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3797 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3798 virtual method.
3799 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3800 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3801 virtual method.
3802 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3803 (Output_data_plt_x86_64::plt_entry_size)
3804 (Output_data_plt_x86_64::first_plt_entry)
3805 (Output_data_plt_x86_64::plt_entry)
3806 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3807 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3808 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3809 (Output_data_plt_x86_64_standard): ... here, new class.
3810 (Target_x86_64::Target_x86_64): Take optional argument for the
3811 Target_info pointer to use.
3812 (Target_x86_64::do_make_data_plt): New virtual method.
3813 (Target_x86_64::make_data_plt): New method to call it.
3814 (Target_x86_64::init_got_plt_for_update): Use that.
3815 Call this->plt_->add_eh_frame method here.
3816 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3817 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3818 rather than static method.
3819 (Target_x86_64::plt_entry_size): Likewise.
3820 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3821 rather than plt_entry_size variable. Move guts of PLT filling to...
3822 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3823 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3824 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3825
3826 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3827 additional argument for the section alignment.
3828 Don't do add_eh_frame_for_plt here.
3829 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3830 non-static. Use get_plt_entry_size method rather than plt_entry_size
3831 variable.
3832 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3833 method.
3834 (Output_data_plt_i386::get_plt_entry_size): Call it.
3835 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3836 (Output_data_plt_i386::add_eh_frame): New method to call it.
3837 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3838 method.
3839 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3840 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3841 method.
3842 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3843 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3844 method instead of plt_entry_size.
3845 (Output_data_plt_i386::plt_entry_size)
3846 (Output_data_plt_i386::plt_eh_frame_fde_size)
3847 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3848 (Output_data_plt_i386_standard): ... here, new class.
3849 (Output_data_plt_i386_exec): New class.
3850 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3851 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3852 (Output_data_plt_i386::exec_plt_entry): Move to ...
3853 (Output_data_plt_i386_exec::plt_entry): ... here.
3854 (Output_data_plt_i386_dyn): New class.
3855 (Output_data_plt_i386::first_plt_entry): Move to ...
3856 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3857 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3858 (Output_data_plt_i386_dyn::plt_entry): ... here.
3859 (Target_i386::Target_i386): Take optional argument for the Target_info
3860 pointer to use.
3861 (Target_i386::do_make_data_plt): New virtual method.
3862 (Target_i386::make_data_plt): New method to call it.
3863 (Target_i386::make_plt_section): Use that.
3864 Call this->plt_->add_eh_frame method here.
3865 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3866 rather than plt_entry_size variable.
3867 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3868 (Output_data_plt_i386::address_for_local): Likewise.
3869 (Output_data_plt_i386::do_write): Likewise.
3870 Move guts of PLT filling to...
3871 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3872 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3873 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3874 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3875
b9b9f2ee
CC
38762012-05-01 Cary Coutant <ccoutant@google.com>
3877
3878 * dwarf_reader.cc (Dwarf_die::read_attributes)
3879 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3880 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3881 * reduced_debug_output.cc
3882 (Output_reduced_debug_info_section::get_die_end): Remove
3883 DW_FORM_GNU_ref_index. Add default case.
3884
57923f48
MW
38852012-04-26 Mark Wielaard <mjw@redhat.com>
3886
3887 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3888 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3889 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3890 DW_AT_high_pc as offset from DW_AT_low_pc.
3891
3892 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3893 * testsuite/Makefile.in: Regenerate.
3894 * testsuite/gdb_index_test_3.c: New test source file.
3895 * testsuite/gdb_index_test_3.sh: New test source file.
3896
2c54b4f4
ILT
38972012-04-25 Ian Lance Taylor <iant@google.com>
3898
3899 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3900 pointer.
3901 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3902 as a class, not a struct.
3903 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3904 (Target_arm::apply_cortex_a8_workaround): Likewise.
3905 * gc.h: Declare Reloc_types as a struct, not a class.
3906 * object.h: Declare Symbols_data as a struct.
3907 * reloc.h: Declare Read_relocs_data as a struct.
3908 * target.h: Declare Relocate_info as a struct.
3909
a5a5f7a3
DM
39102012-04-24 David S. Miller <davem@davemloft.net>
3911
3912 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3913 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3914 and R_SPARC_WPLT30.
3915
f038d496
CC
39162012-04-24 Cary Coutant <ccoutant@google.com>
3917
3918 * incremental-dump.cc (find_input_containing_global): Replace
3919 magic number with symbolic constant.
3920 (dump_incremental_inputs): Update version number.
3921 * incremental.cc (Output_section_incremental_inputs): Update version
3922 number; import symbolic constants from Incremental_inputs_reader.
3923 (Incremental_inputs::create_data_sections): Align relocations
3924 section correctly for 64-bit targets.
3925 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3926 constants; add padding.
3927 (Output_section_incremental_inputs::write_header): Add assert for
3928 header_size.
3929 (Output_section_incremental_inputs::write_input_files): Add assert
3930 for input_entry_size.
3931 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3932 add assert for object_info_size, input_section_entry_size,
3933 global_sym_entry_size.
3934 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3935 for data structure sizes; use them.
3936 (Incremental_input_entry_reader): Import symbolic constants from
3937 Incremental_inputs_reader; use them.
3938
a4d85145
DM
39392012-04-23 David S. Miller <davem@davemloft.net>
3940
3941 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3942 and elf_flags_set_.
3943 (Target_sparc::Target_sparc): Initialize new fields.
3944 (Target_sparc::do_make_elf_object): New function.
3945 (Target_sparc::do_adjust_elf_header): New function.
3946
1d509098
CC
39472012-04-23 Cary Coutant <ccoutant@google.com>
3948
3949 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3950 CU range table of gdb index.
3951
7ebeff7f
DM
39522012-04-20 David S. Miller <davem@davemloft.net>
3953
3954 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3955 instead of false.
3956
13cf9988
DM
39572012-04-16 David S. Miller <davem@davemloft.net>
3958
2a1079e8
DM
3959 * sparc.cc (Target_sparc::got_address): New function.
3960 (Sparc_relocate_functions::gdop_hix22): New function.
3961 (Sparc_relocate_functions::gdop_lox10): New function.
3962 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3963 relocs.
3964 (Target_sparc::Scan::local): Likewise if the global symbol is not
3965 preemptible and is not IFUNC.
3966 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3967 transformations for local and non-preemptible non-IFUNC global
3968 symbols.
3969
0bc964fc
DM
3970 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3971 writing out 64-bit part of ranges.
3972
661d7a80
DM
3973 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3974 -fpic and -fpie respectively.
3975 * Makefile.in: Regenerate.
3976
8c2bf391
DM
3977 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3978 (Target_sparc::Target_sparc): Initialize new field.
3979 (Target_sparc::do_plt_section_for_global): New function.
3980 (Target_sparc::do_plt_section_for_local): New function.
3981 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3982 (Target_sparc::make_plt_section): New function, broken out of
3983 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3984 (Target_sparc::make_plt_entry): Call make_plt_section.
3985 (Target_sparc::make_local_ifunc_plt_entry): New function.
3986 (Target_sparc::rela_ifunc_section): New function.
3987 (Target_sparc::plt_section): Remove const.
3988 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3989 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3990 and ifunc_count_ fields.
3991 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3992 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3993 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3994 (Output_data_plt_sparc::rela_ifunc): New function.
3995 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3996 (Output_data_plt_sparc::has_ifunc_section): New function.
3997 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3998 (Output_data_plt_sparc::address_for_global): New function.
3999 (Output_data_plt_sparc::address_for_local): New function.
4000 (Output_data_plt_sparc::plt_index_to_offset): New function.
4001 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4002 and entry_count.
4003 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4004 entry_count.
4005 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4006 R_SPARC_JMP_IREL to switch.
4007 (Target_sparc::Scan::check_non_pic): Likewise.
4008 (Target_sparc::Scan::local): Handle IFUNC symbols.
4009 (Target_sparc::Scan::local): Likewise.
4010 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4011 and plt_address_for_local.
4012 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4013 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4014
13cf9988
DM
4015 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4016 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4017 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4018 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4019 global relocs too.
4020 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4021 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4022 calls.
4023 * sparc.cc (Target_sparc::Scan::global): Likewise.
4024 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4025
31821be0
CC
40262012-04-16 Cary Coutant <ccoutant@google.com>
4027
4028 * archive.cc (Library_base::should_include_member): Check for
4029 --export-dynamic-symbol.
4030 * options.h (class General_options): Add --export-dynamic-symbol.
4031 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4032 --export-dynamic-symbol.
4033 (Symbol_table::gc_mark_undef_symbols): Likewise.
4034 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4035
2615994e
DM
40362012-04-12 David S. Miller <davem@davemloft.net>
4037
4038 * sparc.cc (Reloc::wdisp10): New relocation method.
4039 (Reloc::h34): Likewise.
4040 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4041 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4042 R_SPARC_WDISP10.
4043 (Target_sparc::Scan::local): Likewise.
4044 (Target_sparc::Scan::global): Likewise.
4045 (Target_sparc::Relocate::relocate): Likewise.
4046
6782735d
CC
40472012-04-09 Cary Coutant <ccoutant@google.com>
4048
4049 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4050 low_pc == 0.
4051
8c7a0b00
ILT
40522012-04-06 Ian Lance Taylor <iant@google.com>
4053
4054 * timer.cc: #include <unistd.h>.
4055
58797674
RM
40562012-04-06 Roland McGrath <mcgrathr@google.com>
4057
4058 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4059 * config.in: Regenerate.
4060 * configure: Regenerate.
4061
44350750
NC
40622012-04-05 Nick Clifton <nickc@redhat.com>
4063
4064 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4065 (AM_LC_MESSAGES): Add.
4066 * aclocal.m4: Regenerate.
4067 * config.in: Regenerate.
4068 * configure: Regenerate.
4069
c1027032
CC
40702012-03-21 Cary Coutant <ccoutant@google.com>
4071
4072 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4073 * Makefile.in: Regenerate.
4074 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4075 (Sized_elf_reloc_mapper::symbol_section): New function.
4076 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4077 (make_elf_reloc_mapper): New function.
4078 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4079 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4080 (Dwarf_abbrev_table::do_get_abbrev): New function.
4081 (Dwarf_ranges_table::read_ranges_table): New function.
4082 (Dwarf_ranges_table::read_range_list): New function.
4083 (Dwarf_pubnames_table::read_section): New function.
4084 (Dwarf_pubnames_table::read_header): New function.
4085 (Dwarf_pubnames_table::next_name): New function.
4086 (Dwarf_die::Dwarf_die): New function.
4087 (Dwarf_die::read_attributes): New function.
4088 (Dwarf_die::skip_attributes): New function.
4089 (Dwarf_die::set_name): New function.
4090 (Dwarf_die::set_linkage_name): New function.
4091 (Dwarf_die::attribute): New function.
4092 (Dwarf_die::string_attribute): New function.
4093 (Dwarf_die::int_attribute): New function.
4094 (Dwarf_die::uint_attribute): New function.
4095 (Dwarf_die::ref_attribute): New function.
4096 (Dwarf_die::child_offset): New function.
4097 (Dwarf_die::sibling_offset): New function.
4098 (Dwarf_info_reader::check_buffer): New function.
4099 (Dwarf_info_reader::parse): New function.
4100 (Dwarf_info_reader::do_parse): New function.
4101 (Dwarf_info_reader::do_read_string_table): New function.
4102 (Dwarf_info_reader::lookup_reloc): New function.
4103 (Dwarf_info_reader::get_string): New function.
4104 (Dwarf_info_reader::visit_compilation_unit): New function.
4105 (Dwarf_info_reader::visit_type_unit): New function.
4106 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4107 Sized_elf_reloc_mapper.
4108 (Sized_dwarf_line_info::symbol_section): Remove function.
4109 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4110 (Sized_dwarf_line_info::read_line_mappings): Remove object
4111 parameter, adjust callers.
4112 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4113 * dwarf_reader.h: Include <sys/types.h>.
4114 (class Track_relocs): Remove forward declaration.
4115 (class Elf_reloc_mapper): New class.
4116 (class Sized_elf_reloc_mapper): New class.
4117 (class Dwarf_abbrev_table): New class.
4118 (class Dwarf_range_list): New class.
4119 (class Dwarf_ranges_table): New class.
4120 (class Dwarf_pubnames_table): New class.
4121 (class Dwarf_die): New class.
4122 (class Dwarf_info_reader): New class.
4123 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4124 (Sized_dwarf_line_info::symbol_section): Remove member function.
4125 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4126 base class.
4127 * gdb-index.cc: New source file.
4128 * gdb-index.h: New source file.
4129 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4130 and .debug_types sections, call Layout::add_to_gdb_index.
4131 (Sized_relobj_incr::do_section_name): Implement.
4132 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4133 return type; Implement.
4134 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4135 return type.
4136 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4137 parameter list and return type.
4138 (Sized_incr_dynobj::do_section_contents): Likewise.
4139 * layout.cc: Include gdb-index.h.
4140 (Layout::Layout): Initialize gdb_index_data_.
4141 (Layout::init_fixed_output_section): Check for .gdb_index section.
4142 (Layout::add_to_gdb_index): New function. Instantiate.
4143 * layout.h: Add forward declaration for class Gdb_index.
4144 (Layout::add_to_gdb_index): New member function.
4145 (Layout::gdb_index_data_): New data member.
4146 * main.cc: Include gdb-index.h.
4147 (main): Print statistics for gdb index.
4148 * object.cc (Object::section_contents): Move code into
4149 do_section_contents.
4150 (need_decompressed_section): Check for sections needed when building
4151 gdb index.
4152 (build_compressed_section_map): Likewise.
4153 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4154 gdb index.
4155 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4156 sections; call Layout::add_to_gdb_index.
4157 (Sized_relobj_file::do_decompressed_section_contents): Call
4158 do_section_contents directly.
4159 * object.h (Object::do_section_contents): Adjust parameter list and
4160 return type.
4161 (Object::do_decompressed_section_contents): Call do_section_contents
4162 directly.
4163 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4164 return type.
4165 * options.h (class General_options): Add --gdb-index option.
4166 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4167 list and return type.
4168 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4169 * reloc.h (Track_relocs::checkpoint): New function.
4170 (Track_relocs::reset): New function.
4171
4172 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4173 New test cases.
4174 * testsuite/Makefile.in: Regenerate.
4175 * testsuite/gdb_index_test.cc: New test source file.
4176 * testsuite/gdb_index_test_1.sh: New test source file.
4177 * testsuite/gdb_index_test_2.sh: New test source file.
4178
647f1574
DK
41792012-03-19 Doug Kwan <dougkwan@google.com>
4180
4181 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4182 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4183 __exidx_start and __exidx_end. Make symbol table parameter
4184 anonymous as it is not used.
4185 * gold.cc (queue_middle_tasks): Call target hook to define any
4186 target-specific symbols.
4187 * target.h (Target::define_standard_symbols): New method.
4188 (Target::do_define_standard_symbols): Same.
4189 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4190 * testsuite/Makefile.in: Regenerate.
4191 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4192 and __exidx_end.
4193 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4194 relocations are generated for __exidx_start and __exidx_end.
4195
7c6109da
DK
41962012-03-16 Doug Kwan <dougkwan@google.com>
4197
4198 * testsuite/Makefile.am: Disable test initpri3b.
4199 * testsuite/Makefile.in: Regenerate.
4200
7b8957f8
DK
42012012-03-15 Doug Kwan <dougkwan@google.com>
4202
4203 * arm.cc (Target_arm::got_section): Make .got section read-only
4204 if -z now is given.
4205
14dc9ef7
ILT
42062012-03-15 Ian Lance Taylor <iant@google.com>
4207
4208 PR gold/13850
4209 * layout.cc (Layout::make_output_section): Correctly mark
4210 SHT_INIT_ARRAY, et. al., as relro.
4211
fa40b62a
DK
42122012-03-14 Doug Kwan <dougkwan@google.com>
4213
4214 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4215 dynamic relocations for protected symbols in shared objects.
4216
fd325007
ILT
42172012-03-13 Ian Lance Taylor <iant@google.com>
4218
4219 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4220 keep the larger alignment.
4221
e8dd54e1
CC
42222012-03-12 Cary Coutant <ccoutant@google.com>
4223
4224 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4225 handling of DW_LNE_define_file.
4226
feb5f3b0
CC
42272012-03-12 Cary Coutant <ccoutant@google.com>
4228
4229 * reduced_debug_output.cc
4230 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4231 codes to switch.
4232
a1fb4256
CC
42332012-02-29 Cary Coutant <ccoutant@google.com>
4234
4235 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4236
5dd8762a
CC
42372012-02-29 Cary Coutant <ccoutant@google.com>
4238
4239 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4240 Call Object::decompressed_section_contents.
4241 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4242 New dtor.
4243 (Sized_dwarf_line_info::buffer_start_): New data member.
4244 * merge.cc (Output_merge_data::do_add_input_section): Call
4245 Object::decompressed_section_contents.
4246 (Output_merge_string::do_add_input_section): Likewise.
4247 * object.cc (need_decompressed_section): New function.
4248 (build_compressed_section_map): Decompress sections needed later.
4249 (Sized_relobj_file::do_decompressed_section_contents): New function.
4250 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4251 * object.h (Object::decompressed_section_contents): New function.
4252 (Object::discard_decompressed_sections): New function.
4253 (Object::do_decompressed_section_contents): New function.
4254 (Object::do_discard_decompressed_sections): New function.
4255 (Compressed_section_info): New type.
4256 (Compressed_section_map): Include decompressed section contents.
4257 (Sized_relobj_file::do_decompressed_section_contents): New function.
4258 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4259
7b5de7ee
CC
42602012-02-16 Cary Coutant <ccoutant@google.com>
4261
4262 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4263 * testsuite/Makefile.in: Regenerate.
4264
f9fa4a63
CC
42652012-02-14 Cary Coutant <ccoutant@google.com>
4266
4267 * options.cc (General_options::finalize): Disallow -pie and -static.
4268
2c175ebc
DK
42692012-02-03 Doug Kwan <dougkwan@google.com>
4270
4271 * arm.cc (Arm_relocate_functions::abs8,
4272 Arm_relocate_functions::abs16): Use
4273 Bits::has_signed_unsigned_overflow32.
4274 (Arm_relocate_functions::thm_abs8): Correct range of
4275 overflow check.
4276 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4277 in assertions.
4278
90cff06f
DK
42792012-02-02 Doug Kwan <dougkwan@google.com>
4280
4281 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4282 position independent outputs, not just shared objects.
4283
63887f3d
L
42842012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4285
4286 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4287 * configure: Regenerated.
4288
bef2b434
ILT
42892012-01-27 Ian Lance Taylor <iant@google.com>
4290
4291 * reloc.h (Bits): New class with static functions, copied from
4292 namespace utils in arm.cc.
4293 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4294 instead.
4295
c335b55d
L
42962012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4297
4298 * incremental.cc (write_info_blocks): Correct relocation offset.
4299
41194d9f
L
43002012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4301
4302 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4303 (Relocate::tls_gd_to_le): Likewise.
4304
1bae613c
L
43052012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4306
4307 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4308
24482ca0
L
43092012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4310
4311 * configure.ac: Check if -mcmodel=medium works.
4312 * configure: Regenerated.
4313
c2c7840a
CC
43142012-01-24 Cary Coutant <ccoutant@google.com>
4315
4316 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4317 definition and ...
4318 (read_unsigned_LEB_128_x): ... this new function.
4319 (read_signed_LEB_128): Replaced with inline definition and ...
4320 (read_signed_LEB_128_x): ... this new function.
4321 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4322 (read_unsigned_LEB_128): Add inline definition.
4323 (read_signed_LEB_128_x): New function.
4324 (read_signed_LEB_128): Add inline definition.
4325 * testsuite/Makefile.am (leb128_unittest): New unit test.
4326 * testsuite/Makefile.in: Regenerate.
4327 * testsuite/leb128_unittest.cc: New unit test.
4328
833de760 43292012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4330
4331 PR gold/13617
4332 * i386.cc (Target_i386::do_code_fill): When using a jmp
4333 instruction, pad with nop instructions.
4334 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4335
618d6666
L
43362012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4337
4338 * x86_64.cc (gc_process_relocs): Add typename on types used in
4339 template.
4340 (scan_relocs): Likewise.
4341 (relocate_section): Likewise.
4342 (apply_relocation): Likewise.
4343
3660ff06
L
43442012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4345
4346 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4347 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4348 under x32.
4349
fc51264f
L
43502012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4351
4352 * x86_64.cc: Initial support for x32.
4353
dd74ae06
CC
43542012-01-03 Cary Coutant <ccoutant@google.com>
4355
4356 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4357 Use abstract base class for GOT.
4358 * gold/output.h (class Output_data_got_base): New abstract base class.
4359 (class Output_data_got): Derive from new base class, adjust ctors.
4360 (Output_data_got::reserve_slot): Make virtual; rename to
4361 do_reserve_slot; Adjust callers.
4362 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4363 pointer to abstract base class.
4364 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4365
83896202
ILT
43662011-12-18 Ian Lance Taylor <iant@google.com>
4367
4368 * object.h (Relobj::local_symbol_value): New function.
4369 (Relobj::local_plt_offset): New function.
4370 (Relobj::local_has_got_offset): New function.
4371 (Relobj::local_got_offset): New function.
4372 (Relobj::set_local_got_offset): New function.
4373 (Relobj::do_local_symbol_value): New pure virtual function.
4374 (Relobj::do_local_plt_offset): Likewise.
4375 (Relobj::do_local_has_got_offset): Likewise.
4376 (Relobj::do_local_got_offset): Likewise.
4377 (Relobj::do_set_local_got_offset): Likewise.
4378 (Sized_relobj::do_local_has_got_offset): Rename from
4379 local_has_got_offset.
4380 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4381 (Sized_relobj::do_set_local_got_offset): Rename from
4382 set_local_got_offset.
4383 (Sized_relobj_file::do_local_plt_offset): Rename from
4384 local_plt_offset.
4385 (Sized_relobj_file::do_local_symbol_value): New function.
4386 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4387 local_plt_offset.
4388 * output.cc (Output_data_got::Got_entry::write): Change object to
4389 Relobj. Use local_symbol_value.
4390 (Output_data_got::add_global_with_rel): Change rel_dyn to
4391 Output_data_reloc_generic*. Use add_global_generic.
4392 (Output_data_got::add_global_with_rela): Remove. Change all
4393 callers to use add_global_with_rel.
4394 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4395 Output_data_reloc_generic*. Use add_global_generic.
4396 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4397 callers to use add_global_pair_with_rel.
4398 (Output_data_got::add_local): Change object to Relobj*.
4399 (Output_data_got::add_local_plt): Likewise.
4400 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4401 change rel_dyn to Output_data_reloc_generic*. Use
4402 add_local_generic.
4403 (Output_data_got::add_local_with_rela): Remove. Change all
4404 callers to use all_local_with_rel.
4405 (Output_data_got::add_local_pair_with_rel): Change object to
4406 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4407 add_output_section_generic.
4408 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4409 callers to use add_local_pair_with_rel.
4410 (Output_data_got::reserve_local): Change object to Relobj*.
4411 * output.h: (class Output_data_reloc_generic): Add pure virtual
4412 declarations for add_global_generic, add_local_generic,
4413 add_output_section_generic.
4414 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4415 functions for Output_data_reloc_generic. Update declarations for
4416 changes listed in output.cc.
4417 (class Output_data_got): Change template parameter to got_size.
4418 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4419 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4420 function.
4421 (Sized_relobj_incr::do_local_plt_offset): New function.
4422 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4423 add_global_generic.
4424
76677ad0
CC
44252011-12-17 Cary Coutant <ccoutant@google.com>
4426
4427 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4428 * resolve.cc (Symbol_table::resolve): Likewise.
4429 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4430 arrays.
4431 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4432
8b8dd8d5
ILT
44332011-12-16 Ian Lance Taylor <iant@google.com>
4434
4435 * output.h (Output_data_reloc_generic::add): Only call
4436 add_dynamic_reloc if this is a dynamic reloc section.
4437
d55525b9
L
44382011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4439
4440 PR gold/13505
4441 * target-reloc.h (apply_relocation): Replace <64, false> with
4442 <size, big_endian>.
4443
ff81c7c1
NC
44442011-11-25 Nick Clifton <nickc@redhat.com>
4445
4446 * po/it.po: New Italian translation.
4447
628f39be
SA
44482011-11-17 Sterling Augustine <saugustine@google.com>
4449
4450 * script.cc (script_include_directive): Implement.
4451 (read_script_file): New local variables name and search_path. Update
4452 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4453 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4454 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4455
98ef3ea4
SA
44562011-11-11 Sterling Augustine <saugustine@google.com>
4457
4458 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4459 (file_or_sections_cmd): Likewise.
4460
f4a8b6d7
DK
44612011-11-11 Doug Kwan <dougkwan@google.com>
4462
4463 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4464 if --just-symbols is given.
4465
29ab395d
DK
44662011-11-10 Doug Kwan <dougkwan@google.com>
4467
4468 PR gold/13362
4469 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4470 when processing data relocs.
4471 * reloc.h (Relocate_functions::rel_unaligned): New method.
4472 (Relocate_functions::pcrel_unaligned): Ditto.
4473 (Relocate_functions::rel32_unaligned): Ditto.
4474 (Relocate_functions::pcrel32_unaligned): Ditto.
4475
2c339f71
DK
44762011-11-09 Doug Kwan <dougkwan@google.com>
4477
4478 PR gold/13362
4479 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4480 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4481 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4482 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4483 (Relocate_functions::rel_unaligned): New.
4484 (Relocate_functions::rel32_unaligned): New.
4485 * target-reloc.h (relocate_for_relocatable): Add code to handle
4486 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4487 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4488 arm_unaligned_reloc_r): New targets.
4489 * testsuite/Makefile.in: Regenerate.
4490 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4491 linking.
4492
3f3cddf1
ILT
44932011-11-02 Ian Lance Taylor <iant@google.com>
4494
4495 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4496 NATIVE_LINKER.
4497 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4498 * options.cc (General_options::finalize): Use library search path
4499 from configure script if specified. If not native and no sysroot,
4500 only search TOOLLIBDIR.
4501 * options.h (Search_directory::Search_directory): Change name to
4502 const std::string&.
4503 (General_options::add_to_library_path_with_sysroot): Change arg to
4504 const std::string&.
4505 * configure, Makefile.in, config.in: Rebuild.
4506
a8e2273b
ILT
45072011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4508
4509 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4510 we are working around the ARM1176 Erratum.
4511 * options.h (General_options::fix_arm1176): Add option.
4512 * testsuite/Makefile.am: Add testcases, and keep current ones
4513 working.
4514 * testsuite/Makefile.in: Regenerate.
4515 * testsuite/arm_fix_1176.s: New file.
4516 * testsuite/arm_fix_1176.sh: Likewise.
4517
cd6eab1c
ILT
45182011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4519
4520 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4521 may_use_blx_.
4522 (Target_arm::may_use_blx): Remove method.
4523 (Target_arm::set_may_use_blx): Likewise.
4524 (Target_arm::may_use_v4t_interworking): New method.
4525 (Target_arm::may_use_v5t_interworking): Likewise.
4526 (Target_arm::may_use_blx_): Remove member variable.
4527 (Arm_relocate_functions::arm_branch_common): Check for v5T
4528 interworking.
4529 (Arm_relocate_functions::thumb_branch_common): Likewise.
4530 (Reloc_stub::stub_type_for_reloc): Likewise.
4531 (Target_arm::do_finalize_sections): Correct interworking checks.
4532 * testsuite/Makefile.am: Add new tests.
4533 * testsuite/Makefile.in: Regenerate.
4534 * testsuite/arm_farcall_arm_arm.s: New test.
4535 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4536 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4537 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4538 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4539 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4540 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4541 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4542
286adcf4
CC
45432011-10-31 Cary Coutant <ccoutant@google.com>
4544
4545 PR gold/13023
4546 * expression.cc (Expression::eval_with_dot): Add
4547 is_section_dot_assignment parameter.
4548 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4549 absolute and assigning to dot within a section.
4550 * script-sections.cc
4551 (Output_section_element_assignment::set_section_addresses): Pass
4552 dot_section to set_if_absolute.
4553 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4554 as is_section_dot_assignment flag to eval_with_dot.
4555 (Output_section_element_dot_assignment::set_section_addresses):
4556 Likewise.
4557 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4558 parameter. Also set value if relative to dot_section; set the
4559 symbol's output_section.
4560 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4561 parameter. Adjust all callers.
4562 (Expression::eval_maybe_dot): Likewise.
4563 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4564 Adjust all callers.
4565 * testsuite/script_test_2.t: Test assignment of an absolute value
4566 to dot within an output section element.
4567
9634ed06
CC
45682011-10-31 Cary Coutant <ccoutant@google.com>
4569
4570 * options.h (class General_options): Add --[no-]gnu-unique options.
4571 * symtab.cc (Symbol_table::sized_write_globals): Convert
4572 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4573
de4101c7
CC
45742011-10-31 Cary Coutant <ccoutant@google.com>
4575
4576 PR gold/13359
4577 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4578 unnecessary assertion.
4579 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4580
7257cc92
ST
45812011-10-31 Sriraman Tallam <tmsriram@google.com>
4582
4583 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4584 gc_mark_symbol.
4585 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4586 gc_mark_symbol.
4587 Change to just keep the section associated with symbol.
4588 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4589 they are externally visible and --export-dynamic is turned on.
4590 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4591
bfc34b3f
ILT
45922011-10-19 Ian Lance Taylor <iant@google.com>
4593
4594 PR gold/13163
4595 * script-sections.cc
4596 (Output_section_element_dot_assignment::needs_output_section): New
4597 function.
4598
ea0d8c47
ILT
45992011-10-19 Ian Lance Taylor <iant@google.com>
4600
4601 PR gold/13204
4602 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4603 --section-start option was seen.
4604 * options.h (General_options::any_section_start): New function.
4605
abd242a9
DM
46062011-10-18 David S. Miller <davem@davemloft.net>
4607
4608 PR binutils/13301
4609 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4610 member to track relocation locations that have moved during TLS
4611 reloc optimizations.
4612 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4613 (Target_sparc::Relocate::relocate): Adjust view down by 4
4614 bytes if it matches reloc_adjust_addr_.
4615 (Target_sparc::Relocate::relocate_tls): Always move the
4616 __tls_get_addr call delay slot instruction forward 4 bytes when
4617 performing relaxation.
4618
bab9090f
CC
46192011-10-18 Cary Coutant <ccoutant@google.com>
4620
4621 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4622 (Output_file::map_no_anonymous): Check for non-zero
4623 return code from posix_fallocate.
4624
f7c5b166
CC
46252011-10-17 Cary Coutant <ccoutant@google.com>
4626
4627 PR gold/13245
4628 * plugin.cc (is_visible_from_outside): Check for symbols
4629 referenced from dynamic objects.
4630 * resolve.cc (Symbol_table::resolve): Don't count references
4631 from dynamic objects as references from real ELF files.
4632 * testsuite/plugin_test_2.sh: Adjust expected result.
4633
b490c0bb
CC
46342011-10-17 Cary Coutant <ccoutant@google.com>
4635
4636 * gold.cc: Include timer.h.
4637 (queue_middle_tasks): Stamp time.
4638 (queue_final_tasks): Likewise.
4639 * main.cc (main): Store timer in parameters. Print timers
4640 for each pass.
4641 * parameters.cc (Parameters::Parameters): Initialize timer_.
4642 (Parameters::set_timer): New function.
4643 (set_parameters_timer): New function.
4644 * parameters.h (Parameters::set_timer): New function.
4645 (Parameters::timer): New function.
4646 (Parameters::timer_): New data member.
4647 (set_parameters_timer): New function.
4648 * timer.cc (Timer::stamp): New function.
4649 (Timer::get_pass_time): New function.
4650 * timer.h (Timer::stamp): New function.
4651 (Timer::get_pass_time): New function.
4652 (Timer::pass_times_): New data member.
4653
f475cf7b
CC
46542011-10-17 Cary Coutant <ccoutant@google.com>
4655
4656 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4657 task for members of lib groups.
4658
cdd7e244
CC
46592011-10-17 Cary Coutant <ccoutant@google.com>
4660
4661 PR gold/13288
4f95c8b4 4662 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4663 (File_read::make_view): Move bounds check (replace with assert)...
4664 (File_read::find_or_make_view): ... to here.
4665
dfb45471
CC
46662011-10-12 Cary Coutant <ccoutant@google.com>
4667
4f95c8b4 4668 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4669 ::read returns less than requested size.
4670
53bbcc1b
CC
46712011-10-10 Cary Coutant <ccoutant@google.com>
4672
4f95c8b4 4673 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4674 Initialize defined_count_.
4675 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4676 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4677 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4678 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4679 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4680 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4681 member.
4682 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4683 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4684 Return zeroes instead of internal error.
4685
397b129b
CC
46862011-10-10 Cary Coutant <ccoutant@google.com>
4687
4688 PR gold/13249
4f95c8b4 4689 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4690 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4691 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4692 (Output_reloc::type_): Adjust size of bit field.
4693 (Output_reloc::use_plt_offset_): New bit field.
4694 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4695 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4696 flag. Adjust all callers.
4f95c8b4 4697 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4698 creating RELATIVE relocations.
4699
d5698657
NC
47002011-10-10 Nick Clifton <nickc@redhat.com>
4701
4702 * po/es.po: Updated Spanish translation.
4703 * po/fi.po: Updated Finnish translation.
4704
6a59a5c2
DN
47052011-10-03 Diego Novillo <dnovillo@google.com>
4706
4707 * options.cc (parse_uint): Fix dereference of RETVAL.
4708
f0558624
ST
47092011-09-29 Sriraman Tallam <tmsriram@google.com>
4710
4711 * layout.h (section_order_map_): New member.
4712 (get_section_order_map): New member function.
4713 * output.cc (Output_section::add_input_section): Check for patterns
4714 only when --section-ordering-file is specified.
4715 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4716 output_sections have been formed.
4717 * layout.cc (Layout_Layout): Initialize section_order_map_.
4718 * plugin.cc (update_section_order): Store order in order_map. Do not
4719 update the order.
4720 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4721 * testsuite/Makefile.in: Regenerate.
4722 * testsuite/plugin_section_order.c: New file.
4723 * testsuite/plugin_final_layout.cc: New file.
4724 * testsuite/plugin_final_layout.sh: New file.
4725
a7dac153
CC
47262011-09-29 Cary Coutant <ccoutant@google.com>
4727
4f95c8b4 4728 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4729 Check for NULL.
4f95c8b4 4730 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4731 symbols during incremental update.
4732 (Symbol_table::add_from_dynobj): Likewise.
4733
eebd87a5
ILT
47342011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4735 Ian Lance Taylor <iant@google.com>
4736
4737 * symtab.cc (Symbol_table::define_special_symbol): Always
4738 canonicalize version string.
4739
403a3331
CC
47402011-09-26 Cary Coutant <ccoutant@google.com>
4741
4f95c8b4
CC
4742 * gold.cc (queue_initial_tasks): Move option checks ...
4743 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4744 some options; make others fatal.
4745
235061c2
CC
47462011-09-26 Cary Coutant <ccoutant@google.com>
4747
4748 gcc PR lto/47247
4749 * plugin.cc (get_symbols_v2): New function.
4750 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4751 (is_referenced_from_outside): New function.
4752 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4753 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4754 (get_symbols): Pass version parameter.
4755 (get_symbols_v2): New function.
4756 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4757 parameter.
4758 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4759 (onload): Add LDPT_GET_SYMBOLS_V2.
4760 (all_symbols_read_hook): Use get_symbols_v2; check for
4761 LDPR_PREVAILING_DEF_IRONLY_EXP.
4762 * testsuite/plugin_test_3.sh: Update expected results.
4763
dc87f620
ILT
47642011-09-23 Simon Baldwin <simonb@google.com>
4765
4766 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4767 configuration options.
4768 * configure: Regenerate.
4769 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4770 * Makefile.in: Regenerate.
4771 * testsuite/Makefile.in: Regenerate.
4772
a8279f82
ST
47732011-09-19 Sriraman Tallam <tmsriram@google.com>
4774
4775 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4776
0c9350c8
CC
47772011-09-19 Cary Coutant <ccoutant@google.com>
4778
4779 * incremental.cc (can_incremental_update): Fix typo in comment.
4780 * incremental.h (can_incremental_update): Likewise.
4781
aa06ae28
CC
47822011-09-18 Cary Coutant <ccoutant@google.com>
4783
4784 * incremental.cc (can_incremental_update): New function.
4785 * incremental.h (can_incremental_update): New function.
4786 * layout.cc (Layout::init_fixed_output_section): Call it.
4787 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4788 * object.cc (Sized_relobj_file::do_layout): Call
4789 can_incremental_update.
4790
ebb300b2
CC
47912011-09-13 Cary Coutant <ccoutant@google.com>
4792
4793 * configure.ac: Check for glibc support for gnu_indirect_function
4794 support with static linking, setting automake conditional
4795 IFUNC_STATIC.
4796 * Makefile.in: Regenerate.
4797 * configure: Regenerate.
4798
4799 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4800 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4801 for IFUNC_STATIC.
4802 * testsuite/Makefile.in: Regenerate.
4803
1206d0d5
CC
48042011-09-13 Cary Coutant <ccoutant@google.com>
4805
4806 * incremental.cc (Sized_relobj_incr::do_layout): Call
4807 report_comdat_group for kept comdat sections.
4808 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4809 * testsuite/Makefile.in: Regenerate.
4810 * testsuite/incr_comdat_test_1.cc: New source file.
4811 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4812 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4813 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4814
40b29874
ILT
48152011-09-13 Ian Lance Taylor <iant@google.com>
4816
4817 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4818 variable external_symbols_offset.
4819
1b045aac
ILT
48202011-09-12 Ian Lance Taylor <iant@google.com>
4821
4822 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4823 triggered if object has no symbols.
4824
24c6c55a
DM
48252011-09-09 David S. Miller <davem@davemloft.net>
4826
4827 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4828 (Output_fill_debug_line::do_write): Likewise.
4829
66570254
CC
48302011-08-29 Cary Coutant <ccoutant@google.com>
4831
4832 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4833 casts to match formatting specs.
4834 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4835
8ea8cd50
CC
48362011-08-26 Cary Coutant <ccoutant@google.com>
4837
4838 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4839 remaining hole size when allocating.
4840 (Layout::make_output_section): Set fill methods for debug sections.
4841 * layout.h (Free_list::Free_list_node): Move from private to
4842 public.
4843 (Free_list::set_min_hole_size): New function.
4844 (Free_list::begin, Free_list::end): New functions.
4845 (Free_list::min_hole_): New data member.
4846 * output.cc: Include dwarf.h.
4847 (Output_fill_debug_info::do_minimum_hole_size): New function.
4848 (Output_fill_debug_info::do_write): New function.
4849 (Output_fill_debug_line::do_minimum_hole_size): New function.
4850 (Output_fill_debug_line::do_write): New function.
4851 (Output_section::Output_section): Initialize new data member.
4852 (Output_section::set_final_data_size): Ensure patch space is larger
4853 than minimum hole size.
4854 (Output_section::do_write): Fill holes in debug sections.
4855 * output.h (Output_fill): New class.
4856 (Output_fill_debug_info): New class.
4857 (Output_fill_debug_line): New class.
4858 (Output_section::set_free_space_fill): New function.
4859 (Output_section::free_space_fill_): New data member.
4860 * testsuite/Makefile.am (incremental_test_3): Add
4861 --incremental-patch option.
4862 (incremental_test_4): Likewise.
4863 (incremental_test_5): Likewise.
4864 (incremental_test_6): Likewise.
4865 (incremental_copy_test): Likewise.
4866 (incremental_common_test_1): Likewise.
4867 * testsuite/Makefile.in: Regenerate.
4868
7cf80422
NC
48692011-08-26 Nick Clifton <nickc@redhat.com>
4870
4871 * po/es.po: Updated Spanish translation.
4872
c3f7b0e5
CC
48732011-08-01 Cary Coutant <ccoutant@google.com>
4874
4875 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4876 * gold/testsuite/Makefile.in: Regenerate.
4877 * gold/testsuite/justsyms_exec.c: New source file.
4878 * gold/testsuite/justsyms_lib.c: New source file.
4879
9590bf25
CC
48802011-08-01 Cary Coutant <ccoutant@google.com>
4881
4882 * layout.cc (Layout::set_segment_offsets): Don't realign text
4883 segment if -Ttext was specified.
4884 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4885 file type.
4886 * object.h (Sized_relobj_file::e_type): New function.
4887 (Sized_relobj_file::e_type_): New data member.
4888 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4889 base address for ET_EXEC files.
4890 * target.cc (Target::do_make_elf_object_implementation): Allow
4891 ET_EXEC files with --just-symbols option.
4892
dcd8d12e
CC
48932011-07-28 Cary Coutant <ccoutant@google.com>
4894
4895 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4896 Add thread_number parameter.
4897 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4898 * workqueue-threads.cc
4899 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4900 current thread if its thread number is greater than desired thread
4901 count.
4902 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4903 Add thread_number parameter.
4904 (Workqueue::should_cancel_thread): Likewise.
4905 (Workqueue::find_runnable_or_wait): Pass thread_number to
4906 should_cancel_thread.
4907 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4908 parameter.
4909
804eb480
ST
49102011-07-22 Sriraman Tallam <tmsriram@google.com>
4911
4912 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4913 only after checking if it cannot be forced local.
4914 * symtab.h (is_externally_visible): Check if the symbol is not forced
4915 local.
4916
f1ddb600
ILT
49172011-07-15 Ian Lance Taylor <iant@google.com>
4918
4919 * options.h (class General_options): Add --print-output-format.
4920 Move -EL next to -EB, for better --help output.
4921 * target-select.cc: Include <cstdio>, "options.h", and
4922 "parameters.h".
4923 (Target_selector::do_target_bfd_name): New function.
4924 (print_output_format): New function.
4925 * target-select.h (class Target_selector): Update declarations.
4926 (Target_selector::target_bfd_name): New function.
4927 (print_output_format): Declare.
4928 * main.cc: Include "target-select.h".
4929 (main): Handle --print-output-format.
4930 * gold.cc: Include "target-select.h".
4931 (queue_initial_tasks): Handle --print-output-format when there are
4932 no input files.
4933 * parameters.cc (parameters_force_valid_target): Give a better
4934 error message if -EB/-EL does not match target.
4935 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4936 function.
4937
7d172687
ILT
49382011-07-15 Ian Lance Taylor <iant@google.com>
4939
4940 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4941 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4942 (Output_data_plt_i386::do_write): Write address of .dynamic
4943 section to first entry in .got.plt section.
4944 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4945 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4946 Initialize layout_.
4947 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4948 section to first entry in .got.plt section.
4949 * layout.h (Layout::dynamic_section): New function.
4950
e9552f7e
ST
49512011-07-13 Sriraman Tallam <tmsriram@google.com>
4952
4953 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4954 to claim_file call.
4955 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4956 input_section_position_, and input_section_glob_.
4957 (read_layout_from_file): Call function section_ordering_specified.
4958 * layout.h (is_section_ordering_specified): New function.
4959 (section_ordering_specified): New function.
4960 (section_ordering_specified_): New boolean member.
4961 * main.cc(main): Call load_plugins after layout object is defined.
4962 * output.cc (Output_section::add_input_section): Use
4963 function section_ordering_specified to check if section ordering is
4964 needed.
4965 * output.cc (Output_section::add_relaxed_input_section): Use
4966 function section_ordering_specified to check if section ordering is
4967 needed.
4968 (Output_section::update_section_layout): New function.
4969 (Output_section::sort_attached_input_sections): Check if input section
4970 must be reordered.
4971 * output.h (Output_section::update_section_layout): New function.
4972 * plugin.cc (get_section_count): New function.
4973 (get_section_type): New function.
4974 (get_section_name): New function.
4975 (get_section_contents): New function.
4976 (update_section_order): New function.
58797674 4977 (allow_section_ordering): New function.
e9552f7e
ST
4978 (Plugin::load): Add the new interfaces to the transfer vector.
4979 (Plugin_manager::load_plugins): New parameter.
4980 (Plugin_manager::all_symbols_read): New parameter.
4981 (Plugin_manager::claim_file): New parameter. Save the elf object for
4982 unclaimed objects.
4983 (Plugin_manager::get_elf_object): New function.
4984 (Plugin_manager::get_view): Change to directly use the bool to check
4985 if get_view is called from claim_file_hook.
4986 * plugin.h (input_objects): New function
4987 (Plugin__manager::load_plugins): New parameter.
4988 (Plugin_manager::claim_file): New parameter.
4989 (Plugin_manager::get_elf_object): New function.
4990 (Plugin_manager::in_claim_file_handler): New function.
4991 (Plugin_manager::in_claim_file_handler_): New member.
4992 (layout): New function.
4993 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4994 handler with an extra parameter. Make the elf object before calling
4995 claim_file handler.
4996 * testsuite/plugin_test.c (get_section_count): New function pointer.
4997 (get_section_type): New function pointer.
4998 (get_section_name): New function pointer.
4999 (get_section_contents): New function pointer.
5000 (update_section_order): New function pointer.
5001 (allow_section_ordering): New function pointer.
5002 (onload): Check if the new interfaces exist.
5003
9446efde
ILT
50042011-07-13 Ian Lance Taylor <iant@google.com>
5005
5006 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5007 relro section.
5008 * x86_64.cc (Target_x86_64::got_section): Likewise.
5009 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5010 (relro_now_test_SOURCES): New variable.
5011 (relro_now_test_DEPENDENCIES): New variable.
5012 (relro_now_test_LDFLAGS): New variable.
5013 (relro_now_test_LDADD): New variable.
5014 (relro_now_test.so): New target.
5015 * testsuite/Makefile.in: Rebuild.
5016
07aa62f2
ILT
50172011-07-12 Ian Lance Taylor <iant@google.com>
5018
5019 PR gold/12980
5020 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5021 GLOB_DAT relocation rather than a RELATIVE relocation for a
5022 protected symbol when creating a shared library.
5023 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5024 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5025 * testsuite/protected_main_1.cc (main): Test that protected
5026 function has same address.
5027
e2153196
ILT
50282011-07-11 Ian Lance Taylor <iant@google.com>
5029
5030 PR gold/12979
5031 * options.h (class General_options): Add -Bgroup.
5032 * options.cc (General_options::finalize): If -Bgroup is set,
5033 default to --unresolved-symbols=report-all.
5034 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5035 * target-reloc.h (issue_undefined_symbol_error): Handle
5036 --unresolved-symbols=report-all.
5037
6daf5215
ILT
50382011-07-08 Ian Lance Taylor <iant@google.com>
5039
5040 PR gold/11985
5041 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5042 if linker script discards key sections.
5043 (Layout::create_dynamic_symtab): Likewise.
5044 (Layout::assign_local_dynsym_offsets): Likewise.
5045 (Layout::sized_create_version_sections): Likewise.
5046 (Layout::create_interp): Likewise.
5047 (Layout::finish_dynamic_section): Likewise.
5048 (Layout::set_dynamic_symbol_size): Likewise.
5049
beabb2c6
ILT
50502011-07-08 Ian Lance Taylor <iant@google.com>
5051
5052 PR gold/12386
5053 * options.h (class General_options): Add --unresolved-symbols.
5054 * target-reloc.h (issue_undefined_symbol_error): Check
5055 --unresolved-symbols. Add comments.
5056
9c16daf1
ILT
50572011-07-08 Ian Lance Taylor <iant@google.com>
5058
5059 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5060 expression more complex.
5061
191f1a2d
ILT
50622011-07-08 Ian Lance Taylor <iant@google.com>
5063
5064 PR gold/11317
5065 * target-reloc.h (issue_undefined_symbol_error): New inline
5066 function, broken out of relocate_section.
5067 (relocate_section): Call issue_undefined_symbol_error.
5068 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5069 there is no TLS segment if we are about to issue an undefined
5070 symbol error.
5071 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5072
62855347
ILT
50732011-07-08 Ian Lance Taylor <iant@google.com>
5074
5075 PR gold/12279
5076 * resolve.cc (Symbol_table::should_override): Add fromtype
5077 parameter. Change all callers. Give error when linking together
5078 TLS and non-TLS symbol.
5079 (Symbol_table::should_override_with_special): Add fromtype
5080 parameter. Change all callers.
5081 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5082 there is no TLS segment if we have reported some errors.
5083 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5084
67181c72
ILT
50852011-07-08 Ian Lance Taylor <iant@google.com>
5086
5087 PR gold/12372
5088 * target.h (Target::plt_address_for_global): New function.
5089 (Target::plt_address_for_local): New function.
5090 (Target::plt_section_for_global): Remove.
5091 (Target::plt_section_for_local): Remove.
5092 (Target::do_plt_address_for_global): New virtual function.
5093 (Target::do_plt_address_for_local): New virtual function.
5094 (Target::do_plt_section_for_global): Remove.
5095 (Target::do_plt_section_for_local): Remove.
5096 (Target::register_global_plt_entry): Add Symbol_table and Layout
5097 parameters.
5098 * output.cc (Output_data_got::Got_entry::write): Use
5099 plt_address_for_global and plt_address_for_local.
5100 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5101 address of output section.
5102 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5103 got_irelative_, and irelative_count_ fields. Update
5104 declarations.
5105 (Output_data_plt_i386::has_irelative_section): New function.
5106 (Output_data_plt_i386::entry_count): Add irelative_count_.
5107 (Output_data_plt_i386::set_final_data_size): Likewise.
5108 (class Target_i386): Add got_irelative_ and rel_irelative_
5109 fields. Update declarations.
5110 (Target_i386::Target_i386): Initialize new fields.
5111 (Target_i386::do_plt_address_for_global): New function replacing
5112 do_plt_section_for_global.
5113 (Target_i386::do_plt_address_for_local): New function replacing
5114 do_plt_section_for_local.
5115 (Target_i386::got_section): Create got_irelative_.
5116 (Target_i386::rel_irelative_section): New function.
5117 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5118 fields. Don't define __rel_iplt_{start,end}.
5119 (Output_data_plt_i386::add_entry): Add symtab and layout
5120 parameters. Change all callers. Use different PLT and GOT for
5121 IFUNC symbols.
5122 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5123 layout parameters. Change all callers. Use different PLT and
5124 GOT.
5125 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5126 (Output_data_plt_i386::rel_irelative): New function.
5127 (Output_data_plt_i386::address_for_global): New function.
5128 (Output_data_plt_i386::address_for_local): New function.
5129 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5130 IRELATIVE GOT when changing IFUNC GOT entries.
5131 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5132 reloc.
5133 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5134 if we didn't create an IRELATIVE GOT.
5135 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5136 plt_address_for_local.
5137 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5138 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5139 got_irelative_, and irelative_count_ fields. Update
5140 declarations.
5141 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5142 Initialize new fields. Remove symtab parameter. Change all
5143 callers.
5144 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5145 irelative_count_.
5146 (Output_data_plt_x86_64::has_irelative_section): New function.
5147 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5148 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5149 fields. Update declarations.
5150 (Target_x86_64::Target_x86_64): Initialize new fields.
5151 (Target_x86_64::do_plt_address_for_global): New function replacing
5152 do_plt_section_for_global.
5153 (Target_x86_64::do_plt_address_for_local): New function replacing
5154 do_plt_section_for_local.
5155 (Target_x86_64::got_section): Create got_irelative_.
5156 (Target_x86_64::rela_irelative_section): New function.
5157 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5158 all callers. Don't create __rel_iplt_{start,end}.
5159 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5160 parameters. Change all callers. Use different PLT and GOT for
5161 IFUNC symbols.
5162 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5163 layout parameters. Change all callers. Use different PLT and
5164 GOT.
5165 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5166 parameters. Change all callers. Use different PLT and GOT for
5167 IFUNC symbols.
5168 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5169 (Output_data_plt_x86_64::rela_irelative): New function.
5170 (Output_data_plt_x86_64::address_for_global): New function.
5171 (Output_data_plt_x86_64::address_for_local): New function.
5172 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5173 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5174 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5175 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5176 parameters.
5177 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5178 reloc.
5179 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5180 symbols if we didn't create an IRELATIVE GOT.
5181 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5182 plt_address_for_local.
5183 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5184 * testsuite/ifuncvar1.c: New test file.
5185 * testsuite/ifuncvar2.c: New test file.
5186 * testsuite/ifuncvar3.c: New test file.
5187 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5188 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5189 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5190 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5191 * testsuite/Makefile.in: Rebuild.
5192
33c15b45
CC
51932011-07-07 Cary Coutant <ccoutant@google.com>
5194
5195 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5196 (two_file_test_1_ndebug.o): Likewise.
5197 (two_file_test_1b_ndebug.o): Likewise.
5198 (two_file_test_2_ndebug.o): Likewise.
5199 (two_file_test_main_ndebug.o): Likewise.
5200 (incremental_test_2): Link with no-debug versions.
5201
f48b5fb7
CC
52022011-07-06 Cary Coutant <ccoutant@google.com>
5203
5204 * gold/incremental.cc
5205 (Output_section_incremental_inputs::write_info_blocks): Check for
5206 hidden and internal symbols.
5207
221597a5
CC
52082011-07-06 Cary Coutant <ccoutant@google.com>
5209
5210 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5211 Check disposition for startup file.
5212 (Incremental_inputs::report_command_line): Ignore
5213 --incremental-startup-unchanged option.
5214 * options.cc (General_options::parse_incremental_startup_unchanged):
5215 New function.
5216 (General_options::General_options): Initialize new data member.
5217 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5218 (General_options): Add --incremental-startup-unchanged option.
5219 (General_options::incremental_startup_disposition): New function.
5220 (General_options::incremental_startup_disposition_): New data member.
5221
e24719f6
CC
52222011-07-06 Cary Coutant <ccoutant@google.com>
5223
5224 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5225 input file index to Script_info ctor.
5226 (Sized_incremental_binary::do_file_has_changed): Find the
5227 command-line argument for files named in scripts.
5228 * incremental.h (Script_info::Script_info): New ctor
5229 with input file index.
5230 (Script_info::input_file_index): New function.
5231 (Script_info::input_file_index_): New data member.
5232 (Incremental_binary::get_library): Add const.
5233 (Incremental_binary::get_script_info): Add const.
5234 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5235 * testsuite/Makefile.am (incremental_test_5): New test case.
5236 (incremental_test_6): New test case.
5237 * testsuite/Makefile.in: Regenerate.
5238
8f7c81e8
CC
52392011-07-06 Cary Coutant <ccoutant@google.com>
5240
5241 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5242 debug output when command lines differ.
5243
9fbd3822
CC
52442011-07-06 Cary Coutant <ccoutant@google.com>
5245
5246 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5247 --incremental-patch option.
5248 * layout.cc (Free_list::allocate): Extend allocation beyond original
5249 end if enabled.
5250 (Layout::make_output_section): Mark sections that should get
5251 patch space.
5252 * options.cc (parse_percent): New function.
5253 * options.h (parse_percent): New function.
5254 (DEFINE_percent): New macro.
5255 (General_options): Add --incremental-patch option.
5256 * output.cc (Output_section::Output_section): Initialize new data
5257 members.
5258 (Output_section::add_input_section): Print section name when out
5259 of patch space.
5260 (Output_section::add_output_section_data): Likewise.
5261 (Output_section::set_final_data_size): Add patch space when
5262 doing --incremental-full.
5263 (Output_section::do_reset_address_and_file_offset): Remove patch
5264 space.
5265 (Output_segment::set_section_list_addresses): Print debug output
5266 only if --incremental-update.
5267 * output.h (Output_section::set_is_patch_space_allowed): New function.
5268 (Output_section::is_patch_space_allowed_): New data member.
5269 (Output_section::patch_space_): New data member.
5270 * parameters.cc (Parameters::incremental_full): New function.
5271 * parameters.h (Parameters::incremental_full): New function
5272 * testsuite/Makefile.am (incremental_test_2): Add test for
5273 --incremental-patch option.
5274 * testsuite/Makefile.in: Regenerate.
5275 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5276 (t18): Remove function body.
5277
f6cccc2c
DK
52782011-07-05 Doug Kwan <dougkwan@google.com>
5279
5280 PR gold/12771
5281 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5282 Arm_Address type for relocation result.
5283 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5284 overflow check.
5285 (Arm_relocate_functions::abs32): Use unaligned access.
5286 (Arm_relocate_functions::rel32): Ditto.
5287 (Arm_relocate_functions::prel31): Ditto.
5288 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5289 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5290 static data relocations.
5291 * testsuite/Makefile.in: Regnerate.
5292 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5293
28a13fec
ILT
52942011-07-05 Ian Lance Taylor <iant@google.com>
5295
5296 PR gold/12392
5297 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5298 symbols if necessary.
5299 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5300
24d47b34
ILT
53012011-07-05 Ian Lance Taylor <iant@google.com>
5302
5303 PR gold/12952
5304 * resolve.cc (Symbol::override_base_with_special): Simply override
5305 version with special symbol version, ignoring previous version.
5306
41f9cbbe
ILT
53072011-07-05 Ian Lance Taylor <iant@google.com>
5308
5309 * object.cc (Sized_relobj_file::include_section_group): Add
5310 information to comment about signature location.
5311
886288f1
ILT
53122011-07-02 Ian Lance Taylor <iant@google.com>
5313
5314 PR gold/12957
5315 * options.h (class General_options): Add -f and -F.
5316 * options.cc (General_options::finalize): Fatal error if -f/-F
5317 are used without -shared.
5318 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5319
ae3a6d4f
ILT
53202011-07-02 Ian Lance Taylor <iant@google.com>
5321
5322 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5323
21131061
ILT
53242011-07-01 Ian Lance Taylor <iant@google.com>
5325
5326 PR gold/12525
5327 PR gold/12952
5328 * resolve.cc (Symbol::override_base_with_special): Don't override
5329 the version if the overriding symbol has a different name.
5330 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5331 all callers. If we give an error about an undefined version,
5332 define the base version if necessary.
5333 * dynobj.h (class Versions): Update declaration.
5334 * testsuite/weak_alias_test_5.cc: New file.
5335 * testsuite/weak_alias_test.script: New file.
5336 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5337 and versioned_alias have the right value, and call t2.
5338 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5339 weak_alias_test_5.so.
5340 (weak_alias_test_LDADD): Likewise.
5341 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5342 * testsuite/Makefile.in: Rebuild.
5343
611062c0
ILT
53442011-07-01 Ian Lance Taylor <iant@google.com>
5345
5346 PR gold/12525
5347 * options.h (class General_options): Support -z notext.
5348 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5349 -Wl,-z,notext.
5350 (two_file_shared_nonpic.so): Likewise.
5351 (two_file_shared_mixed.so): Likewise.
5352 (two_file_shared_mixed_1.so): Likewise.
5353 (weak_undef_lib_nonpic.so): Likewise.
5354 (alt/weak_undef_lib_nonpic.so): Likewise.
5355 (tls_test_shared_nonpic.so): Likewise.
5356 * testsuite/Makefile.in: Rebuild.
5357
328c7c2f
ILT
53582011-07-01 Ian Lance Taylor <iant@google.com>
5359
5360 PR gold/12525
5361 * configure.ac: Test whether static linking works, setting
5362 the automake conditional HAVE_STATIC.
5363 * testsuite/Makefile.am: Disable tests using -static if
5364 HAVE_STATIC is not true.
5365 * configure, testsuite/Makefile.in: Rebuild.
5366
02d7cd44
ILT
53672011-07-01 Ian Lance Taylor <iant@google.com>
5368
5369 PR gold/12525
5370 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5371 Assert if we see DW_EH_PE_indirect.
5372 * target.h (Target::ehframe_datarel_base): New function.
5373 (Target::do_ehframe_datarel_base): New target function.
5374 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5375 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5376 function.
5377
07a60597
ILT
53782011-07-01 Ian Lance Taylor <iant@google.com>
5379
5380 PR gold/12571
5381 * options.h (class General_options): Add
5382 --ld-generated-unwind-info.
5383 * ehframe.cc (Fde::write): Add address parameter. Change all
5384 callers. If associated with PLT, fill in address and size.
5385 (Cie::set_output_offset): Only add merge mapping if there is an
5386 object.
5387 (Cie::write): Add address parameter. Change all callers.
5388 (Eh_frame::add_ehframe_for_plt): New function.
5389 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5390 input_offset_ fields into union u_, with new plt field.
5391 (Fde::Fde): Adjust for new union field.
5392 (Fde::Fde) [Output_data version]: New constructor.
5393 (Fde::add_mapping): Only add merge mapping if there is an object.
5394 (class Cie): Update declarations.
5395 (class Eh_frame): Declare add_ehframe_for_plt.
5396 * layout.cc (Layout::layout_eh_frame): Break out code into
5397 make_eh_frame_section, and call it.
5398 (Layout::make_eh_frame_section): New function.
5399 (Layout::add_eh_frame_for_plt): New function.
5400 * layout.h (class Layout): Update declarations.
5401 * merge.cc (Merge_map::add_mapping): Add assertion.
5402 * i386.cc: Include "dwarf.h".
5403 (class Output_data_plt_i386): Make first_plt_entry,
5404 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5405 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5406 and plt_eh_frame_fde.
5407 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5408 boundary. Call add_eh_frame_for_plt if appropriate.
5409 * x86_64.cc: Include "dwarf.h".
5410 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5411 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5412 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5413 and plt_eh_frame_fde.
5414 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5415 appropriate.
5416
14788a3f
ILT
54172011-06-29 Ian Lance Taylor <iant@google.com>
5418
5419 PR gold/12629
5420 * object.cc (Sized_relobj_file::layout_section): Change shdr
5421 parameter to be const.
5422 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5423 out of do_layout.
5424 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5425 appropriate. Call layout_eh_frame_section.
5426 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5427 sections.
5428 * object.h (class Sized_relobj_file): Update declarations.
5429
6c21fce1
ILT
54302011-06-29 Ian Lance Taylor <iant@google.com>
5431
37e41b03 5432 PR gold/12652
6c21fce1
ILT
5433 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5434 modifier.
5435 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5436
4d5e4e62
ILT
54372011-06-29 Ian Lance Taylor <iant@google.com>
5438
5439 PR gold/12675
5440 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5441 SHT_X86_64_UNWIND.
5442 * layout.cc (Layout::layout_eh_frame): Likewise.
5443
886f533a
ILT
54442011-06-29 Ian Lance Taylor <iant@google.com>
5445
5446 PR gold/12695
5447 * layout.cc (Layout::symtab_section_shndx): New function.
5448 * layout.h (class Layout): Declare symtab_section_shndx.
5449 * output.cc (Output_section::write_header): Call it.
5450
f3ae1b28
ILT
54512011-06-29 Ian Lance Taylor <iant@google.com>
5452
5453 PR gold/12818
5454 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5455 symbols which are not used in a relocation.
5456
aecf301f
ILT
54572011-06-28 Ian Lance Taylor <iant@google.com>
5458
5459 PR gold/12898
5460 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5461 script create indistinguishable segments.
5462 (Layout::set_segment_offsets): Use stable_sort when sorting
5463 segments. Pass this to Compare_segments constructor.
5464 * layout.h (class Layout): Make segment_precedes non-static.
5465 (class Compare_segments): Change from struct to class. Add
5466 layout_ field. Add constructor.
5467 * script-sections.cc
5468 (Script_sections::attach_sections_using_phdrs_clause): Rename
5469 local orphan to is_orphan. Don't report failure to put empty
5470 section in segment. On attachment failure, report name of
5471 section, and attach to first PT_LOAD segment.
5472
03ef7571
ILT
54732011-06-28 Ian Lance Taylor <iant@google.com>
5474
5475 PR gold/12934
5476 * target-select.cc (Target_selector::Target_selector): Add
5477 emulation parameter. Change all callers.
5478 (select_target_by_bfd_name): Rename from select_target_by_name.
5479 Change all callers.
5480 (select_target_by_emulation): New function.
5481 (supported_emulation_names): New function.
5482 * target-select.h (class Target_selector): Add emulation_ field.
5483 Update declarations.
5484 (Target_selector::recognize_by_bfd_name): Rename from
5485 recognize_by_name. Change all callers.
5486 (Target_selector::supported_bfd_names): Rename from
5487 supported_names. Change all callers.
5488 (Target_selector::recognize_by_emulation): New function.
5489 (Target_selector::supported_emulations): New function.
5490 (Target_selector::emulation): New function.
5491 (Target_selector::do_recognize_by_bfd_name): Rename from
5492 do_recognize_by_name. Change all callers.
5493 (Target_selector::do_supported_bfd_names): Rename from
5494 do_supported_names. Change all callers.
5495 (Target_selector::do_recognize_by_emulation): New function.
5496 (Target_selector::do_supported_emulations): New function.
5497 (select_target_by_bfd_name): Change name in declaration.
5498 (select_target_by_emulation): Declare.
5499 (supported_emulation_names): Declare.
5500 * parameters.cc (parameters_force_valid_target): Try to find
5501 target based on emulation from -m option.
5502 * options.h (class General_options): Change doc string for -m.
5503 * options.cc (help): Print emulations.
5504 (General_options::parse_V): Likewise.
5505 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5506 Add emulation parameter. Change all callers.
5507
200b2bb9
ILT
55082011-06-28 Ian Lance Taylor <iant@google.com>
5509
5510 * target.h (class Target): Add osabi_ field.
5511 (Target::osabi): New function.
5512 (Target::set_osabi): New function.
5513 (Target::Target): Initialize osabi_.
5514 (Target::do_adjust_elf_header): Make pure virtual.
5515 (Sized_target::do_adjust_elf_header): Declare.
5516 * target.cc (Sized_target::do_adjust_elf_header): New function.
5517 (class Sized_target): Instantiate all versions.
5518 * freebsd.h (class Target_freebsd): Remove.
5519 (Target_selector_freebsd::do_recognize): Call set_osabi on
5520 Target.
5521 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5522 (Target_selector_freebsd::set_osabi): Remove.
5523 * i386.cc (class Target_i386): Inherit from Sized_target rather
5524 than Target_freebsd.
5525 * x86_64.cc (class Target_x86_64): Likewise.
5526
b3ce541e
ILT
55272011-06-28 Ian Lance Taylor <iant@google.com>
5528
5529 * target.h (Target::can_check_for_function_pointers): Rewrite.
5530 Make non-virtual.
5531 (Target::can_icf_inline_merge_sections): Likewise.
5532 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5533 (Target::Target_info): Add can_icf_inline_merge_sections field.
5534 (Target::do_can_check_for_function_pointers): New virtual
5535 function.
5536 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5537 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5538 from can_check_for_function_pointers, move in file.
5539 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5540 section_may_have_icf_unsafe_poineters, move in file.
5541 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5542 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5543 Rename from can_check_for_function_pointers, move in file.
5544 (Target_i386::can_icf_inline_merge_sections): Remove.
5545 (Target_i386::i386_info): Initialize
5546 can_icf_inline_merge_sections.
5547 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5548 Initialize can_icf_inline_merge_sections.
5549 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5550 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5551 Rename from can_check_for_function_pointers, move in file.
5552 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5553 (Target_x86_64::x86_64_info): Initialize
5554 can_icf_inline_merge_sections.
5555 * testsuite/testfile.cc (Target_test::test_target_info):
5556 Likewise.
5557 * icf.cc (get_section_contents): Correct formatting.
5558
6d1c4efb
ILT
55592011-06-27 Ian Lance Taylor <iant@google.com>
5560
5561 * symtab.cc (Symbol::versioned_name): New function.
5562 (Symbol_table::add_to_final_symtab): Use versioned_name when
5563 appropriate.
5564 (Symbol_table::sized_write_symbol): Likewise.
5565 * symtab.h (class Symbol): Declare versioned_name.
5566 * stringpool.h (class Stringpool_template): Add variant of add
5567 which takes a std::basic_string.
5568 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5569 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5570 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5571 (ver_test_12.o): New target.
5572 * testsuite/Makefile.in: Rebuild.
5573
57eb9b50
DK
55742011-06-27 Doug Kwan <dougkwan@google.com>
5575
5576 * arm.cc (Arm_relocate_functions::thm_jump8,
5577 Arm_relocate_functions::thm_jump11): Use a wider signed
5578 type to compute offset.
5579 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5580 arm_thm_jump8.
5581 * testsuite/Makefile.in: Regenerate.
5582 * testsuite/arm_branch_in_range.sh: Check test results of
5583 arm_thm_jump11 and arm_thm_jump8.
5584 * testsuite/arm_thm_jump11.s: New test source file.
5585 * testsuite/arm_thm_jump11.t: New linker script.
5586 * testsuite/arm_thm_jump8.s: New test source file.
5587 * testsuite/arm_thm_jump8.t: New linker script.
5588
487b39df
ILT
55892011-06-24 Ian Lance Taylor <iant@google.com>
5590
5591 * layout.cc: Include "object.h".
5592 (ctors_sections_in_init_array): New static variable.
5593 (Layout::is_ctors_in_init_array): New function.
5594 (Layout::layout): Add entry to ctors_sections_in_init_array if
5595 appropriate.
5596 * layout.h (class Layout): Declare is_ctors_in_init_array.
5597 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5598 is_ctors_reverse_view is set.
5599 (Sized_relobj_file::write_sections): Add layout parameter. Change
5600 all callers. Set is_ctors_reverse_view field of View_size.
5601 (Sized_relobj_file::reverse_words): New function.
5602 * object.h (Sized_relobj_file::View_size): Add
5603 is_ctors_reverse_view field.
5604 (class Sized_relobj_file): Update declarations.
5605 * testsuite/initpri3.c: New test.
5606 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5607 initpri3b.
5608 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5609 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5610 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5611 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5612 * testsuite/Makefile.in: Rebuild.
5613
472076e4
CC
56142011-06-24 Cary Coutant <ccoutant@google.com>
5615
5616 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5617 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5618 (debug_msg_cdebug.err): New targets.
5619 * testsuite/Makefile.in: Regenerate.
5620 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5621 Fix checks for link with shared library.
5622
a60af0db
DK
56232011-06-24 Doug Kwan <dougkwan@google.com>
5624
5625 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5626 skip empty text sections.
5627 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5628
5393d741
ILT
56292011-06-22 Ian Lance Taylor <iant@google.com>
5630
5631 PR gold/12910
5632 * options.h (class General_options): Add --ctors-in-init-array.
5633 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5634 friends as SHT_PROGBITS for merging sections.
5635 (Layout::layout): Remove special handling of .init_array and
5636 friends. Don't sort if doing relocatable link. Sort for .ctors
5637 and .dtors if ctors_in_init_array.
5638 (Layout::make_output_section): Force correct section types for
5639 .init_array and friends. Don't sort if doing relocatable link,
5640 Don't sort .ctors and .dtors if ctors_in_init_array.
5641 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5642 (Layout::output_section_name): Add relobj parameter. Change all
5643 callers. Handle .ctors. and .dtors. in code rather than table.
5644 Handle .ctors and .dtors if ctors_in_init_array.
5645 (Layout::match_file_name): New function, moved from output.cc.
5646 * layout.h (class Layout): Update declarations.
5647 * output.cc: Include "layout.h".
5648 (Input_section_sort_entry::get_priority): New function.
5649 (Input_section_sort_entry::match_file_name): Just call
5650 Layout::match_file_name.
5651 (Output_section::Input_section_sort_init_fini_compare::operator()):
5652 Handle .ctors and .dtors. Sort by explicit priority rather than
5653 by name.
5654 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5655 * testsuite/initpri2.c: New test.
5656 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5657 (check_PROGRAMS): Add initpri2.
5658 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5659 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5660 * configure, testsuite/Makefile.in: Rebuild.
5661
e1f74f98
ILT
56622011-06-19 Ian Lance Taylor <iant@google.com>
5663
5664 PR gold/12880
5665 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5666 .interp section to a PT_INTERP segment even if we have seen a
5667 --dynamic-linker option. Don't do it if we have seen a PHDRS
5668 clause in a linker script.
5669 (Layout::finalize): Don't create a .interp section if we've
5670 already create a PT_INTERP segment.
5671 (Layout::create_interp): Always call choose_output_section (revert
5672 patch of 2011-06-17). Don't create PT_INTERP segment.
5673 * script-sections.cc
5674 (Script_sections::create_note_and_tls_segments): Add a .interp
5675 section to a PT_INTERP segment even if we have seen a
5676 --dynamic-linker option.
5677
766f91bb
ILT
56782011-06-18 Ian Lance Taylor <iant@google.com>
5679
5680 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5681 merely because a non-PT_LOAD segment has a dynamic reloc.
5682
0d212c3a
ILT
56832011-06-18 Ian Lance Taylor <iant@google.com>
5684
5685 * layout.cc (Layout::finish_dynamic_section): Don't create
5686 DT_FLAGS entry if not needed.
5687
911a5072
ILT
56882011-06-18 Ian Lance Taylor <iant@google.com>
5689
5690 PR gold/12745
5691 * layout.cc (Layout::layout_eh_frame): Correct handling of
5692 writable .eh_frame section.
5693
534b4e5f
ILT
56942011-06-17 Ian Lance Taylor <iant@google.com>
5695
5696 PR gold/12893
5697 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5698 symbol is redefined with the exact same object and value.
5699
10b4f102
ILT
57002011-06-17 Ian Lance Taylor <iant@google.com>
5701
5702 PR gold/12880
5703 * layout.h (class Layout): Add interp_segment_ field.
5704 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5705 (Layout::attach_allocated_section_to_segment): If making shared
5706 library, put .interp section in PT_INTERP segment.
5707 (Layout::finalize): Also call create_interp if -dynamic-linker
5708 option was used.
5709 (Layout::create_interp): Assert that there is no PT_INTERP
5710 segment. If not using a SECTIONS clause, use make_output_section.
5711 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5712 * script-sections.cc
5713 (Script_sections::create_note_and_tls_segments): If making shared
5714 library, put .interp section in PT_INTERP segment.
5715
a29b0dad
ILT
57162011-06-17 Ian Lance Taylor <iant@google.com>
5717
e588ea8d
ILT
5718 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5719 when making a shared library.
5720
57212011-06-17 Ian Lance Taylor <iant@google.com>
5722
5723 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5724 parameter. Change all callers. Don't issue warning about PC32
5725 against locally defined symbol.
a29b0dad 5726
9d3b0698
ILT
57272011-06-16 Ian Lance Taylor <iant@google.com>
5728
5729 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5730 occurs in same object.
5731
85b0f90c
AM
57322011-06-14 Alan Modra <amodra@gmail.com>
5733
5734 * po/POTFILES.in: Regenerate.
5735
a94907d9
ILT
57362011-06-09 Ian Lance Taylor <iant@google.com>
5737
5738 * script-sections.cc
5739 (Orphan_output_section::set_section_addresses): For a relocatable
5740 link set address to 0.
5741
4fb3a1c3
CC
57422011-06-09 Cary Coutant <ccoutant@google.com>
5743
5744 PR gold/12804
5745 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5746 used with --compress-debug-sections.
5747 * gold/object.cc (Sized_relobj_file::do_layout): Report
5748 uncompressed size of compressed input sections.
5749
61220854
CC
57502011-06-08 Cary Coutant <ccoutant@google.com>
5751
5752 PR gold/12804
5753 * testsuite/two_file_test_2_v1.cc: Change initialization of
5754 v2 to keep it in .data.
5755
e6455dfb
CC
57562011-06-07 Cary Coutant <ccoutant@google.com>
5757
5758 * common.cc (Symbol_table::do_allocate_commons_list): Call
5759 gold_fallback.
5760 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5761 (Errors::fallback): New function.
5762 (gold_fallback): New function.
5763 * errors.h (Errors::fallback): New function.
5764 * gold.cc (gold_exit): Change status parameter to enum; adjust
5765 all callers.
5766 (queue_initial_tasks): Call gold_fallback.
5767 * gold.h: Include cstdlib.
5768 (Exit_status): New enum type.
5769 (gold_exit): Change status parameter to enum.
5770 (gold_fallback): New function.
5771 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5772 (Layout::create_symtab_sections): Likewise.
5773 (Layout::create_shdrs): Likewise.
5774 * main.cc (main): Adjust call to gold_exit.
5775 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5776 (Output_data_got::add_got_entry_pair): Likewise.
5777 (Output_section::add_input_section): Likewise.
5778 (Output_section::add_output_section_data): Likewise.
5779 (Output_segment::set_section_list_addresses): Likewise.
5780 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5781
fb0e076f
CC
57822011-06-07 Cary Coutant <ccoutant@google.com>
5783
5784 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5785 for incremental links.
5786 * output.cc (Output_segment::set_section_list_addresses): Remove
5787 FIXME and test for TLS or BSS.
5788
a5ee4d5d
CC
57892011-06-07 Cary Coutant <ccoutant@google.com>
5790
5791 * testsuite/Makefile.am: Add incremental_copy_test,
5792 incremental_common_test_1.
5793 * testsuite/Makefile.in: Regenerate.
5794 * testsuite/common_test_1_v1.c: New source file.
5795 * testsuite/common_test_1_v2.c: New source file.
5796 * testsuite/copy_test_v1.cc: New source file.
5797
5146f448
CC
57982011-06-07 Cary Coutant <ccoutant@google.com>
5799
5800 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5801 update, allocate common from bss section's free list.
5802 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5803 linker-defined symbols.
5804 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5805 Skip GOT and PLT entries that are no longer referenced.
5806 (Output_section_incremental_inputs::write_info_blocks): Mark
5807 linker-defined symbols.
5808 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5809 * output.cc (Output_section::allocate): New function.
5810 * output.h (Output_section::allocate): New function.
5811 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5812 linker-defined symbols.
5813 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5814 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5815 (Symbol::init_base_output_data): Likewise.
5816 (Symbol::init_base_output_segment): Likewise.
5817 (Symbol::init_base_constant): Likewise.
5818 (Sized_symbol::init_output_data): Likewise.
5819 (Sized_symbol::init_output_segment): Likewise.
5820 (Sized_symbol::init_constant): Likewise.
5821 (Symbol_table::do_define_in_output_data): Likewise.
5822 (Symbol_table::do_define_in_output_segment): Likewise.
5823 (Symbol_table::do_define_as_constant): Likewise.
5824 * symtab.h (Symbol::is_predefined): New function.
5825 (Symbol::init_base_output_data): Add is_predefined parameter.
5826 (Symbol::init_base_output_segment): Likewise.
5827 (Symbol::init_base_constant): Likewise.
5828 (Symbol::is_predefined_): New data member.
5829 (Sized_symbol::init_output_data): Add is_predefined parameter.
5830 (Sized_symbol::init_output_segment): Likewise.
5831 (Sized_symbol::init_constant): Likewise.
5832 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5833
26d3c67d
CC
58342011-06-07 Cary Coutant <ccoutant@google.com>
5835
5836 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5837 instead of emit_copy_reloc.
5838 (Copy_relocs::emit_copy_reloc): Refactor.
5839 (Copy_relocs::make_copy_reloc): New function.
5840 (Copy_relocs::add_copy_reloc): Remove.
5841 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5842 section.
5843 (Copy_relocs::make_copy_reloc): New function.
5844 (Copy_relocs::add_copy_reloc): Remove.
5845 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5846 unchanged input files.
5847 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5848 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5849 Reserve BSS space for COPY relocations.
5850 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5851 (Output_section_incremental_inputs::write_info_blocks): Record
5852 whether a symbol is copied from a shared object.
5853 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5854 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5855 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5856 (Incremental_input_entry_reader::get_output_symbol_index): Add
5857 is_copy parameter.
5858 (Incremental_binary::emit_copy_relocs): New function.
5859 (Incremental_binary::do_emit_copy_relocs): New function.
5860 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5861 new data member.
5862 (Sized_incremental_binary::add_copy_reloc): New function.
5863 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5864 (Sized_incremental_binary::Copy_reloc): New struct.
5865 (Sized_incremental_binary::Copy_relocs): New typedef.
5866 (Sized_incremental_binary::copy_relocs_): New data member.
5867 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5868 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5869 * target.h (Sized_target::emit_copy_reloc): New function.
5870 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5871
7cdb37d9
CC
58722011-06-02 Cary Coutant <ccoutant@google.com>
5873
5874 PR gold/12163
5875 * gold/archive.cc (Archive::Archive): Initialize new data member.
5876 (Archive::include_all_members): Return if archive has already been
5877 included.
5878 * gold/archive.h (Archive::include_all_members_): New data member.
5879
cc643b88
NC
58802011-06-02 Nick Clifton <nickc@redhat.com>
5881
5882 * dynobj.h: Fix spelling mistake in comment.
5883 * output.cc: Likewise.
5884
f62a3ca7 58852011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5886 Asier Llano
f62a3ca7
DK
5887
5888 PR gold/12826
cc643b88 5889 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5890 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5891 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5892 redundant arm_exidx_test.so.
5893 * testsuite/Makefile.in: Regenerate.
5894 (check_SCRIPTS): Add pr12826.sh
5895 (check_DATA): Add pr12826.stdout
5896 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5897 * testsuite/pr12826.sh: New file.
5898 * testsuite/pr12826_1.s: Ditto.
5899 * testsuite/pr12826_1.s: Ditto.
5900
8dbe1edc
ILT
59012011-05-30 Ian Lance Taylor <iant@google.com>
5902
5903 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5904 sections.
5905
c49875be
ILT
59062011-05-29 Ian Lance Taylor <iant@google.com>
5907
5908 PR gold/12804
5909 * testsuite/Makefile.am: Use different file name for two_file_test
5910 temporary file for each incremental test.
5911 * testsuite/Makefile.in: Rebuild.
5912
69d53f7a
ILT
59132011-05-29 Ian Lance Taylor <iant@google.com>
5914
5915 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5916 binary input file is empty.
5917
41d0ab5f
ILT
59182011-05-27 Ian Lance Taylor <iant@google.com>
5919
5920 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5921 (ver_test_9.so): Likewise.
5922 * testsuite/Makefile.in: Rebuild.
5923
89d8a36b
CC
59242011-05-26 Cary Coutant <ccoutant@google.com>
5925
5926 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5927 * incremental.cc (Incremental_inputs::report_input_section): Fix
5928 comment, indentation.
5929 (Incremental_inputs::report_comdat_group): New function.
5930 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5931 of data for incremental input file entry.
5932 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5933 group count, COMDAT group signatures.
5934 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5935 an unchanged input file.
5936 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5937 Initialize new data member.
5938 (Incremental_object_entry::add_comdat_group): New function.
5939 (Incremental_object_entry::get_comdat_group_count): New function.
5940 (Incremental_object_entry::get_comdat_signature_key): New function.
5941 (Incremental_object_entry::groups_): New data member.
5942 (Incremental_inputs::report_comdat_group): New function.
5943 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5944 data for incremental input file entry.
5945 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5946 (Incremental_input_entry_reader::get_input_section): Adjust size of
5947 data for incremental input file entry.
5948 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5949 (Incremental_input_entry_reader::get_comdat_group_signature): New
5950 function.
5951 * object.cc (Sized_relobj::include_section_group): Report kept
5952 COMDAT groups for incremental links.
5953
1706a06f
ILT
59542011-05-24 David Meyer <pdox@google.com>
5955
5956 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5957 with name parameter. Add found_name parameter.
5958 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5959 * dirsearch.h (class Dirsearch): Update declaration.
5960
a10ae760
ILT
59612011-05-24 Ian Lance Taylor <iant@google.com>
5962
5963 * archive.cc (Library_base::should_include_member): Pull in object
5964 from archive if it defines the entry symbol.
5965 * parameters.cc (Parameters::entry): New function.
5966 * parameters.h (class Parameters): Declare entry.
5967 * output.h (class Output_file_header): Remove entry_ field.
5968 * output.cc (Output_file_header::Output_file_header): Remove entry
5969 parameter. Change all callers.
5970 (Output_file_header::entry): Use parameters->entry.
5971 * gold.cc (queue_middle_tasks): Likewise.
5972 * plugin.cc (Plugin_hook::run): Likewise.
5973
aa92d6ed
CC
59742011-05-24 Cary Coutant <ccoutant@google.com>
5975
5976 * gold.cc (queue_initial_tasks): Pass incremental base filename
5977 to Output_file::open_base_file; don't print error message.
5978 * incremental-dump.cc (main): Adjust call to
5979 Output_file::open_for_modification.
5980 * incremental-dump.cc (main): Likewise.
5981 * incremental.cc (Incremental_inputs::report_command_line):
5982 Ignore --incremental-base option when comparing command lines.
5983 Ignore parameter when given as separate argument.
5984 * options.h (class General_options): Add --incremental-base.
5985 * output.cc (Output_file::Output_file):
5986 (Output_file::open_base_file): Add base_name and writable parameters;
5987 read base file into new file; print error message here.
5988 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5989 callers.
5990 * output.h (Output_file::open_for_modification): Rename to...
5991 (Output_file::open_base_file): ...this; add base_name and
5992 writable parameters; adjust all callers.
5993 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5994 callers.
5995 * testsuite/Makefile.am (incremental_test_4): Test
5996 --incremental-base.
5997 * testsuite/Makefile.in: Regenerate.
5998
2eedd706
CC
59992011-05-24 Cary Coutant <ccoutant@google.com>
6000
6001 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6002 incremental_test_4.
6003 * testsuite/Makefile.in: Regenerate.
6004 * testsuite/two_file_test_1_v1.cc: New test source file.
6005 * testsuite/two_file_test_1b_v1.cc: New test source file.
6006 * testsuite/two_file_test_2_v1.cc: New test source file.
6007
0f1c85a6
CC
60082011-05-24 Cary Coutant <ccoutant@google.com>
6009
6010 * dynobj.h (Dynobj::do_dynobj): New function.
6011 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6012 flag and soname for shared objects.
6013 * incremental.cc (Incremental_inputs::report_object): Make
6014 either Incremental_object_entry or Incremental_dynobj_entry; add
6015 soname to string table.
6016 (Incremental_inputs::report_input_section): Add assertion.
6017 (Output_section_incremental_inputs::set_final_data_size): Adjust
6018 type of input file entry for shared libraries; adjust size of
6019 shared library info entry.
6020 (Output_section_incremental_inputs::write_input_files): Write
6021 as_needed flag for shared libraries.
6022 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6023 of input file entry for shared libraries; write soname.
6024 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6025 soname from incremental info.
6026 * incremental.h (enum Incremental_input_flags): Add
6027 INCREMENTAL_INPUT_AS_NEEDED.
6028 (Incremental_input_entry::Incremental_input_entry): Initialize new
6029 data member.
6030 (Incremental_input_entry::set_as_needed): New function.
6031 (Incremental_input_entry::as_needed): New function.
6032 (Incremental_input_entry::do_dynobj_entry): New function.
6033 (Incremental_input_entry::as_needed_): New data member.
6034 (Incremental_object_entry::Incremental_object_entry): Don't check
6035 for shared library.
6036 (Incremental_object_entry::do_type): Likewise.
6037 (class Incremental_dynobj_entry): New class.
6038 (Incremental_input_entry_reader::as_needed): New function.
6039 (Incremental_input_entry_reader::get_soname): New function.
6040 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6041 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6042 size of shared library info entry.
58797674 6043 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6044 incremental link when adding DT_NEEDED entries.
6045 * object.h (Object::Object): Initialize new data member.
6046 (Object::dynobj): New function.
6047 (Object::set_as_needed): New function.
6048 (Object::as_needed): New function.
6049 (Object::do_dynobj): New function.
6050 (Object::as_needed_): New data member.
6051
6fa2a40b
CC
60522011-05-24 Cary Coutant <ccoutant@google.com>
6053
6054 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6055 info; adjust display of GOT entries.
6056 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6057 vector of input objects; remove file_status_.
6058 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6059 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6060 got_plt reader; call target hooks to reserve GOT entries.
6061 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6062 of input file info header and GOT info entry.
6063 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6064 relocation info.
6065 (Got_plt_view_info::got_descriptor): Remove.
6066 (Got_plt_view_info::sym_index): New data member.
6067 (Got_plt_view_info::input_index): New data member.
6068 (Local_got_offset_visitor::visit): Write input file index.
6069 (Global_got_offset_visitor::visit): Write 0 for input file index.
6070 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6071 with sym_index and input_index.
6072 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6073 incremental info GOT entry; replace got_descriptor with input_index.
6074 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6075 map from input file index to object.
6076 (Sized_relobj_incr::do_layout): Replace direct data member reference
6077 with accessor function.
6078 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6079 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6080 Adjust size of input file info header.
6081 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6082 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6083 (Incremental_input_entry_reader::get_input_section): Adjust size of
6084 input file info header.
6085 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6086 of incremental info GOT entry.
6087 (Incremental_got_plt_reader::get_got_desc): Remove.
6088 (Incremental_got_plt_reader::get_got_symndx): New function.
6089 (Incremental_got_plt_reader::get_got_input_index): New function.
6090 (Sized_incremental_binary::Sized_incremental_binary): Remove
6091 file_status_; add input_objects_.
6092 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6093 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6094 (Sized_incremental_binary::file_is_unchanged): Remove.
6095 (Sized_incremental_binary::set_input_object): New function.
6096 (Sized_incremental_binary::input_object): New function.
6097 (Sized_incremental_binary::file_status_): Remove.
6098 (Sized_incremental_binary::input_objects_): New data member.
6099 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6100 references.
6101 (Sized_relobj_incr::invalid_address): Move to base class.
6102 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6103 class.
6104 (Sized_relobj_incr::do_output_section_offset): Likewise.
6105 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6106 (Sized_relobj_incr::section_offsets_): Likewise.
6107 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6108 function.
6109 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6110 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6111 with accessor function.
6112 (Sized_relobj_file::do_layout): Likewise.
6113 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6114 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6115 (Sized_relobj_file::compute_final_local_value): Replace refs to
6116 section_offsets_ with accessor function.
6117 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6118 * object.h (Relobj::Relobj): Initialize new data members.
6119 (Relobj::add_dyn_reloc): New function.
6120 (Relobj::first_dyn_reloc): New function.
6121 (Relobj::dyn_reloc_count): New function.
6122 (Relobj::first_dyn_reloc_): New data member.
6123 (Relobj::dyn_reloc_count_): New data member.
6124 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6125 references.
6126 (Sized_relobj::Address): New typedef.
6127 (Sized_relobj::invalid_address): Move here from child class.
6128 (Sized_relobj::Sized_relobj): Initialize new data members.
6129 (Sized_relobj::sized_relobj): New function.
6130 (Sized_relobj::is_output_section_offset_invalid): Move here from
6131 child class.
6132 (Sized_relobj::get_output_section_offset): Likewise.
6133 (Sized_relobj::local_has_got_offset): Likewise.
6134 (Sized_relobj::local_got_offset): Likewise.
6135 (Sized_relobj::set_local_got_offset): Likewise.
6136 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6137 (Sized_relobj::clear_got_offsets): New function.
6138 (Sized_relobj::section_offsets): Move here from child class.
6139 (Sized_relobj::do_output_section_offset): Likewise.
6140 (Sized_relobj::do_set_section_offset): Likewise.
6141 (Sized_relobj::Local_got_offsets): Likewise.
6142 (Sized_relobj::local_got_offsets_): Likewise.
6143 (Sized_relobj::section_offsets_): Likewise.
6144 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6145 references.
6146 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6147 class.
6148 (Sized_relobj_file::sized_relobj): New function
6149 (Sized_relobj_file::local_has_got_offset): Move to base class.
6150 (Sized_relobj_file::local_got_offset): Likewise.
6151 (Sized_relobj_file::set_local_got_offset): Likewise.
6152 (Sized_relobj_file::get_output_section_offset): Likewise.
6153 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6154 (Sized_relobj_file::do_output_section_offset): Likewise.
6155 (Sized_relobj_file::do_set_section_offset): Likewise.
6156 (Sized_relobj_file::Local_got_offsets): Likewise.
6157 (Sized_relobj_file::local_got_offsets_): Likewise.
6158 (Sized_relobj_file::section_offsets_): Likewise.
6159 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6160 (all constructors).
6161 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6162 (Output_reloc::get_symbol_index): Likewise.
6163 (Output_reloc::local_section_offset): Likewise.
6164 (Output_reloc::get_address): Likewise.
6165 (Output_reloc::symbol_value): Likewise.
6166 (Output_data_got::reserve_slot): Move to class definition.
6167 (Output_data_got::reserve_local): New function.
6168 (Output_data_got::reserve_slot_for_global): Remove.
6169 (Output_data_got::reserve_global): New function.
6170 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6171 (all constructors, two instantiations).
6172 (Output_reloc::get_relobj): New function (two instantiations).
6173 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6174 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6175 (Output_data_reloc::add_global): Adjust type of relobj.
6176 (Output_data_reloc::add_global_relative): Likewise.
6177 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6178 (Output_data_reloc::add_local): Likewise.
6179 (Output_data_reloc::add_local_relative): Likewise.
6180 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6181 (Output_data_reloc::add_local_section): Likewise.
6182 (Output_data_reloc::add_output_section): Likewise.
6183 (Output_data_reloc::add_absolute): Likewise.
6184 (Output_data_reloc::add_target_specific): Likewise.
6185 (Output_data_got::reserve_slot): Move definition here.
6186 (Output_data_got::reserve_local): New function.
6187 (Output_data_got::reserve_global): New function.
6188 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6189 section_offsets_ with accessor function.
6190 (Sized_relobj_file::write_sections): Likewise.
6191 (Sized_relobj_file::do_relocate_sections): Likewise.
6192 * target.h (Sized_target::reserve_local_got_entry): New function.
6193 (Sized_target::reserve_global_got_entry): New function.
6194 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6195 (Target_x86_64::reserve_global_got_entry): New function.
6196 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6197
4829d394
CC
61982011-05-23 Cary Coutant <ccoutant@google.com>
6199
6200 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6201 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6202 bit when checking got_type.
6203 * incremental.cc (Sized_incremental_binary::setup_readers):
6204 Store symbol table and string table locations; initialize bit vector
6205 of file status flags.
6206 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6207 unchanged files.
6208 (Sized_incremental_binary::do_process_got_plt): New function.
6209 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6210 (Output_section_incremental_inputs::set_final_data_size): Record
6211 file index for each input file.
6212 (Output_section_incremental_inputs::write_got_plt): Store file index
6213 instead of input entry offset for each GOT entry.
6214 * incremental.h
6215 (Incremental_input_entry::Incremental_input_entry): Initialize new
6216 data member.
6217 (Incremental_input_entry::set_offset): Store file index.
6218 (Incremental_input_entry::get_file_index): New function.
6219 (Incremental_input_entry::file_index_): New data member.
6220 (Incremental_binary::process_got_plt): New function.
6221 (Incremental_binary::do_process_got_plt): New function.
6222 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6223 data members.
6224 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6225 (Sized_incremental_binary::set_file_is_unchanged): New function.
6226 (Sized_incremental_binary::file_is_unchanged): New function.
6227 (Sized_incremental_binary::do_process_got_plt): New function.
6228 (Sized_incremental_binary::file_status_): New data member.
6229 (Sized_incremental_binary::main_symtab_loc_): New data member.
6230 (Sized_incremental_binary::main_strtab_loc_): New data member.
6231 * output.cc (Output_data_got::Got_entry::write): Add case
6232 RESERVED_CODE.
6233 (Output_data_got::add_global): Call add_got_entry.
6234 (Output_data_got::add_global_plt): Likewise.
6235 (Output_data_got::add_global_with_rel): Likewise.
6236 (Output_data_got::add_global_with_rela): Likewise.
6237 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6238 (Output_data_got::add_global_pair_with_rela): Likewise.
6239 (Output_data_got::add_local): Call add_got_entry.
6240 (Output_data_got::add_local_plt): Likewise.
6241 (Output_data_got::add_local_with_rel): Likewise.
6242 (Output_data_got::add_local_with_rela): Likewise.
6243 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6244 (Output_data_got::add_local_pair_with_rela): Likewise.
6245 (Output_data_got::reserve_slot): New function.
6246 (Output_data_got::reserve_slot_for_global): New function.
6247 (Output_data_got::add_got_entry): New function.
6248 (Output_data_got::add_got_entry_pair): New function.
6249 (Output_section::add_output_section_data): Edit FIXME.
6250 * output.h
6251 (Output_section_data_build::Output_section_data_build): New
6252 constructor with size parameter.
6253 (Output_data_space::Output_data_space): Likewise.
6254 (Output_data_got::Output_data_got): Initialize new data member; new
6255 constructor with size parameter.
6256 (Output_data_got::add_constant): Call add_got_entry.
6257 (Output_data_got::reserve_slot): New function.
6258 (Output_data_got::reserve_slot_for_global): New function.
6259 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6260 (Output_data_got::add_got_entry): New function.
6261 (Output_data_got::add_got_entry_pair): New function.
6262 (Output_data_got::free_list_): New data member.
6263 * target.h (Sized_target::init_got_plt_for_update): New function.
6264 (Sized_target::register_global_plt_entry): New function.
6265 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6266 Initialize new data member; call init; add constructor with PLT count.
6267 (Output_data_plt_x86_64::init): New function.
6268 (Output_data_plt_x86_64::add_relocation): New function.
6269 (Output_data_plt_x86_64::reserve_slot): New function.
6270 (Output_data_plt_x86_64::free_list_): New data member.
6271 (Target_x86_64::init_got_plt_for_update): New function.
6272 (Target_x86_64::register_global_plt_entry): New function.
6273 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6274 incremental updates.
6275 (Output_data_plt_x86_64::add_relocation): New function.
6276 * testsuite/object_unittest.cc (Object_test): Set default options.
6277
ec69d6da
ILT
62782011-05-16 Ian Lance Taylor <iant@google.com>
6279
6280 * options.h (class General_options): Make -i a synonym for -r.
6281
732e31de
ILT
62822011-05-16 Ian Lance Taylor <iant@google.com>
6283
6284 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6285
403676b5
CC
62862011-05-10 Cary Coutant <ccoutant@google.com>
6287
6288 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6289 strip_all (-s).
6290
5b7b7d6e
ILT
62912011-05-06 Ian Lance Taylor <iant@google.com>
6292
6293 * layout.cc (Layout::layout): If the output section flags change,
6294 update the ordering.
6295
f0f9babf
CC
62962011-04-25 Cary Coutant <ccoutant@google.com>
6297
6298 * incremental-dump.cc (dump_incremental_inputs): Print local
6299 symbol info for each input file.
6300 * incremental.cc
6301 (Output_section_incremental_inputs::set_final_data_size): Add local
6302 symbol info to input file entries in incremental info.
6303 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6304 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6305 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6306 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6307 implementation.
6308 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6309 (Sized_incr_relobj::do_relocate): Write the local symbols.
6310 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6311 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6312 Adjust size of input file header.
6313 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6314 (Incremental_inputs_reader::get_local_symbol_count): New function.
6315 (Incremental_inputs_reader::get_input_section): Adjust size of input
6316 file header.
6317 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6318 (Sized_incr_relobj::This): New typedef.
6319 (Sized_incr_relobj::sym_size): New const data member.
6320 (Sized_incr_relobj::Local_symbol): New struct.
6321 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6322 (Sized_incr_relobj::do_local_symbol_offset): New function.
6323 (Sized_incr_relobj::local_symbol_count_): New data member.
6324 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6325 (Sized_incr_relobj::local_symbol_index_): New data member.
6326 (Sized_incr_relobj::local_symbol_offset_): New data member.
6327 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6328 (Sized_incr_relobj::local_symbols_): New data member.
6329 * object.h (Relobj::output_local_symbol_count): New function.
6330 (Relobj::local_symbol_offset): New function.
6331 (Relobj::do_output_local_symbol_count): New function.
6332 (Relobj::do_local_symbol_offset): New function.
6333 (Sized_relobj::do_output_local_symbol_count): New function.
6334 (Sized_relobj::do_local_symbol_offset): New function.
6335
d0a9ace3
ILT
63362011-04-22 Vladimir Simonov <sv@sw.ru>
6337
6338 * descriptors.cc (set_close_on_exec): New function.
6339 (Descriptors::open): Use set_close_on_exec.
6340 * output.cc (S_ISLNK): Define if not defined.
6341
94a3fc8b
CC
63422011-04-22 Cary Coutant <ccoutant@google.com>
6343
6344 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6345 global symbol map.
6346 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6347 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6348 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6349 relocations.
6350 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6351 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6352 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6353 * incremental.h
6354 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6355 function.
6356 (Incremental_binary::apply_incremental_relocs): New function.
6357 (Incremental_binary::do_apply_incremental_relocs): New function.
6358 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6359 data member.
6360 (Sized_incremental_binary::add_global_symbol): New function.
6361 (Sized_incremental_binary::global_symbol): New function.
6362 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6363 (Sized_incremental_binary::symbol_map_): New data member.
6364 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6365 * target.h (Sized_target::apply_relocation): New function.
6366 * target-reloc.h (apply_relocation): New function.
6367 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6368
c87e4302
DK
63692011-04-22 Doug Kwan <dougkwan@google.com>
6370
6371 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6372 flag of a SHT_ARM_EXIDX section.
2e702c99 6373 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6374 * testsuite/Makefile.in: Regenerate.
6375 * testsuite/arm_exidx_test.s: New file.
6376 * testsuite/arm_exidx_test.sh: Same.
6377
e7782cf6
CC
63782011-04-20 Cary Coutant <ccoutant@google.com>
6379
6380 PR gold/12689
6381 * archive.h (Incremental_archive_entry::Archive_member):
6382 Initialize arg_serial_ (second constructor).
6383
308ecdc7
ILT
63842011-04-17 Ian Lance Taylor <iant@google.com>
6385
6386 * object.cc (Relocate_info::location): Simplify location string.
6387 * errors.cc (Errors::error_at_location): Don't print program
6388 name.
6389 (Errors::warning_at_location): Likewise.
6390 (Errors::undefined_symbol): Likewise.
6391 * testsuite/debug_msg.sh: Update accordingly.
6392
bec5b579
CC
63932011-04-14 Cary Coutant <ccoutant@google.com>
6394
6395 * gold/layout.cc (Layout::symtab_section_offset): New function.
6396 * gold/layout.h (Layout::symtab_section_offset): New function.
6397 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6398
88597d34
ILT
63992011-04-12 Ian Lance Taylor <iant@google.com>
6400
6401 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6402 with MREMAP_MAYMOVE.
6403 * output.h (class Output_file): Add map_is_allocated_ field.
6404 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6405 not available, provide stubs. If mremap is not available, #define
6406 it to gold_mremap.
6407 (MREMAP_MAYMOVE): Define if not defined.
6408 (Output_file::Output_file): Initialize map_is_allocated_.
6409 (Output_file::resize): Check map_is_allocated_.
6410 (Output_file::map_anonymous): If mmap fails, use malloc.
6411 (Output_file::unmap): Don't do anything for an anonymous map.
6412 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6413 is not available, provide stubs.
6414 (File_read::View::~View): Use free rather than delete[].
6415 (File_read::make_view): Use malloc rather than new[]. If mmap
6416 fails, use malloc.
6417 (File_read::find_or_make_view): Use malloc rather than new[].
6418 * gold.h: Remove HAVE_REMAP code.
6419 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6420 exists. Rename mremap to gold_mremap. If mmap is not available
6421 don't do anything.
6422 * configure, config.in: Rebuild.
6423
11e361bc
ILT
64242011-04-11 Ian Lance Taylor <iant@google.com>
6425
6426 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6427 initialize local variable v.
6428
cdc29364
CC
64292011-04-11 Cary Coutant <ccoutant@google.com>
6430
6431 * archive.cc (Archive::include_member): Adjust call to
6432 report_object.
6433 (Add_archive_symbols::run): Track argument serial numbers.
6434 (Lib_group::include_member): Likewise.
6435 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6436 * archive.h (Incremental_archive_entry::Archive_member):
6437 Initialize arg_serial_.
6438 (Archive_member::arg_serial_): New data member.
6439 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6440 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6441 incremental link.
6442 (Sized_dynobj::do_for_all_local_got_entries): New function.
6443 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6444 function.
6445 * fileread.cc (get_mtime): New function.
6446 * fileread.h (get_mtime): New function.
6447 * gold.cc (queue_initial_tasks): Check for incremental update.
6448 (process_incremental_input): New function.
6449 (queue_middle_tasks): Don't force valid target for incremental
6450 update.
6451 * incremental-dump.cc (find_input_containing_global): Adjust
6452 size of symbol info entry.
6453 (dump_incremental_inputs): Dump argument serial number and
6454 in_system_directory flag; bias shndx by 1; print symbol names
6455 when dumping per-file symbol lists; use new symbol info readers.
6456 * incremental.cc
6457 (Output_section_incremental_inputs:update_data_size): New function.
6458 (Sized_incremental_binary::setup_readers): Setup input readers
6459 for each input file; build maps for files added from libraries
6460 and scripts.
6461 (Sized_incremental_binary::check_input_args): New function.
6462 (Sized_incremental_binary::do_check_inputs): Build map of argument
6463 serial numbers to input arguments.
6464 (Sized_incremental_binary::do_file_has_changed): Rename
6465 do_file_is_unchanged to this; compare file modification times.
6466 (Sized_incremental_binary::do_init_layout): New function.
6467 (Sized_incremental_binary::do_reserve_layout): New function.
6468 (Sized_incremental_binary::do_get_input_reader): Remove.
6469 (Sized_incremental_binary::get_symtab_view): New function.
6470 (Incremental_checker::can_incrementally_link_output_file): Remove.
6471 (Incremental_inputs::report_command_line): Exclude --debug options.
6472 (Incremental_inputs::report_archive_begin): Add parameter; track
6473 argument serial numbers; don't put input file entry for archive
6474 before archive members.
6475 (Incremental_inputs::report_archive_end): Put input file entry
6476 for archive after archive members.
6477 (Incremental_inputs::report_object): Add parameter; track argument
6478 serial numbers and in_system_directory flag.
6479 (Incremental_inputs::report_script): Add parameter; track argument
6480 serial numbers.
6481 (Output_section_incremental_inputs::set_final_data_size): Adjust
6482 size of symbol info entry; check for forwarding symbols.
6483 (Output_section_incremental_inputs::write_input_files): Write
6484 in_system_directory flag and argument serial number.
6485 (Output_section_incremental_inputs::write_info_blocks): Map section
6486 indices between incremental info and original input file; store
6487 input section index for each symbol.
6488 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6489 change operator() to visit().
6490 (class Global_got_offset_visitor): Likewise.
6491 (class Global_symbol_visitor_got_plt):
6492 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6493 classes.
6494 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6495 (Sized_incr_relobj::do_read_symbols): New function.
6496 (Sized_incr_relobj::do_layout): New function.
6497 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6498 (Sized_incr_relobj::do_add_symbols): New function.
6499 (Sized_incr_relobj::do_should_include_member): New function.
6500 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6501 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6502 (Sized_incr_relobj::do_section_size): New function.
6503 (Sized_incr_relobj::do_section_name): New function.
6504 (Sized_incr_relobj::do_section_contents): New function.
6505 (Sized_incr_relobj::do_section_flags): New function.
6506 (Sized_incr_relobj::do_section_entsize): New function.
6507 (Sized_incr_relobj::do_section_address): New function.
6508 (Sized_incr_relobj::do_section_type): New function.
6509 (Sized_incr_relobj::do_section_link): New function.
6510 (Sized_incr_relobj::do_section_info): New function.
6511 (Sized_incr_relobj::do_section_addralign): New function.
6512 (Sized_incr_relobj::do_initialize_xindex): New function.
6513 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6514 (Sized_incr_relobj::do_read_relocs): New function.
6515 (Sized_incr_relobj::do_gc_process_relocs): New function.
6516 (Sized_incr_relobj::do_scan_relocs): New function.
6517 (Sized_incr_relobj::do_count_local_symbols): New function.
6518 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6519 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6520 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6521 (Sized_incr_relobj::do_relocate): New function.
6522 (Sized_incr_relobj::do_set_section_offset): New function.
6523 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6524 (Sized_incr_dynobj::do_read_symbols): New function.
6525 (Sized_incr_dynobj::do_layout): New function.
6526 (Sized_incr_dynobj::do_add_symbols): New function.
6527 (Sized_incr_dynobj::do_should_include_member): New function.
6528 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6529 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6530 (Sized_incr_dynobj::do_section_size): New function.
6531 (Sized_incr_dynobj::do_section_name): New function.
6532 (Sized_incr_dynobj::do_section_contents): New function.
6533 (Sized_incr_dynobj::do_section_flags): New function.
6534 (Sized_incr_dynobj::do_section_entsize): New function.
6535 (Sized_incr_dynobj::do_section_address): New function.
6536 (Sized_incr_dynobj::do_section_type): New function.
6537 (Sized_incr_dynobj::do_section_link): New function.
6538 (Sized_incr_dynobj::do_section_info): New function.
6539 (Sized_incr_dynobj::do_section_addralign): New function.
6540 (Sized_incr_dynobj::do_initialize_xindex): New function.
6541 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6542 (make_sized_incremental_object): New function.
6543 (Incremental_library::copy_unused_symbols): New function.
6544 (Incremental_library::do_for_all_unused_symbols): New function.
6545 * incremental.h (enum Incremental_input_flags): New type.
6546 (class Incremental_checker): Remove.
6547 (Incremental_input_entry::Incremental_input_entry): Add argument
6548 serial number.
6549 (Incremental_input_entry::arg_serial): New function.
6550 (Incremental_input_entry::set_is_in_system_directory): New function.
6551 (Incremental_input_entry::is_in_system_directory): New function.
6552 (Incremental_input_entry::arg_serial_): New data member.
6553 (Incremental_input_entry::is_in_system_directory_): New data member.
6554 (class Script_info): Move here from script.h.
6555 (Script_info::Script_info): Add filename parameter.
6556 (Script_info::filename): New function.
6557 (Script_info::filename_): New data member.
6558 (Incremental_script_entry::Incremental_script_entry): Add argument
6559 serial number.
6560 (Incremental_object_entry::Incremental_object_entry): Likewise.
6561 (Incremental_object_entry::add_input_section): Build list of input
6562 sections with map to original shndx.
6563 (Incremental_object_entry::get_input_section_index): New function.
6564 (Incremental_object_entry::shndx_): New data member.
6565 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6566 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6567 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6568 serial number.
6569 (Incremental_inputs::report_archive_begin): Likewise.
6570 (Incremental_inputs::report_object): Likewise.
6571 (Incremental_inputs::report_script): Likewise.
6572 (class Incremental_global_symbol_reader): New class.
6573 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6574 and store flags and input file type.
6575 (Incremental_input_entry_reader::arg_serial): New function.
6576 (Incremental_input_entry_reader::type): Extract type from flags.
6577 (Incremental_input_entry_reader::is_in_system_directory): New function.
6578 (Incremental_input_entry_reader::get_input_section_count): Call
6579 accessor function for type.
6580 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6581 function for type; adjust size of global symbol entry.
6582 (Incremental_input_entry_reader::get_global_symbol_count): Call
6583 accessor function for type.
6584 (Incremental_input_entry_reader::get_object_count): Likewise.
6585 (Incremental_input_entry_reader::get_object_offset): Likewise.
6586 (Incremental_input_entry_reader::get_member_count): Likewise.
6587 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6588 (Incremental_input_entry_reader::get_member_offset): Likewise.
6589 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6590 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6591 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6592 (Incremental_input_entry_reader::get_global_symbol_reader): New
6593 function.
6594 (Incremental_input_entry_reader::get_output_symbol_index): New
6595 function.
6596 (Incremental_input_entry_reader::type_): Remove.
6597 (Incremental_input_entry_reader::flags_): New data member.
6598 (Incremental_inputs_reader::input_file_offset): New function.
6599 (Incremental_inputs_reader::input_file_index): New function.
6600 (Incremental_inputs_reader::input_file): Call input_file_offset.
6601 (Incremental_inputs_reader::input_file_at_offset): New function.
6602 (Incremental_relocs_reader::get_r_type): Reformat.
6603 (Incremental_relocs_reader::get_r_shndx): Reformat.
6604 (Incremental_relocs_reader::get_r_offset): Reformat.
6605 (Incremental_relocs_reader::data): New function.
6606 (Incremental_binary::Incremental_binary): Initialize new data members.
6607 (Incremental_binary::check_inputs): Add cmdline parameter.
6608 (Incremental_binary::file_is_unchanged): Remove.
6609 (Input_reader::arg_serial): New function.
6610 (Input_reader::get_unused_symbol_count): New function.
6611 (Input_reader::get_unused_symbol): New function.
6612 (Input_reader::do_arg_serial): New function.
6613 (Input_reader::do_get_unused_symbol_count): New function.
6614 (Input_reader::do_get_unused_symbol): New function.
6615 (Incremental_binary::input_file_count): New function.
6616 (Incremental_binary::get_input_reader): Change signature to use
6617 index instead of filename.
6618 (Incremental_binary::file_has_changed): New function.
6619 (Incremental_binary::get_input_argument): New function.
6620 (Incremental_binary::get_library): New function.
6621 (Incremental_binary::get_script_info): New function.
6622 (Incremental_binary::init_layout): New function.
6623 (Incremental_binary::reserve_layout): New function.
6624 (Incremental_binary::output_file): New function.
6625 (Incremental_binary::do_check_inputs): New function.
6626 (Incremental_binary::do_file_is_unchanged): Remove.
6627 (Incremental_binary::do_file_has_changed): New function.
6628 (Incremental_binary::do_init_layout): New function.
6629 (Incremental_binary::do_reserve_layout): New function.
6630 (Incremental_binary::do_input_file_count): New function.
6631 (Incremental_binary::do_get_input_reader): Change signature.
6632 (Incremental_binary::input_args_map_): New data member.
6633 (Incremental_binary::library_map_): New data member.
6634 (Incremental_binary::script_map_): New data member.
6635 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6636 new data members.
6637 (Sized_incremental_binary::output_section): New function.
6638 (Sized_incremental_binary::inputs_reader): Add const.
6639 (Sized_incremental_binary::symtab_reader): Add const.
6640 (Sized_incremental_binary::relocs_reader): Add const.
6641 (Sized_incremental_binary::got_plt_reader): Add const.
6642 (Sized_incremental_binary::get_symtab_view): New function.
6643 (Sized_incremental_binary::Inputs_reader): New typedef.
6644 (Sized_incremental_binary::Input_entry_reader): New typedef.
6645 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6646 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6647 (Sized_incremental_binary::do_file_has_changed): New function.
6648 (Sized_incremental_binary::do_init_layout): New function.
6649 (Sized_incremental_binary::do_reserve_layout): New function.
6650 (Sized_input_reader::Inputs_reader): Remove.
6651 (Sized_input_reader::Input_entry_reader): Remove.
6652 (Sized_input_reader::do_arg_serial): New function.
6653 (Sized_input_reader::do_get_unused_symbol_count): New function.
6654 (Sized_input_reader::do_get_unused_symbol): New function.
6655 (Sized_incremental_binary::do_input_file_count): New function.
6656 (Sized_incremental_binary::do_get_input_reader): Change signature;
6657 use index instead of filename.
6658 (Sized_incremental_binary::section_map_): New data member.
6659 (Sized_incremental_binary::input_entry_readers_): New data member.
6660 (class Sized_incr_relobj): New class.
6661 (class Sized_incr_dynobj): New class.
6662 (make_sized_incremental_object): New function.
6663 (class Incremental_library): New class.
6664 * layout.cc (Free_list::num_lists): New static data member.
6665 (Free_list::num_nodes): New static data member.
6666 (Free_list::num_removes): New static data member.
6667 (Free_list::num_remove_visits): New static data member.
6668 (Free_list::num_allocates): New static data member.
6669 (Free_list::num_allocate_visits): New static data member.
6670 (Free_list::init): New function.
6671 (Free_list::remove): New function.
6672 (Free_list::allocate): New function.
6673 (Free_list::dump): New function.
6674 (Free_list::print_stats): New function.
6675 (Layout_task_runner::run): Resize output file for incremental updates.
6676 (Layout::Layout): Initialize new data members.
6677 (Layout::set_incremental_base): New function.
6678 (Layout::init_fixed_output_section): New function.
6679 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6680 incremental updates.
6681 (Layout::create_gold_note): Do not create gold note section for
6682 incremental updates.
6683 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6684 for incremental updates.
6685 (Layout::set_section_offsets): For incremental updates, allocate space
6686 from free list.
6687 (Layout::create_symtab_sections): Layout with offsets relative to
6688 start of section; for incremental updates, allocate space from free
6689 list.
6690 (Layout::create_shdrs): For incremental updates, allocate space from
6691 free list.
6692 (Layout::finish_dynamic_section): For incremental updates, do not
6693 check --as-needed (fixed in subsequent patch).
6694 * layout.h (class Free_list): New class.
6695 (Layout::set_incremental_base): New function.
6696 (Layout::incremental_base): New function.
6697 (Layout::init_fixed_output_section): New function.
6698 (Layout::allocate): New function.
6699 (Layout::incremental_base_): New data member.
6700 (Layout::free_list_): New data member.
6701 * main.cc (main): Print Free_list statistics.
6702 * object.cc (Relobj::finalize_incremental_relocs): Add
6703 clear_counts parameter; clear counts only when clear_counts is set.
6704 (Sized_relobj::Sized_relobj): Initialize new base class.
6705 (Sized_relobj::do_layout): Don't report special sections.
6706 (Sized_relobj::do_for_all_local_got_entries): New function.
6707 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6708 symtab_off to all symbol table offsets.
6709 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6710 * object.h (class Got_offset_list): Move to top of file.
6711 (Object::Object): Allow case where input_file == NULL.
6712 (Object::~Object): Likewise.
6713 (Object::input_file): Assert that input_file != NULL.
6714 (Object::lock): Allow case where input_file == NULL.
6715 (Object::unlock): Likewise.
6716 (Object::is_locked): Likewise.
6717 (Object::token): Likewise.
6718 (Object::release): Likewise.
6719 (Object::is_incremental): New function.
6720 (Object::get_mtime): New function.
6721 (Object::for_all_local_got_entries): New function.
6722 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6723 (Object::set_is_in_system_directory): New function.
6724 (Object::is_in_system_directory): New function.
6725 (Object::do_is_incremental): New function.
6726 (Object::do_get_mtime): New function.
6727 (Object::do_for_all_local_got_entries): New function.
6728 (Object::is_in_system_directory_): New data member.
6729 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6730 (class Sized_relobj_base): New class.
6731 (class Sized_relobj): Derive from Sized_relobj_base.
6732 (class Sized_relobj::Symbols): Redeclare from base class.
6733 (class Sized_relobj::local_got_offset_list): Remove.
6734 (class Sized_relobj::Output_sections): Redeclare from base class.
6735 (class Sized_relobj::do_for_all_local_got_entries): New function.
6736 (class Sized_relobj::write_local_symbols): Add offset parameter.
6737 (class Sized_relobj::local_symbol_offset_): Update comment.
6738 (class Sized_relobj::local_dynsym_offset_): Update comment.
6739 * options.cc (Input_arguments::add_file): Remove const.
6740 * options.h (Input_file_argument::Input_file_argument):
6741 Initialize arg_serial_ (all constructors).
6742 (Input_file_argument::set_arg_serial): New function.
6743 (Input_file_argument::arg_serial): New function.
6744 (Input_file_argument::arg_serial_): New data member.
6745 (Input_arguments::Input_arguments): Initialize file_count_.
6746 (Input_arguments::add_file): Remove const.
6747 (Input_arguments::number_of_input_files): New function.
6748 (Input_arguments::file_count_): New data member.
6749 (Command_line::number_of_input_files): Call
6750 Input_arguments::number_of_input_files.
6751 * output.cc (Output_segment_headers::Output_segment_headers):
6752 Set current size.
6753 (Output_section::Input_section::current_data_size): New function.
6754 (Output_section::Output_section): Initialize new data members.
6755 (Output_section::add_input_section): Don't do merge sections for
6756 an incremental link; allocate space from free list for an
6757 incremental update.
6758 (Output_section::add_output_section_data): Allocate space from
6759 free list for an incremental update.
6760 (Output_section::update_data_size): New function.
6761 (Output_section::set_fixed_layout): New function.
6762 (Output_section::reserve): New function.
6763 (Output_segment::set_section_addresses): Remove const.
6764 (Output_segment::set_section_list_addresses): Remove const; allocate
6765 space from free list for an incremental update.
6766 (Output_segment::set_offset): Adjust size of RELRO segment for an
6767 incremental update.
6768 * output.h (Output_data::current_data_size): Move here from
6769 child classes.
6770 (Output_data::pre_finalize_data_size): New function.
6771 (Output_data::update_data_size): New function.
6772 (Output_section_headers::update_data_size): new function.
6773 (Output_section_data_build::current_data_size): Move to Output_data.
6774 (Output_data_strtab::update_data_size): New function.
6775 (Output_section::current_data_size): Move to Output_data.
6776 (Output_section::set_fixed_layout): New function.
6777 (Output_section::has_fixed_layout): New function.
6778 (Output_section::reserve): New function.
6779 (Output_section::update_data_size): New function.
6780 (Output_section::has_fixed_layout_): New data member.
6781 (Output_section::free_list_): New data member.
6782 (Output_segment::set_section_addresses): Remove const.
6783 (Output_segment::set_section_list_addresses): Remove const.
6784 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6785 New function.
6786 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6787 New function.
6788 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6789 parameter when calling Add_symbols constructor; store argument
6790 serial number for members of a lib group.
6791 (Add_symbols::locks): Allow case where token == NULL.
6792 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6793 (Read_member::~Read_member): New function.
6794 (Read_member::is_runnable): New function.
6795 (Read_member::locks): New function.
6796 (Read_member::run): New function.
6797 (Check_script::~Check_script): New function.
6798 (Check_script::is_runnable): New function.
6799 (Check_script::locks): New function.
6800 (Check_script::run): New function.
6801 (Check_library::~Check_library): New function.
6802 (Check_library::is_runnable): New function.
6803 (Check_library::locks): New function.
6804 (Check_library::run): New function.
6805 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6806 (Add_symbols::library_): New data member.
6807 (class Read_member): New class.
6808 (class Check_script): New class.
6809 (class Check_library): New class.
6810 * reloc.cc (Read_relocs::is_runnable): Allow case where
6811 token == NULL.
6812 (Read_relocs::locks): Likewise.
6813 (Scan_relocs::locks): Likewise.
6814 (Relocate_task::locks): Likewise.
6815 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6816 to clear counters.
6817 (Sized_relobj::incremental_relocs_scan): Fix comment.
6818 (Sized_relobj::do_relocate): Pass output file offset to
6819 write_local_symbols.
6820 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6821 from class declaration.
6822 * script.cc (read_input_script): Allocate Script_info; pass
6823 argument serial number to report_script.
6824 * script.h (class Script_info): Move to incremental.h.
6825 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6826 * symtab.h (Symbol_table::add_from_incrobj): New function.
6827 (Symbol_table::set_file_offset): New function.
6828
b961d0d7
CC
68292011-04-05 Cary Coutant <ccoutant@google.com>
6830
6831 * incremental-dump.cc (dump_incremental_inputs): Change signature
6832 to take a Sized_incremental_binary; change caller. Use readers
6833 in Sized_incremental_binary.
6834 * incremental.cc
6835 (Sized_incremental_binary::find_incremental_inputs_sections):
6836 Rename do_find_incremental_inputs_sections to this.
6837 (Sized_incremental_binary::setup_readers): New function.
6838 (Sized_incremental_binary::do_check_inputs): Check
6839 has_incremental_info_ flag; move setup code to setup_readers;
6840 use input readers.
6841 (Sized_incremental_binary::do_file_is_unchanged): New function.
6842 (Sized_incremental_binary::do_get_input_reader): New function.
6843 * incremental.h (class Incremental_binary): Move to end of file.
6844 (Incremental_binary::file_is_unchanged): New function.
6845 (Incremental_binary::do_file_is_unchanged): New function.
6846 (Incremental_binary::Input_reader): New class.
6847 (Incremental_binary::get_input_reader): New function.
6848 (class Sized_incremental_binary): Move to end of file.
6849 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6850 input section reader classes.
6851 (Sized_incremental_binary::has_incremental_info): New function.
6852 (Sized_incremental_binary::inputs_reader): New function.
6853 (Sized_incremental_binary::symtab_reader): New function.
6854 (Sized_incremental_binary::relocs_reader): New function.
6855 (Sized_incremental_binary::got_plt_reader): New function.
6856 (Sized_incremental_binary::do_file_is_unchanged): New function.
6857 (Sized_incremental_binary::Sized_input_reader): New class.
6858 (Sized_incremental_binary::get_input_reader): New function.
6859 (Sized_incremental_binary::find_incremental_inputs_sections):
6860 Rename do_find_incremental_inputs_sections to this.
6861 (Sized_incremental_binary::setup_readers): New function.
6862 (Sized_incremental_binary::has_incremental_info_): New data member.
6863 (Sized_incremental_binary::inputs_reader_): New data member.
6864 (Sized_incremental_binary::symtab_reader_): New data member.
6865 (Sized_incremental_binary::relocs_reader_): New data member.
6866 (Sized_incremental_binary::got_plt_reader_): New data member.
6867 (Sized_incremental_binary::current_input_file_): New data member.
6868
a869183f
PP
68692011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6870
6871 PR gold/12640
6872 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6873 violation.
6874
68752011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6876
6877 * archive.cc (Archive::include_member): Adjust call to report_object.
6878 (Add_archive_symbols::run): Add script_info to call to
6879 report_archive_begin.
6880 (Lib_group::include_member): Adjust call to report_object.
6881 (Add_lib_group_symbols::run): Adjust call to report_object.
6882 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6883 blocks. Add object count for script input files.
6884 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6885 script_info parameter; change all callers.
6886 (Incremental_inputs::report_object): Add script_info parameter;
6887 change all callers.
6888 (Incremental_inputs::report_script): Store backpointer to
6889 incremental info entry.
6890 (Output_section_incremental_inputs::set_final_data_size): Record
6891 additional information for scripts.
6892 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6893 * incremental.h (Incremental_script_entry::add_object): New function.
6894 (Incremental_script_entry::get_object_count): New function.
6895 (Incremental_script_entry::get_object): New function.
6896 (Incremental_script_entry::objects_): New data member; adjust
6897 constructor.
6898 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6899 (Incremental_inputs::report_object): Add script_info parameter.
6900 (Incremental_inputs_reader::get_object_count): New function.
6901 (Incremental_inputs_reader::get_object_offset): New function.
6902 * options.cc (Input_arguments::add_file): Return reference to
6903 new input argument.
6904 * options.h (Input_argument::set_script_info): New function.
6905 (Input_argument::script_info): New function.
6906 (Input_argument::script_info_): New data member; adjust all
6907 constructors.
6908 (Input_file_group::add_file): Return reference to new input argument.
6909 (Input_file_lib::add_file): Likewise.
6910 (Input_arguments::add_file): Likewise.
6911 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6912 * script.cc (Parser_closure::Parser_closure): Add script_info
6913 parameter; adjust all callers.
6914 (Parser_closure::script_info): New function.
6915 (Parser_closure::script_info_): New data member.
6916 (read_input_script): Report scripts earlier to incremental info.
6917 (script_add_file): Set script_info in Input_argument.
6918 (script_add_library): Likewise.
6919 * script.h (Script_options::Script_info): Rewrite class.
6920
a869183f 69212011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6922
6923 * archive.cc (Library_base::should_include_member): Move
6924 method here from class Archive.
6925 (Archive::Archive): Initialize base class.
6926 (Archive::should_include_member): Move to base class.
6927 (Archive::do_for_all_unused_symbols): New function.
6928 (Add_archive_symbols::run): Remove redundant access to
6929 incremental_inputs.
6930 (Lib_group::Lib_group): Initialize base class.
6931 (Lib_group::do_filename): New function.
6932 (Lib_group::include_member): Pass pointer to Lib_group to
6933 report_object.
6934 (Lib_group::do_for_all_unused_symbols): New function.
6935 (Add_lib_group_symbols::run): Report archive information for
6936 incremental links.
6937 * archive.h (class Library_base): New base class.
6938 (class Archive): Derive from Library_base.
6939 (Archive::filename): Move to base class.
6940 (Archive::set_incremental_info): Likewise.
6941 (Archive::incremental_info): Likewise.
6942 (Archive::Should_include): Likewise.
6943 (Archive::should_include_member): Likewise.
6944 (Archive::Armap_entry): Remove.
6945 (Archive::Unused_symbol_iterator): Remove.
6946 (Archive::unused_symbols_begin): Remove.
6947 (Archive::unused_symbols_end): Remove.
6948 (Archive::do_filename): New function.
6949 (Archive::do_get_mtime): New function.
6950 (Archive::do_for_all_unused_symbols): New function.
6951 (Archive::task_): Move to base class.
6952 (Archive::incremental_info_): Likewise.
6953 (class Lib_group): Derive from Library_base.
6954 (Lib_group::do_filename): New function.
6955 (Lib_group::do_get_mtime): New function.
6956 (Lib_group::do_for_all_unused_symbols): New function.
6957 (Lib_group::task_): Move to base class.
6958 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6959 function.
6960 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6961 function.
6962 * incremental.cc (Incremental_inputs::report_archive_begin):
6963 Use Library_base; call library's get_mtime; add incremental inputs
6964 entry before members.
6965 (class Unused_symbol_visitor): New class.
6966 (Incremental_inputs::report_archive_end): Use Library_base; use
6967 visitor class to record unused symbols; don't add incremental inputs
6968 entry after members.
6969 (Incremental_inputs::report_object): Use Library_base.
6970 * incremental.h
6971 (Incremental_archive_entry::Incremental_archive_entry): Remove
6972 unused Archive parameter.
6973 (Incremental_inputs::report_archive_begin): Use Library_base.
6974 (Incremental_inputs::report_archive_end): Likewise.
6975 (Incremental_inputs::report_object): Likewise.
6976 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6977 function.
6978 * object.h (Object::for_all_global_symbols): New function.
6979 (Object::do_for_all_global_symbols): New function.
6980 (Sized_relobj::do_for_all_global_symbols): New function.
6981 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6982 function.
6983 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6984 function.
6985
61ab3e40
ILT
69862011-03-27 Ian Lance Taylor <iant@google.com>
6987
6988 * archive.cc (Archive::interpret_header): Return -1 if something
6989 goes wrong. Change callers accordingly.
6990
30e1f9e6
CC
69912011-03-25 Cary Coutant <ccoutant@google.com>
6992
6993 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6994 * testsuite/Makefile.in: Regenerate.
6995
9370ce59 69962011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6997
6998 * plugin.cc (get_view): New.
6999 (Plugin::load): Pass get_view to the plugin.
7000 (Plugin_manager::get_view): New.
7001
9312bb0a
ILT
70022011-03-21 Ian Lance Taylor <iant@google.com>
7003
7004 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7005 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7006
7e12ba9e
ST
70072011-03-21 Sriraman Tallam <tmsriram@google.com>
7008
7009 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7010 Change == to -eq.
7011 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7012 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7013 Change == to -eq.
7014 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7015 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7016
fd7a005d
ILT
70172011-03-14 Ian Lance Taylor <iant@google.com>
7018
7019 * script-sections.cc (Sort_output_sections::script_compare):
7020 Rename from is_before, change return type.
7021 (Sort_output_sections::operator()): Adjust accordingly.
7022
ed16fd1b
ILT
70232011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7024
7025 PR gold/12572
7026 * testsuite/odr_violation2.cc: Add comment to make all error line
7027 numbers double digits.
7028 * testsuite/debug_msg.sh: Adjust expected errors.
7029
71ff8986
ILT
70302011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7031
7032 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7033 but mark earlier ones as non-canonical
7034 (offset_to_iterator): Update search target and example
7035 (do_addr2line): Return extra lines in a vector*
7036 (format_file_lineno): Extract from do_addr2line
7037 (one_addr2line): Add vector* out-param
7038 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7039 when a lineno entry appeared last for its instruction
7040 (Dwarf_line_info): Add vector* out-param
7041 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7042 * symtab.cc (Odr_violation_compare): Include the lineno in the
7043 comparison again.
7044 (linenos_from_loc): New. Combine the canonical line for an
7045 address with its other lines.
7046 (True_if_intersect): New. Helper functor to make
7047 std::set_intersection a query.
7048 (detect_odr_violations): Compare sets of lines instead of just
7049 one line for each function. This became less deterministic, but
7050 has fewer false positives.
7051 * symtab.h: Declarations.
7052 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7053 mix an optimized and non-optimized object in the same binary
7054 (odr_violation2.so): Same.
7055 * testsuite/Makefile.in: Regenerate from Makefile.am.
7056 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7057 * testsuite/debug_msg.sh: Update line numbers and add
7058 assertions.
7059 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7060 non-optimized context.
7061 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7062 isn't inlined, and use OdrDerived in an optimized context.
7063 * testsuite/odr_header1.h: Defines OdrDerived, where
7064 optimization will change the
7065 first-instruction-in-the-destructor's file and line number.
7066 * testsuite/odr_header2.h: Defines OdrBase.
7067
a19fefdc
ILT
70682011-03-09 Ian Lance Taylor <iant@google.com>
7069
7070 * fileread.cc (File_read::clear_views): Don't delete the whole
7071 file view.
7072
ecb351e9
ILT
70732011-03-08 Ian Lance Taylor <iant@google.com>
7074
7075 PR gold/12525
7076 * fileread.cc: #include <climits>.
7077 (GOLD_IOV_MAX): Define.
7078 (File_read::read_multiple): Limit number of entries by iov_max.
7079 * fileread.h (class File_read): Always set max_readv_entries to
7080 128.
7081
b821d13c
ILT
70822011-03-07 Ian Lance Taylor <iant@google.com>
7083
7084 PR gold/12525
7085 * options.h (class General_options): Add -dy and -dn.
7086
89243142
CC
70872011-03-02 Cary Coutant <ccoutant@google.com>
7088
7089 * testsuite/script_test_9.t: Add TLS segment.
7090
d0773f31
ILT
70912011-03-02 Simon Baldwin <simonb@google.com>
7092
7093 * configure.ac: Add check for gnu_indirect_function support in
7094 the toolchain building binutils.
7095 * configure: Rebuild.
7096
9370ce59 70972011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7098
7099 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7100 plugin only symbols.
7101 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7102 in plugin files as not needed in the symbol table.
7103
4cf7a849
ST
71042011-02-11 Sriraman Tallam <tmsriram@google.com>
7105
7106 * output.cc (Output_section::add_input_section): Delay fill
7107 generation for section ordering.
7108
b578bd7d
ILT
71092011-02-09 Ian Lance Taylor <iant@google.com>
7110
7111 PR gold/12316
7112 * object.h (class Sized_relobj): Remove clear_local_symbols.
7113 * reloc.cc (Sized_relobj::do_relocate): Don't call
7114 clear_local_symbols.
7115
9370ce59 71162011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7117
7118 * plugin.cc (is_visible_from_outside): Return true for symbols
7119 in the -u option.
7120
55382fb7
ILT
71212011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7122
7123 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7124 filename.
7125
4e271fff
ST
71262011-02-02 Sriraman Tallam <tmsriram@google.com>
7127
7128 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7129 to std::string.
4e271fff 7130 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7131 section_name to be std::string.
4e271fff
ST
7132 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7133
d433c3ac
ILT
71342011-01-25 Ian Lance Taylor <iant@google.com>
7135
7136 * script.cc (script_add_extern): Rewrite to use
7137 add_symbol_reference.
7138
880473a6
DK
71392011-01-25 Doug Kwan <dougkwan@google.com>
7140
d433c3ac 7141 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7142
f30f86fa
ILT
71432011-01-24 Ian Lance Taylor <iant@google.com>
7144
7145 * options.h (class General_options): Accept
7146 --no-detect-odr-violations.
7147
8e51a0b9
ILT
71482011-01-24 Ian Lance Taylor <iant@google.com>
7149
7150 * version.cc (version_string): Bump to 1.11.
7151
0f3b89d8
ILT
71522011-01-24 Ian Lance Taylor <iant@google.com>
7153
7154 * plugin.cc (class Plugin_rescan): Define new class.
7155 (Plugin_manager::claim_file): Set any_claimed_.
7156 (Plugin_manager::save_archive): New function.
7157 (Plugin_manager::save_input_group): New function.
7158 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7159 necessary.
7160 (Plugin_manager::new_undefined_symbol): New function.
7161 (Plugin_manager::rescan): New function.
7162 (Plugin_manager::rescannable_defines): New function.
7163 (Plugin_manager::add_input_file): Set any_added_.
7164 * plugin.h (class Plugin_manager): define new fields rescannable_,
7165 undefined_symbols_, any_claimed_, and any_added_. Declare
7166 Plugin_rescan as friend. Declare new functions.
7167 (Plugin_manager::Rescannable): Define type.
7168 (Plugin_manager::Rescannable_list): Define type.
7169 (Plugin_manager::Undefined_symbol_list): Define type.
7170 (Plugin_manager::Plugin_manager): Initialize new fields.
7171 * archive.cc (Archive::defines_symbol): New function.
7172 (Add_archive_symbols::run): Pass archive to plugins if any.
7173 * archive.h (class Archive): Declare defines_symbol.
7174 * readsyms.cc (Input_group::~Input_group): New function.
7175 (Finish_group::run): Pass input_group to plugins if any.
7176 * readsyms.h (class Input_group): Declare destructor.
7177 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7178 any.
7179
3bb951e5
ILT
71802011-01-10 Ian Lance Taylor <iant@google.com>
7181
7182 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7183 section as relro.
7184 (Layout::set_segment_offsets): Reset increase_relro before calling
7185 set_section_addresses a second time.
7186
0aa45fac
CC
71872011-01-04 Cary Coutant <ccoutant@google.com>
7188
7189 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7190 sections before NOBITS sections.
7191
0db46eb4
L
71922011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7193
7194 * version.cc (print_version): Update copyright to 2011.
7195
829c9745
CC
71962010-12-23 Cary Coutant <ccoutant@google.com>
7197
7198 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7199 of OS to this->add. Add OD parameter to second form of the function.
7200
7500420b
ILT
72012010-12-20 Ian Lance Taylor <iant@google.com>
7202
7203 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7204 second of two consecutive entries with same offset.
7205
f8e9a930
RW
72062010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7207
7208 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7209 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7210 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7211 to avoid unneeded links against $(LDADD).
7212 * testsuite/Makefile.in: Regenerate.
7213
2fbb4320
ILT
72142010-12-15 Ian Lance Taylor <iant@google.com>
7215
7216 PR gold/12324
7217 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7218 for R_X86_64_32 and R_X86_64_PC32.
7219 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7220 ver_matching_def_pic.o.
7221 (ver_matching_def_pic.o): New target.
7222
fedb228d
RW
72232010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7224
7225 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7226 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7227 Move definition before File_read::View member definitions.
7228 (File_read::View::~View): Initialize and hold lock before
7229 updating current_mapped_bytes.
7230
9b547ce6
RW
72312010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7232
7233 * dwarf_reader.cc: Remove outdated comment.
7234 * gold-threads.cc: Fix typo in error message.
7235 * archive.cc: Fix typos in comments.
7236 * archive.h: Likewise.
7237 * arm-reloc-property.cc: Likewise.
7238 * arm-reloc-property.h: Likewise.
7239 * arm-reloc.def: Likewise.
7240 * arm.cc: Likewise.
7241 * attributes.h: Likewise.
7242 * cref.cc: Likewise.
7243 * ehframe.cc: Likewise.
7244 * fileread.h: Likewise.
7245 * gold.h: Likewise.
7246 * i386.cc: Likewise.
7247 * icf.cc: Likewise.
7248 * incremental.h: Likewise.
7249 * int_encoding.cc: Likewise.
7250 * layout.h: Likewise.
7251 * main.cc: Likewise.
7252 * merge.h: Likewise.
7253 * object.cc: Likewise.
7254 * object.h: Likewise.
7255 * options.cc: Likewise.
7256 * readsyms.cc: Likewise.
7257 * reduced_debug_output.cc: Likewise.
7258 * reloc.cc: Likewise.
7259 * script-sections.cc: Likewise.
7260 * sparc.cc: Likewise.
7261 * symtab.h: Likewise.
7262 * target-reloc.h: Likewise.
7263 * target.cc: Likewise.
7264 * target.h: Likewise.
7265 * timer.cc: Likewise.
7266 * timer.h: Likewise.
7267 * x86_64.cc: Likewise.
7268
83e17bd5
CC
72692010-12-09 Cary Coutant <ccoutant@google.com>
7270
7271 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7272 stack.
7273 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7274 parameter; change all callers.
7275 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7276 * options.h (warn_execstack): New option.
7277
017257f8
DK
72782010-12-07 Doug Kwan <dougkwan@google.com>
7279
7280 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7281 like function call relocations.
7282
c20cbc06
ILT
72832010-12-07 Ian Lance Taylor <iant@google.com>
7284
7285 * archive.cc (Archive::get_elf_object_for_member): Permit
7286 punconfigured to be NULL.
7287 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7288 (Archive::include_member): Pass NULL to get_elf_object_for_member
7289 if we searched for the archive and this is the first included
7290 object.
7291
4dbfafcc
ILT
72922010-12-01 Ian Lance Taylor <iant@google.com>
7293
7294 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7295 track_relocs_type_ field.
7296 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7297 Set track_relocs_type_.
7298 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7299 contents when using RELA relocs.
7300 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7301 reloc_map_.
7302 * reloc.cc (Track_relocs::next_addend): New function.
7303 * reloc.h (class Track_relocs): Declare next_addend.
7304
e5e19edd
ILT
73052010-12-01 Ian Lance Taylor <iant@google.com>
7306
7307 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7308 virtual destructor.
7309
9a5ce24c
ILT
73102010-12-01 Ian Lance Taylor <iant@google.com>
7311
7312 * README: Update compilers known to work and fail.
7313
c7791212
NC
73142010-11-23 Matthias Klose <doko@ubuntu.com>
7315
7316 * configure.in: For --enable-gold, handle value `default' instead of
7317 `both*'. Always install ld as ld.bfd, install as ld if gold is
7318 not the default.
7319 * configure: Regenerate.
7320
0ad220c9
DK
73212010-11-18 Doug Kwan <dougkwan@google.com>
7322
7323 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7324 and right_alignment to be zero. Store result alignment only if it is
7325 greater than existing alignment.
7326
ab8056e0
CC
73272010-11-16 Cary Coutant <ccoutant@google.com>
7328
7329 PR gold/12220
7330 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7331 Check for ".zdebug_line".
7332
fd064a5b
CC
73332010-11-16 Doug Kwan <dougkwan@google.com>
7334 Cary Coutant <ccoutant@google.com>
7335
7336 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7337 by reference; adjust all callers.
7338 * output.cc (Output_segment::set_section_addresses): Adjust references
7339 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7340 list is empty.
7341 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7342 end at page boundary.
7343
6fc6ea19
CC
73442010-11-16 Cary Coutant <ccoutant@google.com>
7345
7346 PR gold/12220
7347 * layout.cc (Layout::choose_output_section): Transform names of
7348 compressed sections even when using a script with a SECTIONS clause.
7349 (Layout::output_section_name): Remove code to transform
7350 compressed debug section names.
7351 * output.cc (Output_section::add_input_section): Use uncompressed
7352 section size when tracking input sections.
7353
95a2c8d6
RS
73542010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7355
7356 * symtab.h (Symbol::NON_PIC_REF): Remove.
7357 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7358 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7359 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7360 (Symbol::use_plt_offset): Take a flags argument and pass it
7361 directly to needs_dynamic_reloc. Restrict check for undefined
7362 weak symbols to function calls.
7363 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7364 (Target_arm::Scan::global): Use it.
7365 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7366 (Target_arm::Relocate::relocate): Likewise.
7367 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7368 parameter with an r_type parameter. Use get_reference_flags
7369 to get the flags.
7370 (Target_arm::Relocate::relocate): Update accordingly.
7371 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7372 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7373 (Target_i386::Scan::global): Likewise.
7374 (Target_i386::Relocate::relocate): Likewise.
7375 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7376 parameter with an r_type parameter. Use get_reference_flags
7377 to get the flags.
7378 (Target_i386::Relocate::relocate): Update accordingly.
7379 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7380 (Target_powerpc::Scan::global): Use it.
7381 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7382 (Target_powerpc::Relocate::relocate): Likewise.
7383 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7384 (Target_sparc::Scan::global): Use it.
7385 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7386 (Target_sparc::Relocate::relocate): Likewise.
7387 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7388 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7389 (Target_x86_64::Scan::global): Likewise.
7390 (Target_x86_64::Relocate::relocate): Likewise.
7391
f625ae50
DK
73922010-11-08 Doug Kwan <dougkwan@google.com>
7393 Cary Coutant <ccoutant@google.com>
7394
7395 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7396 (Arm_exidx_merge_section::section_contents_): New data member.
7397 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7398 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7399 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7400 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7401 in parameters instead of calling Object::section_contents without
7402 locking.
7403 (Arm_output_section::group_section): New parameter TASK. Pass it
7404 to callees that need locking objects.
7405 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7406 to lock EXIDX input sections. Fix a formatting issue. Call
7407 Arm_exidx_merged_section::build_contents to create merged section
7408 contents.
7409 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7410 to lock object of stub table owner.
7411 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7412 TEXT_SIZE to initialize data member TEXT_SIZE_.
7413 (Arm_exidx_input_section::addralign): Fix typo in comment.
7414 (Arm_exidx_input_section::text_size): New method.
7415 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7416 that require locking objects. Lock objects before scanning for stubs
7417 and updating local symbols.
7418 (Arm_input_section<big_endian>::init): Copy contents of original
7419 input section.
2e702c99 7420 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7421 original input section instead of calling Object::section_contents
7422 without locking.
7423 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7424 size without calling Object::section_size().
7425 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7426 for size. Allocate a buffer for merged EXIDX entries.
7427 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7428 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7429 building code to Arm_exidx_merged_section::build_contetns. Write
7430 out contetns in buffer instead of building it on the fly.
7431 (Arm_relobj::make_exidx_input_section): Also pass text section size
7432 to Arm_exidx_input_section constructor.
7433 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7434 (Arm_dynobj::do_read_symbols): Fix memory leak.
7435 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7436 * target.h: (class Task): Add forward declaration.
7437 (Target::relax): Add new parameter TASK and pass it to
7438 Target::do_relax().
7439 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7440
5f9bcf58
CC
74412010-11-05 Cary Coutant <ccoutant@google.com>
7442
7443 PR gold/10708
7444 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7445 object when reading from the file.
7446 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7447 second layout pass.
7448 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7449 when reading section contents.
7450 (get_section_contents): Likewise.
7451 (icf::find_identical_sections): Likewise.
7452 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7453 object when reading from the file.
7454 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7455 the object when doing deferred section layout.
7456
e597fa08
NC
74572010-11-03 Nick Clifton <nickc@redhat.com>
7458
7459 PR gold/12001
7460 * script.h (class Symbol_assignment: name): New member. Returns
7461 the name of the symbol.
7462 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7463 Returns true if the given symbol name is on the list of
7464 assignments wating to be processed.
7465 * archive.cc (should_incldue_member): If the symbol is undefined,
7466 check to see if it is on the list of symbols pending assignment.
7467
3f9a3278
ILT
74682010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7469
7470 * script-sections.cc (Script_sections::find_memory_region): Check
7471 for a NULL output section pointer.
7472
d06fb4d1
DK
74732010-10-29 Doug Kwan <dougkwan@google.com>
7474
7475 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7476 Output_section::add_relaxed_input_section.
7477 * output.cc (Output_section::add_relaxed_input_section): Add new
7478 arguments LAYOUT and NAME. Set section order index.
7479 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7480 Copy section order index.
7481 * output.h (Output_section::add_relaxed_input_section): Add new
7482 arguments LAYOUT and NAME.
7483
90e24de5
ILT
74842010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7485
7486 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7487 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7488 * testsuite/Makefile.in: Regenerate.
7489
c9484ea5
DK
74902010-10-20 Doug Kwan <dougkwan@google.com>
7491
7492 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7493 without SHF_LINK_ORDER flags.
7494 * layout.cc (Layout::choose_output_section): Do not filter
7495 SHF_LINK_ORDER flag in a relocatable link.
7496
5bc2f5be
CC
74972010-10-17 Cary Coutant <ccoutant@google.com>
7498
7499 * output.h (Output_segment::set_section_addresses): Change function
7500 signature. Update all callers.
7501 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7502 sections.
7503 (Output_segment::set_section_addresses): Align after last TLS
7504 section. Add padding before last relro section instead of after.
7505
0c91cf04
DK
75062010-10-17 Doug Kwan <dougkwan@google.com>
7507
7508 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7509 GOT output section to be writable.
7510
8c21d9d3
CC
75112010-10-14 Cary Coutant <ccoutant@google.com>
7512
7513 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7514 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7515 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7516 mode.
7517 * incremental.cc (report_command_line): Ignore all forms of
7518 --incremental.
7519 * layout.cc (Layout::Layout): Check parameters for incremental link
7520 mode.
7521 * options.cc (General_options::parse_incremental): New function.
7522 (General_options::parse_no_incremental): New function.
7523 (General_options::parse_incremental_full): New function.
7524 (General_options::parse_incremental_update): New function.
7525 (General_options::incremental_mode_): New data member.
7526 (General_options::finalize): Check incremental_mode_.
7527 * options.h (General_options): Update help text for --incremental.
7528 Add --no-incremental, --incremental-full, --incremental-update.
7529 (General_options::Incremental_mode): New enum type.
7530 (General_options::incremental_mode): New function.
7531 (General_options::incremental_mode_): New data member.
7532 * parameters.cc (Parameters::incremental_mode_): New data member.
7533 (Parameters::set_options): Set incremental_mode_.
7534 (Parameters::set_incremental_full): New function.
7535 (Parameters::incremental): New function.
7536 (Parameters::incremental_update): New function.
7537 (set_parameters_incremental_full): New function.
7538 * parameters.h (Parameters::set_incremental_full): New function.
7539 (Parameters::incremental): New function.
7540 (Parameters::incremental_update): New function.
7541 (Parameters::incremental_mode_): New data member.
7542 (set_parameters_incremental_full): New function.
7543 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7544 incremental link mode.
7545 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7546 (Sized_relobj::do_relocate_sections): Likewise.
7547 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7548 option.
7549 * testsuite/Makefile.in: Regenerate.
7550 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7551
bb32aa18 75522010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7553
7554 * script-sections.h (class Script_sections): Make
7555 Sections_elements typedef public.
7556 * script-sections.cc (class Sort_output_sections): Add elements_
7557 field. Add constructor which sets it; change all callers.
7558 (Sort_output_sections::is_before): New function.
7559 (Sort_output_sections::operator()): Call is_before.
7560 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7561 conditional.
7562 * testsuite/script_test_10.sh: New test. Test script section
7563 order.
7564 * testsuite/script_test_10.t: Likewise.
7565 * testsuite/script_test_10.s: Likewise.
7566 * testsuite/Makefile.am: Wrap the cross linker tests and the
7567 common tests into NATIVE_OR_CROSS_LINKER.
7568 (check_SCRIPTS): Add script_test_10.sh.
7569 (check_DATA): Add script_test_10.stdout.
7570 (script_test_10.o, script_test_10): New targets.
7571 (script_test_10.stdout): New target.
7572 * configure, testsuite/Makefile.in: Regenerate.
7573
3cef7179
ILT
75742010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7575
7576 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7577 error for the deprecated relocations.
7578 (Target_arm::Scan::global): Likewise.
7579 (Target_arm::Relocate::relocate): Likewise.
7580
7411e9a8
RS
75812010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7582
7583 * fileread.cc (Input_file::find_file): Initialize *found_name
7584 and *namep when using the fallback search for case 4.
7585
6a9da32a
CC
75862010-10-11 Cary Coutant <ccoutant@google.com>
7587
7588 * options.h (class General_options): Redefine -z lazy as an alias for
7589 the negation of -z now.
7590
ac897c20
ILT
75912010-10-11 Ian Lance Taylor <iant@google.com>
7592
7593 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7594 binding.
7595
ea5cae92
NC
75962010-10-06 Nick Clifton <nickc@redhat.com>
7597
7598 * script-sections.cc(class Memory_region): Remove
7599 current_lma_offset_ field. Rename current_vma_offset_ to
7600 current_offset_. Add last_section_ field.
7601 (Memory_region::get_current_vma_address): Rename to
7602 get_current_address.
7603 (Memory_region::get_current_lma_address): Delete.
7604 (Memory_region::increment_vma_offset): Rename to
7605 increment_offset.
7606 (Memory_region::increment_lma_offset): Delete.
7607 (Memory_region::attributes_compatible): New method. Returns
7608 true if the provided section is compatible with the region.
7609 (Memory_region::get_last_section): New method. Returns the last
7610 section to use the region.
7611 (Memory_region::set_last_section): New method. Stores the last
7612 section to use the region.
7613 (Script_sections::block_in_region): New method. Returns true if
7614 a block of memory is contained within a region.
7615 (Script_sections::find_memory_region): New method. Locates a
7616 memory region to be used to set a VMA or LMA address.
7617 (Output_section_definition::set_section_addresses): Add code to
7618 check for addresses set by memory regions.
7619 (Output_segment::set_section_addresses): Remove memory region
7620 walking code.
7621 (Script_sections::create_segment): Add a warning if a header
7622 segment is created outside of any region.
7623 * script-sections.h (class Script_sections): Add prototypes for
7624 find_memory_region and block_in_region methods.
7625 * testsuite/memory_test.s: Use .long instead of .word.
7626 * testsuite/memory_test.t: Add some more output sections.
7627 * testsuite/memory_test.sh: Update expected output.
7628
a9bfd952
DK
76292010-10-02 Doug Kwan <dougkwan@google.com>
7630
7631 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7632 defintion to symtab.h
7633 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7634 declaration to defintion.
7635
bacff3ab
NC
76362010-10-01 Nick Clifton <nickc@redhat.com>
7637
7638 * expression.cc (eval): Replace dummy argument with NULL.
7639 (eval_maybe_dot): Check for a NULL result section pointer.
7640 (Symbol_expression::value): Likewise.
7641 (Dot_expression::value): Likewise.
7642 (BINARY_EXPRESSION): Likewise.
7643 (Max_expression::value): Likewise.
7644 (Min_expression::value): Likewise.
7645 (Absolute_expression::value): Likewise.
7646 (Addr_expression::value_from_output_section): Likewise.
7647 (Loaddddr_expression::value_from_output_section): Likewise.
7648 (Segment_start_expression::value): Likewise.
7649 * script-sections.cc
7650 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7651 argument with NULL.
7652 (Sections_elememt_dot_assignment::set_section_addresses):
7653 Likewise.
7654 (Output_data_expression::do_write_to_buffer): Likewise.
7655 (Output_section_definition::finalize_symbols): Likewise.
7656 (Output_section_definition::set_section_addresses): Likewise.
7657
f81bc8b5
DK
76582010-09-30 Doug Kwan <dougkwan@google.com>
7659
7660 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7661
c95e9f27
ST
76622010-09-28 Sriraman Tallam <tmsriram@google.com>
7663
7664 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7665 function.
c95e9f27
ST
7666 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7667 virtual function.
7668 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7669 virtual function.
7670 * icf.cc (get_section_contents): Inline merge sections only when
7671 target allows it.
7672
3cac54d2
RW
76732010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7674
7675 * configure: Regenerate.
7676
2904037a
ILT
76772010-09-17 Ian Lance Taylor <iant@google.com>
7678
7679 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7680 * testsuite/Makefile.am (memory_test.o): New target.
7681 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7682 memory_test.t.
7683 * testsuite/Makefile.in: Rebuild.
2904037a 7684
bca7fb63
DK
76852010-09-17 Doug Kwan <dougkwan@google.com>
7686
7687 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7688 defintion if relocation uses GOT entries of the symbol.
7689 * testsuite/icf_safe_test.sh: Fix test.
7690 * testsuite/icf_safe_so_test.sh: Fix test.
7691
4ef28648
CC
76922010-09-16 Cary Coutant <ccoutant@google.com>
7693
7694 * script_sections.cc (class Memory_region): Remove "NULL" from
7695 vector initializations.
7696
793990de
CC
76972010-09-15 Cary Coutant <ccoutant@google.com>
7698
7699 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7700 Resolve forwarding symbols.
7701
81e015e2
DK
77022010-09-15 Doug Kwan <dougkwan@google.com>
7703
7704 * gold/testsuite/script_test_3.t: Add ARM special sections.
7705 * gold/testsuite/script_test_4.t: Same.
7706 * gold/testsuite/script_test_5.t: Same.
7707 * gold/testsuite/script_test_6.t: Same.
7708 * gold/testsuite/script_test_7.t: Same.
7709 * gold/testsuite/script_test_7.t: Same.
7710 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7711
36171d64
CC
77122010-09-14 Cary Coutant <ccoutant@google.com>
7713
7714 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7715 (Target_x86_64::Relocate::relocate_tls): Replace check for
7716 saw_tls_block_reloc_ with test for executable section.
7717
d89051bd
CC
77182010-09-12 Cary Coutant <ccoutant@google.com>
7719
7720 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7721 position-independent executables to shared libraries need dynamic
7722 relocations.
7723 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7724 position-independent executables.
7725 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7726 * testsuite/Makefile.in: Regenerate.
7727
fca41f0f
NC
77282010-09-10 Nick Clifton <nickc@redhat.com>
7729
7730 PR gold/11997
7731 * testsuite/memory_test.t: Discard any sections that are not
7732 needed.
7733
6695e4b3
L
77342010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7735
7736 PR gold/11996
7737 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7738 "This::" to work around a bug in gcc 4.2.
7739
7740 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7741
0f72bf6f
RÁE
77422010-09-09 Rafael Espindola <espindola@google.com>
7743
7744 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7745 sections with different PF_X flags in the same segment.
7746 (Layout::find_first_load_seg): Search all segments to find the first
7747 one.
7748 * options.h (rosegment): New.
7749
77502010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7751
05a79166 7752 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7753
aa98ff75
DK
77542010-09-08 Doug Kwan <dougkwan@google.com>
7755
7756 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7757 (Arm_relobj::do_relocate_sections): Add new parameter for output
7758 file to match the parent.
7759 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7760 of local symbols instead of input values. Update code to track
7761 changes in gold::relocate_section.
7762 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7763 (Sized_relobj::compute_final_local_value_internal): New methods.
7764 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7765 body into private version of Sized_relobj::compute_final_local_value.
7766 Call the inline method.
7767 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7768 merged symbol value if there is one.
7769 (Symbol_value::has_output_value): New method defintiion.
7770 (Sized_relobj::Compute_final_local_value_status): New enum type.
7771 (Sized_relobj::compute_final_local_value): New methods.
7772 (Sized_relobj::compute_final_local_value_internal): New methods.
7773 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7774 and arm_cortex_a8.sh.
7775 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7776 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7777 New tests.
7778 * Makefile.in: Regenerate.
7779 * testsuite/arm_bl_out_of_range.s: Update test.
7780 * testsuite/thumb_bl_out_of_range.s: Ditto.
7781 * testsuite/thumb_blx_out_of_range.s: Ditto.
7782 * testsuite/arm_branch_out_of_range.sh: New file.
7783 * testsuite/arm_cortex_a8.sh: Ditto.
7784 * testsuite/arm_cortex_a8_b.s: Ditto.
7785 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7786 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7787 * testsuite/arm_cortex_a8_bl.s: Ditto.
7788 * testsuite/arm_cortex_a8_blx.s: Ditto.
7789 * testsuite/arm_cortex_a8_local.s: Ditto.
7790 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7791 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7792
05a79166
L
77932010-09-08 Rafael Espindola <espindola@google.com>
7794
7795 * Makefile.am (memory_test.stdout): Run readelf with -W.
7796 * Makefile.in: Regenerate.
7797 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7798 64 bit output.
7799
33dbc701
RÁE
78002010-09-08 Rafael Espindola <espindola@google.com>
7801
7802 * script-sections.cc (Script_sections::add_memory_region): Convert
7803 field precision to int.
7804 * script.cc (script_set_section_region, script_set_section_region):
7805 Convert field precision to int.
7806
731ca54a
RÁE
78072010-09-08 Rafael Espindola <espindola@google.com>
7808
7809 * arm.cc (do_finalize_sections): Create the __exidx_start and
7810 __exdix_end symbols even when the section is missing.
7811
7f8cd844
NC
78122010-09-08 Nick Clifton <nickc@redhat.com>
7813
7814 * README: Remove claim that MEMORY is not supported.
7815 * expression.cc (script_exp_function_origin)
7816 (script_exp_function_length): Move from here to ...
7817 * script.cc: ... here.
7818 (script_set_section_region, script_add_memory)
7819 (script_parse_memory_attr, script_include_directive): New
7820 functions.
7821 * script-sections.cc
7822 (class Memory_region): New class.
7823 (class Output_section_definition): Add set_memory_region,
7824 set_section_vma, set_section_lma and get_section_name methods.
7825 (class Script_Sections): Add add_memory_region,
7826 find_memory_region, find_memory_region_origin,
7827 find_memory_region_length and set_memory_region methods.
7828 Have set_section_addresses method walk the list of set memory
7829 regions.
7830 Extend the print methos to display memory regions.
7831 * script-sections.h: Add prototypes for new methods.
7832 Add enum for MEMORY region attributes.
7833 * yyscript.y: Add support for parsing MEMORY regions.
7834 * script-c.h: Add prototypes for new functions.
7835 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7836 * testsuite/Makefile.in: Regenerate.
7837 * testsuite/memory_test.sh: New script.
7838 * testsuite/memory_test.s: New assembler source file.
7839 * testsuite/memory_test.t: New linker script.
7840
a4649286
DK
78412010-08-27 Doug Kwan <dougkwan@google.com>
7842
7843 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7844 reference override an existing dynamic weak reference.
7845 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7846 * testsuite/Makefile.in: Regenerate.
7847 * testsuite/dyn_weak_ref.sh: New file.
7848 * testsuite/dyn_weak_ref_1.c: Ditto.
7849 * testsuite/dyn_weak_ref_2.c: Ditto.
7850
b56648ad
ILT
78512010-08-27 Ian Lance Taylor <iant@google.com>
7852
7853 * incremental.h (class Incremental_input_entry): Add virtual
7854 destructor.
7855
809313cb
ILT
78562010-08-27 Ian Lance Taylor <iant@google.com>
7857
7858 * testsuite/start_lib_test_3.c: Mark t3 as used.
7859
11e32464
NC
78602010-08-27 Nick Clifton <nickc@redhat.com>
7861
7862 * options.cc (version_script): Fix small typo in previous
7863 whitespace tidyup.
7864
ca09d69a
NC
78652010-08-25 Nick Clifton <nickc@redhat.com>
7866
7867 * archive.cc: Formatting fixes: Remove whitespace between
7868 typename and following asterisk. Remove whitespace between
7869 function name and opening parenthesis.
7870 * archive.h: Likewise.
7871 * arm.cc: Likewise.
7872 * attributes.cc: Likewise.
7873 * attributes.h: Likewise.
7874 * common.cc: Likewise.
7875 * copy-relocs.cc: Likewise.
7876 * dirsearch.h: Likewise.
7877 * dynobj.cc: Likewise.
7878 * ehframe.cc: Likewise.
7879 * ehframe.h: Likewise.
7880 * expression.cc: Likewise.
7881 * fileread.cc: Likewise.
7882 * fileread.h: Likewise.
7883 * gc.h: Likewise.
7884 * gold-threads.cc: Likewise.
7885 * gold.cc: Likewise.
7886 * i386.cc: Likewise.
7887 * icf.h: Likewise.
7888 * incremental-dump.cc: Likewise.
7889 * incremental.cc: Likewise.
7890 * layout.cc: Likewise.
7891 * layout.h: Likewise.
7892 * main.cc: Likewise.
7893 * merge.cc: Likewise.
7894 * merge.h: Likewise.
7895 * object.cc: Likewise.
7896 * object.h: Likewise.
7897 * options.cc: Likewise.
7898 * options.h: Likewise.
7899 * output.cc: Likewise.
7900 * output.h: Likewise.
7901 * plugin.cc: Likewise.
7902 * plugin.h: Likewise.
7903 * powerpc.cc: Likewise.
7904 * reloc.cc: Likewise.
7905 * script-c.h: Likewise.
7906 * script-sections.cc: Likewise.
7907 * script.cc: Likewise.
7908 * stringpool.cc: Likewise.
7909 * symtab.cc: Likewise.
7910 * symtab.h: Likewise.
7911 * target.cc: Likewise.
7912 * timer.cc: Likewise.
7913 * timer.h: Likewise.
7914 * version.cc: Likewise.
7915 * x86_64.cc: Likewise.
7916
b8fa8750
NC
79172010-08-24 Nick Clifton <nickc@redhat.com>
7918
7919 PR 11899
7920 * layout.cc (segment_precedes): Sort segments by their physical
7921 addresses, if they have been set.
7922
9919d93b
CC
79232010-08-23 Cary Coutant <ccoutant@google.com>
7924
7925 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7926 symbols data.
7927 (Lib_group::include_member): Unlock object after deleting its
7928 symbols data.
7929 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7930 the bug fixed here.
7931
97b4be1c
CC
79322010-08-19 Neil Vachharajani <nvachhar@google.com>
7933 Cary Coutant <ccoutant@google.com>
7934
7935 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7936 constructor, and set_blocker.
7937 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7938 readsyms_blocker_.
7939 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7940 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7941 * testsuite/Makefile.am (start_lib_test): New test case.
7942 * testsuite/Makefile.in: Regenerate.
7943 * testsuite/start_lib_test_main.c: New file.
7944 * testsuite/start_lib_test_1.c: New file.
7945 * testsuite/start_lib_test_2.c: New file.
7946 * testsuite/start_lib_test_3.c: New file.
7947
dd0b1884
ILT
79482010-08-19 Ian Lance Taylor <iant@google.com>
7949
7950 * Makefile.in: Rebuild with automake 1.11.1.
7951 * aclocal.m4: Likewise.
7952 * testsuite/Makefile.in: Likewise.
7953
7223e9ca
ILT
79542010-08-19 Ian Lance Taylor <iant@google.com>
7955
7956 PR 10893
7957 * i386.cc (class Output_data_plt_i386): Update declarations.
7958 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7959 local_ifuncs_ fields.
7960 (Target_i386::do_plt_section_for_global): New function.
7961 (Target_i386::do_plt_section_for_local): New function.
7962 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7963 parameter; change all callers. Initialize global_ifuncs_ and
7964 local_ifuncs_. If doing a static link define __rel_iplt_start and
7965 __rel_iplt_end.
7966 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7967 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7968 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7969 symbols.
7970 (Target_i386::make_plt_section): New function, broken out of
7971 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7972 (Target_i386::make_plt_entry): Call make_plt_section.
7973 (Target_i386::make_local_ifunc_plt_entry): New function.
7974 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7975 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7976 R_386_IRELATIVE to switch.
7977 (Target_i386::Scan::global): Likewise.
7978 (Target_i386::Relocate::relocate): Likewise.
7979 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7980 switch.
7981 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7982 (Target_x86_64::do_plt_section_for_global): New function.
7983 (Target_x86_64::do_plt_section_for_local): New function.
7984 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7985 parameter; change all callers. If doing a static link define
7986 __rela_iplt_start and __rela_iplt_end.
7987 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7988 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7989 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7990 to point to .plt.
7991 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7992 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7993 switch.
7994 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7995 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7996 R_X86_64_IRELATIVE to switch.
7997 (Target_x86_64::Scan::global): Likewise.
7998 (Target_x86_64::Relocate::relocate): Likewise.
7999 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8000 switch.
8001 * target.h (class Target): Add plt_section_for_global and
8002 plt_section_for_local functions. Add do_plt_section_for_global
8003 and do_plt_section_for_local virtual functions.
8004 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8005 clarifying comments.
8006 (Symbol::use_plt_offset): Handle IFUNC symbol.
8007 * object.cc (Sized_relobj::Sized_relobj): Initialize
8008 local_plt_offsets_.
8009 (Sized_relobj::local_has_plt_offset): New function.
8010 (Sized_relobj::local_plt_offset): New function.
8011 (Sized_relobj::set_local_plt_offset): New function.
8012 (Sized_relobj::do_count): Handle IFUNC symbol.
8013 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8014 a bit away from input_shndx_ field. Add set_is_func_symbol and
8015 is_ifunc_symbol functions.
8016 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8017 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8018 local_plt_offsets_ field.
8019 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8020 * output.h (class Output_section_data): Add non-const
8021 output_section function.
8022 (class Output_data_got): Update declarations.
8023 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8024 Add use_plt_offset parameter to global and local constructors.
8025 Change all callers. Change local_sym_index_ field to 31 bits.
8026 Change GSYM_CODE and CONSTANT_CODE accordingly.
8027 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8028 doing a static link don't set sh_link field.
8029 (Output_data_got::Got_entry::write): Use PLT offset if
8030 appropriate.
8031 (Output_data_got::add_global_plt): New function.
8032 (Output_data_got::add_local_plt): New function.
8033 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8034 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8035 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8036 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8037 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8038 IFUNC conditional.
8039 * testsuite/ifunc-sel.h: New file.
8040 * testsuite/ifuncmain1.c: New file.
8041 * testsuite/ifuncmain1vis.c: New file.
8042 * testsuite/ifuncmod1.c: New file.
8043 * testsuite/ifuncdep2.c: New file.
8044 * testsuite/ifuncmain2.c: New file.
8045 * testsuite/ifuncmain3.c: New file.
8046 * testsuite/ifuncmod3.c: New file.
8047 * testsuite/ifuncmain4.c: New file.
8048 * testsuite/ifuncmain5.c: New file.
8049 * testsuite/ifuncmod5.c: New file.
8050 * testsuite/ifuncmain6pie.c: New file.
8051 * testsuite/ifuncmod6.c: New file.
8052 * testsuite/ifuncmain7.c: New file.
8053 * configure, testsuite/Makefile.in: Rebuild.
8054
56f75c03
ILT
80552010-08-18 Ian Lance Taylor <iant@google.com>
8056
8057 * incremental.cc
8058 (Output_section_incremental_inputs::write_input_files): Add cast
8059 to avoid signed/unsigned comparison warning.
8060 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8061
55455f89
CC
80622010-08-12 Cary Coutant <ccoutant@google.com>
8063
8064 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8065
e2054bcb
ILT
80662010-08-13 Ian Lance Taylor <iant@google.com>
8067
8068 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8069
74f67560
DK
80702010-08-12 Cary Coutant <ccoutant@google.com>
8071 Doug Kwan <dougkwan@google.com>
8072
8073 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8074 defintion overrides non-weak undef, remember that the original undef
8075 is not weak.
8076 * symtab.cc (Symbol_table::sized_write_global): For undef without
8077 an original weak binding, set binding to global in output.
8078 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8079 * testsuite/Makefile.in: Regenerate.
8080 * testsuite/strong_ref_weak_def.sh: New file.
8081 * testsuite/strong_ref_weak_def_1.c: Ditto.
8082 * testsuite/strong_ref_weak_def_2.c: Ditto.
8083
d1238d12
CC
80842010-08-12 Cary Coutant <ccoutant@google.com>
8085
8086 * testsuite/incremental_test.sh: Rewrite.
8087 * testsuite/incremental_test_1.c: Rewrite.
8088 * testsuite/incremental_test_2.c: Rewrite.
8089
0e70b911
CC
80902010-08-12 Cary Coutant <ccoutant@google.com>
8091
8092 * arm.cc (Target_arm::got_size): Add const.
8093 (Target_arm::got_entry_count): New function.
8094 (Target_arm::plt_entry_count): New function.
8095 (Target_arm::first_plt_entry_offset): New function.
8096 (Target_arm::plt_entry_size): New function.
8097 (Output_data_plt_arm::entry_count): New function.
8098 (Output_data_plt_arm::first_plt_entry_offset): New function.
8099 (Output_data_plt_arm::get_plt_entry_size): New function.
8100 * i386.cc (Target_i386::got_size): Add const.
8101 (Target_i386::got_entry_count): New function.
8102 (Target_i386::plt_entry_count): New function.
8103 (Target_i386::first_plt_entry_offset): New function.
8104 (Target_i386::plt_entry_size): New function.
8105 (Output_data_plt_i386::entry_count): New function.
8106 (Output_data_plt_i386::first_plt_entry_offset): New function.
8107 (Output_data_plt_i386::get_plt_entry_size): New function.
8108 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8109 find_incremental_inputs_sections. Dump incremental_got_plt section.
8110 * incremental.cc: Include target.h.
8111 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8112 parameter. Adjust all callers. Find incremental_got_plt section.
8113 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8114 section.
8115 (Output_section_incremental_inputs::set_final_data_size): Calculate
8116 size of incremental_got_plt section.
8117 (Output_section_incremental_inputs::do_write): Write the
8118 incremental_got_plt section.
8119 (Got_plt_view_info): New struct.
8120 (Local_got_offset_visitor): New class.
8121 (Global_got_offset_visitor): New class.
8122 (Global_symbol_visitor_got_plt): New class.
8123 (Output_section_incremental_inputs::write_got_plt): New function.
8124 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8125 Add parameter. Adjust all callers.
8126 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8127 (Incremental_inputs::got_plt_section): New function.
8128 (Incremental_inputs::got_plt_section_): New data member.
8129 (Incremental_got_plt_reader): New class.
8130 * layout.cc (Layout::create_incremental_info_sections): Add the
8131 incremental_got_plt section.
8132 * object.h (Got_offset_list::get_list): New function.
8133 (Got offset_list::for_all_got_offsets): New function.
8134 (Sized_relobj::local_got_offset_list): New function.
8135 * powerpc.cc (Target_powerpc::got_size): Add const.
8136 (Target_powerpc::got_entry_count): New function.
8137 (Target_powerpc::plt_entry_count): New function.
8138 (Target_powerpc::first_plt_entry_offset): New function.
8139 (Target_powerpc::plt_entry_size): New function.
8140 (Output_data_plt_powerpc::entry_count): New function.
8141 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8142 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8143 * sparc.cc (Target_sparc::got_size): Add const.
8144 (Target_sparc::got_entry_count): New function.
8145 (Target_sparc::plt_entry_count): New function.
8146 (Target_sparc::first_plt_entry_offset): New function.
8147 (Target_sparc::plt_entry_size): New function.
8148 (Output_data_plt_sparc::entry_count): New function.
8149 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8150 (Output_data_plt_sparc::get_plt_entry_size): New function.
8151 * symtab.h (Symbol::got_offset_list): New function.
8152 (Symbol_table::for_all_symbols): New function.
8153 * target.h (Sized_target::got_entry_count): New function.
8154 (Sized_target::plt_entry_count): New function.
8155 (Sized_target::plt_entry_size): New function.
8156 * x86_64.cc (Target_x86_64::got_size): Add const.
8157 (Target_x86_64::got_entry_count): New function.
8158 (Target_x86_64::plt_entry_count): New function.
8159 (Target_x86_64::first_plt_entry_offset): New function.
8160 (Target_x86_64::plt_entry_size): New function.
8161 (Output_data_plt_x86_64::entry_count): New function.
8162 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8163 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8164
09ec0418
CC
81652010-08-12 Cary Coutant <ccoutant@google.com>
8166
8167 * archive.cc: Include incremental.h.
8168 (Archive::Archive): Initialize incremental_info_.
8169 (Archive::include_member): Record archive members in incremental info.
8170 (Add_archive_symbols::run): Record begin and end of an archive in
8171 incremental info.
8172 (Lib_group::include_member): Record objects in incremental info.
8173 * archive.h (Incremental_archive_entry): Forward declaration.
8174 (Archive::set_incremental_info): New member function.
8175 (Archive::incremental_info): New member function.
8176 (Archive::Unused_symbol_iterator): New class.
8177 (Archive::unused_symbols_begin): New member function.
8178 (Archive::unused_symbols_end): New member function.
8179 (Archive::incremental_info_): New data member.
8180 * incremental-dump.cc (find_input_containing_global): New function.
8181 (dump_incremental_inputs): Dump new incremental info sections.
8182 * incremental.cc: Include symtab.h.
8183 (Output_section_incremental_inputs): New class.
8184 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8185 new incremental info sections.
8186 (Sized_incremental_binary::do_check_inputs): Likewise.
8187 (Incremental_inputs::report_archive): Remove.
8188 (Incremental_inputs::report_archive_begin): New function.
8189 (Incremental_inputs::report_archive_end): New function.
8190 (Incremental_inputs::report_object): New function.
8191 (Incremental_inputs::finalize_inputs): Remove.
8192 (Incremental_inputs::report_input_section): New function.
8193 (Incremental_inputs::report_script): Rewrite.
8194 (Incremental_inputs::finalize): Do nothing but finalize string table.
8195 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8196 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8197 (Incremental_inputs::create_data_sections): New function.
8198 (Incremental_inputs::relocs_entsize): New function.
8199 (Output_section_incremental_inputs::set_final_data_size): New function.
8200 (Output_section_incremental_inputs::do_write): New function.
8201 (Output_section_incremental_inputs::write_header): New function.
8202 (Output_section_incremental_inputs::write_input_files): New function.
8203 (Output_section_incremental_inputs::write_info_blocks): New function.
8204 (Output_section_incremental_inputs::write_symtab): New function.
8205 * incremental.h (Incremental_script_entry): Forward declaration.
8206 (Incremental_object_entry): Forward declaration.
8207 (Incremental_archive_entry): Forward declaration.
8208 (Incremental_inputs): Forward declaration.
8209 (Incremental_inputs_header_data): Remove.
8210 (Incremental_inputs_header): Remove.
8211 (Incremental_inputs_header_write): Remove.
8212 (Incremental_inputs_entry_data): Remove.
8213 (Incremental_inputs_entry): Remove.
8214 (Incremental_inputs_entry_write): Remove.
8215 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8216 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8217 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8218 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8219 Likewise.
8220 (Incremental_input_entry): New class.
8221 (Incremental_script_entry): New class.
8222 (Incremental_object_entry): New class.
8223 (Incremental_archive_entry): New class.
8224 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8225 (Incremental_inputs::report_inputs): Remove.
8226 (Incremental_inputs::report_archive): Remove.
8227 (Incremental_inputs::report_archive_begin): New function.
8228 (Incremental_inputs::report_archive_end): New function.
8229 (Incremental_inputs::report_object): Change prototype.
8230 (Incremental_inputs::report_input_section): New function.
8231 (Incremental_inputs::report_script): Change prototype.
8232 (Incremental_inputs::get_reloc_count): New function.
8233 (Incremental_inputs::set_reloc_count): New function.
8234 (Incremental_inputs::create_data_sections): New function.
8235 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8236 (Incremental_inputs::inputs_section): New function.
8237 (Incremental_inputs::symtab_section): New function.
8238 (Incremental_inputs::relocs_section): New function.
8239 (Incremental_inputs::get_stringpool): Add const.
8240 (Incremental_inputs::command_line): Add const.
8241 (Incremental_inputs::inputs): Remove.
8242 (Incremental_inputs::command_line_key): New function.
8243 (Incremental_inputs::input_file_count): New function.
8244 (Incremental_inputs::input_files): New function.
8245 (Incremental_inputs::relocs_entsize): New function.
8246 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8247 (Incremental_inputs::finalize_inputs): Remove.
8248 (Incremental_inputs::Input_info): Remove.
8249 (Incremental_inputs::lock_): Remove.
8250 (Incremental_inputs::inputs_): Change type.
8251 (Incremental_inputs::inputs_map_): Remove.
8252 (Incremental_inputs::current_object_entry_): New data member.
8253 (Incremental_inputs::inputs_section_): New data member.
8254 (Incremental_inputs::symtab_section_): New data member.
8255 (Incremental_inputs::relocs_section_): New data member.
8256 (Incremental_inputs::reloc_count_): New data member.
8257 (Incremental_inputs_reader): New class.
8258 (Incremental_symtab_reader): New class.
8259 (Incremental_relocs_reader): New class.
8260 * layout.cc (Layout::finalize): Move finalization of incremental info
8261 and creation of incremental info sections to follow finalization of
8262 symbol table. Set offsets for postprocessing sections.
8263 (Layout::create_incremental_info_sections): Call
8264 Incremental_inputs::create_data_sections. Add incremental symtab
8265 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8266 sections to layout after input sections.
8267 * layout.h (struct Timespec): Forward declaration.
8268 (Layout::incremental_inputs): Add const.
8269 (Layout::create_incremental_info_sections): Add parameter.
8270 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8271 * object.cc: Include incremental.h.
8272 (Relobj::finalize_incremental_relocs): New function.
8273 (Sized_relobj::do_layout): Record input sections in incremental info.
8274 * object.h (Object::output_section): New function.
8275 (Object::output_section_offset): Moved from Relobj.
8276 (Object::get_incremental_reloc_base): New function.
8277 (Object::get_incremental_reloc_count): New function.
8278 (Object::do_output_section): New function.
8279 (Object::do_output_section_offset): Moved from Relobj.
8280 (Object::do_get_incremental_reloc_base): New function.
8281 (Object::do_get_incremental_reloc_count): New function.
8282 (Object::Object): Initialize new data members.
8283 (Relobj::output_section): Renamed do_output_section and moved to
8284 protected.
8285 (Relobj::output_section_offset): Moved to Object.
8286 (Relobj::do_get_incremental_reloc_base): New function.
8287 (Relobj::do_get_incremental_reloc_count): New function.
8288 (Relobj::allocate_incremental_reloc_counts): New function.
8289 (Relobj::count_incremental_reloc): New function.
8290 (Relobj::finalize_incremental_relocs): New function.
8291 (Relobj::next_incremental_reloc_index): New function.
8292 (Relobj::reloc_counts_): New data member.
8293 (Relobj::reloc_bases_): New data member.
8294 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8295 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8296 (Sized_relobj::incremental_relocs_scan): New function.
8297 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8298 (Sized_relobj::incremental_relocs_write): New function.
8299 (Sized_relobj::incremental_relocs_write_reltype): New function.
8300 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8301 incremental link.
8302 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8303 archives and object files elsewhere.
8304 (Add_symbols::run): Report object files here.
8305 (Finish_group::run): Report end of archive at end of group.
8306 * reloc.cc: Include layout.h, incremental.h.
8307 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8308 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8309 (Sized_relobj::incremental_relocs_scan): New function.
8310 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8311 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8312 (Sized_relobj::incremental_relocs_write): New function.
8313 (Sized_relobj::incremental_relocs_write_reltype): New function.
8314 * script.cc (read_input_script): Rewrite test for incremental link.
8315 Change call to Incremental_inputs::report_script.
8316 * symtab.h (Symbol_table::first_global_index): New function.
8317 (Symbol_table::output_count): New function.
8318
ce0d1972
DK
83192010-08-12 Doug Kwan <dougkwan@google.com>
8320
8321 * arm.cc (Target_arm::merge_object_attributes): Check command line
8322 options --no-wchar-size-warning and --no-enum-size-warning.
8323 * options.h (General_options): Add ld-compatible options
8324 --no-enum-size-warning and --no-wchar-size-warning.
8325
6e5710ce
ILT
83262010-08-04 Ian Lance Taylor <iant@google.com>
8327
8328 * x86_64.cc (Target_x86_64::Scan::local): Use
8329 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8330 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8331 (Target_x86_64::Scan::global): Likewise.
8332 (Target_x86_64::Relocate::relocate): Likewise.
8333 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8334 Likewise.
8335
fef830db
CC
83362010-08-03 Cary Coutant <ccoutant@google.com>
8337
8338 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8339 to reserve space in merged_strings vector. Keep total input size
8340 for stats.
8341 (Output_merge_string::do_print_merge_stats): Print total input size.
8342 * merge.h (Output_merge_string): Add input_size_ field.
8343 * stringpool.cc (Stringpool_template::string_length): Move
8344 implementations out of Stringpool_template class and place in
8345 stringpool.h.
8346 * stringpool.h (string_length): Move out of Stringpool_template.
8347
1e3811b0
ILT
83482010-08-03 Ian Lance Taylor <iant@google.com>
8349
8350 PR 11712
8351 * layout.cc (relaxation_loop_body): If address of load segment is
8352 set, adjust address to include headers if possible.
8353
7af0c620
ILT
83542010-08-03 Ian Lance Taylor <iant@google.com>
8355
8356 * version.cc (version_string): Bump to 1.10.
8357
22f0da72
ILT
83582010-08-03 Ian Lance Taylor <iant@google.com>
8359
8360 PR 11805
8361 * layout.h (enum Output_section_order): Define.
8362 (class Layout): Update declarations.
8363 * layout.cc (Layout::get_output_section): Add order parameter.
8364 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8365 is_first_non_relro parameters. Change all callers.
8366 (Layout::choose_output_section): Likewise.
8367 (Layout::add_output_section_data): Likewise.
8368 (Layout::make_output_section): Likewise. Set order.
8369 (Layout::default_section_order): New function.
8370 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8371 * output.cc (Output_section::Output_section): Initialize order_.
8372 Don't initialize deleted fields.
8373 (Output_segment::Output_segment): Don't initialize deleted
8374 fields.
8375 (Output_segment::add_output_section_to_load): New function
8376 replacing add_output_section. Change all callers to call this or
8377 add_output_section_to_nonload.
8378 (Output_segment::add_output_section_to_nonload): New function.
8379 (Output_segment::remove_output_section): Rewrite.
8380 (Output_segment::add_initial_output_data): Likewise.
8381 (Output_segment::has_any_data_sections): Likewise.
8382 (Output_segment::is_first_section_relro): Likewise.
8383 (Output_segment::maximum_alignment): Likewise.
8384 (Output_segment::has_dynamic_reloc): New function replacing
8385 dynamic_reloc_count. Change all callers.
8386 (Output_segment::has_dynamic_reloc_list): New function replacing
8387 dynamic_reloc_count_list. Change all callers.
8388 (Output_segment::set_section_addresses): Rewrite.
8389 (Output_segment::set_offset): Rewrite.
8390 (Output_segment::find_first_and_last_list): Remove.
8391 (Output_segment::set_tls_offsets): Rewrite.
8392 (Output_segment::first_section_load_address): Likewise.
8393 (Output_segment::output_section_count): Likewise.
8394 (Output_segment::section_with_lowest_load_address): Likewise.
8395 (Output_segment::write_section_headers): Likewise.
8396 (Output_segment::print_sections_to_map): Likewise.
8397 * output.h (class Output_data): Remove dynamic_reloc_count_
8398 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8399 (Output_data::add_dynamic_reloc): Rewrite.
8400 (Output_data::has_dynamic_reloc): New function.
8401 (Output_data::dynamic_reloc_count): Remove.
8402 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8403 is_last_relro_, is_first_non_relro_, is_interp_,
8404 is_dynamic_linker_section_ fields. Add order and set_order
8405 functions. Remove is_relro_local, set_is_relro_local,
8406 is_last_relro, set_is_last_relro, is_first_non_relro,
8407 set_is_first_non_relro functions, is_interp, set_is_interp,
8408 is_dynamic_linker_section, and set_is_dynamic_linker_section
8409 functions.
8410 (class Output_segment): Change Output_data_list from std::list to
8411 std:;vector. Add output_lists_ field. Remove output_data_ and
8412 output_bss_ fields. Update declarations.
8413
3ff2ccb0
ILT
84142010-08-02 Ian Lance Taylor <iant@google.com>
8415
8416 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8417 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8418 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8419
88a4108b
ILT
84202010-08-02 Ian Lance Taylor <iant@google.com>
8421
8422 PR 11855
8423 * script.cc (Script_options::Script_options): Initialize
8424 symbol_definitions_ and symbol_references_.
8425 (Script_options::add_symbol_assignment): Update
8426 symbol_definitions_ and symbol_references_.
8427 (Script_options::add_symbol_reference): New function.
8428 (script_symbol): New function.
8429 * script.h (class Script_options): Add symbol_definitions_ and
8430 symbol_references_ fields.
8431 (Script_options::referenced_const_iterator): New type.
8432 (Script_options::referenced_begin): New function.
8433 (Script_options::referenced_end): New function.
8434 (Script_options::is_referenced): New function.
8435 (Script_options::any_unreferenced): New function.
8436 * script-c.h (script_symbol): Declare.
8437 * yyscript.y (exp): Call script_symbol.
8438 * symtab.cc: Include "script.h".
8439 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8440 Change all callers. Check symbols referenced by scripts.
8441 (Symbol_table::add_undefined_symbols_from_command_line): Add
8442 layout parameter. Change all callers.
8443 (Symbol_table::do_add_undefined_symbols_from_command_line):
8444 Likewise. Break out loop body. Check symbols referenced by
8445 scripts.
8446 (Symbol_table::add_undefined_symbol_from_command_line): New
8447 function broken out of
8448 do_add_undefined_symbols_from_command_line.
8449 * symtab.h (class Symbol_table): Update declarations.
8450 * archive.cc: Include "layout.h".
8451 (Archive::should_include_member): Add layout parameter. Change
8452 all callers. Check for symbol mentioned in expression.
8453 * archive.h (class Archive): Update declaration.
8454 * object.cc (Sized_relobj::do_should_include_member): Add layout
8455 parameter.
8456 * object.h (Object::should_include_member): Add layout parameter.
8457 Change all callers.
8458 (Object::do_should_include_member): Add layout parameter.
8459 (class Sized_relobj): Update declaration.
8460 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8461 parameter.
8462 * dynobj.h (class Sized_dynobj): Update declaration.
8463 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8464 layout parameter.
8465 * plugin.h (class Sized_pluginobj): Update declaration.
8466
5f1ab67a
ILT
84672010-08-02 Ian Lance Taylor <iant@google.com>
8468
8469 PR 11866
8470 * output.cc (Output_segment::set_offset): Search for the first and
8471 last sections rather than assuming that the list is in order.
8472 (Output_segment::find_first_and_last_list): New function.
8473 * output.h (class Output_segment): Update declarations.
8474 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8475 (relro_strip_test_SOURCES): New variable.
8476 (relro_strip_test_DEPENDENCIES): New variable.
8477 (relro_strip_test_LDFLAGS): New variable.
8478 (relro_strip_test_LDADD): New variable.
8479 (relro_strip_test.so): New target.
8480
a8df5856
ILT
84812010-08-02 Ian Lance Taylor <iant@google.com>
8482
8483 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8484 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8485 (Target_i386::got_tlsdesc_section): New function.
8486 (Target_i386::got_section): Create space for GOT entries for
8487 TLSDESC relocations.
8488 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8489 R_386_TLS_GOTDESC.
8490 (Target_i386::Scan::global): Likewise.
8491 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8492 using TLSDESC GOT.
8493 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8494 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8495 (Target_x86_64::got_tlsdesc_section): New function.
8496 (Target_x86_64::got_section): Create space for GOT entries for
8497 TLSDESC relocations.
8498 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8499 R_386_TLS_GOTDESC.
8500 (Target_x86_64::Scan::global): Likewise.
8501 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8502 using TLSDESC GOT.
8503
0c10a0a6
ILT
85042010-08-02 Ian Lance Taylor <iant@google.com>
8505
8506 * testsuite/final_layout.sh: Use dc to convert from hex to
8507 decimal.
8508
41cbeecc
ST
85092010-07-29 Sriraman Tallam <tmsriram@google.com>
8510
8511 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8512 paramter to the call to gold::gc_process_relocs.
8513 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8514 paramter to the call to gold::gc_process_relocs.
8515 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8516 parameter to the call to gold::gc_process_relocs.
8517 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8518 template parameter to the call to gold::gc_process_relocs.
8519 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8520 paramter to the call to gold::gc_process_relocs.
8521 * gc.h (get_embedded_addend_size): New function.
8522 (gc_process_relocs): Save the size of the reloc for use by ICF.
8523 * icf.cc (get_section_contents): Get the addend from the text section
8524 for SHT_REL relocation sections.
8525 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8526 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8527 * int_encoding.h (read_from_pointer): New overloaded function.
8528 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8529 * testsuite/icf_sht_rel_addend_test.sh: New file.
8530 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8531 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8532
6ea55b82
RW
85332010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8534
8535 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8536 * Makefile.in: Regenerate.
8537 * testsuite/Makefile.in: Regenerate.
8538
9691462b
ILT
85392010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8540
8541 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8542 * gold/testsuite/debug_msg.cc: Likewise.
8543 * gold/testsuite/odr_violation1.cc
8544 * gold/testsuite/odr_violation2.cc
8545
76897331
CC
85462010-07-21 Cary Coutant <ccoutant@google.com>
8547
8548 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8549 string, and length fields.
8550 (Output_merge_string::Merged_strings_list): New type.
8551 (Output_merge_string::Merged_strings_lists): New typedef.
8552 (Output_merge_string): Replace merged_strings_ with
8553 merged_strings_lists_.
8554 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8555 Merged_strings_list per input object and section. Don't store pointer
8556 to the string. Don't store length with each merged string entry.
8557 (Output_merge_string::finalize_merged_data): Loop over list of merged
8558 strings lists. Recompute length of each merged string.
8559
78384e8f
CC
85602010-07-15 Cary Coutant <ccoutant@google.com>
8561
8562 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8563 here.
8564
783659f9
ILT
85652010-07-14 Ian Lance Taylor <iant@google.com>
8566
8567 * descriptors.cc (Descriptors::open): Report correct name in error
8568 message.
8569
131687b4
DK
85702010-07-13 Doug Kwan <dougkwan@google.com>
8571
8572 * arm.cc (Arm_input_section::Arm_input_section): For a
8573 SHT_ARM_EXIDX section, always keeps the input sections.
8574 (Arm_input_section::set_exidx_section_link): New method.
8575 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8576 has_errors_ to false.
8577 (Arm_exidx_input_section::has_errors,
8578 Arm_exidx_input_section::set_has_errors): New methods.
8579 (Arm_exidx_input_section::has_errors_): New data member.
8580 (Arm_relobj::get_exidx_shndx_list): New method.
8581 (Arm_output_section::append_text_sections_to_list): Do not skip
8582 section without SHF_EXECINSTR.
8583 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8584 errors.
2e702c99 8585 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8586 section header. Make error messages more verbose. Check for
8587 a non-executable section linked to an EXIDX section.
8588 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8589 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8590 check that there is no deferred EXIDX section if we exit early.
8591 Instead of not making an EXIDX section in case of an error, make one
8592 and set the has_errors flag of it.
8593 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8594 in a relocatable link.
8595 (Target_arm::do_relax): Look for the EXIDX output section instead of
8596 assuming that it is called .ARM.exidx.
2e702c99 8597 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8598 section list. Do not check for SHF_EXECINSTR section flags but
8599 skip any input section with errors.
8600 * output.cc (Output_section::Output_section): Initialize
8601 always_keeps_input_sections_ to false.
8602 (Output_section::add_input_section): Check for
8603 always_keeps_input_sections_.
8604 * output.h (Output_section::always_keeps_input_sections,
8605 Output_section::set_always_keeps_input_sections): New methods.
8606 (Output_section::always_keeps_input_sections): New data member.
8607
69517287
RÁE
86082010-07-13 Rafael Espindola <espindola@google.com>
8609
8610 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8611 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8612
82742395
ILT
86132010-07-13 Philip Herron <herron.philip@googlemail.com>
8614 Ian Lance Taylor <iant@google.com>
8615
8616 * output.h (Output_section_lookup_maps::add_merge_section):
8617 Correct check of whether value was inserted.
8618 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8619 (Output_section_lookup_maps::add_relaxed_input_section):
8620 Likewise.
8621 * arm.cc (Target_arm::got_section): Remove used local os.
8622 * i386.cc (Target_i386::got_section): Likewise.
8623 * x86_64.cc (Target_x86_64::got_section): Likewise.
8624 * sparc.cc (Target_sparc::got_section): Likewise.
8625 (Target_sparc::relocate): Remove unused local have_got_offset.
8626 * powerpc.cc (Target_powerpc::relocate): Likewise.
8627
f2d707b5
ILT
86282010-07-13 Ian Lance Taylor <iant@google.com>
8629
241531d6
ILT
8630 * compressed_output.cc (zlib_decompress): Fix signature in
8631 !HAVE_ZLIB_H case.
8632
f2d707b5
ILT
8633 * archive.cc (Archive::include_member): Unlock an external member
8634 of a thin archive. Don't bother to delete an object we know is
8635 NULL.
8636
a2e47362
CC
86372010-07-12 Cary Coutant <ccoutant@google.com>
8638
8639 * compressed_output.cc (zlib_decompress): New function.
8640 (get_uncompressed_size): New function.
8641 (decompress_input_section): New function.
8642 * compressed_output.h (get_uncompressed_size): New function.
8643 (decompress_input_section): New function.
8644 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8645 Handle compressed debug sections.
8646 * layout.cc (is_compressed_debug_section): New function.
8647 (Layout::output_section_name): Map compressed section names to
8648 canonical names.
8649 * layout.h (is_compressed_debug_section): New function.
8650 (is_debug_info_section): Recognize compressed debug sections.
8651 * merge.cc: Include compressed_output.h.
8652 (Output_merge_data::do_add_input_section): Handle compressed
8653 debug sections.
8654 (Output_merge_string::do_add_input_section): Handle compressed
8655 debug sections.
8656 * object.cc: Include compressed_output.h.
8657 (Sized_relobj::Sized_relobj): Initialize new data members.
8658 (build_compressed_section_map): New function.
8659 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8660 * object.h (Object::section_is_compressed): New method.
8661 (Object::do_section_is_compressed): New method.
8662 (Sized_relobj::Compressed_section_map): New type.
8663 (Sized_relobj::do_section_is_compressed): New method.
8664 (Sized_relobj::compressed_sections_): New data member.
8665 * output.cc (Output_section::add_input_section): Handle compressed
8666 debug sections.
8667 * reloc.cc: Include compressed_output.h.
8668 (Sized_relobj::write_sections): Handle compressed debug sections.
8669
ce279a62
CC
86702010-07-08 Cary Coutant <ccoutant@google.com>
8671
8672 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8673 weak when resolving to a dynamic def.
8674 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8675 for weak undef/dynamic def cases. Adjust callers.
8676 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8677 undef_binding_weak_.
8678 (Symbol_table::sized_write_globals): Adjust symbol binding.
8679 (Symbol_table::sized_write_symbol): Add binding parameter.
8680 * symtab.h (Symbol::set_undef_binding): New method.
8681 (Symbol::is_undef_binding_weak): New method.
8682 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8683 (Symbol_table::should_override): Add new parameter.
8684 (Symbol_table::sized_write_symbol): Add new parameter.
8685
8686 * testsuite/weak_undef_file1.cc: Add new test case.
8687 * testsuite/weak_undef_file2.cc: Fix header comment.
8688 * testsuite/weak_undef_test.cc: Add new test case.
8689
b2286c10
DK
86902010-06-29 Doug Kwan <dougkwan@google.com>
8691
8692 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8693 Initialize USE_SYMBOL_.
8694 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8695 definition.
8696 (Arm_reloc_property::uses_symbol_): New data member declaration.
8697 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8698 uses symbol value and symbol is undefined but not weakly undefined.
8699
4802450a
RÁE
87002010-06-28 Rafael Espindola <espindola@google.com>
8701
8702 * plugin.cc (Plugin::load): Use dlerror.
8703
e5ca47ba
ILT
87042010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8705
8706 * symtab.cc (detect_odr_violations): When reporting an ODR
8707 violation, report an object where the symbol is defined.
8708
8a75a161
DK
87092010-06-25 Doug Kwan <dougkwan@google.com>
8710
8711 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8712 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8713 definition.
8714 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8715 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8716 target hook to detect function points.
8717 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8718 * icf.h (Icf::check_section_for_function_pointers): Change type of
8719 parameter SECTION_NAME to const reference to std::string. Use
8720 target hook to determine if section may have unsafe pointers.
8721 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8722 method definition.
8723
42218b9f
RÁE
87242010-06-21 Rafael Espindola <espindola@google.com>
8725
8726 * fileread.cc (Input_file::find_fie): New
8727 (Input_file::open): Use Input_file::find_fie.
8728 * fileread.h (Input_file::find_fie): New
8729 * plugin.cc (set_extra_library_path): New.
8730 (Plugin::load): Add set_extra_library_path to the transfer vector.
8731 (Plugin_manager::set_extra_library_path): New.
8732 (Plugin_manager::add_input_file): Use the extra search path if set.
8733 (set_extra_library_path(): New.
8734 * plugin.h (Plugin_manager): Add set_extra_library_path and
8735 extra_search_path_.
8736
a0506cca
CC
87372010-06-19 Cary Coutant <ccoutant@google.com>
8738
8739 * layout.cc (gdb_sections): Add .debug_types.
8740 (lines_only_debug_sections): Likewise.
8741
6508b958
RÁE
87422010-06-18 Rafael Espindola <espindola@google.com>
8743
8744 * plugin.cc (add_input_file,add_input_library)
8745 (Plugin_manager::add_input_file): Make filename arguments const.
8746 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8747 const.
8748
3e235302
DK
87492010-06-16 Doug Kwan <dougkwan@google.com>
8750
8751 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8752 .ARM.attributes section if we have not merged any input
8753 attributes sections.
8754
106e8a6c
DK
87552010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8756
8757 * arm.cc: Allow combining objects with no EABI version
8758 information.
8759
91ff43fe
RÁE
87602010-06-15 Rafael Espindola <espindola@google.com>
8761
8762 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8763
68ed838c
ILT
87642010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8765
8766 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8767 (struct iovec): Correct !HAVE_READV definition.
8768
f3a2388f
CC
87692010-06-10 Cary Coutant <ccoutant@google.com>
8770
8771 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8772 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8773 reloc sections.
8774 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8775
8776 PR 11683
8777 * symtab.h (Symbol::is_placeholder): New member function.
8778 * target-reloc.h (relocate_section): Check for placeholder symbols.
8779
8780 * testsuite/Makefile.am (plugin_test_8): New test.
8781 (plugin_test_9): New test.
8782 * testsuite/Makefile.in: Regenerate.
8783
e1df38aa
NC
87842010-06-09 Nick Clifton <nickc@redhat.com>
8785
8786 * yyscript.y (input_list_element): Allow strings prefixed with
8787 the '-' character. Treat these as libraries.
8788 * script.cc (script_add_library): New function. Adds a library
8789 specified by "-l<name>" found in an input script.
8790 * script-c.h: Add prototype for script_add_library.
8791
25bbe950
DK
87922010-06-07 Doug Kwan <dougkwan@google.com>
8793
8794 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8795 Restrict stub-group size to be within long conditional branch
8796 range when working around cortex-A8 erratum.
8797
0f32ea4c
ILT
87982010-06-07 Damien Diederen <dd@crosstwine.com>
8799
8800 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8801 #ifdef typo.
8802
8fe2a369
ST
88032010-06-03 Sriraman Tallam <tmsriram@google.com>
8804
8805 PR gold/11658
8806 * output.cc
8807 (Output_section::Input_section_sort_entry::compare_section_ordering):
8808 Change to return non-zero correctly.
8809 (Output_section::Input_section_sort_section_order_index_compare
8810 ::operator()): Change to fix ambiguity in comparisons.
8811
6e9ba2ca
ST
88122010-06-01 Sriraman Tallam <tmsriram@google.com>
8813
8814 * gold.h (is_wildcard_string): New function.
8815 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8816 (Layout::layout_eh_frame): Ditto.
8817 (Layout::find_section_order_index): New method.
8818 (Layout::read_layout_from_file): New method.
8819 * layout.h (Layout::find_section_order_index): New method.
8820 (Layout::read_layout_from_file): New method.
8821 (Layout::input_section_position_): New private member.
8822 (Layout::input_section_glob_): New private member.
8823 * main.cc (main): Call read_layout_from_file here.
8824 * options.h (--section-ordering-file): New option.
8825 * output.cc (Output_section::input_section_order_specified_): New
8826 member.
8827 (Output_section::Output_section): Initialize new member.
8828 (Output_section::add_input_section): Add new parameter.
8829 Keep input sections when --section-ordering-file is used.
8830 (Output_section::set_final_data_size): Sort input sections when
8831 section ordering file is specified.
8832 (Output_section::Input_section_sort_entry): Add new parameter.
8833 Check sorting type.
8834 (Output_section::Input_section_sort_entry::compare_section_ordering):
8835 New method.
8836 (Output_section::Input_section_sort_compare::operator()): Change to
8837 consider section_order_index.
8838 (Output_section::Input_section_sort_init_fini_compare::operator()):
8839 Change to consider section_order_index.
8840 (Output_section::Input_section_sort_section_order_index_compare
8841 ::operator()): New method.
8842 (Output_section::sort_attached_input_sections): Change to sort
8843 according to section order when specified.
e1df38aa
NC
8844 (Output_section::add_input_section<32, true>): Add new parameter.
8845 (Output_section::add_input_section<64, true>): Add new parameter.
8846 (Output_section::add_input_section<32, false>): Add new parameter.
8847 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8848 * output.h (Output_section::add_input_section): Add new parameter.
8849 (Output_section::input_section_order_specified): New
8850 method.
8851 (Output_section::set_input_section_order_specified): New method.
8852 (Input_section::Input_section): Initialize section_order_index_.
8853 (Input_section::section_order_index): New method.
8854 (Input_section::set_section_order_index): New method.
8855 (Input_section::section_order_index_): New member.
8856 (Input_section::Input_section_sort_section_order_index_compare): New
8857 struct.
8858 (Output_section::input_section_order_specified_): New member.
8859 * script-sections.cc (is_wildcard_string): Delete and move modified
8860 method to gold.h.
8861 (Output_section_element_input::Output_section_element_input): Modify
8862 call to is_wildcard_string.
8863 (Output_section_element_input::Input_section_pattern
8864 ::Input_section_pattern): Ditto.
8865 (Output_section_element_input::Output_section_element_input): Ditto.
8866 * testsuite/Makefile.am (final_layout): New test case.
8867 * testsuite/Makefile.in: Regenerate.
8868 * testsuite/final_layout.cc: New file.
8869 * testsuite/final_layout.sh: New file.
8870
3537c84b
RÁE
88712010-06-01 Rafael Espindola <espindola@google.com>
8872
8873 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8874
105b6afd
RÁE
88752010-06-01 Rafael Espindola <espindola@google.com>
8876
8877 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8878 visibility of symbols.
8879
29e11421
DK
88802010-05-27 Doug Kwan <dougkwan@google.com>
8881
8882 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8883 from start of output section instead of address for a local symbol
8884 in a merged or relaxed section when doing a relocatable link.
8885
5e0f337e
RÁE
88862010-05-26 Rafael Espindola <espindola@google.com>
8887
703d02da 8888 PR 11604
5e0f337e
RÁE
8889 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8890 adding sections the garbage collector removed.
8891 * gold/testsuite/Makefile.am: Add test.
8892 * gold/testsuite/Makefile.in: Regenerate.
8893 * gold/testsuite/plugin_test_7.sh: New.
8894 * gold/testsuite/plugin_test_7_1.c: New.
8895 * gold/testsuite/plugin_test_7_2.c: New.
8896
f4187277
RÁE
88972010-05-26 Rafael Espindola <espindola@google.com>
8898
8899 * script-sections.cc (Output_section_definition::set_section_addresses):
8900 Check for --section-start.
8901
5c388529
DK
89022010-05-26 Doug Kwan <dougkwan@google.com>
8903
8904 * arm.cc (Arm_scan_relocatable_relocs): New class.
8905 (Target_arm::relocate_special_relocatable): New method.
8906 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8907 (Arm_relocate_functions::thumb_branch_common): Same.
8908 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8909 instead of Default_scan_relocatable_relocs.
8910 * target-reloc.h (relocate_for_relocatable): Let target handle
8911 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8912 * target.h (Sized_target::relocate_special_relocatable): New method.
8913
bca1c3ae
ILT
89142010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8915
8916 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8917
0439c796
DK
89182010-05-23 Doug Kwan <dougkwan@google.com>
8919
8920 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8921 instead of a cast.
8922 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8923 with a direct branch, not a conditional branch, to a stub.
8924 * merge.cc (Output_merge_base::record_input_section): New method
8925 defintion.
8926 (Output_merge_data::do_add_input_section): Record input section if
8927 keeps-input-sections flag is set.
8928 (Output_merge_string::do_add_input_section): Ditto.
8929 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8930 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8931 INPUT_SECTIONS_.
8932 (Output_merge_base::keeps_input_sections,
8933 Output_merge_base::set_keeps_input_sections,
8934 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8935 method definitions.
8936 (Output_merge_base::Input_sections): New type declaration.
8937 (Output_merge_base::input_sections_begin,
8938 Output_merge_base::input_sections_end,
8939 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8940 (Output_merge_base::bool keeps_input_sections_,
8941 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8942 Output_merge_base::input_sections_): New data members.
8943 (Output_merge_data::do_set_keeps_input_sections): New method
8944 defintion.
8945 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8946 * output.cc (Output_section::Input_section::relobj): Move method
8947 defintion from class declaration to here and handle merge sections.
8948 (Output_section::Input_section::shndx): Ditto.
8949 (Output_section::Output_section): Remove initializations of removed
8950 data members and initialize new data member LOOKUP_MAPS_.
8951 (Output_section::add_input_section): Set keeps-input-sections flag
8952 for a newly created merge output section as appropriate. Adjust code
8953 to use Output_section_lookup_maps class.
8954 (Output_section::add_relaxed_input_section): Adjst code for lookup
8955 maps code refactoring.
2e702c99 8956 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8957 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8958 class. If adding input section to a newly created merge output
8959 section fails, remove the new merge section.
8960 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8961 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8962 (Output_section::find_merge_section): Ditto.
0439c796 8963 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8964 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8965 Output_section_lookup_maps class.
8966 (Output_section::get_input_sections): Export merge sections. Adjust
8967 code to use Output_section_lookup_maps class.
8968 (Output_section:::add_script_input_section): Adjust code to use
8969 Output_section_lookup_maps class. Update lookup maps for merge
8970 sections also.
8971 (Output_section::discard_states): Use Output_section_lookup_maps.
8972 (Output_section::restore_states): Same.
8973 * output.h (Merge_section_properties): Move class defintion out of
8974 Output_section.
8975 (Output_section_lookup_maps): New class.
8976 (Output_section::Input_section::is_merge_section): New method
8977 defintion.
8978 (Output_section::Input_section::relobj): Move defintion out of class
8979 defintion. Declare method only.
8980 (Output_section::Input_section::shndx): Ditto.
8981 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8982 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8983 (Output_section::Merge_section_by_properties_map,
8984 Output_section::Output_section_data_by_input_section_map,
8985 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8986 Remove types.
2e702c99 8987 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8988 KEEPS_INPUT_SECTIONS.
8989 (Output_section::build_lookup_maps): New method declaration.
8990 (Output_section::merge_section_map_,
8991 Output_section::merge_section_by_properties_map_,
8992 Output_section::relaxed_input_section_map_,
8993 Output_section::is_relaxed_input_section_map_valid_): Remove data
8994 members.
8995 (Output_section::lookup_maps_): New data member.
8996
76295588
L
89972010-05-21 Doug Kwan <dougkwan@google.com>
8998
8999 PR gold/11619
9000 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9001 avoid a compilation error.
9002
d103a984
RÁE
90032010-05-19 Rafael Espindola <espindola@google.com>
9004
9005 * script-sections.cc (Output_section_definition::allocate_to_segment):
9006 Update the phdrs_list even when the output section is NULL.
9007 * testsuite/Makefile.am: Add test.
9008 * testsuite/Makefile.in: Regenerate.
9009 * testsuite/script_test_9.cc: New.
9010 * testsuite/script_test_9.sh: New.
9011 * testsuite/script_test_9.t: New.
9012
6625d24e
DK
90132010-05-19 Doug Kwan <dougkwan@google.com>
9014
9015 * arm.cc (Arm_input_section::original_size): New method.
9016 (Arm_input_section::do_addralign): Add a cast.
9017 (Arm_input_section::do_output_offset): Remove static cast.
9018 (Arm_input_section::original_addralign,
9019 Arm_input_section::original_size_): Change type to uint32_t.
9020 (Arm_input_section::init): Add safe casts for section alignment
9021 and size.
9022 (Arm_input_section::set_final_data_size): Do not set address and
9023 offset of stub table.
9024 (Arm_output_section::fix_exidx_coverage): Change use of of
9025 Output_section::Simple_input_section to that of
9026 Output_section::Input_section.
9027 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9028 except for the first pass.
9029 * output.cc (Output_section::get_input_sections): Change type of
9030 input_sections to std::list<Input_section>.
9031 (Output_section::add_script_input_section): Rename from
9032 Output_section::add_simple_input_section. Change type of SIS
9033 parameter from Simple_input_section to Input_section.
9034 * output.h (Output_section::Simple_input_section): Remove class.
9035 (Output_section::Input_section): Change class visibility to public.
9036 (Output_section::Input_section::addralign): Use stored alignments
9037 for special input sections if set.
9038 (Output_section::Input_section::set_addralign): New method.
9039 (Output_section::get_input_sections): Change parameter type from
9040 list of Simple_input_section to list of Input_section.
9041 (Output_section::add_script_input_section): Rename from
9042 Output_section::add_simple_input_section. Change first parameter's
9043 type from Simple_input_section to Input_section and remove the
9044 second and third parameters.
9045 * script-sections.cc (Input_section::Input_section_list): Change
9046 type to list of Output_section::Input_section/
9047 (Input_section_info::Input_section_info): Change parameter type of
9048 INPUT_SECTION to Output_section::Input_section.
9049 (Input_section_info::input_section): Change return type.
9050 (Input_section_info::input_section_): Change type to
9051 Output_section::Input_section.
9052 (Output_section_element_input::set_section_addresses): Adjust code
9053 to use Output_section::Input_section instead of
9054 Output_section::Simple_input_section. Adjust code for renaming
9055 of Output_section::add_simple_input_section.
9056 (Orphan_output_section::set_section_addresses): Ditto.
9057
e1e82ea4
RW
90582010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9059
9060 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9061 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9062
91e75c8a
RÁE
90632010-05-18 Rafael Espindola <espindola@google.com>
9064
9065 * options.cc (General_options::finalize): Handle -nostdlib.
9066 * options.h (nostdlib): New option.
9067 * script.cc (script_add_search_dir): Handle -nostdlib.
9068
da59ad79
DK
90692010-05-12 Doug Kwan <dougkwan@google.com>
9070
9071 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9072 attributes section only if there no attributes section after merging.
9073 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9074 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9075 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9076 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9077 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9078 and arm_attr_merge_7.stdout.
9079 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9080 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9081 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9082 arm_attr_merge_7b.o): New rules.
9083 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9084 arm_attr_merge_7
9085 * testsuite/Makefile.in: Regenerate.
9086 * testsuite/arm_attr_merge.sh: New file.
9087 * testsuite/arm_attr_merge_[67][ab].s: Same.
9088
3e01a7fd
NC
90892010-05-05 Nick Clifton <nickc@redhat.com>
9090
9091 * po/es.po: Updated Spanish translation.
9092
7ad2014a
L
90932010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9094
9095 * Makefile.am (install-exec-local): Properly install gold as
9096 default cross linker.
9097 * Makefile.in: Regenerated.
9098
4fda8867
NC
90992010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9100 Nick Clifton <nickc@redhat.com>
9101
9102 * configure.ac (install_as_default): Define and set to false
9103 unless --enable-gold or --enable-gold=both/gold has been
9104 specified.
9105 * configure: Regenerate.
9106
9107 * Makefile.am (install-exec-local): Install the executable as
9108 'ld.gold'. If install_as_default is true then also install it as
9109 'ld'.
9110 * Makefile.in: Regenerated.
9111
bd288ea2
ILT
91122010-04-24 Ian Lance Taylor <iant@google.com>
9113
9114 * layout.cc (Layout::layout_reloc): In relocatable link don't
9115 combine reloc sections for grouped sections.
9116
ef38fd8a
ST
91172010-04-23 Sriraman Tallam <tmsriram@google.com>
9118
9119 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9120 sections that are not ordinary to icf.
9121 * icf.cc (get_section_contents): Handle relocation pointing to section
9122 with no object or shndx information.
9123 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9124 * testsuite/Makefile.in: Regenerate.
9125 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9126 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9127
f6973bdc
ILT
91282010-04-22 Ian Lance Taylor <iant@google.com>
9129
9130 * expression.cc (Expression::Expression_eval_info): Add
9131 result_alignment_pointer field.
9132 (Expression::eval_with_dot): Add result_alignment_pointer
9133 parameter. Change all callers.
9134 (Expression::eval_maybe_dot): Likewise.
9135 (class Binary_expression): Add alignment_pointer parameter to
9136 left_value and right_value. Change all callers.
9137 (BINARY_EXPRESSION): Set result alignment.
9138 (class Trinary_expression): Add alignment_pointer parameter to
9139 arg2_value and arg3_value. Change all callers.
9140 (Trinary_cond::value): Set result alignment.
9141 (Max_expression::value, Min_expression::value): Likewise.
9142 (Align_expression::value): Likewise.
9143 * script-sections.cc (class Sections_element): Add dot_alignment
9144 parameter to set_section_addresses virtual function. Update
9145 instantiations.
9146 (class Output_section_element): Likewise.
9147 (Script_sections::create_segments): Add dot_alignment parameter.
9148 Change all callers.
9149 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9150 (Script_sections::set_phdrs_clause_addresses): Likewise.
9151 * script-sections.h: Update declarations.
9152 * script.h: Update declarations.
9153 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9154 min_p_align.
9155 * testsuite/script_test_3.t: Set large alignment.
9156 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9157 segment has expected alignment.
9158
9c9c98a5
NC
91592010-04-22 Nick Clifton <nickc@redhat.com>
9160
9161 * po/gold.pot: Updated by the Translation project.
9162 * po/vi.po: Updated Vietnamese translation.
9163
2253bfba
L
91642010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9165
9166 * testsuite/Makefile.am (check_PROGRAMS): Add
9167 icf_virtual_function_folding_test.
9168 * testsuite/Makefile.in: Regenerated.
9169
85fdf906
AH
91702010-04-15 Andrew Haley <aph@redhat.com>
9171
9172 * options.h (merge_exidx_entries): New option.
9173 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9174 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9175 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9176 (Target_arm::merge_exidx_entries): New function.
9177 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9178 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9179 to Arm_exidx_fixup constructor.
9180 Add new arg, merge_exidx_entries.
9181 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9182 Arm_output_section::fix_exidx_coverage.
9183
ce97fa81
ST
91842010-04-18 Sriraman Tallam <tmsriram@google.com>
9185
9186 * icf.cc (get_section_contents): Check for preemptible functions.
9187 Ignore addend when appropriate.
9188 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9189 section folded.
9190 (add_from_relobj): Check for section folded.
9191 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9192 * symtab.h (should_add_dynsym_entry): Add new parameter.
9193 * target-reloc.h (scan_relocs): Check for section folded.
9194 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9195 Check reloc types for function pointers in shared objects.
9196 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9197 case.
9198 (icf_preemptible_functions_test): New test case.
9199 (icf_string_merge_test): New test case.
9200 * testsuite.Makefile.in: Regenerate.
9201 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9202 bar_glob. Refactor code.
9203 * testsuite/icf_preemptible_functions_test.cc: New file.
9204 * testsuite/icf_preemptible_functions_test.sh: New file.
9205 * testsuite/icf_string_merge_test.cc: New file.
9206 * testsuite/icf_string_merge_test.sh: New file.
9207 * testsuite/icf_virtual_function_folding_test.cc: New file.
9208 * testsuite/icf_virtual_function_folding_test.sh: New file.
9209
04ceb17c
DK
92102010-04-14 Doug Kwan <dougkwan@google.com>
9211
9212 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9213 for local symbol recounting if we remove a section due to ICF.
9214 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9215 there are no regular objects in input.
9216
153e7da4
DK
92172010-04-13 Doug Kwan <dougkwan@google.com>
9218
9219 * arm.cc (Arm_input_section::set_final_data_size): Compute
9220 accurate final data size instead of using current data size.
9221
4dbd9faf
DK
92222010-04-09 Doug Kwan <dougkwan@google.com>
9223
9224 * layout.cc (Layout::choose_output_section): Handle script section
9225 types.
9226 (Layout::make_output_section_for_script): Add section type parameter.
9227 Handle script section types.
9228 * layout.h (Layout::make_output_section_for_script): Add section
9229 type parameter.
9230 * output.cc (Output_section::Output_section): Initialize data member
9231 is_noload_.
9232 (Output_section::do_reset_address_and_file_offset): Do not set address
9233 to 0 if section is a NOLOAD section.
9234 * output.h (Output_section::is_noload): New method.
9235 (Output_section::set_is_noload): Ditto.
9236 (Output_section::is_noload_): New data member.
9237 * script-c.h (Script_section_type): New enum type.
9238 (struct Parser_output_section_header): Add new file section_type.
9239 * script-sections.cc (Sections_element::output_section_name): Add
9240 parameter for returning script section type.
9241 (Output_section_definition::output_section_name): Ditto.
9242 (Output_section_definition::section_type)P; New method.
9243 (Output_section_definiton::script_section_type_name): Ditto.
9244 (Output_section_definition::script_section_type_): New data member.
9245 (Output_section_definition::Output_section_definition): Initialize
9246 data member Output_section_definition::script_section_type_.
9247 (Output_section_definition::create_sections): Pass script section type
9248 to Layout::make_output_section_for_script.
9249 (Output_section_definition::output_section_name): Return script
9250 section type to caller.
9251 (Output_section_definition::set_section_address): Do not advance
9252 dot value and load address if section type is NOLOAD. Set address
9253 of NOLOAD sections regardless of section flags.
9254 (Output_section_definition::print): Print section type if it is
9255 not SCRIPT_SECTION_TYPE_NONE.
9256 (Output_section_definition::section_type): New method.
9257 (Output_section_definition::script_section_type_name): Ditto.
9258 (Script_sections::output_section_name): Add new parameter
9259 PSECTION_TYPE for returning script section type. Pass it to
9260 section elements. Handle discard sections.
9261 (Sort_output_sections::operator()): Handle NOLOAD sections.
9262 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9263 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9264 returning script section type.
9265 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9266 INFO and NOLOAD.
9267 * yyscript.y (union): Add new field SECTION_TYPE.
9268 (COPY, DSECT, INFO, NOLOAD): New tokens.
9269 (opt_address_and_section_type): Change type to output_section_header.
9270 (section_type): New non-terminal
9271 (section_header): Handle section type.
2253bfba 9272 (opt_address_and_section_type): Return section type value.
4dbd9faf 9273
721ea635
L
92742010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9275
9276 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9277 * testsuite/plugin_common_test_2.c (foo): Likewise.
9278
6bf924b0
DK
92792010-04-08 Doug Kwan <dougkwan@google.com>
9280
9281 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9282 Output_merge_data.
9283 * output.cc (Output_section::add_merge_input_section): Simplify
9284 code and return status of Output_merge_base::add_input_section.
e1df38aa 9285 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9286 returns true.
9287
24af6f92
DK
92882010-04-07 Doug Kwan <dougkwan@google.com>
9289
9290 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9291 if section is marked as containing instructions but has no mapping
9292 symbols.
9293 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9294 correct section index.
9295 (Arm_relobj::find_linked_text_section): Ditto.
9296
00698fc5
CC
92972010-04-07 Cary Coutant <ccoutant@google.com>
9298
9299 * archive.cc (include_member): Destroy Read_symbols_data object before
9300 releasing file.
9301 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9302 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9303 (Read_symbols_data::~Read_symbols_data) New destructor.
9304 (Section_relocs::Section_relocs) New constructor.
9305 (Section_relocs::~Section_relocs) New destructor.
9306 (Read_relocs_data::Read_relocs_data) New constructor.
9307 (Read_relocs_data::~Read_relocs_data) New destructor.
9308 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9309 pointers to NULL after deleting.
9310
7296d933
DK
93112010-04-07 Doug Kwan <dougkwan@google.com>
9312
9313 * arm.cc: Replace "endianity" with "endianness" in comments.
9314 (Arm_exidx_cantunwind): Ditto.
9315 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9316 (Arm_relobj::merge_flags_and_attributes): New method.
9317 (Arm_relobj::merge_flags_and_attributes_): New data member.
9318 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9319 (Arm_relobj::scan_sections_for_stubs): Ditto.
9320 (Arm_relobj::do_read_symbols): Check to see if we really want to
9321 merge processor-specific flags and attributes. Exit early if
9322 an object is empty except for section names and the undefined symbol.
9323 (Target_arm::do_finalize_sections): Move check for ELF format to
9324 Arm_relobj::do_read_symbols. Merge processor specific flags and
9325 attributes from a regular object only when we have determined that
9326 it is aapropriate. Do not create an .ARM.attributes section in
9327 output if there is no regular input object.
9328 (Target_arm::merge_processor_specific_flags): Check
9329 --warn-mismatch before printing any error.
9330 (Target_arm::merge_object_attributes): Ditto.
9331 * gold.cc (queue_middle_tasks): Handle the case in which there is
9332 no regular object in input.
9333 * options.cc (General_options::parse_EB): New method.
9334 (General_options::parse_EL): Same.
9335 (General_options::General_options): Initialize endianness_.
9336 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9337 New options.
9338 (General_options::Endianness): New enum.
9339 (General_options::endianness): New method.
9340 (General_options::endianness_): New data member.
9341 * parameters.cc (Parameters::set_options): Check target endianness.
9342 (Parameters::set_target_once): Ditto.
9343 (Parameters::check_target_endianness): New method.
9344 (parameters_force_valid_target): If either -EL or -EB is specified,
9345 use it to define endianness of default target.
9346 * parameters.h (Parameters::check_target_endianness): New method
9347 declaration.
9348 * target.h (class Target): Change "endianity" to "endianness"
9349 in comments.
9350
efc8d4f2
RW
93512010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9352
9353 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9354 * configure: Regenerate.
9355 * Makefile.in: Regenerate.
9356 * testsuite/Makefile.in: Regenerate.
9357
be234d88
CC
93582010-04-06 Cary Coutant <ccoutant@google.com>
9359
9360 gcc PR lto/42757
9361 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9362 prevailing definitions of common symbols.
9363 * testsuite/plugin_test_6.sh: New test case.
9364 * testsuite/plugin_common_test_1.c: New test case.
9365 * testsuite/plugin_common_test_2.c: New test case.
9366 * testsuite/Makefile.am (plugin_test_6): New test case.
9367 * testsuite/Makefile.in: Regenerate.
9368
bd32c6bd
NC
93692010-04-06 Nick Clifton <nickc@redhat.com>
9370
9371 * po/vi.po: New Vietnamese translation.
9372
323c532f
DK
93732010-03-30 Doug Kwan <dougkwan@google.com>
9374
9375 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9376
4fcd97eb
DK
93772010-03-25 Doug Kwan <dougkwan@google.com>
9378
9379 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9380 to avoid a conversion warning on a 32-bit host.
9381
4ebf39db
ILT
93822010-03-24 Ian Lance Taylor <iant@google.com>
9383
9384 * testsuite/script_test_3.t: Add a TLS segment.
9385 * testsuite/Makefile.am (check_PROGRAMS): Add
9386 tls_phdrs_script_test.
9387 (tls_phdrs_script_test_SOURCES): Define.
9388 (tls_phdrs_script_test_DEPENDENCIES): Define.
9389 (tls_phdrs_script_test_LDFLAGS): Define.
9390 (tls_phdrs_script_test_LDADD): Define.
9391 * testsuite/Makefile.in: Rebuild.
9392
4a599bdd
CC
93932010-03-23 Cary Coutant <ccoutant@google.com>
9394
9395 * fileread.cc (find_or_make_view): Fix comment.
9396
6c93b22c
ILT
93972010-03-23 Ian Lance Taylor <iant@google.com>
9398
9399 * script-sections.cc (class Orphan_section_placement): Define
9400 PLACE_TLS and PLACE_TLS_BSS.
9401 (Orphan_section_placement::Orphan_section_placement): Initialize
9402 new places.
9403 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9404 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9405 (tls_script_test_SOURCES): Define.
9406 (tls_script_test_DEPENDENCIES): Define.
9407 (tls_script_test_LDFLAGS): Define.
9408 (tls_script_test_LDADD): Define.
9409 * testsuite/Makefile.in: Rebuild.
9410
a2c7281b
DK
94112010-03-22 Doug Kwan <dougkwan@google.com>
9412
9413 * arm.cc (Arm_relocate_functions::abs8,
9414 Arm_relocate_functions::abs16): Use correct check for overflow
9415 specified in the ARM ELF specs.
9416 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9417 target of a BLX instruction specially.
9418 (Reloc_stub::stub_type_for_reloc): Ditto.
9419 (Relocate::relocate): Use symbolic names instead of numeric relocation
9420 codes to report error.
9421 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9422 workaround.
9423 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9424 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9425 thumb2_blx_out_of_range.stdout
9426 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9427 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9428 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9429 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9430 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9431 thumb2_blx_in_range, thumb2_blx_in_range.o,
9432 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9433 thumb2_blx_out_of_range.o): New rules.
2e702c99 9434 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9435 thumb2_blx_in_range and thumb2_blx_out_of_range.
9436 * testsuite/Makefile.in: Regenerate.
9437 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9438 * testsuite/thumb_blx_in_range.s: New file.
9439 * testsuite/thumb_blx_out_of_range.s: New file.
9440
b0193076
RÁE
94412010-03-22 Rafael Espindola <espindola@google.com>
9442
9443 * archive.cc (Should_include): Move to archive.h.
9444 (should_include_member): Make it a member of Archive.
9445 (Lib_group): New.
9446 (Add_lib_group_symbols): New.
9447 * archive.h: Include options.h.
9448 (Archive_member): Moved from Archive.
9449 (Should_include): Moved from archive.cc.
9450 (Lib_group): New.
9451 (Add_lib_group_symbols): New.
9452 * dynobj.cc (do_should_include_member): New.
9453 * dynobj.h (do_should_include_member): New.
9454 * gold.cc (queue_initial_tasks): Update call to queue.
9455 * main.cc (main): Print lib group stats.
9456 * object.cc (do_should_include_member): New.
9457 * object.h: Include archive.h.
9458 (Object::should_include_member): New.
9459 (Object::do_should_include_member): New.
9460 (Sized_relobj::do_should_include_member): New.
9461 * options.cc (General_options::parse_start_lib): New.
9462 (General_options::parse_end_lib): New.
9463 (Input_arguments::add_file): Handle lib groups.
9464 (Input_arguments::start_group): Check we are not in a lib.
9465 (Input_arguments::start_lib): New.
9466 (Input_arguments::end_lib): New.
9467 * options.h (General_options): Add start_lib and end_lib.
9468 (Input_argument::lib_): New.
9469 (Input_argument::lib): New.
9470 (Input_argument::is_lib): New.
9471 (Input_file_lib): New.
9472 (Input_arguments::in_lib_): New.
9473 (Input_arguments::in_lib): New.
9474 (Input_arguments::start_lib): New.
9475 (Input_arguments::end_lib_): New.
9476 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9477 in unused members as preempted.
9478 (Sized_pluginobj::do_should_include_member): New.
9479 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9480 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9481 return the blocker.
9482 (Read_symbols::do_whole_lib_group): New.
9483 (Read_symbols::do_lib_group): New.
9484 (Read_symbols::do_read_symbols): Handle lib groups.
9485 (Read_symbols::get_name): Handle lib groups.
9486 * readsyms.h (Read_symbols): Add an archive member pointer.
9487 (Read_symbols::do_whole_lib_group): New.
9488 (Read_symbols::do_lib_group): New.
9489 (Read_symbols::member_): New.
9490 * script.cc (read_input_script): Update call to queue_soon.
9491
d099120c
DK
94922010-03-19 Doug Kwan <dougkwan@google.com>
9493
9494 * arm.cc (Stub_table::Stub_table): Initialize new data members
9495 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9496 (Stub_table::add_reloc_stub): Assign stub offset and update
9497 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9498 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9499 New data members.
2e702c99 9500 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9501 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9502 instead of going over all reloc stubs.
2e702c99 9503 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9504 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9505 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9506 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9507 Stringpool_template::offset_.
9508 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9509 Stringpool_template::offset_ to zero.
9510
1aa37384
DK
95112010-03-15 Doug Kwan <dougkwan@google.com>
9512
9513 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9514 offset_.
9515 (Stringpool_template::new_key_offset): New method.
9516 (Stringpool_template::add_string): Assign offsets when adding new
9517 strings.
9518 (Stringpool_template::set_string_offsets): Do not set string offsets
9519 when not optimizing.
9520 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9521 member size_.
2e702c99
RM
9522 (Chunked_vector::clear): Clear size_.
9523 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9524 (Chunked_vector::size): Return size_.
9525 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9526 (Chunked_vector::size_): New data member.
1aa37384
DK
9527 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9528 (Stringpool_template::new_key_offset): New method declaration.
9529 (Stringpool_template::offset_): New data member.
9530
b672b057
RÁE
95312010-03-15 Rafael Espindola <espindola@google.com>
9532
9533 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9534 Add_symbols' constructor.
9535 * readsyms.h (Add_symbols): Remove the input_group member.
9536
b6848d3c
ILT
95372010-03-10 Ian Lance Taylor <iant@google.com>
9538
9539 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9540 target to ask whether a reference to a symbol requires a stack
9541 split.
9542 * target.h (Target::is_call_to_non_split): New function.
9543 (Target::do_is_call_to_non_split): Declare virtual function.
9544 * target.cc: Include "symtab.h".
9545 (Target::do_is_call_to_non_split): New function.
9546 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9547
a2a5469e
CC
95482010-03-10 Cary Coutant <ccoutant@google.com>
9549
9550 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9551 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9552 (File_read::open[2]): Add whole_file_view_ to list of views.
9553 (File_read::make_view): Remove test of whole_file_view_.
9554 (File_read::find_or_make_view): Create whole_file_view_ if
9555 necessary.
9556 (File_read::clear_views): Replace bool parameter with enum;
9557 adjust all callers. Don't delete views with permanent data;
9558 do delete cached views and views from archives if
9559 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9560 if clearing the corresponding view.
9561 * fileread.h (File_read::Clear_views_mode): New enum.
9562 (File_read::View::is_permanent_view): New method.
9563 (File_read::clear_views): Replace bool parameter
9564 with enum; adjust all callers.
9565 * options.h (General_options): Change keep_files_mapped option;
9566 add map_whole_files.
9567 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9568 releasing the file.
9569 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9570 the file.
9571
8861f32b
DM
95722010-03-10 David S. Miller <davem@davemloft.net>
9573
9574 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9575
d62d0f5f
ST
95762010-03-09 Sriraman Tallam <tmsriram@google.com>
9577
9578 * icf.cc (get_section_contents): Add '@' marker after processing the
9579 merge reloc.
9580
9177756d
DK
95812010-03-08 Doug Kwan <dougkwan@google.com>
9582
9583 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9584 due to a conversion warning.
9585 (Arm_relobj::update_output_local_symbol_count): Check for local
9586 symbol with unset output index.
9587
9e9e071b
ILT
95882010-03-05 Ian Lance Taylor <iant@google.com>
9589
9590 * options.h (class General_options): Add --spare-dynamic-tags.
9591 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9592 --spare-dynamic-tags.
9593
a81ee015
ILT
95942010-03-05 Ian Lance Taylor <iant@google.com>
9595
9596 * incremental.cc: Include "libiberty.h".
9597
44ec90b9
RO
95982010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9599
9600 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9601 function, is_info_ member.
9602 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9603 (Versions::Versions): Update caller.
9604 (Versions::define_base_version): Likewise.
9605 (Versions::add_def): Likewise.
9606
0897ed3b
ST
96072010-03-03 Sriraman Tallam <tmsriram@google.com>
9608
9609 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9610 (Scan::possible_function_pointer_reloc): New function.
9611 (Scan::local_reloc_may_be_function_pointer): Change to call
9612 possible_function_pointer_reloc.
9613 (Scan::global_reloc_may_be_function_pointer): Ditto.
9614 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9615 relocations in ".data.rel.ro._ZTV" section.
9616 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9617 * testsuite/icf_safe_so_test.cc: Ditto.
9618 * testsuite/icf_safe_test.cc: Ditto.
9619 * testsuite/icf_safe_test.sh: Ditto.
9620
d3bbad62
ILT
96212010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9622 Ian Lance Taylor <iant@google.com>
9623
9624 * target-reloc.h (relocate_section): Check the symbol table index
9625 for -1U before setting the local symbol index.
9626 (scan_relocatable_relocs): If copying the relocation, record that
9627 the local symbol is required.
9628 * object.h (Symbol_value::is_output_symtab_index_set): New
9629 function.
9630 (Symbol_value::may_be_discarded_from_output_symtab): New
9631 function.
9632 (Symbol_value::has_output_symtab_entry): New function.
9633 (Symbol_value::needs_output_symtab_entry): Remove.
9634 (Symbol_value::output_symtab_index): Make sure the symbol index is
9635 set.
9636 (Symbol_value::set_output_symtab_index): Make sure the symbol
9637 index is not set. Make sure the new index is valid.
9638 (Symbol_value::set_must_have_output_symtab_entry): New function.
9639 (Symbol_value::has_output_dynsym_entry): New function.
9640 (Symbol_value::set_output_dynsym_index): Make sure the new index
9641 is valid.
9642 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9643 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9644 local symbol if permitted.
9645 (Sized_relobj::do_finalize_local_symbols): Call
9646 is_output_symtab_index_set rather than needs_output_symtab_entry.
9647 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9648 rather than needs_output_symtab_entry. Call
9649 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9650 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9651 is_output_symtab_index_set rather than needs_output_symtab_entry.
9652 * testsuite/discard_locals_relocatable_test.c: New file.
9653 * testsuite/discard_locals_test.sh: Test -r.
9654 * testsuite/Makefile.am (check_DATA): Add
9655 discard_locals_relocatable_test1.syms,
9656 discard_local_relocatable_test2.syms.
9657 (MOSTLYCLEANFILES): Likewise. Also add
9658 discard_locals_relocatable_test1.lout and
9659 discard_locals_relocatable_test2.out.
9660 (discard_locals_relocatable_test1.syms): New target.
9661 (discard_locals_relocatable_test.o): New target.
9662 (discard_locals_relocatable_test1.out): New target.
9663 (discard_locals_relocatable_test2.syms): New target.
9664 (discard_locals_relocatable_test2.out): New target.
9665 (various): Add missing ../ld-new dependencies.
9666 * testsuite/Makefile.in: Rebuild.
9667
7e8ccf26
NC
96682010-03-03 Nick Clifton <nickc@redhat.com>
9669
9670 * po/fi.po: New Finnish translation.
9671
2a0ff005
DK
96722010-03-01 Doug Kwan <dougkwan@google.com>
9673
9674 * layout.cc (Layout::Layout): Force section types of .init_array*,
9675 .preinit_array* and .fini_array* sections.
9676 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9677 Fix check of return value of std::string::find.().
9678 (Output_section::Input_section_sort_compare::operator()): Remove
9679 comment about .init_array.
9680 (Output_section::Input_section_sort_init_fini_compare::operator()):
9681 New method.
9682 (Output_section::sort_attached_input_sections): Handle .init_array
9683 and .fini_array specially.
9684 * output.h (Output_section::Inut_section_sort_compare): Update
9685 comment.
9686 (Output_section::Input_section_sort_init_fini_compare): New struct.
9687
c3e4ae29
DK
96882010-02-26 Doug Kwan <dougkwan@google.com>
9689
9690 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9691 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9692 * testsuite/debug_msg.sh: Avoid matching source line number for
9693 use of global variable undef_int.
9694
2fd9ae7a
DK
96952010-02-26 Doug Kwan <dougkwan@google.com>
9696
9697 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9698 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9699 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9700 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9701 * options.cc (General_options::General_options): Initialize member
9702 fix_v4bx_.
9703 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9704 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9705 and rm_no_fix_v4bx.stdout
9706 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9707 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9708 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9709 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9710 and arm_no_fix_v4bx.
9711 * Makefile.in: Regenerate.
9712 * testsuite/arm_fix_v4bx.s: New file.
9713 * testsuite/arm_fix_v4bx.sh: Ditto.
9714
67ec7d0b
DK
97152010-02-24 Doug Kwan <dougkwan@google.com>
9716
9717 * arm.cc (Target_arm::got_section): Make the .got section the first
9718 non RELRO section in the data segment.
9719 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9720 suffixes of section names.
9721
10165461
DK
97222010-02-24 Doug Kwan <dougkwan@google.com>
9723
9724 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9725 flags and attributes merging if an input file is a binary file.
9726 * fileread.cc (Input_file::open): Record format of original file.
9727 * fileread.h (Input_file::Format): New enum type.
2e702c99 9728 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9729 (Input_file::format): New method definition.
9730 (Input_file::format_):: New data member.
9731
4a54abbb
DK
97322010-02-24 Doug Kwan <dougkwan@google.com>
9733
9734 * arm.cc (Arm_output_data_got): New class.
9735 (ARM_TCB_SIZE): New constant
9736 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9737 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9738 If user uses a script with a SECTIONS clause, issue only a warning
9739 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9740 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9741 garbage collection.
9742 (Target_arm::got_mode_index_entry): Handle static linking.
9743 (Target_arm::Scan::local): Ditto.
9744 (Target_arm::Scan::global): Ditto.
9745 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9746 all incorrectly implemented relocations.
e1df38aa 9747 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9748 Arm_output_section::fix_exidx_coverage.
9749 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9750 from ".ARM.exidx." and ".ARM.extab.".
9751
ca419a6f
ILT
97522010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9753
9754 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9755 section if it does not already exist.
9756 * attributes.cc (Attributes_section_data::Attributes_section_data):
9757 Don't crash if size is zero.
9758
135b9c78
ILT
97592010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9760 Ian Lance Taylor <iant@google.com>
9761
9762 * gold.cc (queue_middle_tasks): If no input files were opened,
9763 exit.
9764 * workqueue.h (Task_function::Task_function): Assert that there is
9765 a blocker.
9766
bb0bfe4f
DK
97672010-02-22 Doug Kwan <dougkwan@google.com>
9768
9769 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9770 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9771 types to avoid warnings due to different uint64_t implementations
9772 on different hosts.
9773
2a2b6d42
DK
97742010-02-21 Doug Kwan <dougkwan@google.com>
9775
9776 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9777 handling of the maximum backward branch offset.
2e702c99 9778 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9779 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9780 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9781 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9782 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9783 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9784 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9785 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9786 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9787 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9788 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9789 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9790 thumb2_bl_out_of_range.o): New rules.
9791 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9792 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9793 thumb2_bl_out_of_range
9794 * testsuite/Makefile.in: Regenerate.
9795 * testsuite/arm_bl_in_range.s: New file.
9796 * testsuite/arm_bl_out_of_range.s: Ditto.
9797 * testsuite/arm_branch_in_range.sh: Ditto.
9798 * testsuite/arm_branch_range.t: Ditto.
9799 * testsuite/thumb2_branch_range.t: Ditto.
9800 * testsuite/thumb_bl_in_range.s: Ditto.
9801 * testsuite/thumb_bl_out_of_range.s: Ditto.
9802 * testsuite/thumb_branch_range.t: Ditto.
9803
b487ad64
ST
98042010-02-20 Sriraman Tallam <tmsriram@google.com>
9805
9806 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9807 Add reloc offset information.
9808 * icf.cc (get_section_contents): Change iterators to point to the new
9809 vectors. Add reloc offset information to the contents.
9810 * icf.h (Icf::Sections_reachable_info): New typedef.
9811 (Icf::Sections_reachable_list): New typedef.
9812 (Icf::Offset_info): New typedef.
9813 (Icf::Reloc_info): New struct typedef.
9814 (Icf::Reloc_info_list): New typedef.
9815 (Icf::symbol_reloc_list): Delete method.
9816 (Icf::addend_reloc_list): Delete method.
9817 (Icf::section_reloc_list): Delete method.
9818 (Icf::reloc_info_list): New method.
9819 (Icf::reloc_info_list_): New member.
9820
f96accdf
DK
98212010-02-19 Doug Kwan <dougkwan@google.com>
9822
9823 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9824 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9825 * arm.cc (Arm_relocation_functions): New forward declaration.
9826 (Target_arm::Target_arm): Initialize new data members
9827 got_mod_index_offset_ and tls_base_symbol_defined_.
9828 (Target_arm::Relocate::relocate_tls): New method.
9829 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9830 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9831 New methods.
2e702c99 9832 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9833 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9834 (Target_arm::got_mod_index_offset_,
9835 Target_arm::tls_base_symbol_defined_): New data members.
9836 (Target_arm::Scan::local, Target::Scan::global,
9837 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9838 relocations.
9839
c8761b9a
DK
98402010-02-18 Doug Kwan <dougkwan@google.com>
9841
9842 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9843 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9844 text section as a parameter becuase some broken tools may not set
9845 the link in section header.
9846 (Target_arm::has_got_section): New method.
9847 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9848 without any mapping symbol as data only. Remove warning.
9849 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9850 link in its section header, try to discover the link by inspecting the
9851 REL31 relocation at the beginning of the section.
9852 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9853 in error message.
9854 (Target_arm::Scan::global): Treat any reference to the symbol
9855 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9856
21bb3914
ST
98572010-02-12 Sriraman Tallam <tmsriram@google.com>
9858
9859 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9860 (Scan::global_reloc_may_be_function_pointer): New function.
9861 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9862 (Scan::global_reloc_may_be_function_pointer): New function.
9863 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9864 (Scan::global_reloc_may_be_function_pointer): New function.
9865 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9866 (Scan::global_reloc_may_be_function_pointer): New function.
9867 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9868 (Scan::global_reloc_may_be_function_pointer): New function.
9869 (Scan::possible_function_pointer_reloc): New function.
9870 (Target_x86_64::can_check_for_function_pointers): New function.
9871 * gc.h (gc_process_relocs): Scan relocation types to determine if
9872 function pointers were taken for targets that support it.
9873 * icf.cc (Icf::find_identical_sections): Include functions for
9874 folding in safe ICF whose pointer is not taken.
9875 * icf.h (Secn_fptr_taken_set): New typedef.
9876 (fptr_section_id_): New member.
9877 (section_has_function_pointers): New function.
9878 (set_section_has_function_pointers): New function.
9879 (check_section_for_function_pointers): New function.
9880 * options.h: Fix comment for safe ICF option.
9881 * target.h (can_check_for_function_pointers): New function.
9882 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9883 Modify icf_safe_test for X86-64.
9884 * testsuite/Makefile.in: Regenerate.
9885 * testsuite/icf_safe_so_test.cc: New file.
9886 * testsuite/icf_safe_so_test.sh: New file.
9887 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9888 (main): Change to take pointer to function kept_func_3.
9889 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9890 folding is done correctly for X86-64.
9891
0da6fa6c
DM
98922010-02-12 David S. Miller <davem@davemloft.net>
9893
9894 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9895 is_symbolless parameter.
9896 (Output_reloc<SHT_REL>::is_symbolless): New.
9897 (Output_reloc<SHT_REL>::is_symbolless_): New.
9898 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9899 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9900 (Output_reloc<SHT_RELA>::is_symbolless): New.
9901 (Output_data_reloc::add_global): Handle is_symbolless.
9902 (Output_data_reloc::add_global_relative): Likewise.
9903 (Output_data_reloc::add_local): Likewise.
9904 (Output_data_reloc::add_local_relative): Likewise.
9905 (Output_data_reloc::add_symbolless_global_addend): New.
9906 (Output_data_reloc::add_symbolless_local_addend): New.
9907 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9908 is_symbolless.
9909 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9910 instead of ->is_relative_
9911 (Output_reloc::write): Likewise.
9912 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9913 (Output_reloc::write_rel): Simplify.
9914
9915 * sparc.cc (Target_sparc::Scan::local): Use
9916 ->add_symbolless_local_addend as needed.
9917 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9918 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9919 based upon relocation offset.
9920
e4782e83
DK
99212010-02-11 Doug Kwan <dougkwan@google.com>
9922
9923 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9924 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9925 beginning of function.
9926 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9927 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9928 parameter is_32bit in calls to should_apply_static_reloc.
9929 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9930 (check_DATA): Add arm_abs_global.stdout.
9931 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9932 arm_abs_global.stdout): New rules.
9933 (MOSTLLYCLEANFILES): Add arm_abs_global
9934 * Makefile.in: Regenerate.
9935 * testsuite/arm_abs_global.s: New file.
9936 * testsuite/arm_abs_global.sh: Ditto.
9937 * testsuite/arm_abs_lib.s: Ditto.
9938
93ceb764
ILT
99392010-02-11 Ian Lance Taylor <iant@google.com>
9940
9941 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9942 Read_relocs task.
9943 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9944 Allocate_commons_task first.
9945 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9946 task, rather than symtab_lock_.
9947 (Gc_process_relocs::~Gc_process_relocs): New function.
9948 (Gc_process_relocs::is_runnable): Check this_blocker_.
9949 (Gc_process_relocs::locks): Use next_blocker_ rather than
9950 blocker_.
9951 (Scan_relocs::~Scan_relocs): New function.
9952 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9953 symtab_lock_.
9954 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9955 next_blocker_.
9956 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9957 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9958 constructor accordingly.
9959 (class Gc_process_relocs): Likewise.
9960 (class Scan_relocs): Likewise.
9961 * common.h (class Allocate_commons_task): Remove symtab_lock_
9962 field, and corresponding constructor parameter.
9963 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9964 symtab_lock_.
9965 (Allocate_commons_task::locks): Likewise.
9966
114dfbe1
ILT
99672010-02-11 Ian Lance Taylor <iant@google.com>
9968
9969 * gold-threads.h (class Once): Define.
9970 (class Initialize_lock): Rewrite as child of Once.
9971 * gold-threads.cc (class Once_initialize): Define.
9972 (once_pointer_control): New static variable.
9973 (once_pointer, once_arg): New static variables.
9974 (c_run_once): New static function.
9975 (Once::Once, Once::run_once, Once::internal_run): New functions.
9976 (class Initialize_lock_once): Remove.
9977 (initialize_lock_control): Remove.
9978 (initialize_lock_pointer): Remove.
9979 (initialize_lock_once): Remove.
9980 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9981 (Initialize_lock::initialize): Rewrite.
9982 (Initialize_lock::do_run_once): New function.
9983 * archive.cc (Archive::interpret_header): Only clear name if it is
9984 not already empty.
9985 * fileread.cc: Include "gold-threads.h"
9986 (file_counts_lock): New static variable.
9987 (file_counts_initialize_lock): Likewise.
9988 (File_read::release): Only increment counts when using --stats.
9989 Use a lock around the increment.
9990 * parameters.cc (class Set_parameters_target_once): Define.
9991 (set_parameters_target_once): New static variable.
9992 (Parameters::Parameters): Move here from parameters.h.
9993 (Parameters::set_target): Rewrite.
9994 (Parameters::set_target_once): New function.
9995 (Parameters::clear_target): Move here and rewrite.
9996 * parameters.h (class Parameters): Update declarations. Add
9997 set_parameters_target_once_ field.
9998 (Parameters::Parameters): Move to parameters.cc.
9999 (Parameters::clear_target): Likewise.
10000 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10001 task.
10002 (Start_group::~Start_group): New function.
10003 (Start_group::is_runnable): New function.
10004 (Start_group::locks, Start_group::run): New functions.
10005 (Finish_group::run): Change saw_undefined to size_t.
10006 * readsyms.h (class Start_group): Define.
10007 (class Finish_group): Change saw_undefined_ field to size_t.
10008 (Finish_group::Finish_group): Remove saw_undefined and
10009 this_blocker parameters. Change all callers.
10010 (Finish_group::set_saw_undefined): New function.
10011 (Finish_group::set_blocker): New function.
10012 * symtab.h (class Symbol_table): Change saw_undefined to return
10013 size_t. Change saw_undefined_ field to size_t.
10014 * target-select.cc (Set_target_once::do_run_once): New function.
10015 (Target_selector::Target_selector): Initialize set_target_once_
10016 field. Don't initialize lock_ and initialize_lock_ fields.
10017 (Target_selector::instantiate_target): Rewrite.
10018 (Target_selector::set_target): New function.
10019 * target-select.h (class Set_target_once): Define.
10020 (class Target_selector): Update declarations. Make
10021 Set_target_once a friend. Remove lock_ and initialize_lock_
10022 fields. Add set_target_once_ field.
10023
fa17a3f4
ILT
100242010-02-10 Ian Lance Taylor <iant@google.com>
10025
10026 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10027 queueing any tasks.
10028 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10029 (queue_middle_tasks): Add all blockers before queueing any tasks.
10030 (queue_final_tasks): Likewise.
10031 * token.h (Task_token::add_blockers): New function.
10032 * object.h (Input_objects::number_of_relobjs): New function.
10033
c7177d31
ILT
100342010-02-10 Ian Lance Taylor <iant@google.com>
10035
5de0e392
ILT
10036 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10037 shared, not if not position independent.
10038 * x86_64.cc (Relocate::relocate_tls): Likewise.
10039 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10040 (tls_pie_pic_test): New target.
10041 * testsuite/Makefile.in: Rebuild.
10042
c7177d31
ILT
10043 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10044 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10045 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10046 * testsuite/Makefile.in: Rebuild.
10047
684b268a
DM
100482010-02-09 David S. Miller <davem@davemloft.net>
10049
10050 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10051 R_SPARC_RELATIVE using ->add_local_relative().
10052 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10053
612a8d3d
DM
10054 * output.h (Output_data_dynamic::add_section_size): New method
10055 that takes two Output_data objects.
10056 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10057 entry param. Handle it in initializers.
10058 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10059 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10060 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10061 arg.
10062 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10063 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10064 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10065 for dynrel_includes_plt.
10066 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10067 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10068 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10069 before .rela.plt
10070 (Target_sparc::do_finalize_sections): Update to pass true for
10071 dynrel_includes_plt.
10072 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10073 output before .rela.plt
10074 (Target_powerpc::do_finalize_sections): Update to pass true for
10075 dynrel_includes_plt when 32-bit.
10076
cb1be87e
DK
100772010-02-08 Doug Kwan <dougkwan@google.com>
10078
10079 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10080 method.
10081 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10082 Arm_relobj::scan_section_for_cortex_a8_stubs,
10083 Arm_relobj::do_relocation_section): Instead of calling
10084 Output_section::output_address, use faster
10085 Arm_relobj::simple_input_section_output_address.
10086
705b5121
DM
100872010-02-08 David S. Miller <davem@davemloft.net>
10088
10089 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10090 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10091 relocation helper function.
10092
024c4466
DM
10093 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10094 just like R_SPARC_GOT{10,13,22}.
10095 (Target_sparc::Scan::local): Likewise.
10096 (Target_sparc::Relocate:relocate): Likewise.
10097
9109c078
ILT
100982010-02-06 Ian Lance Taylor <iant@google.com>
10099
10100 * configure.ac: Rewrite targetobjs duplicate removal code to use
10101 only shell constructs.
10102 * configure: Rebuild.
10103
cf846138
DK
101042010-02-05 Doug Kwan <dougkwan@google.com>
10105
10106 PR 11247
10107 * arm.cc (Arm_relobj::section_is_scannable): New method.
10108 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10109 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10110
6cfaf60b
DK
101112010-02-04 Doug Kwan <dougkwan@google.com>
10112
10113 PR 11247
10114 * arm-reloc-property.cc (cstdio): Include.
10115 * configure.ac (targetobjs): Remove duplicates.
10116 * configure: Regenerate.
10117 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10118 big and little endian version for a given address size.
10119
5c57f1be
DK
101202010-02-03 Doug Kwan <dougkwan@google.com>
10121
10122 * arm-reloc-property.cc
10123 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10124 definition.
10125 * arm-reloc-property.h
10126 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10127 New method definition.
10128 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10129 declaration.
10130 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10131 overflow to N.
10132 (GOT_PREL): Change implemented to Y.
10133 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10134 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10135 (Arm_relocate_functions::movw_abs_nc): Remove method.
10136 (Arm_relocate_functions::movt_abs): Ditto.
10137 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10138 (Arm_relocate_functions::thm_movt_abs): Ditto.
10139 (Arm_relocate_functions::movw_rel_nc): Ditto.
10140 (Arm_relocate_functions::movw_rel): Ditto.
10141 (Arm_relocate_functions::movt_rel): Ditto.
10142 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10143 (Arm_relocate_functions:thm_movw_rel): Ditto.
10144 (Arm_relocate_functions:thm_movt_rel): Ditto.
10145 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10146 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10147 New method definitions.
10148 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10149 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10150 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10151 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10152 (Target_arm::Relocate::relocate): Check for non-static or
10153 unimplemented relocation code and exit early. Change calls to
10154 Target_arm::reloc_uses_thumb_bit and
10155 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10156 instead. Refactor code to handle similar relocations to increase
10157 code sharing. Remove check for unsupported relocation code in switch
10158 statement.
10159 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10160 relocation property table to find out size. Change error message to
10161 print out the name of a relocation code instead of the numeric value.
10162 (Target_arm::scan_reloc_for_stub): Use relocation property table
10163 instead of calling Target_arm::reloc_uses_thumb_bit().
10164
218c5831
DK
101652010-02-02 Doug Kwan <dougkwan@google.com>
10166
10167 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10168 types of relaxed input section.
10169
0d31c79d
DK
101702010-02-02 Doug Kwan <dougkwan@google.com>
10171
10172 * Makefile.am (HFILES): Add arm-reloc-property.h.
10173 (DEFFILES): New.
2e702c99
RM
10174 (TARGETSOURCES): Add arm-reloc-property.cc
10175 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10176 (libgold_a_SOURCES): $(DEFFILES)
10177 * Makefile.in: Regenerate.
10178 * arm-reloc-property.cc: New file.
10179 * arm-reloc-property.h: New file.
10180 * arm-reloc.def: New file.
10181 * arm.cc: Update comments.
10182 (arm-reloc-property.h): New included header.
10183 (arm_reloc_property_table): New global variable.
10184 (Target_arm::do_select_as_default_target): New method definition.
10185 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10186 arm-reloc-property to targ_extra_obj.
10187 * parameters.cc (set_parameters_target): Call
10188 Target::select_as_default_target().
10189 * target.h (Target::select_as_default_target): New method definition.
10190 (Target::do_select_as_default_target): Same.
10191
546c7457
DK
101922010-02-01 Doug Kwan <dougkwan@google.com>
10193
10194 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10195 first_output_text_section_.
10196 (Arm_exidx_fixup::first_output_text_section): New method definition.
10197 (Arm_exidx_fixup::first_output_text_section_): New data member.
10198 (Arm_exidx_fixup::process_exidx_section): Record the first text
10199 output section seen.
10200 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10201 and entsize in output section header.
10202
11b861d5
DK
102032010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10204
10205 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10206 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10207 (Arm_relocate_functions::thm_alu11): New Method.
10208 (Arm_relocate_functions::thm_pc8): New Method.
10209 (Arm_relocate_functions::thm_pc12): New Method.
10210 (Target_arm::Scan::local): Handle the relocations.
10211 (Target_arm::Scan::global): Likewise.
10212 (Target_arm::Relocate::relocate): Likewise.
10213 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10214
c9a2c125
DK
102152010-01-29 Doug Kwan <dougkwan@google.com>
10216
10217 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10218 of relocation types as ld.
10219
1521477a
DK
102202010-01-29 Doug Kwan <dougkwan@google.com>
10221
10222 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10223 to public.
10224 (Arm_relocate_functions::thumb_branch_common): Ditto.
10225 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10226 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10227 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10228 Arm_relocate_functions::jump24): Remove.
10229 (Target_arm::Relocate::relocate): Adjust code to call
10230 Arm_relocation_functions::arm_branch_common and
10231 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10232 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10233
e7eca48c
DK
102342010-01-29 Doug Kwan <dougkwan@google.com>
10235
10236 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10237 output_local_symbol_count_needs_update_.
10238 (Arm_relobj::output_local_symbol_count_needs_update,
10239 Arm_relobj::set_output_local_symbol_count_needs_update,
10240 Arm_relobj::update_output_local_symbol_count): New methods.
10241 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10242 member.
10243 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10244 of pointed function as in a R_ARM_PREL31 relocation.
10245 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10246 for output local symbol count updating.
10247 (Target_arm::do_relax): Update output local symbol counts in objects
10248 if necessary.
10249 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10250
02961d7e
ILT
102512010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10252
10253 * arm.cc: Added support for the ARM relocations:
10254 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10255 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10256 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10257 movw_prel_nc).
10258 (Arm_relocate_functions::movw_rel): New method.
10259 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10260 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10261 thm_movw_prel_nc).
10262 (Arm_relocate_functions::thm_movw_rel): New method.
10263 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10264 thm_movt_prel).
10265 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10266 relocations.
10267 (Target_arm::Scan::global): Likewise.
10268 (Target_arm::Relocate::relocate): Likewise.
10269 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10270 Likewise.
10271
b10d2873
ILT
102722010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10273
10274 * arm.cc: Added support for ARM group relocations.
10275 (Target_arm::reloc_needs_sym_origin): New method.
10276 (Arm_relocate_functions::calc_grp_kn): New method.
10277 (Arm_relocate_functions::calc_grp_residual): New method.
10278 (Arm_relocate_functions::calc_grp_gn): New method.
10279 (Arm_relocate_functions::arm_grp_alu): New Method.
10280 (Arm_relocate_functions::arm_grp_ldr): New Method.
10281 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10282 (Arm_relocate_functions::arm_grp_ldc): New Method.
10283 (Target_arm::Scan::local): Handle the ARM group relocations.
10284 (Target_arm::Scan::global): Likewise.
10285 (Target_arm::Relocate::relocate): Likewise.
10286 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10287 Likewise.
10288
2b328d4e
DK
102892010-01-26 Doug Kwan <dougkwan@google.com>
10290
10291 * arm.cc (set): Include.
10292 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10293 pointer type.
2e702c99 10294 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10295 (Arm_output_section::append_text_sections_to_list): New method.
10296 (Arm_output_section::fix_exidx_coverage): Ditto.
10297 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10298 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10299 Relobj::set_section_offset() instead of
10300 Sized_relobj::invalidate_section_offset().
2e702c99 10301 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10302 parameter for section headers. Ignore relocation sections for
10303 unallocated sections and EXIDX sections.
10304 (Target_arm::fix_exidx_coverage): New method.
10305 (Target_arm::output_section_address_less_than): New type.
10306 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10307 linked text section instead of the EXIDX section.
10308 (Arm_output_section::create_stub_group): Add an assertion to check
10309 that this is not an EXIDX output section.
10310 (Arm_output_section::append_text_sections_to_list): New method.
10311 (Arm_output_section::fix_exidx_coverage): Ditto.
10312 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10313 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10314 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10315 first pass.
10316 (Target_arm::fix_exidx_coverage): New method.
10317 * object.h (Relobj::set_output_section): New method.
10318 (Sized_relobj::invalidate_section_offset): Remove method.
10319 (Sized_relobj::do_invalidate_section_offset): Remove method.
10320 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10321
c7f3c371
DK
103222010-01-25 Doug Kwan <dougkwan@google.com>
10323
10324 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10325 Fix warning due to signed and unsigned comparison on a 32-bit host.
10326
8923b24c
DK
103272010-01-22 Doug Kwan <dougkwan@google.com>
10328
10329 * arm.cc (Target_arm::do_relax): Record an output section for section
10330 offset adjustment it contains any stub table that has changed.
10331 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10332 offsets in an output section if necessary.
10333 * output.cc (Output_section::Output_section): Initialize
10334 section_offsets_need_adjustments_.
10335 (Output_section::add_input_section_for_script): Renamed to
10336 Output_section::add_simple_input_section.
10337 (Output_section::save_states): Add a comment.
10338 (Output_section::discard_states): New method defintion.
10339 (Output_section::adjust_section_offsets): Same.
10340 * output.h (Output_section::add_input_section_for_script): Renamed to
10341 Output_section::add_simple_input_section.
10342 (Output_section::discard_states): New method declaration.
10343 (Output_section::adjust_section_offsets): Same.
10344 (Output_section::section_offsets_need_adjustment,
10345 Output_section::set_section_offsets_need_adjustment): New method
10346 definitions.
10347 (Output_section::section_offsets_need_adjustment_): New data member.
10348 * script-sections.cc
10349 (Output_section_element_input::set_section_address): Adjust code for
10350 renaming of Output_section::add_input_section_for_script.
10351 (Orphan_output_section::set_section_address): Same.
10352
9b2fd367
DK
103532010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10354
10355 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10356 Fix_v4bx enum values .
10357 * gold/options.h (General_options): New option definitions.
10358 (General_options::fix_v4bx): New method.
10359 (General_options::Fix_v4bx): New enum.
10360 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10361 (General_options::parse_fix_v4bx_interworking): New method.
10362
80d0d023
DK
103632010-01-22 Doug Kwan <dougkwan@google.com>
10364
10365 * arm.cc (Arm_exidx_fixup): New class.
10366
af2cdeae
DK
103672010-01-21 Doug Kwan <dougkwan@google.com>
10368
10369 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10370 classes.
10371 (Arm_exidx_section_offset_map): New type.
10372
993d07c1
DK
103732010-01-21 Doug Kwan <dougkwan@google.com>
10374
10375 * arm.cc (Arm_exidx_input_section): New class.
10376 (Arm_relobj::exidx_input_section_by_link,
10377 Arm_relobj::exidx_input_section_by_shndx,
10378 Arm_relobj::make_exidx_input_section): New methods.
10379 (read_arm_attributes_section): Remove.
10380 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10381 information about them.
10382 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10383 to here.
10384
5ac169d4
DK
103852010-01-20 Doug Kwan <dougkwan@google.com>
10386
10387 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10388 Input_section_specifier to Section_id.
10389 (Target_arm::new_arm_input_section: Adjust code for change of key
10390 type.
10391 (Target_arm::find_arm_input_section): Ditto.
10392 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10393 (Section_id): Remove.
10394 (Garbage_collection::Section_id_hash): Remove.
10395 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10396 (Section_id): Remove.
10397 (Icf::Section_id_hash): Remove.
10398 * object.h (Section_id, Const_section_id, Section_id_hash,
10399 Const_section_id_hash): New type definitions.
10400 * output.cc (Output_section::add_relaxed_input_section): Change to
10401 use Const_section_id instead of Input_section_specifier as key type.
10402 (Output_section::add_merge_input_section): Ditto.
10403 (Output_section::build_relaxation_map): Change to use Section_id
10404 instead of Input_section_specifier as key type.
2e702c99 10405 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10406 Ditto.
10407 (Output_section::convert_input_sections_to_relaxed_sections): Change
10408 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10409 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10410 (Output_section::find_relaxed_input_section): Ditto.
10411 * output.h (Input_section_specifier): Remove class.
10412 (Output_section::Output_section_data_by_input_section_map): Change
10413 key type to Const_section_id.
10414 (Output_section::Output_relaxed_input_section_by_input_section_map):
10415 Ditto.
10416 (Output_section::Relaxation_map): Change key type to Section_id.
10417
a2162063
ILT
104182010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10419
10420 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10421 (class Arm_v4bx_stub): New class.
10422 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10423 (Stub_factory::make_arm_v4bx_stub): New method.
10424 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10425 (Stub_table::empty): Handle v4bx stubs.
10426 (Stub_table::add_arm_v4bx_stub): New method.
10427 (Stub_table::find_arm_v4bx_stub): New method.
10428 (Arm_relocate_functions::v4bx): New method.
10429 (Target_arm::fix_v4bx): New method.
10430 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10431 (Stub_table::relocate_stubs): Likewise.
10432 (Stub_table::do_write): Likewise.
10433 (Stub_table::update_data_size_and_addralign): Likewise.
10434 (Stub_table::finalize_stubs): Likewise.
10435 (Target_arm::Scan::local): Likewise.
10436 (Target_arm::Scan::global): Likewise.
10437 (Target_arm::do_finalize_sections): Likewise.
10438 (Target_arm::Relocate::relocate): Likewise.
10439 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10440 Likewise.
10441 (Target_arm::scan_reloc_for_stub): Likewise.
10442 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10443
5696ab0b
ILT
104442010-01-19 Ian Lance Taylor <iant@google.com>
10445
10446 * output.cc (Output_section_headers::do_sized_write): Write large
10447 segment count to sh_info field.
10448 (Output_file_header::do_sized_write): For large segment count,
10449 write PN_XNUM to e_phnum field.
10450
800d0f56
ILT
104512010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10452
10453 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10454 (Arm_relocate_functions::thm_jump8): New function.
10455 (Arm_relocate_functions::thm_jump11): New function.
10456 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10457 R_ARM_THM_JUMP11.
10458 (Target_arm::Scan::global): Likewise.
10459 (Target_arm::Relocate::relocate): Likewise.
10460 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10461 Likewise.
10462
41263c05
DK
104632010-01-14 Doug Kwan <dougkwan@google.com>
10464
10465 * arm.cc (map, utility): Include headers.
10466 (Target_arm::apply_cortex_a8_workaround): New method.
10467 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10468 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10469 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10470 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10471 the --[no-]fix-cortex-a8 command line options.
10472 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10473 (Target_arm::relocate_stub): Use addend in instruction template.
10474 * options.h (DEFINE_bool): Set the user-set flag.
10475 (General_options): Add --[no-]-fix-cortex options.
10476 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10477 : Update fast look-up map after conversion.
41263c05 10478
459e9b03
ST
104792010-01-14 Sriraman Tallam <tmsriram@google.com>
10480
10481 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10482 in the first pass of do_layout.
10483
b521dfe4
DK
104842010-01-13 Doug Kwan <dougkwan@google.com>
10485
10486 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10487 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10488 apparent compiler problem of not folding static constant integral
10489 data members of elfcpp::Elf_sizes<32>.
10490
44272192
DK
104912010-01-13 Doug Kwan <dougkwan@google.com>
10492
10493 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10494 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10495 Arm_relobj::scan_section_for_cortex_a8_erratum,
10496 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10497 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10498 sections to scan for relocation stubs into a new method
10499 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10500 relocation and Cortex-A8 stub scanning.
10501 (Target_arm::do_relax): Force stubs to be after stubbed sections
10502 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10503 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10504 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10505
44b71ece
ILT
105062010-01-12 Ian Lance Taylor <iant@google.com>
10507
10508 * target-reloc.h (visibility_error): New inline function.
10509 (relocate_section): Call visibility_error.
10510 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10511 (MOSTLYCLEANFILES): Likewise.
10512 (protected_4_pic.o, protected_3.err): New targets.
10513 * testsuite/protected_4.cc: New file.
10514
a120bc7f
DK
105152010-01-12 Doug Kwan <dougkwan@google.com>
10516
10517 * arm.cc (Cortex_a8_reloc): New class.
10518 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10519 and cortex_a8_relocs_info_.
10520 (Target_arm::fix_cortex_a8): New method definition.
10521 (Target_arm::Cortex_a8_relocs_info): New type.
10522 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10523 New data member declarations.
10524 (Target_arm::scan_reloc_for_stub): Record information about
10525 relocations for THUMB branches that might be exempted from the
10526 Cortex-A8 workaround.
10527 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10528 at the beginning of a relaxation pass.
10529
20138696
DK
105302010-01-12 Doug Kwan <dougkwan@google.com>
10531
10532 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10533 (Arm_relobj::Mapping_symbol_position,
10534 Arm_reloj::Mapping_symbol_position_less,
10535 Arm_relobj::Mapping_symbols_info): New types.
10536 (Target_arm::is_mapping_symbol_name): New method definition.
10537 (Arm_relobj::do_count_local_symbols): Save information about mapping
10538 symbols.
10539
089d69dc
DK
105402010-01-11 Doug Kwan <dougkwan@google.com>
10541
10542 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10543 Arm_relocate_functions::thumb32_branch_upper,
10544 Arm_relocate_functions::thumb32_branch_lower,
10545 Arm_relocate_functions::thumb32_cond_branch_offset,
10546 Arm_relocate_functions::thumb32_cond_branch_upper,
10547 Arm_relocate_functions::thumb32_cond_branch_lower,
10548 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10549 branch offset encoding.
10550 (Arm_relocate_functions::thumb_branch_common): Use new branch
10551 offset encoding methods to avoid code duplication.
10552 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10553 (Stub_addend_reader::operator()): Use new branch encoding method
10554 to avoid code duplication.
10555
99e5bff2
DK
105562010-01-11 Doug Kwan <dougkwan@google.com>
10557
10558 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10559 (Target_arm::do_finalize_sections): Define special EXIDX section
10560 symbols only if referenced.
10561 * gc.h (Garbage_collection::add_reference): New method.
10562 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10563 code duplication.
10564
98e090bd
ILT
105652010-01-11 Ian Lance Taylor <iant@google.com>
10566
d0a91bd8
ILT
10567 * script.cc (Version_script_info::build_expression_list_lookup):
10568 Change complaing about duplicate wildcard match from error to
10569 warning.
10570
98e090bd
ILT
10571 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10572 of 2009-12-30.
10573 (Version_script_info::Version_script_info): Initialize globs_,
10574 default_version_, default_is_global_, and exact_. Don't
10575 initialize globals_ or locals_.
10576 (Version_script_info::build_lookup_tables): Build local symbols
10577 first.
10578 (Version_script_info::unquote): New function.
10579 (Version_script_info::add_exact_match): New function.
10580 (Version_script_info::build_expression_list_lookup): Remove lookup
10581 parameter. Add is_global parameter. Change all callers. Handle
10582 wildcard pattern specially. Unquote pattern. Call
10583 add_exact_match.
10584 (Version_script_info::get_name_to_match): New function.
10585 (Version_script_info::get_symbol_version): New function.
10586 (Version_script_info::get_symbol_version_helper): Remove.
10587 (Version_script_info::check_unmatched_names): Call unquote.
10588 * script.h (class Version_script_info): Change get_symbol_version
10589 to be non-inline and add is_global parameter; change all callers.
10590 Rewrite symbol_is_local. Update declarations. Define struct
10591 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10592 Remove globals_ and locals_ members. Add exact_, globs_,
10593 default_version_, is_global_.
10594 (Version_script_info::Glob): Remove pattern, add expression and
10595 is_global. Update constructor. Change all callers.
10596 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10597 default version.
10598 (Versions::symbol_section_contents): If a symbol is undefined, or
10599 defined in a dynamic object, set the version index to
10600 VER_NDX_LOCAL.
10601 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10602 symbol_is_local.
10603 (Symbol_table::add_from_pluginobj): Likewise.
10604 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10605
d56962d3
DK
106062010-01-11 Doug Kwan <dougkwan@google.com>
10607
10608 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10609 (incremental_dump_LDADD): Add linking option for libintl.
10610 * Makefile.in: Regenerate.
10611
94e6ee91
L
106122010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10613
10614 PR gold/11144
10615 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10616 instead of -Ds.
10617 * testsuite/Makefile.in: Regenerated.
10618
e96c574b
DK
106192010-01-10 Doug Kwan <dougkwan@google.com>
10620
10621 * options.h (DEFINE_var): Use parentheses around argument varname__
10622 in macro body to avoid any unintended subsequent substitutions.
10623
7198066b
ILT
106242010-01-10 Ian Lance Taylor <iant@google.com>
10625
ba4d53bf
ILT
10626 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10627 candidates before doing symbol resolution.
10628
7198066b
ILT
10629 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10630 ODR candidates if only one is weak.
10631
a2beed37
ILT
106322010-01-08 Ian Lance Taylor <iant@google.com>
10633
10634 * script.cc (Version_script_info::build_expression_list_lookup):
10635 Don't warn about ambiguous version, just record the ambiguity.
10636 (Version_script_info::get_symbol_version_helper): Give error if
10637 version is ambiguous.
10638
2fb7225c
DK
106392010-01-08 Doug Kwan <dougkwan@google.com>
10640
10641 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10642 prev_data_size_ and prev_addralign_. Remove initializer for
10643 deleted data member has_been_changed_.
10644 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10645 to determine if the table is empty.
10646 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10647 Remove.
10648 (Stub_table::add_reloc_stub): Define method in class definition
10649 instead of just declaring it there.
10650 (Stub_table::add_cortex_a8_stub): New method definition.
10651 (Stub_table::update_data_size_and_addralign): Ditto.
10652 (Stub_table::finalize_stubs): Ditto.
10653 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10654 (Stub_table::do_addralign_): Return address alignment in the
10655 (Stub_table::do_reset_address_and_file_offset): Define method in
10656 class definition instead of declaring it there. Set current data
10657 size to be the data size of the previous pass.
10658 (Stub_table::set_final_data_size): Use current data size as the
10659 final data size.
10660 (Stub_table::relocate_stub): Change parameter type of stub from
10661 Reloc_stub pointer to Stub pointer.
10662 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10663 (Stub_table::Cortex_a8_stub_list): New typedef.
10664 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10665 Stub_table::prev_addralign_): New data member.
10666 (Arm_relobj::Arm_relobj): Initialize data member
10667 section_has_cortex_a8_workaround_.
10668 (Arm_relobj::section_has_cortex_a8_workaround,
10669 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10670 definitions.
10671 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10672 declarations.
10673 (Target_arm::relocate_stub): Change parameter type of stub from
10674 Reloc_stub pointer to Stub pointer.
10675 (Insn_template::size, Insn_template::alignment): Handle
10676 THUMB16_SPECIAL_TYPE.
10677 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10678 Stub_table::update_data_size_and_addralign,
10679 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10680 definitions.
10681 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10682 (Stub_table::do_write): Ditto.
10683 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10684
880cd20d
ILT
106852010-01-08 Ian Lance Taylor <iant@google.com>
10686
10687 PR 11108
10688 * symtab.h (class Symbol): Remove fields is_target_special_ and
10689 has_plt_offset_. Add field is_defined_in_discarded_section_.
10690 (Symbol::is_defined_in_discarded_section): New function.
10691 (Symbol::set_is_defined_in_discarded_section): New function.
10692 (Symbol::has_plt_offset): Rewrite.
10693 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10694 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10695 Don't initialize is_target_special_ or has_plt_offset_.
10696 Initialize is_defined_in_discarded_section_.
10697 (Symbol_table::add_from_relobj): If appropriate, set
10698 is_defined_in_discarded_section.
10699 * resolve.cc (Symbol::override_base_with_special): Don't test
10700 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10701 * target-reloc.h (relocate_section): Do special handling for
10702 symbols defined in discarded sections for global symbols as well
10703 as local symbols.
10704
2703e3eb
ILT
107052010-01-08 Ian Lance Taylor <iant@google.com>
10706
10707 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10708 the SHT_SYMTAB case.
10709
339d40a3
ILT
107102010-01-08 Ian Lance Taylor <iant@google.com>
10711
10712 * object.cc (Sized_relobj::do_layout): Don't get confused if
10713 layout_eh_frame returns NULL.
10714
abecea76
ILT
107152010-01-08 Ian Lance Taylor <iant@google.com>
10716
10717 PR 11084
10718 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10719 dynamic symbol table, use the normal symbol table.
10720 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10721 symbol table.
10722
6b7dd3f3
ILT
107232010-01-08 Ian Lance Taylor <iant@google.com>
10724
10725 PR 11072
10726 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10727 sections.
10728
36c50e63
L
107292010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10730
10731 * version.cc (print_version): Change to "Copyright 2010".
10732
e291e7b9
ILT
107332010-01-08 Ian Lance Taylor <iant@google.com>
10734
10735 PR 10287
10736 PR 11063
10737 * i386.cc (class Target_i386): Change return type of plt_section
10738 to be non-const.
10739 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10740 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10741 tls_desc_rel_ field.
10742 (Output_data_plt_i386::rel_tls_desc): New function.
10743 (Target_i386::rel_tls_desc_section): New function.
10744 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10745 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10746 R_386_TLS_DESC reloc in rel_tls_desc_section.
10747 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10748 Define struct Tlsdesc_info.
10749 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10750 (Target_x86_64::do_reloc_symbol_index): New function.
10751 (Target_x86_64::add_tlsdesc_info): New function.
10752 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10753 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10754 tlsdesc_rel_ field.
10755 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10756 all callers.
10757 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10758 (Target_x86_64::rela_tlsdesc_section): New function.
10759 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10760 handling.
10761 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10762 (Target_x86_64::do_reloc_addend): New function.
10763 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10764 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10765 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10766 (Output_reloc::type): New function.
10767 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10768 (Output_reloc::is_target_specific): New function.
10769 (Output_reloc::target_arg): New function.
10770 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10771 absolute relocs and target specific relocs.
10772 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10773 add_target_specific.
10774 (class Output_data_reloc) [SHT_RELA]: Likewise.
10775 * output.cc (Output_reloc::Output_reloc): Add four new versions
10776 for absolute relocs and target specific relocs.
10777 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10778 (Output_reloc::get_symbol_index): Likewise.
10779 (Output_reloc::local_section_offset): Check that local_sym_index_
10780 is not TARGET_CODE or 0.
10781 (Output_reloc::symbol_value): Likewise.
10782 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10783 reloc.
10784 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10785 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10786 functions.
10787 * layout.cc (add_target_dynamic_tags): Use output section for
10788 DT_PLTRELSZ and DT_JMPREL.
10789
3a44184e
ILT
107902010-01-07 Ian Lance Taylor <iant@google.com>
10791
10792 PR 11061
10793 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10794 function.
10795 (class Output_data_reloc_generic): Define.
10796 (class Output_data_reloc_base): Change base class to
10797 Output_data_reloc_generic. Change add() method to call
10798 bump_relative_reloc_count for a relative reloc. Remove
10799 sort_relocs_ field.
10800 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10801 to sort_relocs().
10802 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10803 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10804 appropriate.
10805 * layout.h (class Layout): Update declaration.
10806
ea715a34
ILT
108072010-01-07 Ian Lance Taylor <iant@google.com>
10808
10809 * output.h (class Output_data): Add const version of
10810 output_section and do_output_section.
10811 (class Output_section_data): Add const version of
10812 do_output_section.
10813 (class Output_section): Likewise.
10814 * layout.cc (Layout::add_target_dynamic_tags): New function.
10815 * layout.h (class Layout): Update declarations.
10816 * arm.cc (Target_arm::do_finalize_sections): Use
10817 add_target_dynamic_tags.
10818 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10819 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10820 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10821 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10822
659948a4
ILT
108232010-01-07 Ian Lance Taylor <iant@google.com>
10824
10825 PR 11042
10826 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10827 object as needed.
10828
9d3b86f6
ILT
108292010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10830 Ian Lance Taylor <iant@google.com>
10831
10832 PR 11019
10833 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10834 Xindex::read_symtab_xindex.
10835
bb0d3eb0
DK
108362010-01-07 Doug Kwan <dougkwan@google.com>
10837
10838 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10839 (Insn_template::thumb16_bcond_insn): New method declaration.
10840 (Insn_template): Fix spelling.
10841 (Stub::thumb16_special): New method declaration.
10842 (Stub::do_write): Define virtual method which was previously pure
10843 virtual.
10844 (Stub::do_thumb16_special): New method declaration.
10845 (Stub::do_fixed_endian_write): New template member.
10846 (Reloc_stub::do_write): Remove.
10847 (Reloc_stub::do_fixed_endian_write): Remove.
10848 (Cortex_a8_stub): New class definition.
10849 (Stub_factory::make_cortex_a8_stub): New method definition.
10850 (Stub_factory::Stub_factory): Add missing static storage class
10851 qualifier for elf32_arm_stub_a8_veneer_blx.
10852
ffeef7df
ILT
108532010-01-07 Ian Lance Taylor <iant@google.com>
10854
dc3f80fe
ILT
10855 PR 10980
10856 * options.h (class General_options): Add --warn-unresolved-symbols
10857 and --error-unresolved-symbols.
10858 * errors.cc (Errors::undefined_symbol): Implement
10859 --warn-unresolved-symbols.
10860
ffeef7df
ILT
10861 * options.h (class General_options): Add -z text and -z textoff.
10862 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10863
f1ec9ded
ST
108642010-01-06 Sriraman Tallam <tmsriram@google.com>
10865
10866 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10867 (Garbage_collection::cident_sections): New function.
10868 (Garbage_collection::add_cident_section): New function.
10869 (Garbage_collection::cident_sections_): New member.
10870 (gc_process_relocs): Add references to sections whose names are C
10871 identifiers.
10872 * gold.h (cident_section_start_prefix): New constant.
10873 (cident_section_stop_prefix): New constant.
10874 (is_cident): New function.
10875 * layout.cc (Layout::define_section_symbols): Replace string constants
10876 with the newly defined constants.
10877 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10878 C identifiers.
10879 * testsuite/Makefile.am: Add gc_orphan_section_test.
10880 * testsuite/Makefile.in: Regenerate.
10881 * testsuite/gc_orphan_section_test.cc: New file.
10882 * testsuite/gc_orphan_section_test.sh: New file.
10883
6eda8c29
ILT
108842010-01-06 Ian Lance Taylor <iant@google.com>
10885
b9674e17
ILT
10886 PR 10980
10887 * options.h (class General_options): Add --warn-shared-textrel.
10888 * layout.cc (Layout::finish_dynamic_section): Implement
10889 --warn-shared-textrel.
10890
6eda8c29
ILT
10891 PR 10980
10892 * options.h (class General_options): Add --warn-multiple-gp.
10893
32dcd44e
ILT
108942010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10895
10896 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10897 $(THREADSLIB) and $(LIBDL).
10898 * Makefile.in: Rebuild.
10899
a192ba05
ILT
109002010-01-06 Ian Lance Taylor <iant@google.com>
10901
10902 PR 10980
10903 * options.cc (General_options::parse_section_start): New function.
10904 (General_options::section_start): New function.
10905 (General_options::General_options): Initialize all members.
10906 * options.h: Include <map>
10907 (class General_options): Add --section-start. Add section_starts_
10908 member.
10909 * layout.cc (Layout::attach_allocated_section_to_segment): If
10910 --section-start was used, set the address of the segment. Remove
10911 local sort_sections.
10912 (Layout::relaxation_loop_body): If the address of the load segment
10913 has been set by --section-start, don't use it.
10914 * output.h (Output_segment::update_flags_for_output_section): New
10915 function.
10916 * output.cc (Output_segment::add_output_section): Call
10917 update_flags_for_output_section.
10918
dde3f402
ILT
109192010-01-05 Ian Lance Taylor <iant@google.com>
10920
62dfdd4d
ILT
10921 PR 10980
10922 * options.h (class General_options): Add --undefined-version.
10923 * script.cc (struct Version_expression): Add was_matched_by_symbol
10924 field.
10925 (Version_script_info::matched_symbol): New function.
10926 (Version_script_info::get_symbol_version_helper): Call
10927 matched_symbol.
10928 (Version_script_info::check_unmatched_names): New function.
10929 * script.h (class Version_script_info): Update declarations.
10930 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10931
9c4ae156
ILT
10932 * options.h (class General_options): Use DEFINE_bool_alias for
10933 allow_multiple_definition.
10934 * resolve.cc (Symbol_table::should_override): Don't test
10935 allow_multiple_definition.
10936
dde3f402
ILT
10937 PR 10980
10938 * options.h (class General_options): Add --cref.
10939 * main.cc (main): Print cref table if --cref. Don't close mapfile
10940 until after printing cref table.
10941 * cref.cc: Include "symtab.h".
10942 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10943 (Cref_table_compare::operator()): New function.
10944 (Cref_inputs::gather_cref): New function.
10945 (filecol): New static const.
10946 (Cref_inputs::print_cref): New function.
10947 (Cref::print_cref): New function.
10948 * cref.h: Include <cstdio>.
10949 (class Cref): Update declarations.
10950 * mapfile.h (Mapfile::file): New function.
10951 * object.h (class Object): Define Symbols. Declare virtual
10952 do_get_global_symbols.
10953 (Object::get_global_symbols): New function.
10954 * object.cc (Input_objects::add_object): Pass object to cref_ if
10955 --cref.
10956 (Input_objects::archive_start): Likewise.
10957 (Input_objects::archive_stop): Likewise.
10958 (Input_objects::print_cref): New function.
10959 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10960 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10961 --cref.
10962 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10963 function.
10964 * plugin.h (class Sized_pluginobj): Update declarations.
10965
8781f709
ILT
109662010-01-05 Ian Lance Taylor <iant@google.com>
10967
10968 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10969 to is_default_version. Rename insdef to insdefault.
10970 (Symbol_table::add_from_relobj): Rename def to is_default_version
10971 and local to is_forced_local.
10972 (Symbol_table::add_from_pluginobj): Likewise.
10973 (Symbol_table::add_from_dynobj): Likewise.
10974 (Symbol_table::define_special_symbol): Rename insdef to
10975 insdefault.
10976
fe35d28d
ILT
109772010-01-04 Ian Lance Taylor <iant@google.com>
10978
30bc8c46
ILT
10979 PR 10980
10980 * options.h (class General_options): Add
10981 --allow-multiple-definition and -z muldefs.
10982 * resolve.cc (Symbol_table::should_override): Don't warn about a
10983 multiple symbol definition if --allow-multiple-definition or -z
10984 muldefs.
10985
7eaea549
ILT
10986 PR 10980
10987 * options.h (class General_options): Add --add-needed and
10988 --copy-dt-needed-entries. Tweak --as-needed help entry.
10989 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10990 error if --copy-dt-needed-entries aka --add-needed is used and
10991 would cause a change in behaviour.
10992
fe35d28d
ILT
10993 PR 10980
10994 * options.h (class General_options): Add -G as a short version of
10995 --shared. Add no-op options -assert, -g, and -i.
10996
55a2bb35
ST
109972010-01-04 Sriraman Tallam <tmsriram@google.com>
10998
10999 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11000 check for .text or .gnu.linkonce.t sections.
11001 * icf.cc (Icf::find_identical_sections): Ditto.
11002 Change the detection for mangled function name within the section
11003 name.
11004 * icf.h (is_section_foldable_candidate): New function.
11005
719328e1
ILT
110062009-12-30 Ian Lance Taylor <iant@google.com>
11007
11008 PR 10980
11009 * options.h (class General_options): Permit two dashes with
11010 --retain-symbols-file.
11011
d7bb5745
ILT
110122009-12-30 Ian Lance Taylor <iant@google.com>
11013
403a15dd
ILT
11014 PR 10979
11015 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11016 don't put the file header and segment headers in the text
11017 segment.
11018
eda294df
ILT
11019 PR 10979
11020 * common.cc (Sort_commons::operator()): Stabilize sort when both
11021 entries are NULL.
11022 (Symbol_table::do_allocate_commons_list): When allocating common
11023 symbols, skip a symbol which is no longer common.
11024 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11025 an object before checking its type.
11026 * testsuite/common_test_2.c: New file.
11027 * testsuite/common_test_3.c: New file.
11028 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11029 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11030 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11031 (common_test_2_pic.o, common_test_2.so): New targets.
11032 (common_test_3_pic.o, common_test_3.so): New targets.
11033 * testsuite/Makefile.in: Rebuild.
11034
d7bb5745
ILT
11035 PR 10979
11036 * script.cc (read_input_script): If we see a new SECTIONS clause,
11037 and we have added an input section, give an error.
11038 * layout.h (class Layout): Add have_added_input_section function.
11039 Add have_added_input_section_ field.
11040 * layout.cc (Layout::Layout): Initialize
11041 have_added_input_section_.
11042 (Layout::layout): Set have_added_input_section_.
11043 (Layout::layout_eh_frame): Likewise.
11044
fc59c572
ILT
110452009-12-30 Ian Lance Taylor <iant@google.com>
11046
11047 PR 10931
11048 * options.h (class General_options): Add --sort-common option.
11049 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11050 * common.cc (Sort_common): Add sort_order parameter to
11051 constructor. Add sort_order_ field.
11052 (Sort_commons::operator): Check sort_order_.
11053 (Symbol_table::allocate_commons): Determine the sort order.
11054 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11055 Change all callers.
11056 (Symbol_table::do_allocate_commons_list): Likewise.
11057
1c74fab0
ILT
110582009-12-30 Ian Lance Taylor <iant@google.com>
11059
11060 PR 10916
11061 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11062 symbols from this object, don't change the visibility of an
11063 undefined symbol.
11064 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11065
6affe781
ILT
110662009-12-30 Ian Lance Taylor <iant@google.com>
11067
11068 PR 10861
11069 * script.h (class Version_script_info): Define Language enum.
11070 Update declarations. Define Glob, Exact, and Lookup types. Add
11071 new fields globals_, locals_, and is_finalized_.
11072 * script.cc: Various formatting fixes.
11073 (class Parser_closure): Change language_stack_ from a vector of
11074 std::string to one of Version_script_info::Language. Adjust all
11075 uses accordingly.
11076 (class Lazy_demangler): Remove.
11077 (struct Version_expression): Change language from std::string to
11078 Version_script_info::Language.
11079 (Version_script_info::Version_script_info): New function.
11080 (Version_script_info::~Version_script_info): Don't call clear.
11081 (Version_script_info::finalize): New function.
11082 (Version_script_info::build_lookup_tables): New function.
11083 (Version_script_info::build_expression_list_lookup): New
11084 function.
11085 (Version_script_info::get_symbol_version_helper): Rewrite to use
11086 lookup tables.
11087 (Version_script_info::print_expression_list): Adjust to use
11088 Version_script_info::Language.
11089 (script_push_lex_into_version_mode): Check that the version script
11090 has not been finalized.
11091 (version_script_push_lang): Change language string to
11092 Version_script_info::Language.
11093 * options.cc (Command_line::version_script): New function.
11094 * options.h (class General_options): Add finalize_dynamic_list
11095 function. Change version_script from declaration to definition.
11096 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11097 * testsuite/version_script.map: Remove duplicate def of foo.
11098 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11099 version_script.map.
11100 * testsuite/Makefile.in: Rebuild.
11101
818bf354
ILT
111022009-12-30 Ian Lance Taylor <iant@google.com>
11103
11104 PR 10843
11105 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11106 if the input symbol index is 0, make the output symbol index 0.
11107
ebcc8304
ILT
111082009-12-30 Ian Lance Taylor <iant@google.com>
11109
11110 PR 10670
11111 * options.h (class General_options): Add -x/--discard-all.
11112 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11113 --discard-all. If the local symbol needs a dynamic entry, check
11114 that before handling --discard-locals.
11115
176fe33f
ILT
111162009-12-30 Ian Lance Taylor <iant@google.com>
11117
bb321bb1
ILT
11118 PR 10450
11119 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11120 flags to PF_R.
11121 (Output_segment::add_output_section): Don't change the flags if
11122 the type is PT_TLS.
11123
176fe33f
ILT
11124 PR 10450
11125 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11126 GNU hash table if they need a dynamic value. Otherwise, don't add
11127 them if they are defined in a dynamic object or are forced local.
11128
e8cd95c7
ILT
111292009-12-29 Ian Lance Taylor <iant@google.com>
11130
1b81fb71
ILT
11131 PR 10450
11132 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11133 .gnu.hash table for a 32-bit target.
11134
8d6d383d
ILT
11135 PR 10450
11136 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11137 regular and a dynamic object only needs a dynamic symbol table
11138 entry if it is externally visible.
11139
e785ec03
ILT
11140 PR 10450
11141 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11142 constructor. Add global_offset_table_ field.
11143 (Target_i386::got_section): Set global_offset_table_.
11144 (Target_i386::do_finalize_sections): Set global_offset_table_
11145 size.
11146 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11147 in constructor. Add global_offset_table_ field.
11148 (Target_x86_64::got_section): Set global_offset_table_.
11149 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11150 size.
11151
1a2dff53
ILT
11152 * layout.cc (Layout::Layout): Initialize increase_relro_.
11153 (Layout::get_output_section): Add is_relro, is_last_relro, and
11154 is_first_non_relro parameters. Change all callers.
11155 (Layout::choose_output_section): Likewise.
11156 (Layout::add_output_section_data): Likewise.
11157 (Layout::make_output_section): Likewise.
11158 (Layout::set_segment_offsets): Clear increase_relro when using a
11159 linker script.
11160 * layout.h (class Layout): Add increase_relro method. Add
11161 increase_relro_ field. Update declarations.
11162 * output.cc (Output_section::Output_section): Initialize
11163 is_last_relro_ and is_first_non_relro_.
11164 (Output_segment::add_output_section): Group relro sections is
11165 do_sort is true. Handle is_last_relro and is_first_non_relro.
11166 (Output_segment::maximum_alignment): Remove relro handling.
11167 (Output_segment::set_section_addresses): Add increase_relro
11168 parameter. Change all callers. Add initial alignment to align
11169 relro sections on separate page. Remove old relro handling.
11170 (Output_segment::set_section_list_addresses): Remove in_relro
11171 parameter. Change all callers.
11172 (Output_segment::set_offset): Add increase parameter. Change all
11173 callers. Remove old relro handling.
11174 * output.h (class Output_section): Add new methods: is_last_relro,
11175 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11176 Add is_last_relro_ and is_first_non_relro_ fields.
11177 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11178 Create separate .got.plt section. Call increase_relro.
11179 * x86_64.cc (Target_x86_64::got_section): Likewise.
11180 * testsuite/relro_script_test.t: Add .got.plt.
11181
f0ba79e2
ILT
11182 PR 10450
11183 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11184 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11185 (Layout::finalize): Call set_dynamic_symbol_size.
11186 (Layout::set_dynamic_symbol_size): New function.
11187 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11188 set_dynamic_symbol_size.
11189
e8cd95c7
ILT
11190 PR 10450
11191 * output.h (class Output_section): Add is_entsize_zero_ field.
11192 * output.cc (Output_section::Output_section): Initialize
11193 is_entsize_zero_.
11194 (Output_section::set_entsize): If two different entsizes are
11195 requested, force it to zero.
11196 (Output_section::add_input_section): Set flags for .debug_str
11197 before updating section flags. Set entsize.
11198 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11199 and SHF_STRING if all input sections have those flags.
11200
3e1b9a8a
RÁE
112012009-12-29 Rafael Espindola <espindola@google.com>
11202
11203 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11204 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11205 reporting.
3e1b9a8a 11206
3dcad376
ST
112072009-12-29 Sriraman Tallam <tmsriram@google.com>
11208
11209 * options.cc (General_options::parse_version): Allow -v to exit
11210 without an error if there is nothing to link.
11211
084e2665
ILT
112122009-12-29 Ian Lance Taylor <iant@google.com>
11213
11214 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11215 using a version of gcc before 4.1.
11216 * configure: Rebuild.
11217
250acde3
CD
112182009-12-28 Chris Demetriou <cgd@google.com>
11219
11220 * attributes.cc (Output_attributes_section_data::do_write): Use
11221 std::vector::front rather than std::vector::data.
11222
99fff23b
ILT
112232009-12-28 Ian Lance Taylor <iant@google.com>
11224
11225 * symtab.h (class Symbol_table): Add enum Defined.
11226 * resolve.cc (Symbol_table::should_override): Add defined
11227 parameter. Change all callers. Test whether object is NULL
11228 before calling a method on it.
11229 (Symbol_table::report_resolve_problem): Add defined parameter.
11230 Change all callers.
11231 (Symbol_table::should_override_with_special): Likewise.
11232 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11233 parameter. Change all callers.
11234 (Symbol_table::do_define_in_output_data): Likewise.
11235 (Symbol_table::define_in_output_segment): Likewise.
11236 (Symbol_table::do_define_in_output_segment): Likewise.
11237 (Symbol_table::define_as_constant): Likewise.
11238 (Symbol_table::do_define_as_constant): Likewise.
11239 * script.h (class Symbol_assignment): Add is_defsym parameter to
11240 constructor; change all callers.
11241 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11242 parameter. Change all callers. Add is_defsym_ field.
11243 (class Parser_closure): Add parsing_defsym parameter to
11244 constructor; change all callers. Add parsing_defsym accessor
11245 function. Add parsing_defsym_ field.
11246
556bd683
ILT
112472009-12-28 Ian Lance Taylor <iant@google.com>
11248
11249 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11250 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11251
1782c879
ILT
112522009-12-23 Ian Lance Taylor <iant@google.com>
11253
11254 * i386.cc (Target_i386::do_calls_non_split): Recognize
11255 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11256 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11257 -fsplit-stack prologue when using %r11.
1782c879 11258
329ca2b1
ST
112592009-12-21 Sriraman Tallam <tmsriram@google.com>
11260
11261 * options.cc (General_options::parse_version): Make -v continue and do
11262 the link like GNU ld does.
11263
d675ff46
RÁE
112642009-12-17 Rafael Avila de Espindola <espindola@google.com>
11265
11266 * Makefile.am (CCFILES): Add timer.cc.
11267 (HFILES): Add timer.h.
11268 * configure.ac: Check for sysconf and times.
11269 * main.cc: include timer.h.
11270 (main): Use Timer instead of get_run_time.
11271 * timer.cc: New.
11272 * timer.h: New.
11273 * workqueue.cc: include timer.h.
11274 (Workqueue::find_and_run_task):
11275 Report user, sys and wall time.
11276 * Makefile.in: Regenerate.
11277 * config.in: Regenerate.
11278 * configure: Regenerate.
11279
d6344fb5
DK
112802009-12-16 Doug Kwan <dougkwan@google.com>
11281
11282 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11283 sections.
11284 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11285 relaxed input sections.
11286 * output.cc (Output_section::find_relaxed_input_section): Change
11287 return type to Output_relaxed_input_section pointer. Adjust code
11288 for new type of relaxed_input_section_map_.
11289 * output.h (Output_section::find_relaxed_input_section): Change
11290 return type to Output_relaxed_input_section pointer.
11291 (Output_section::Output_relaxed_input_section_by_input_section_map):
11292 New type.
11293 (Output_section::relaxed_input_section_map_): Change type to
11294 Output_section::Output_relaxed_input_section_by_input_section_map.
11295 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11296 input section.
11297
0e0d5469
ILT
112982009-12-15 Ian Lance Taylor <iant@google.com>
11299
11300 * layout.cc (Layout::create_shstrtab): Only write out after input
11301 sections if we are compressing debug sections.
11302
0649a889
ILT
113032009-12-15 Ian Lance Taylor <iant@google.com>
11304
11305 * archive.cc (Archive::add_symbols): Only look up a symbol without
11306 a version if there is, in fact, a version.
11307
2ea97941
ILT
113082009-12-14 Ian Lance Taylor <iant@google.com>
11309
11310 Revert -Wshadow changes, all changes from:
11311 2009-12-11 Doug Kwan <dougkwan@google.com>
11312 2009-12-11 Nick Clifton <nickc@redhat.com>
11313 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11314
b0eec2cc
DK
113152009-12-11 Doug Kwan <dougkwan@google.com>
11316
11317 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11318 due to -Wshadow.
11319 * attributes.cc (Object_attribute::size): Ditto.
11320 (Attributes_section_data::size): Ditto.
11321 (Attributes_section_data::Attributes_section_data): Ditto.
11322 (Output_attributes_section_data::do_write): Ditto.
11323 * attributes.h (Object_attribute::set_type): Ditto.
11324 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11325
91d6fa6a
NC
113262009-12-11 Nick Clifton <nickc@redhat.com>
11327
11328 * archive.cc: Fix shadowed variable warnings.
11329 * arm.cc: Likewise.
11330 * compressed_output.cc: Likewise.
11331 * compressed_output.h: Likewise.
11332 * configure: Likewise.
11333 * dwarf_reader.cc: Likewise.
11334 * dynobj.cc: Likewise.
11335 * dynobj.h: Likewise.
11336 * ehframe.cc: Likewise.
11337 * ehframe.h: Likewise.
11338 * errors.cc: Likewise.
11339 * expression.cc: Likewise.
11340 * fileread.cc: Likewise.
11341 * fileread.h: Likewise.
11342 * freebsd.h: Likewise.
11343 * i386.cc: Likewise.
11344 * icf.cc: Likewise.
11345 * incremental.h: Likewise.
11346 * layout.cc: Likewise.
11347 * layout.h: Likewise.
11348 * mapfile.cc: Likewise.
11349 * merge.cc: Likewise.
11350 * merge.h: Likewise.
11351 * object.cc: Likewise.
11352 * object.h: Likewise.
11353 * options.h: Likewise.
11354 * output.cc: Likewise.
11355 * output.h: Likewise.
11356 * parameters.cc: Likewise.
11357 * plugin.cc: Likewise.
11358 * powerpc.cc: Likewise.
11359 * reduced_debug_output.cc: Likewise.
11360 * reduced_debug_output.h: Likewise.
11361 * reloc.cc: Likewise.
11362 * reloc.h: Likewise.
11363 * resolve.cc: Likewise.
11364 * script-sections.cc: Likewise.
11365 * script.cc: Likewise.
11366 * script.h: Likewise.
11367 * sparc.cc: Likewise.
11368 * symtab.cc: Likewise.
11369 * symtab.h: Likewise.
11370 * target-select.cc: Likewise.
11371 * target-select.h: Likewise.
11372 * token.h: Likewise.
11373 * workqueue.cc: Likewise.
11374 * workqueue.h: Likewise.
11375 * x86_64.cc: Likewise.
11376
a0351a69
DK
113772009-12-10 Doug Kwan <dougkwan@google.com>
11378
11379 * arm.cc (attributes.h): New include.
11380 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11381 (Arm_relobj::~Arm_relobj): Delete object pointed by
11382 attributes_section_data_.
11383 (Arm_relobj::attributes_section_data): New method definition.
11384 (Arm_relobj::attributes_section_data_): New data member declaration.
11385 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11386 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11387 attributes_section_data_.
11388 (Arm_dynobj::attributes_section_data): New method definition.
11389 (Arm_dynobj::attributes_section_data_): New data member declaration.
11390 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11391 initialization value of may_use_blx_ to false.
2e702c99 11392 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11393 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11394 object attributes to compute results instead of hard-coding.
11395 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11396 Target_arm::get_secondary_compatible_arch,
11397 Target_arm::set_secondary_compatible_arch
11398 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11399 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11400 New method declarations.
11401 (Target_arm::get_aeabi_object_attribute): New method definition.
11402 (Target_arm::attributes_section_data_): New data member declaration.
11403 (read_arm_attributes_section): New template definition.
11404 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11405 (Arm_dynobj::do_read_symbols): Ditto.
11406 (Target_arm::do_finalize_sections): Merge attributes sections from
11407 input. Check for BLX use after attributes section merging.
11408 Fix __exidx_start and __exidx_end visibility. Create an
11409 .ARM.attributes section if necessary.
11410 (Target_arm::get_secondary_compatible_arch,
11411 Target_arm::set_secondary_compatible_arch,
11412 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11413 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11414 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11415 New method definitions.
11416
b59befec
ILT
114172009-12-09 Ian Lance Taylor <iant@google.com>
11418
11419 * plugin.cc (Plugin::load): Don't cast from void* to a function
11420 pointer.
11421
1276bc89
ILT
114222009-12-09 Ian Lance Taylor <iant@google.com>
11423
11424 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11425 information fields.
11426
2f2de248
L
114272009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11428
11429 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11430 Replace two_file_shared_1.so with two_file_shared_2.so.
11431 * testsuite/Makefile.in: Regenerated.
11432
4f787271
DK
114332009-12-08 Doug Kwan <dougkwan@google.com>
11434
11435 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11436 (HFILES): Add attributes.h and int_encoding.h.
11437 * Makefile.in: Regenerate.
11438 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11439 function definitions to int_encoding.cc
11440 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11441 prototypes to int_encoding.h
11442 * reduced_debug_output.cc (int_encoding.h): New include.
11443 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11444 function definitions to int_encoding.cc
11445 (insert_into_vector, read_from_pointer): Move template definitions to
11446 int_encoding.h
11447 * attributes.cc: New file.
11448 * attributes.h: New file.
11449 * int_encoding.cc: New file.
11450 * int_encoding.h: New file.
11451
20b52f1a
RÁE
114522009-12-07 Rafael Avila de Espindola <espindola@google.com>
11453
11454 PR gold/11055
11455 * incremental-dump.cc (dump_incremental_inputs): New.
11456 (main): Use dump_incremental_inputs.
11457
53d7974c
L
114582009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11459
11460 PR gold/10893
11461 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11462 checking elfcpp::STT_FUNC.
11463 (Target_i386::Relocate::relocate): Likewise.
11464 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11465
11466 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11467 symbols from shared libraries into normal FUNC symbols.
11468
11469 * symtab.h (Symbol): Add is_func and use it.
11470
05a352e6
DK
114712009-12-05 Doug Kwan <dougkwan@google.com>
11472
11473 * arm.cc (Target_arm::arm_info): Initialize new fields
11474 attributes_section and attributes_vendor.
11475 * i386.cc (Target_i386::i386_info): Same.
11476 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11477 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11478 fields attributes_section and attributes_vendor.
53d7974c 11479 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11480 * target.h (Target::attributes_section, Target::attributes_vendor,
11481 Target::is_attributes_section, Target::attribute_arg_type,
11482 Target::attributes_order): New method definitions.
11483 (Target::Target_info::attributes_section,
11484 Target::Target_info::attributes_vendor): New fields.
11485 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11486 virtual method definitions.
11487 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11488 attributes_section and attributes_vendor.
11489 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11490
f4e5969c
DK
114912009-12-05 Doug Kwan <dougkwan@google.com>
11492
11493 * arm.cc: Update comments about interworking and stub generation.
11494 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11495 considered as non-PIC.
11496 (Arm_relocate_functions::base_abs): Fix formatting.
11497 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11498 of function to use GOT entry address instead of offset.
11499 (Target_arm::Scan::global): Issue an error if a symbol would need a
11500 PLT does not get one because it is untyped. Remove code to create
11501 dynamic symbols for relative branches.
11502 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11503 takes unsigned integer instead of boolean.
11504
1abce4a6
L
115052009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11506
11507 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11508 (two_file_test_LDADD): Likewise.
11509 (common_test_1_LDADD): Likewise.
11510 (exception_test_LDADD) Likewise.
11511 (weak_test_LDADD): Likewise.
11512 (many_sections_test_LDADD): Likewise.
11513 (initpri1_LDADD): Likewise.
11514 (script_test_1_LDADD): Likewise.
11515 (script_test_2_LDADD): Likewise.
11516 (justsyms_LDADD): Likewise.
11517 (binary_test_LDADD): Likewise.
11518 (large_LDADD): Likewise.
11519 * testsuite/Makefile.in: Regenerated.
11520
adcf2816 115212009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11522
adcf2816
L
11523 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11524 (Symbol_table::override_with_special): Likewise.
11525 (Symbol_table::add_from_object): Likewise.
11526
28e67f5d
RÁE
115272009-12-04 Rafael Avila de Espindola <espindola@google.com>
11528
11529 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11530 Don't set the data_offset twice.
11531
ae10a101
RÁE
115322009-12-04 Rafael Avila de Espindola <espindola@google.com>
11533
11534 * testsuite/Makefile.in: Regenerate.
11535
f59f41f3
DK
115362009-12-03 Doug Kwan <dougkwan@google.com>
11537
11538 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11539 (Target_arm::do_finalize_sections): Add parameter for symbol table
11540 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11541 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11542 parameter for symbol table pointer.
11543 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11544 an additional parameter for a pointer to symbol table.
11545 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11546 parameter for a symbol table pointer.
11547 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11548 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11549 Ditto.
11550 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11551 parameter for a symbol table pointer.
11552
ca55d848
RÁE
115532009-12-03 Rafael Avila de Espindola <espindola@google.com>
11554
11555 * incremental.cc (Incremental_inputs_header)
11556 (Incremental_inputs_header_write, Incremental_inputs_entry)
11557 (Incremental_inputs_entry_write): Move ...
11558 * incremental.h (Incremental_inputs_header)
11559 (Incremental_inputs_header_write, Incremental_inputs_entry)
11560 (Incremental_inputs_entry_write): here.
11561
3aec4f9c
RÁE
115622009-12-02 Rafael Avila de Espindola <espindola@google.com>
11563
11564 * incremental.cc (make_sized_incremental_binary): Set the target.
11565 Error if it is incompatible.
11566 * output.h (Output_file): Add filename method.
11567
9c0ae74d
RÁE
115682009-12-02 Rafael Avila de Espindola <espindola@google.com>
11569
11570 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11571 from the get_* methods.
11572
a45500ae
RÁE
115732009-12-02 Rafael Avila de Espindola <espindola@google.com>
11574
11575 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11576 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11577 Write 0 for the data_offset of scripts.
11578
325e6408
RÁE
115792009-12-02 Rafael Avila de Espindola <espindola@google.com>
11580
11581 * testsuite/Makefile.am: Add the incremental_test.sh test.
11582 * testsuite/incremental_test.sh: New.
11583 * testsuite/incremental_test_1.c: New.
11584 * testsuite/incremental_test_2.c: New.
11585
954c3e2e
RÁE
115862009-12-01 Rafael Avila de Espindola <espindola@google.com>
11587
703d02da 11588 * incremental-dump.cc (main): Fix typos.
954c3e2e 11589
f8086623
RÁE
115902009-11-27 Rafael Avila de Espindola <espindola@google.com>
11591
11592 PR gold/11025
11593 * incremental-dump.cc (main): Use llu to print 64 bit values.
11594
3b0dd6ac
L
115952009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11596 H.J. Lu <hongjiu.lu@intel.com>
11597
11598 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11599 $(LIBDL).
11600 (incremental_dump_LDADD): Likewise.
11601 * Makefile.in: Regenerated.
11602
a6d1ef57 116032009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11604
a6d1ef57
DK
11605 Revert:
11606
11607 2009-11-25 Doug Kwan <dougkwan@google.com>
11608
11609 * arm.cc (Target_arm::Target_arm): Move method definition
11610 outside of class definition. Add code to handle
11611 --target1-rel, --target1-abs and --target2= options.
11612 (Target_arm::get_reloc_reloc_type): Change method to be
11613 non-static and const.
11614 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11615 New data member declaration.
11616 (Target_arm::Scan::local, Target_arm::Scan::global,
11617 Target_arm::Relocate::relocate,
11618 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11619 Adjust call to Target_arm::get_real_reloc_type.
11620 (Target_arm::get_real_reloc_type): Use command line options
11621 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11622 * options.h (--target1-rel, --target1-abs, --target2): New
11623 ARM-only options.
11624
50aeb7d4
DK
116252009-11-25 Doug Kwan <dougkwan@google.com>
11626
11627 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11628 class definition. Add code to handle --target1-rel, --target1-abs
11629 and --target2= options.
11630 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11631 and const.
11632 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11633 member declaration.
11634 (Target_arm::Scan::local, Target_arm::Scan::global,
11635 Target_arm::Relocate::relocate,
11636 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11637 call to Target_arm::get_real_reloc_type.
11638 (Target_arm::get_real_reloc_type): Use command line options to
11639 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11640 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11641 options.
11642
51938283
DK
116432009-11-25 Doug Kwan <dougkwan@google.com>
11644
11645 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11646 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11647 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11648 formatting.
11649 (Arm_relocate_functions::thm_call): Replace body with a call to
11650 Arm_relocate_functions::thumb_branch_common.
11651 (Arm_relocate_functions::thm_jump24,
11652 Arm_relocate_functions::thm_xpc22): New method definitions.
11653 (Arm_relocate_functions::thumb_branch_common): New method definition.
11654 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11655 operator.
11656 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11657 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11658
e2b8f3c4
RÁE
116592009-11-24 Rafael Avila de Espindola <espindola@google.com>
11660
11661 * Makefile.am: Build incremental-dump
11662 * Makefile.in: Regenerate.
11663 * incremental-dump.cc: New.
11664 * incremental.cc (Incremental_inputs_header_data,
11665 Incremental_inputs_entry_data): Move to incremental.h
11666 * incremental.h: (Incremental_inputs_header_data,
11667 Incremental_inputs_entry_data): Move from incremental.cc
11668
bcba9aec
RÁE
116692009-11-24 Rafael Avila de Espindola <espindola@google.com>
11670
11671 * incremental.cc (Incremental_inputs_header,
11672 Incremental_inputs_header_write, Incremental_inputs_entry,
11673 Incremental_inputs_entry_write): Add a typedef with the data type.
11674
7c3afe08
RÁE
116752009-11-24 Rafael Avila de Espindola <espindola@google.com>
11676
11677 * incremental.cc (Incremental_inputs_header,
11678 Incremental_inputs_header_write, Incremental_inputs_entry,
11679 Incremental_inputs_entry_write): Update comment about which
11680 type has the filed descriptions.
11681
d204b6e9
DK
116822009-11-15 Doug Kwan <dougkwan@google.com>
11683
11684 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11685 (Arm_relocate_functions::arm_branch_common): Change method defintion
11686 in class definition to a method declaration and update list of formal
11687 parameters.
11688 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11689 Arm_relocation_functions::jump24): Adjust call to
11690 Arm_relocate_functions::arm_branch_common. Update list of formal
11691 parameters.
11692 (Arm_relocate_functions::xpc25): New method definition.
11693 (Arm_relocate_functions::arm_branch_common): Move method defintion
11694 out from class definition. Use stubs for mode-switching and extending
11695 branch ranges.
11696 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11697 specially. Change code to enable use of stubs in ARM branches.
11698
43d12afe
DK
116992009-11-10 Doug Kwan <dougkwan@google.com>
11700
11701 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11702 in method declaration.
11703 (Target_arm::relocate_stub): New method declaration.
11704 (Target_arm::default_target): Change to return a pointer instead of
11705 a const reference.
11706 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11707 Target_arm::default_target.
11708 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11709 method definition.
11710 (Target_arm::relocate_section): Adjust view.
11711 (Target_arm::relocate_stub): New method definition.
11712
ac33a407
DK
117132009-11-10 Doug Kwan <dougkwan@google.com>
11714
11715 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11716 a format warning.
11717 * incremental.cc (open_incremental_binary): Initialized local
11718 variables to avoid warnings.
11719 * object.cc (make_elf_object): Ditto.
11720 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11721 a format warning.
e1df38aa 11722
88ee28e9
L
11723009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11724
11725 PR gold/10930
11726 * testsuite/plugin_test.c: Include "config.h".
11727
2daedcd6
DK
117282009-11-09 Doug Kwan <dougkwan@google.com>
11729
11730 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11731 (arm_symbol_value): Remove.
11732 (Arm_relocate_functions::arm_branch_common,
11733 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11734 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11735 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11736 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11737 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11738 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11739 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11740 Arm_relocate_functions::thm_mobw_abs_nc,
11741 Arm_relocate_functions::thm_mov_abs,
11742 Arm_relocate_functions::movw_prel_nc,
11743 Arm_relocate_functions::thm_movt_abs,
11744 Arm_relocate_functions::movt_prel,
11745 Arm_relocate_functions::thm_movw_prel_nc,
11746 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11747 (Target_arm::Relocate::relocate): Only decompose address into two
11748 parts if relocation type uses the thumb-bit and pass the actual
11749 bit instead of a flag indicating that the thumb-bit is used. Adjust
11750 calls to methods in Arm_relocate_functions for this change.
11751
1276bc89 117522009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11753
11754 PR 10925
11755 * reloc.cc: Instantiate
11756 Sized_relobj::initialize_input_to_output_maps and
11757 Sized_relobj:free_input_to_output_maps.
11758
e53ad1b5
ILT
117592009-11-06 Ian Lance Taylor <iant@google.com>
11760
11761 PR 10876
11762 * defstd.cc (in_segment): Set only_if_ref true for "end".
11763
eb44217c
DK
117642009-11-06 Doug Kwan <dougkwan@google.com>
11765
11766 * arm.cc (class Reloc_stub): Correct a comment.
11767 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11768 (Target_arm::scan_section_for_stubs): New method declaration.
11769 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11770 Change methods from private to protected.
11771 (Target_arm::do_may_relax): New method definition.
11772 (Target_arm::do_relax, Target_arm::group_sections,
11773 Target_arm::scan_reloc_for_stub,
11774 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11775 (Target_arm::arm_input_section_map_): New data member declaration.
11776 (Target_arm::scan_reloc_for_stub,
11777 Target_arm::scan_reloc_section_for_stubs,
11778 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11779 Target_arm::do_relax): New method definitions.
11780
5d329b7d
ILT
117812009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11782
11783 * configure.ac: Check for (struct stat)::st_mtim
11784 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11785 * config.in: Regenerate.
11786 * configure: Regenerate.
11787
96a0d71b
ILT
117882009-11-05 Ian Lance Taylor <iant@google.com>
11789
11790 PR 10910
11791 * output.cc (Output_segment::add_output_section): Add missing
11792 return statement.
11793
594c8e5e
ILT
117942009-11-04 Ian Lance Taylor <iant@google.com>
11795
11796 PR 10880
11797 * object.h (class Object): Add is_needed and set_is_needed
11798 methods. Add is_needed_ field. Make bool fields into bitfields.
11799 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11800 defined in a dynamic object and referenced by a regular object,
11801 set is_needed for the dynamic object.
11802 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11803 if the file is marked with as_needed and it is not needed.
11804
22b127cc
ILT
118052009-11-04 Ian Lance Taylor <iant@google.com>
11806
11807 PR 10887
11808 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11809 tags if data is discarded by linker script.
11810 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11811 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11812 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11813 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11814
f5c870d2
ILT
118152009-11-04 Ian Lance Taylor <iant@google.com>
11816
11817 * layout.cc (Layout::get_output_section): Add is_interp and
11818 is_dynamic_linker_section parameters. Change all callers.
11819 (Layout::choose_output_section): Likewise.
11820 (Layout::make_output_section): Likewise.
11821 (Layout::add_output_section_data): Add is_dynamic_linker_section
11822 parameter. Change all callers.
11823 * layout.h (class Layout): Update declarations.
11824 * output.h (class Output_section): Add is_interp, set_is_interp,
11825 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11826 Add is_interp_, is_dynamic_linker_section_ fields. Change
11827 generate_code_fills_at_write_ to a bitfield.
11828 * output.cc (Output_section::Output_sections): Initialize new
11829 fields.
11830 (Output_segment::add_output_section): Add do_sort parameter.
11831 Change all callers.
11832
1ae4d23b
ILT
118332009-11-03 Ian Lance Taylor <iant@google.com>
11834
11835 PR 10860
11836 * options.h (class General_options): Add --warn-common.
11837 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11838 merging two common symbols.
11839 (Symbol_table::should_override): Handle --warn-common when merging
11840 a common symbol with a defined symbol. Use report_resolve_problem
11841 for multiple definitions.
11842 (Symbol_table::report_resolve_problem): New function.
11843 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11844
55da9579
DK
118452009-11-03 Doug Kwan <dougkwan@google.com>
11846
11847 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11848 stub_factory_.
11849 (Target_arm::stub_factory): New method definition.
11850 (Target_arm::new_arm_input_section,
11851 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11852 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11853 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11854 New type definitions.
11855 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11856 member declarations.
11857 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11858 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11859 New method definitions.
11860
37a9ac43
ILT
118612009-11-03 Ian Lance Taylor <iant@google.com>
11862
11863 * options.h (class General_options): Add --warn_constructors.
11864
b3d6a3d4
ILT
118652009-11-03 Ian Lance Taylor <iant@google.com>
11866
11867 PR 10893
11868 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11869 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11870
934b01dd
ILT
118712009-11-03 Ian Lance Taylor <iant@google.com>
11872
11873 PR 10895
11874 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11875 --msgid-bugs-address.
11876 (install-pdf): New target.
11877 (install-data_yes): Look up one directory to find mkinstalldirs.
11878
03c1939b
L
118792009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11880
11881 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11882 tree.
11883
ebd95253
DK
118842009-10-30 Doug Kwan <dougkwan@google.com>
11885
11886 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11887
e9bbb538
DK
118882009-10-30 Doug Kwan <dougkwan@google.com>
11889
11890 * arm.cc (Stub_addend_reader): New struct template definition
11891 and partial specializations.
11892 (Stub_addend_reader::operator()): New method definition for a
11893 partially specialized template.
11894
d5b40221
DK
118952009-10-30 Doug Kwan <dougkwan@google.com>
11896
11897 * arm.cc (Arm_relobj::processor_specific_flags): New method
11898 definition.
11899 (Arm_relobj::do_read_symbols): New method declaration.
11900 (Arm_relobj::processor_specific_flags_): New data member declaration.
11901 (Arm_dynobj): New class definition.
11902 (Target_arm::do_finalize_sections): Add input_objects parameter.
11903 (Target_arm::do_adjust_elf_header): New method declaration.
11904 (Target_arm::are_eabi_versions_compatible,
11905 (Target_arm::merge_processor_specific_flags): New method declaration.
11906 (Target_arm::do_make_elf_object): New overloaded method definitions
11907 and declaration.
11908 (Arm_relobj::do_read_symbols): New method definition.
11909 (Arm_dynobj::do_read_symbols): Ditto.
11910 (Target_arm::do_finalize_sections): Add input_objects parameters.
11911 Merge processor-specific flags from all input objects.
11912 (Target_arm::are_eabi_versions_compatible,
11913 Target_arm::merge_processor_specific_flags,
11914 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11915 New method definitions.
11916 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11917 Input_objects pointer type parameter.
11918 * layout.cc (Layout::finalize): Pass input objects to target's.
11919 finalize_sections function.
11920 * output.cc (Output_file_header::do_sized_write): Set ELF file
11921 header's processor-specific flags.
11922 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11923 Input_objects pointer type parameter.
11924 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11925 * target.h (Input_objects): New forward class declaration.
11926 (Target::processor_specific_flags,
11927 Target::are_processor_specific_flags_sect): New method definitions.
11928 (Target::finalize_sections): Add input_objects parameter.
11929 (Target::Target): Initialize processor_specific_flags_ and
11930 are_processor_specific_flags_set_.
11931 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11932 parameter.
11933 (Target::set_processor_specific_flags): New method definition.
11934 (Target::processor_specific_flags_,
11935 Target::are_processor_specific_flags_set_): New data member
11936 declarations.
11937 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11938 Input_objects pointer type parameter.
11939
ebabffbd
DK
119402009-10-30 Doug Kwan <dougkwan@google.com>
11941
11942 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11943
ad0f2072
ILT
119442009-10-28 Ian Lance Taylor <iant@google.com>
11945
11946 * object.h (class Relobj): Drop options parameter from
11947 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11948 do_scan_relocs, do_relocate. Change all callers.
11949 (class Sized_relobj): Drop options parameters from
11950 do_gc_process_relocs, do_scan_relocs, do_relocate,
11951 do_relocate_sections, relocate_sections, emit_relocs_scan,
11952 emit_relocs_scan_reltype. Change all callers.
11953 (struct Relocate_info): Remove options field and all references to
11954 it.
11955 * reloc.h (class Read_relocs): Remove options constructor
11956 parameter and options_ field. Change all callers.
11957 (class Gc_process_relocs, class Scan_relocs): Likewise.
11958 (class Relocate_task): Likewise.
11959 * target-reloc.h (scan_relocs): Remove options parameter. Change
11960 all callers.
11961 (scan_relocatable_relocs): Likewise.
11962 * target.h (class Sized_target): Remove options parameter from
11963 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11964 all callers.
11965 * gc.h (gc_process_relocs): Remove options parameter. Change all
11966 callers.
11967 * arm.cc: Update functions to remove options parameters.
11968 * i386.cc: Likewise.
11969 * powerpc.cc: Likewise.
11970 * sparc.cc: Likewise.
11971 * x86_64.cc: Likewise.
11972 * testsuite/testfile.cc: Likewise.
11973
8ffa3667
DK
119742009-10-28 Doug Kwan <dougkwan@google.com>
11975
11976 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11977 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11978 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11979 New method definitions.
11980
40f36857
CC
119812009-10-28 Cary Coutant <ccoutant@google.com>
11982
11983 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11984 (Plugin::cleanup_done_): New member.
11985 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11986 (Plugin_manager::cleanup_done_): Remove.
11987 (Plugin_manager::add_input_file): Edit error message.
11988 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11989 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11990
2c849493
ILT
119912009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11992
11993 * fileread.cc: (File_read::View::~View): Use the new
11994 data_ownership_ filed.
11995 (File_read::~File_read): Dispose the new whole_file_view_.
11996 (File_read::open): Mmap the whole file if needed.
11997 (File_read::open): Use whole_file_view_ instead of contents_.
11998 (File_read::find_view): Use whole_file_view_ if applicable.
11999 (File_read::do_read): Use whole_file_view_ instead of contents_.
12000 (File_read::make_view): Use whole_file_view_ instead of contents_,
12001 update File_read::View::View call.
12002 (File_read::find_or_make_view): Update File_read::View::View
12003 call.
12004 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12005 remove contents_
12006 (File_read::View::Data_ownership): New enum.
12007 (File_read::View::View): Replace bool mapped_ with Data_ownership
12008 argument.
12009 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12010 (File_read::View::data_ownership_): New field.
12011 (File_read::contents_): Remove (replaced by whole_file_view_).
12012 (File_read::whole_file_view_): New field.
12013 * options.h (class General_options): Add --keep-files-mapped.
12014
24998053
CC
120152009-10-27 Cary Coutant <ccoutant@google.com>
12016
12017 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12018 * testsuite/Makefile.am (plugin_test_5): New test case.
12019 * testsuite/Makefile.in: Regenerate.
12020
72adc4fa
DK
120212009-10-25 Doug Kwan <dougkwan@google.com>
12022
12023 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12024 from private to protected to allow access by child class.
12025 (Sized_relobj::do_relocate_sections): New method declaration.
12026 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12027 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12028 Sized_relobj::relocate_sections. Instantiate template explicitly
12029 for different target sizes and endianity.
12030
07f508a2
DK
120312009-10-24 Doug Kwan <dougkwan@google.com>
12032
12033 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12034 (Arm_input_section::as_arm_input_section): New method.
12035 (Arm_output_section): New class definition.
12036 (Arm_output_section::create_stub_group,
12037 Arm_output_section::group_sections): New method definitions.
12038
10ad9fe5
DK
120392009-10-22 Doug Kwan <dougkwan@google.com>
12040
12041 * arm.cc (Arm_input_section): New class definition.
12042 (Arm_input_section::init, Arm_input_section:do_write,
12043 Arm_input_section::set_final_data_size,
12044 Arm_input_section::do_reset_address_and_file_offset): New method
12045 definitions.
12046
56ee5e00
DK
120472009-10-21 Doug Kwan <dougkwan@google.com>
12048
12049 * arm.cc (Stub_table, Arm_input_section): New forward class
12050 declarations.
12051 (Stub_table): New class defintion.
12052 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12053 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12054 New method definition.
12055
b569affa
DK
120562009-10-21 Doug Kwan <dougkwan@google.com>
12057
12058 * arm.cc: Update copyright comments.
12059 (Target_arm): New forward class template declaration.
12060 (Arm_address): New type.
12061 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12062 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12063 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12064 constants.
12065 (Insn_template): Same.
12066 (DEF_STUBS): New macro.
12067 (Stub_type): New enum type.
12068 (Stub_template): New class definition.
12069 (Stub): Same.
12070 (Reloc_stub): Same.
12071 (Stub_factory): Same.
12072 (Target_arm::Target_arm): Initialize may_use_blx_ and
12073 should_force_pic_veneer_.
12074 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12075 Target_arm::should_force_pic_veneer,
12076 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12077 Target_arm::using_thumb_only, Target_arm:;default_target): New
12078 method defintions.
12079 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12080 New data member declarations.
12081 (Insn_template::size, Insn_template::alignment): New method defintions.
12082 (Stub_template::Stub_template): New method definition.
12083 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12084 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12085 (Stub_factory::Stub_factory): New method definition.
12086 * gold.h (string_hash): New template.
12087 * output.h (Input_section_specifier::hash_value): Use
12088 gold::string_hash.
12089 (Input_section_specifier::string_hash): Remove.
12090 * stringpool.cc (Stringpool_template::string_hash): Use
12091 gold::string_hash.
12092
6c172549
DK
120932009-10-20 Doug Kwan <dougkwan@google.com>
12094
12095 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12096 symbols of relaxed input sections.
12097 * output.h (Output_section::find_relaxed_input_section): Make
12098 method public.
12099
c5617f2f
DK
121002009-10-16 Doug Kwan <dougkwan@google.com>
12101
12102 * dynobj.cc (Versions::Versions): Initialize version_script_.
12103 Only insert base version symbol definition for a shared object
12104 if version script defines any version versions.
12105 (Versions::define_base_version): New method definition.
12106 (Versions::add_def): Check that base version is not needed.
12107 (Versions::add_need): Define base version lazily.
12108 * dynobj.h (Versions::define_base_version): New method declaration.
12109 (Versions::needs_base_version_): New data member declaration.
12110 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12111 (check_DATA): Add no_version_test.stdout.
12112 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12113 New make rules.
12114 * testsuite/Makefile.in: Regenerate.
12115 * testsuite/no_version_test.c: New file.
12116 * testsuite/no_version_test.sh: Ditto.
12117
3c12dcdb
DK
121182009-10-16 Doug Kwan <dougkwan@google.com>
12119
12120 * expression.cc (class Segment_start_expression): New class definition.
12121 (Segment_start_expression::value): New method definition.
12122 (script_exp_function_segment_start): Return a new
12123 Segment_start_expression.
12124 * gold/script-c.h (script_saw_segment_start_expression): New function
12125 prototype.
12126 * script-sections.cc (Script_sections::Script_sections): Initialize
12127 SAW_SEGMENT_START_EXPRESSION_ to false.
12128 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12129 and -Tbbs options to specify section addresses if given in
12130 command line and no SEGMENT_START expression is seen in a script.
12131 * script-sections.h (Script_sections::saw_segment_start_expression,
12132 Script_sections::set_saw_segment_start_expression): New method
12133 definition.
12134 (Script_sections::saw_segment_start_expression_): New data member
12135 declaration.
12136 * script.cc (script_saw_segment_start_expression): New function.
12137 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12138 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12139 script_test_7.sh and script_test_8.sh.
12140 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12141 script_test_8.stdout.
12142 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12143 (script_test_6, script_test_6.stdout, script_test_7,
12144 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12145 * Makefile.in: Regenerate.
12146 * testsuite/script_test_6.sh: New file.
12147 * testsuite/script_test_6.t: Same.
12148 * testsuite/script_test_7.sh: Same.
12149 * testsuite/script_test_7.t: Same.
12150 * testsuite/script_test_8.sh: Same.
12151
64b1ae37
DK
121522009-10-16 Doug Kwan <dougkwan@google.com>
12153
12154 * output.cc (Output_segment::set_section_list_address): Cast
12155 expressions to unsigned long long type to avoid format warnings.
12156
661be1e2
ILT
121572009-10-15 Ian Lance Taylor <iant@google.com>
12158
12edd763 12159 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12160 dot assignment to script_sections_.
12edd763
ILT
12161 * script-sections.cc (Script_sections::add_dot_assignment):
12162 Initialize if necessary.
12163
68b6574b
ILT
12164 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12165 program headers with no load segment if there is a linker script.
12166
661be1e2
ILT
12167 * layout.cc (Layout::set_segment_offsets): Align the file offset
12168 to the segment aligment for -N or -n with no load segment.
12169 * output.cc (Output_segment::add_output_section): Don't crash if
12170 the first section is a TLS section.
12171 (Output_segment::set_section_list_addresses): Print an error
12172 message if the address moves backward in a linker script.
12173 * script-sections.cc
12174 (Output_section_element_input::set_section_addresses): Don't
12175 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12176 (Orphan_output_section::set_section_addresses): Likewise.
12177
f15f61a7
DK
121782009-10-15 Doug Kwan <dougkwan@google.com>
12179
12180 * layout.cc (Layout::finish_dynamic_section): Generate tags
12181 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12182 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12183 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12184
82bb573a
ILT
121852009-10-14 Ian Lance Taylor <iant@google.com>
12186
12187 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12188 fields.
12189 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12190 data_shdr fields of relinfo.
12191 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12192 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12193 R_386_TLS_LDO_32, adjust based on section flags.
12194 (Target_i386::Relocate::fix_up_ldo): Remove.
12195
374ad285
ILT
121962009-10-13 Ian Lance Taylor <iant@google.com>
12197
12198 Add support for -pie.
12199 * options.h (class General_options): Add -pie and
12200 --pic-executable.
12201 (General_options::output_is_position_independent): Test -pie.
12202 (General_options::output_is_executable): Return true if not shared
12203 and not relocatable.
12204 (General_options::output_is_pie): Remove.
12205 * options.cc (General_options::finalize): Reject incompatible uses
12206 of -pie.
12207 * gold.cc (queue_middle_tasks): A -pie link is not static.
12208 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12209 * symtab.cc (Symbol::final_value_is_known): Return false if
12210 output_is_position_independent.
12211 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12212 output_is_position_independent.
12213 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12214 output_is_position_independent.
12215 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12216 output_is_position_independent.
12217 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12218 two_file_pie_test.
12219 (basic_pie_test.o, basic_pie_test): New targets.
12220 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12221 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12222 (two_file_pie_test): New target.
12223 * testsuite/Makefile.in: Rebuild.
12224 * README: Remove note saying that -pie is not supported.
12225
c6585162
ILT
122262009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12227
12228 * options.h (class General_options): Add -init and -fini.
12229 * layout.cc (Layout::finish_dynamic_section): Emit
12230 given init and fini functions.
12231
032ce4e9
ST
122322009-10-13 Sriraman Tallam <tmsriram@google.com>
12233
12234 * gc.h (gc_process_relocs): Check if icf is enabled using new
12235 function.
12236 * gold.cc (queue_initial_tasks): Likewise.
12237 (queue_middle_tasks): Likewise.
12238 * object.cc (do_layout): Likewise.
12239 * symtab.cc (is_section_folded): Likewise.
12240 * main.cc (main): Likewise.
12241 * reloc.cc (Read_relocs::run): Likewise.
12242 (Sized_relobj::do_scan_relocs): Likewise.
12243 * icf.cc (is_function_ctor_or_dtor): New function.
12244 (Icf::find_identical_sections): Check if function is ctor or dtor when
12245 safe icf is chosen.
12246 * options.h (General_options::icf): Change option to be an enum.
12247 (Icf_status): New enum.
12248 (icf_enabled): New method.
12249 (icf_safe_folding): New method.
12250 (set_icf_status): New method.
12251 (icf_status_): New variable.
12252 * (options.cc) (General_options::finalize): Set icf_status_.
12253 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12254 icf_test and icf_keep_unique_test to use the --icf enum flag.
12255 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12256 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12257
f345227a
ST
122582009-10-12 Sriraman Tallam <tmsriram@google.com>
12259
12260 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12261 includes to gc.h and icf.h.
12262 * arm.cc: Include gc.h.
12263 * gold.cc: Likewise.
12264 * i386.cc: Likewise.
12265 * powerpc.cc: Likewise.
12266 * sparc.cc: Likewise.
12267 * x86_64.cc: Likewise.
12268 * gc.h: Include icf.h.
12269
1c7814ed
ILT
122702009-10-11 Ian Lance Taylor <iant@google.com>
12271
12272 * plugin.cc: Include "gold.h" before other header files.
12273
ae3b5189
CD
122742009-10-10 Chris Demetriou <cgd@google.com>
12275
12276 * options.h (Input_file_argument::Input_file_type): New enum.
12277 (Input_file_argument::is_lib_): Replace with...
12278 (Input_file_argument::type_): New member.
12279 (Input_file_argument::Input_file_argument): Take Input_file_type
12280 'type' rather than boolean 'is_lib' as second argument.
12281 (Input_file_argument::is_lib): Use type_.
12282 (Input_file_argument::is_searched_file): New function.
12283 (Input_file_argument::may_need_search): Handle is_searched_file.
12284 * options.cc (General_options::parse_library): Support -l:filename.
12285 (General_options::parse_just_symbols): Update for Input_file_argument
12286 changes.
12287 (Command_line::process): Likewise.
12288 * archive.cc (Archive::get_file_and_offset): Likewise.
12289 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12290 * script.cc (read_script_file, script_add_file): Likewise.
12291 * fileread.cc (Input_file::Input_file): Likewise.
12292 (Input_file::will_search_for): Handle is_searched_file.
12293 (Input_file::open): Likewise.
12294 * readsyms.cc (Read_symbols::get_name): Likewise.
12295 * testsuite/Makefile.am (searched_file_test): New test.
12296 * testsuite/Makefile.in: Regenerate.
12297 * testsuite/searched_file_test.cc: New file.
12298 * testsuite/searched_file_test_lib.cc: New file.
12299
f3048a1d
ILT
123002009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12301 Ian Lance Taylor <iant@google.com>
12302
12303 * descriptor.cc: Include <cstdio> and "binary-io.h".
12304 (Descriptors::open): Open the files in binary mode always.
12305 * script.cc (Lex::get_token): Treat \r as whitespace.
12306
d4780e57
ILT
123072009-10-09 Ian Lance Taylor <iant@google.com>
12308
12309 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12310
d9a893b8
ILT
123112009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12312 Ian Lance Taylor <iant@google.com>
12313
12314 * configure.ac: Check for readv function also.
12315 * fileread.cc (readv): Define if not HAVE_READV.
12316 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12317 does not exist.
12318 * config.in: Regenerate.
12319 * configure: Regenerate.
12320
c0a62865
DK
123212009-10-09 Doug Kwan <dougkwan@google.com>
12322
12323 * layout.cc (Layout::make_output_section): Call target hook to make
12324 ordinary output section.
12325 (Layout::finalize): Adjust parameter list of call the
12326 Target::may_relax().
12327 * layout.h (class Layout::section_list): New method.
12328 * merge.h (Output_merge_base::entsize): Change visibility to public.
12329 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12330 New methods.
12331 (Output_merge_string::do_is_string): New method.
12332 * object.cc (Sized_relobj::do_setup): renamed from
12333 Sized_relobj::set_up.
12334 * object.h (Sized_relobj::adjust_shndx,
12335 Sized_relobj::initializ_input_to_output_maps,
12336 Sized_relobj::free_input_to_output_maps): Change visibilities to
12337 protected.
12338 (Sized_relobj::setup): Virtualize.
12339 (Sized_relobj::do_setup): New method declaration.
12340 (Sized_relobj::invalidate_section_offset,
12341 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12342 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12343 * options.cc (parse_int): New function.
12344 * options.h (parse_int): New declaration.
12345 (DEFINE_int): New macro.
12346 (stub_group_size): New option.
12347 * output.cc (Output_section::Output_section): Initialize memebers
12348 merge_section_map_, merge_section_by_properties_map_,
12349 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12350 (Output_section::add_input_section): Handled deferred code-fill
12351 generation and remove an old comment.
12352 (Output_section::add_relaxed_input_section): New method definition.
12353 (Output_section::add_merge_input_section): Use merge section by
12354 properties map to speed to search. Update merge section maps
12355 as appropriate.
12356 (Output_section::build_relaxation_map): New method definition.
12357 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12358 Same.
12359 (Output_section::relax_input_section): Renamed to
12360 Output_section::convert_input_sections_to_relaxed_sections and change
12361 interface to take a vector of pointers to relaxed sections.
12362 (Output_section::find_merge_section,
12363 Output_section::find_relaxed_input_section): New method definitions.
12364 (Output_section::is_input_address_mapped,
12365 Output_section::output_offset, Output_section::output_address):
12366 Use output section data maps to speed up searching.
12367 (Output_section::find_starting_output_address): Add comments.
12368 (Output_section::do_write,
12369 Output_section::write_to_postprocessing_buffer): Do code-fill
12370 generation as appropriate.
12371 (Output_section::get_input_sections): Invalidate relaxed input section
12372 map.
12373 (Output_section::restore_states): Adjust type of checkpoint .
12374 Invalidate relaxed input section map.
12375 * output.h (Output_merge_base): New class declaration.
12376 (Input_section_specifier): New class defintion.
12377 (class Output_relaxed_input_section) Change base class to
12378 Output_section_data_build.
12379 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12380 base class initializer.
12381 (Output_section::add_relaxed_input_section): New method declaration.
12382 (Output_section::Input_section): Change visibility to protected.
2e702c99 12383 (Output_section::Input_section::relobj,
c0a62865
DK
12384 Output_section::Input_section::shndx): Handle relaxed input sections.
12385 Output_section::input_sections) Change visibility to protected. Also
12386 define overload to return a non-const pointer.
12387 (Output_section::Merge_section_properties): New class defintion.
12388 (Output_section::Merge_section_by_properties_map,
12389 Output_section::Output_section_data_by_input_section_map,
12390 Output_section::Relaxation_map): New types.
12391 (Output_section::relax_input_section): Rename method to
12392 Output_section::convert_input_sections_to_relaxed_sections and change
12393 interface to take a vector of relaxed section pointers.
12394 (Output_section::find_merge_section,
12395 Output_section::find_relaxed_input_section,
12396 Output_section::build_relaxation_map,
12397 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12398 New method declarations.
12399 (Output_section::merge_section_map_
12400 Output_section::merge_section_by_properties_map_,
12401 Output_section::relaxed_input_section_map_,
12402 Output_section::is_relaxed_input_section_map_valid_,
12403 Output_section::generate_code_fills_at_write_): New data members.
12404 * script-sections.cc
12405 (Output_section_element_input::set_section_addresses): Call
12406 current_data_size and addralign methods of relaxed input sections.
12407 (Orphan_output_section::set_section_addresses): Call current_data_size
12408 and addralign methods of relaxed input sections.
12409 * symtab.cc (Symbol_table::compute_final_value): Extract template
12410 from the body of Symbol_table::sized_finalize_symbol.
12411 (Symbol_table::sized_finalized_symbol): Call
12412 Symbol_table::compute_final_value.
12413 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12414 (Symbol_table::compute_final_value): New templated method declaration.
12415 * target.cc (Target::do_make_output_section): New method defintion.
12416 * target.h (Target::make_output_section): New method declaration.
12417 (Target::relax): Add more parameters for input objects, symbol table
12418 and layout. Adjust call to do_relax.
12419 (Target::do_make_output_section): New method declaration.
12420 (Target::do_relax): Add parameters for input objects, symbol table
12421 and layout.
12422
d446d6c4
ILT
124232009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12424
12425 * pread.c: Include stdio.h.
12426
bc06c745
ILT
124272009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12428
12429 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12430 defined.
12431
75aea3d0
ILT
124322009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12433
12434 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12435 Change read_shndx type to unsigned int.
12436 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12437 int.
12438 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12439 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12440 Change read_shndx type to unsigned int.
12441 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12442 int.
12443 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12444 * layout.cc (Layout::create_symtab_sections): Cast the result of
12445 local_symcount * symsize to off_t in the gold_assert.
12446
be8fcb75
ILT
124472009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12448
12449 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12450 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12451 R_ARM_BASE_ABS.
12452 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12453 (Arm_relocate_functions::thm_abs5): New function.
12454 (Arm_relocate_functions::abs12): New function.
12455 (Arm_relocate_functions::abs16): New function.
12456 (Arm_relocate_functions::base_abs): New function.
12457 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12458 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12459 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12460 R_ARM_BASE_ABS.
12461 (Scan::global): Likewise.
12462 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12463 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12464 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12465 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12466 R_ARM_BASE_ABS.
12467
c2a122b6
ILT
124682009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12469
12470 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12471 (Arm_relocate_functions::movt_prel): New function.
12472 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12473 (Arm_relocate_functions::thm_movt_prel): New function.
12474 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12475 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12476 (Scan::global, Relocate::relocate): Likewise.
12477 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12478
c4aa1e2d
ILT
124792009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12480
12481 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12482 Incremental_checker.
12483 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12484 unsigned int.
12485 (class Incremental_inputs_header): New class.
12486 (Incremental_inputs_header_writer): Edit comment.
12487 (Incremental_inputs_entry): New class.
12488 (Incremental_inputs_entry_writer): Edit comment.
12489 (Sized_incremental_binary::do_find_incremental_inputs_section):
12490 Add *strtab_shndx parameter, fill it.
12491 (Sized_incremental_binary::do_check_inputs): New method.
12492 (Incremental_checker::can_incrementally_link_output_file): Use
12493 Sized_incremental_binary::check_inputs.
12494 (Incremental_inputs::report_command_line): Save command line in
12495 command_line_.
12496 * incremental.h:
12497 (Incremental_binary::find_incremental_inputs_section): New
12498 method.
12499 (Incremental_binary::do_find_incremental_inputs_section): Add
12500 strtab_shndx parameter.
12501 (Incremental_binary::do_check_inputs): New pure virtual method.
12502 (Sized_incremental_binary::do_check_inputs): Declare.
12503 (Incremental_checker::Incremental_checker): Add incremental_inputs
12504 parameter, use it to initialize incremental_inputs_.
12505 (Incremental_checker::incremental_inputs_): New field.
12506 (Incremental_checker::command_line): New method.
12507 (Incremental_checker::inputs): New method.
12508 (Incremental_checker::command_line_): New field.
12509
c549a694
ILT
125102009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12511
12512 * incremental.cc: Include <cstdarg> and "target-select.h".
12513 (vexplain_no_incremental): New function.
12514 (explain_no_incremental): New function.
12515 (Incremental_binary::error): New method.
12516 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12517 method.
12518 (make_sized_incremental_binary): New function.
12519 (open_incremental_binary): New function.
12520 (can_incrementally_link_file): Add checks if output is ELF and has
12521 inputs section.
12522 * incremental.h: Include "elfcpp_file.h" and "output.h".
12523 (Incremental_binary): New class.
12524 (Sized_incremental_binary): New class.
12525 (open_incremental_binary): Declare.
12526 * object.cc (is_elf_object): Use
12527 elfcpp::Elf_recognizer::is_elf_file.
12528 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12529 * output.h (Output_file::filesize): New method.
12530
fd3c5f0b
ILT
125312009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12532
12533 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12534 New function.
12535 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12536 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12537 function.
12538 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12539 function.
12540 (Arm_relocate_functions::movw_abs_nc): New function.
12541 (Arm_relocate_functions::movt_abs): New function.
12542 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12543 (Arm_relocate_functions::thm_movt_abs): New function.
12544 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12545 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12546 (Scan::global): Likewise.
12547 (Relocate::relocate): Likewise.
12548 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12549
7f5309a5
ILT
125502009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12551
12552 * arm.cc (Arm_relocate_functions::got_prel) New function.
12553 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12554 (Relocate::relocate): Likewise.
12555 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12556
364c7fa5
ILT
125572009-10-06 Ian Lance Taylor <iant@google.com>
12558
12559 * options.h (class General_options): Define
12560 split_stack_adjust_size parameter.
12561 * object.h (class Object): Add uses_split_stack_ and
12562 has_no_split_stack_ fields. Add uses_split_stack and
12563 has_no_split_stack accessor functions. Declare
12564 handle_split_stack_section.
12565 (class Reloc_symbol_changes): Define.
12566 (class Sized_relobj): Define Function_offsets. Declare
12567 split_stack_adjust, split_stack_adjust_reltype, and
12568 find_functions.
12569 * object.cc (Object::handle_split_stack_section): New function.
12570 (Sized_relobj::do_layout): Call handle_split_stack_section.
12571 * dynobj.cc (Sized_dynobj::do_layout): Call
12572 handle_split_stack_section.
12573 * reloc.cc (Sized_relobj::relocate_sections): Call
12574 split_stack_adjust for executable sections in split_stack
12575 objects. Pass reloc_map to relocate_section.
12576 (Sized_relobj::split_stack_adjust): New function.
12577 (Sized_relobj::split_stack_adjust_reltype): New function.
12578 (Sized_relobj::find_functions): New function.
12579 * target-reloc.h: Include "object.h".
12580 (relocate_section): Add reloc_symbol_changes parameter. Change
12581 all callers.
12582 * target.h (class Target): Add calls_non_split method. Declare
12583 do_calls_non_split virtual method. Declare match_view and
12584 set_view_to_nop.
12585 * target.cc: Include "elfcpp.h".
12586 (Target::do_calls_non_split): New function.
12587 (Target::match_view): New function.
12588 (Target::set_view_to_nop): New function.
12589 * gold.cc (queue_middle_tasks): Give an error if mixing
12590 split-stack and non-split-stack objects with -r.
12591 * i386.cc (Target_i386::relocate_section): Add
12592 reloc_symbol_changes parameter.
12593 (Target_i386::do_calls_non_split): New function.
12594 * x86_64.cc (Target_x86_64::relocate_section): Add
12595 reloc_symbol_changes parameter.
12596 (Target_x86_64::do_calls_non_split): New function.
12597 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12598 parameter.
12599 * powerpc.cc (Target_powerpc::relocate_section): Add
12600 reloc_symbol_changes parameter.
12601 * sparc.cc (Target_sparc::relocate_section): Add
12602 reloc_symbol_changes parameter.
12603 * configure.ac: Call AM_CONDITIONAL for the default target.
12604 * configure: Rebuild.
12605 * testsuite/Makefile.am (TEST_AS): New variable.
12606 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12607 (check_DATA): Add split_i386 and split_x86_64 files.
12608 (SPLIT_DEFSYMS): Define.
12609 (split_i386_[1234n].o): New targets.
12610 (split_i386_[124]): New targets.
12611 (split_i386_[1234r].stdout): New targets.
12612 (split_x86_64_[1234n].o): New targets.
12613 (split_x86_64_[124]): New targets.
12614 (split_x86_64_[1234r].stdout): New targets.
12615 (MOSTLYCLEANFILES): Add new executables.
12616 * testsuite/split_i386.sh: New file.
12617 * testsuite/split_x86_64.sh: New file.
12618 * testsuite/split_i386_1.s: New file.
12619 * testsuite/split_i386_2.s: New file.
12620 * testsuite/split_i386_3.s: New file.
12621 * testsuite/split_i386_4.s: New file.
12622 * testsuite/split_i386_n.s: New file.
12623 * testsuite/split_x86_64_1.s: New file.
12624 * testsuite/split_x86_64_2.s: New file.
12625 * testsuite/split_x86_64_3.s: New file.
12626 * testsuite/split_x86_64_4.s: New file.
12627 * testsuite/split_x86_64_n.s: New file.
12628 * testsuite/testfile.cc (Target_test): Update relocation_section
12629 function.
12630 * testsuite/Makefile.in: Rebuild.
12631
e8a9fcda
ILT
126322009-10-06 Ian Lance Taylor <iant@google.com>
12633
12634 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12635 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12636 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12637 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12638 the address on ldo_addrs_.
12639 (Target_i386::Relocate::fix_up_ldo): New function.
12640
e99daf92
ILT
126412009-10-06 Rafael Espindola <espindola@google.com>
12642
12643 * plugin.cc (add_input_library): New.
12644 (Plugin::load): Add add_input_library to tv.
12645 (Plugin_manager::add_input_file): Add the is_lib argument.
12646 (add_input_file): Update call to Plugin_manager::add_input_file.
12647 (add_input_library): New.
12648 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12649
966d4097
DK
126502009-09-30 Doug Kwan <dougkwan@google.com>
12651
12652 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12653 symbol and call Symbol::may_need_copy_reloc to determine if
12654 a copy reloc is needed.
12655 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12656 nocopyreloc is given in command line.
12657 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12658 given in command line.
12659 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12660 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12661 of the removed Target_i386::may_need_copy_reloc.
12662 * options.h (copyreloc): New option with default value false.
12663 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12664 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12665 instead of the removed Target_powerpc::may_need_copy_reloc.
12666 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12667 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12668 instead of the removed Target_sparc::may_need_copy_reloc.
12669 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12670 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12671 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12672 instead of the removed Target_x86_64::may_need_copy_reloc.
12673
029ba973
ILT
126742009-09-30 Ian Lance Taylor <iant@google.com>
12675
12676 * object.h (class Object): Remove target_ field, and target,
12677 sized_target, and set_target methods.
12678 (Object::sized_target): Remove.
12679 (class Sized_relobj): Update declarations. Remove sized_target.
12680 * object.cc (Sized_relobj::setup): Remove target parameter.
12681 Change all callers.
12682 (Input_objects::add_object): Don't do anything with the target.
12683 (make_elf_sized_object): Add punconfigured parameter. Change all
12684 callers. Set or test parameter target.
12685 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12686 Change all callers.
12687 * parameters.cc (Parameters::set_target): Change parameter type to
12688 be non-const.
12689 (Parameters::default_target): Remove.
12690 (set_parameters_target): Change parameter type to be non-const.
12691 (parameters_force_valid_target): New function.
12692 (parameters_clear_target): New function.
12693 * parameters.h (class Parameters): Update declarations. Remove
12694 default_target method. Add sized_target and clear_target
12695 methods. Change target_ to be non-const.
12696 (set_parameters_target): Update declaration.
12697 (parameters_force_valid_target): Declare.
12698 (parameters_clear_target): Declare.
12699 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12700 as NULL if we aren't searching.
12701 (Add_symbols::run): Don't check for compatible target.
12702 * fileread.cc (Input_file::open_binary): Call
12703 parameters_force_valid_target.
12704 * gold.cc (queue_middle_tasks): Likewise.
12705 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12706 set_target on object.
12707 * dynobj.h (class Sized_dynobj): Update declarations.
12708 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12709 make_elf_object returns NULL.
12710 (Archive::include_member): Don't check whether object target is
12711 compatible.
12712 * output.cc (Output_section::add_input_section): Get target from
12713 parameters.
12714 (Output_section::relax_input_section): Likewise.
12715 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12716 parameters.
12717 (Sized_relobj::do_scan_relocs): Likewise.
12718 (Sized_relobj::relocate_sections): Likewise.
12719 * resolve.cc (Symbol_table::resolve): Likewise.
12720 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12721 parameter. Change all callers.
12722 (Symbol_table::add_from_object): Get target from parameters.
12723 (Symbol_table::add_from_relobj): Don't check object target.
12724 (Symbol_table::add_from_dynobj): Likewise.
12725 (Symbol_table::define_special_symbol): Get target from
12726 parameters.
12727 * symtab.h (class Symbol_table): Update declaration.
12728 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12729 parameter. Change all callers. Clear parameter target.
12730 (Binary_test): Test target here.
12731 * testsuite/object_unittest.cc (gold_testsuite): Remove
12732 target_test_pointer parameter. Change all callers.
12733 (Object_test): Test target here.
12734
a6a22b83
ILT
127352009-09-26 Ian Lance Taylor <iant@google.com>
12736
12737 * testsuite/initpri1.c: Don't try to use constructor priorities if
12738 compiling with gcc before 4.3.
12739
6a8f49fe
ILT
127402009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12741
12742 * testsuite/retain_symbols_file_test.sh (check_present): Change
12743 output file name to retain_symbols_file_test.stdout.
12744 (check_absent): Likewise.
12745
8c604651
CS
127462009-09-18 Craig Silverstein <csilvers@google.com>
12747
12748 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12749 * options.cc: Include <cerrno> and <fstream>.
12750 (General_options::finalize): Parse -retain-symbols-file tag.
12751 * options.h: New flag.
12752 (General_options): New method should_retain_symbol, new
12753 variable symbols_to_retain.
12754 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12755 should_retain_symbol map.
12756 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12757 * testsuite/Makefile.in: Regenerate.
12758 * testsuite/retain_symbols_file_test.sh: New file.
12759
ca58b19f
NC
127602009-09-18 Nick Clifton <nickc@redhat.com>
12761
12762 * po/es.po: Updated Spanish translation.
12763
20e6d0d6
DK
127642009-09-17 Doug Kwan <dougkwan@google.com>
12765
12766 * debug.h (DEBUG_RELAXATION): New constant.
12767 (DEBUG_ALL): Add DEBUG_RELAXATION.
12768 (debug_string_to_enum): Add relaxation debug option.
12769 * layout.cc
12770 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12771 Layout::Relaxation_debug_check::read_sections,
12772 Layout::Relaxation_debug_check::read_sections): New method definitions.
12773 (Layout::Layout): Initialize data members
12774 record_output_section_data_from_scrips_,
12775 script_output_section_data_list_ and relaxation_debug_check_.
12776 (Layout::save_segments, Layout::restore_segments,
12777 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12778 Layout::relaxation_loop_body): New method definitions.
12779 (Layout::finalize): Support relaxation. Move section layout code to
12780 Layout::relaxation_loop_body.
12781 (Layout::set_asection_address_from_script): Move code for orphan
12782 section placement out.
12783 (Layout::place_orphan_sections_in_script): New method definition.
12784 * layout.h (Output_segment_headers, Output_file_header):
12785 New forward class declarations.
12786 (Layout::~Layout): Define.
12787 (Layout::new_output_section_data_from_script): New method definition.
12788 (Layout::place_orphan_sections_in_script): New method declaration.
12789 (Layout::Segment_states): New type declaration.
12790 (Layout::save_segments, Layout::restore_segments,
12791 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12792 Layout::relaxation_loop_body): New method declarations.
12793 (Layout::Output_section_data_list): New type declaration.
12794 (Layout::Relaxation_debug_check): New class definition.
12795 (Layout::record_output_section_data_from_script_,
12796 Layout::script_output_section_data_list_, Layout::segment_states_,
12797 Layout::relaxation_debug_check_): New data members.
12798 * output.cc: (Output_section_headers::do_size): New method definition.
12799 (Output_section_headers::Output_section_headers): Move size
12800 computation to Output_section_headers::do_size.
12801 (Output_segment_headers::do_size): New method definition.
e1df38aa 12802 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12803 Output_file_header::do_size and call it.
12804 (Output_file_header::do_size): New method definition.
12805 (Output_data_group::Output_data_group): Adjust call to
12806 Output_section_data.
12807 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12808 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12809 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12810 RELAXED_INPUT_SECTION_CODE.
12811 (Output_section::Output_section): Initialize data member checkpoint_.
12812 (Output_section::~Output_section): Delete checkpoint object pointed
12813 by checkpoint_.
12814 (Output_section::add_input_section): Always add an Input_section if
12815 relaxing.
12816 (Output_section::add_merge_input_section): Add assert.
12817 (Output_section::relax_input_section): New method definition.
12818 (Output_section::set_final_data_size): Set load address to zero for
12819 an unallocated section.
12820 (Output_section::do_address_and_file_offset_have_reset_values):
12821 New method definition.
12822 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12823 Handle relaxed input section.
12824 (Output_section::sort_attached_input_sections): Checkpoint input
12825 section list lazily.
12826 (Output_section::get_input_sections): Change type of input_sections to
12827 list of Simple_input_section pointers. Checkpoint input section list
12828 lazily. Also handle relaxed input sections.
12829 (Output_section::add_input_section_for_script): Take a reference to
12830 a Simple_input_section object instead of Relobj pointer and section
12831 index as parameter. Handle relaxed input sections.
12832 (Output_section::save_states, Output_section::restore_states): New
12833 method definitions.
12834 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12835 (Output_data::is_data_size_fixed): New method definition.
12836 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12837 if it is fixed.
12838 (Output_data::address_and_file_offset_have_reset_values): New method
12839 definition.
12840 (Output_data::do_address_and_file_offset_have_reset_values): New method
12841 definition.
12842 (Output_data::set_data_size): Check that data size is not fixed.
12843 (Output_data::fix_data_size): New method definition.
12844 (Output_data::is_data_size_fixed_): New data member.
12845 (Output_section_headers::set_final_data_size): New method definition.
12846 (Output_section_headers::do_size): New method declaration.
12847 (Output_segment_headers::set_final_data_size): New method definition.
12848 (Output_segment_headers::do_size): New method declaration.
12849 (Output_file_header::set_final_data_size)::New method definition.
12850 (Output_file_header::do_size)::New method declaration.
12851 (Output_section_data::Output_section_data): Add new parameter
12852 is_data_size_fixed and use it to fix data size.
12853 (Output_data_const::Output_data_const): Adjust call to base class
12854 constructor and fix data size.
12855 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12856 base class constructor and fix data size.
12857 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12858 base class constructor and fix data size.
12859 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12860 class constructor and fix data size.
12861 (Output_data_group::set_final_data_size): New method definition.
12862 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12863 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12864 class constructor and fix data size.
12865 (Output_relaxed_input_section): New class definition.
12866 (Output_section::Simple_input_section): New class definition.
12867 (Output_section::get_input_sections): Adjust parameter list.
12868 (Output_section::add_input_section_for_script): Same.
12869 (Output_section::save_states, Output_section::restore_states,
12870 Output_section::do_address_and_file_offset_have_reset_values,
12871 (Output_section::Input_section::Input_section): Handle
12872 RELAXED_INPUT_SECTION_CODE. Add new overload for
12873 Output_relaxed_input_section.
12874 (Output_section::Input_section::is_input_section,
12875 Output_section::Input_section::set_output_section): Handle relaxed
12876 input section.
12877 (Output_section::Input_section::is_relaxed_input_section,
12878 Output_section::Input_section::output_section_data,
12879 Output_section::Input_section::relaxed_input_section): New method
12880 definitions.
12881 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12882 value.
12883 (Output_section::Input_section::u1_): Update comments.
12884 (Output_section::Input_section::u2_): Add new union member poris.
12885 (Output_section::Checkpoint_output_section): New classs definition.
12886 (Output_section::relax_input_section): New method declaration.
12887 (Output_section::checkpoint_): New data member.
12888 (Output_segment): Update comments.
12889 (Output_segment::Output_segment): Un-privatize copy constructor.
12890 (Output_segment::operator=): Un-privatize.
12891 * script-sections.cc (Output_section_element::Input_section_list):
12892 Change element type to Output_section::Simple_input_section.
12893 (Output_section_element_dot_assignment::set_section_addresses):
12894 Register output section data for relaxation clean up.
12895 (Output_data_exression::Output_data_expression): Adjust call to base
12896 constructor to fix data size.
12897 (Output_section_element_data::set_section_addresses): Register
12898 Output_data_expression object for relaxation clean up.
12899 (struct Input_section_info): Replace Relobj pointer and section index
12900 pair with Output_section::Simple_input_section and Convert struct to a
12901 class.
12902 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12903 Input_section_info data member to use accessors.
20e6d0d6
DK
12904 (Output_section_element_input::set_section_addresses): Use layout
12905 parameter. Adjust code to use Output_section::Simple_input_section
12906 and Input_secction_info classes. Register filler for relaxation
12907 clean up.
12908 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12909 and section index pair with Output_section::Simple_input_section
12910 class. Adjust code accordingly.
12911 (Phdrs_element::release_segment): New method definition.
12912 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12913 segment list.
12914 (Script_sections::release_segments): New method definition.
12915 * gold/script-sections.h (Script_sections::release_segments): New
12916 method declaration.
12917 * gold/target.h (Target::may_relax, Target::relax,
12918 Target::do_may_relax, Target::do_relax): New method definitions.
12919
5e445df6
ILT
129202009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12921
12922 * arm.cc (has_signed_unsigned_overflow): New function.
12923 (Arm_relocate_functions::abs8): New function.
12924 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12925 (Target_arm::Scan::global): Likewise.
12926 (Target_arm::relocate::relocate): Likewise.
12927 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12928 Likewise.
12929
8c604651 129302009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12931
12932 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12933 * testsuite/Makefile.in: Regenerate.
12934
1e9cc1c2
NC
129352009-09-11 Nick Clifton <nickc@redhat.com>
12936
12937 * po/gold.pot: Updated by the Translation project.
12938
6a89f575
CC
129392009-09-08 Cary Coutant <ccoutant@google.com>
12940
12941 * output.cc (Output_file::open): Add execute permission to empty file.
12942 * testsuite/Makefile.am (permission_test): New test.
12943 * testsuite/Makefile.in: Regenerate.
12944
fdcac5af
ILT
129452009-09-02 Ian Lance Taylor <iant@google.com>
12946
12947 * output.cc (Output_file::resize): Call map_no_anonymous rather
12948 than map.
12949
44453f85
ILT
129502009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12951
12952 * gold.cc: Include "incremental.h".
12953 (queue_initial_tasks): Call Incremental_checker methods.
12954 * incremental.cc: Include "output.h".
12955 (Incremental_checker::can_incrementally_link_output_file): New
12956 method.
12957 * incremental.h (Incremental_checker): New class.
12958
12959 * output.cc (Output_file::open_for_modification): New method.
12960 (Output_file::map_anonymous): Changed return type to bool. Record
12961 map in base_ field.
12962 (Output_file::map_no_anonymous): New method, broken out of map.
12963 (Output_file::map): Use map_no_anonymous and map_anonymous.
12964 * output.h (class Output_file): Update declarations.
12965
293c1386
CC
129662009-08-24 Cary Coutant <ccoutant@google.com>
12967
12968 * options.h (Command_line::Pre_options): New class.
12969 (Command_line::pre_options): New member.
12970 * options.cc (gold::options::ready_to_register): New variable.
12971 (One_option::register_option): Do nothing if not registering options.
12972 Assert if same short option registered twice.
12973 (General_options::General_options): Turn off option registration when
12974 done constructing.
12975 (Command_line::Pre_options::Pre_options): New constructor.
12976
f773f3d2
CC
129772009-08-24 Cary Coutant <ccoutant@google.com>
12978
06a73cfe
CC
12979 * options.h (General_options::no_keep_memory): Remove incorrect
12980 short option.
f773f3d2 12981
a15af8e2
RW
129822009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12983
12984 * Makefile.am (am__skiplex, am__skipyacc): New.
12985 * Makefile.in: Regenerate.
12986
c462b41b
RW
129872009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12988
14ec8efd
RW
12989 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12990 (INCLUDES): ... this.
12991 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12992 (AM_CPPFLAGS): Renamed from ...
12993 (INCLUDE): ... this.
12994 * Makefile.in, testsuite/Makefile.in: Regenerate.
12995
81ecdfbb
RW
12996 * Makefile.in: Regenerate.
12997 * aclocal.m4: Likewise.
12998 * config.in: Likewise.
12999 * configure: Likewise.
13000 * testsuite/Makefile.in: Likewise.
13001
c462b41b
RW
13002 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13003 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13004 * Makefile.in: Regenerate.
13005 * testsuite/Makefile.in: Regenerate.
13006
2da73f13
CC
130072009-08-19 Cary Coutant <ccoutant@google.com>
13008
13009 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13010 symbols in shared libraries overridden by hidden or internal symbols
13011 in the main program.
13012
2db70501
CD
130132009-08-19 Chris Demetriou <cgd@google.com>
13014
13015 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13016 checking source file names in error messages.
13017
f733487b
DK
130182009-08-18 Doug Kwan <dougkwan@google.com>
13019
13020 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13021 an elcpp::Ehdr as parameter. Adjust call to set_target.
13022 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13023 an elfcpp::Ehdr as parameter.
13024 * object.cc (Object::set_target): Remove the version that looks up
13025 a target and sets it.
13026 (Sized_relobj::setup): Take a Target object instead of
13027 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13028 (make_elf_sized_object): Find target and ask target to
13029 make an ELF object.
13030 * object.h: (Object::set_target): Remove the version that looks up
13031 a target and sets it.
13032 (Sized_relobj::setup): Take a Target object instead of
13033 an elfcpp:Ehdr as parameter.
13034 * target.cc: Include dynobj.h.
13035 (Target::do_make_elf_object_implementation): New.
2e702c99 13036 (Target::do_make_elf_object): New.
f733487b
DK
13037 * target.h (Target::make_elf_object): New template declaration.
13038 (Target::do_make_elf_object): New method declarations.
13039 (Target::do_make_elf_object_implementation): New template declaration.
13040
cc70f101
ILT
130412009-08-14 Ian Lance Taylor <iant@google.com>
13042
13043 * gold.h (FUNCTION_NAME): Define.
13044 (gold_unreachable): Use FUNCTION_NAME.
13045
ef5e0cb1
ST
130462009-08-12 Sriraman Tallam <tmsriram@google.com>
13047
13048 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13049 symbol in the --keep-unique list is not found.
13050
48c187ce
ST
130512009-08-12 Sriraman Tallam <tmsriram@google.com>
13052
13053 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13054 been maked as --keep-unique.
13055 (Icf::unfold_section): New function.
13056 * icf.h (Icf::unfold_section): New function.
13057 * options.h (General_options::keep_unique): New option.
13058 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13059 * testsuite/Makefile.in: Regenerate.
13060 * testsuite/icf_keep_unique_test.sh: New file.
13061 * testsuite/icf_keep_unique_test.cc: New file.
13062
645afe0c
CC
130632009-08-12 Cary Coutant <ccoutant@google.com>
13064
13065 PR 10471
13066 * resolve.cc (Symbol_table::resolve): Check for references from
13067 dynamic objects to hidden and internal symbols.
13068 * testsuite/Makefile.am (hidden_test.sh): New test.
13069 * testsuite/Makefile.in: Regenerate.
13070 * testsuite/hidden_test.sh: New script.
13071 * testsuite/hidden_test_1.c: New test source.
13072 * testsuite/hidden_test_main.c: New test source.
13073
11af873f
DK
130742009-08-11 Doug Kwan <dougkwan@google.com>
13075
13076 * arm.cc: Update comments.
13077 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13078 segment to locate the .ARM.exidx section if present.
13079
b9f7d72d
DK
130802009-08-09 Doug Kwan <dougkwan@google.com>
13081
13082 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13083 patch.
13084
ddd3c53c
ST
130852009-08-07 Sriraman Tallam <tmsriram@google.com>
13086 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13087 compiler warnings.
13088
27721062
ST
130892009-08-06 Sriraman Tallam <tmsriram@google.com>
13090
13091 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13092 valid tls_segment only for non-debug-section relocations.
13093 * testsuite/Makefile.am: Add gc_tls_test.
13094 * testsuite/Makefile.in: Regenerate.
13095 * testsuite/gc_tls_test.cc: New file.
13096 * testsuite/gc_tls_test.sh: New file.
13097
ef15dade 130982009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13099
ef15dade
ST
13100 * icf.cc: New file.
13101 * icf.h: New file.
13102 * Makefile.am (CCFILES): Add icf.cc.
13103 (HFILES): Add icf.h
13104 * Makefile.in: Regenerate.
13105 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13106 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13107 section, symbol and addend information for the relocs.
13108 * gold.cc (queue_middle_tasks): Call identical code folding.
13109 * gold.h: Add defines for multimap.
13110 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13111 to the call of finalize_local_symbols.
13112 * main.cc (main): Create object of class Icf.
13113 * object.cc (Sized_relobj::do_layout): Allow this function to be
13114 called twice during icf.
13115 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13116 to sections marked as identical by icf.
13117 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13118 when available.
13119 (Sized_relobj::do_section_entsize): New function.
13120 * object.h (Object::section_entsize): New function.
13121 (Object::do_section_entsize): New pure virtual function.
13122 (Relobj::finalize_local_symbols): Add new parameter.
13123 (Relobj::do_section_entsize): New function.
13124 * options.h (General_options::icf): New option.
13125 (General_options::icf_iterations): New option.
13126 (General_options::print_icf_sections): New option.
13127 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13128 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13129 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13130 icf.
13131 * symtab.cc (Symbol_table::is_section_folded): New function.
13132 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13133 to sections marked as identical by icf.
13134 * symtab.h (Symbol_table::set_icf): New function.
13135 (Symbol_table::icf): New function.
13136 (Symbol_table::is_section_folded): New function.
13137 (Symbol_table::icf_): New data member.
13138 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13139 * testsuite/Makefile.am: Add commands to build icf_test.
13140 * testsuite/Makefile.in: Regenerate.
13141 * testsuite/icf_test.sh: New file.
13142 * testsuite/icf_test.cc: New file.
13143
c3b65ac4
CD
131442009-07-24 Chris Demetriou <cgd@google.com>
13145
13146 * layout.cc (is_compressible_debug_section): Fix incorrect
13147 comment about compressed section names.
13148
1caf2c51
ILT
131492009-07-20 Ian Lance Taylor <ian@airs.com>
13150
13151 PR 10419
13152 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13153
1ef4d87f
ILT
131542009-07-16 Ian Lance Taylor <iant@google.com>
13155
13156 PR 10400
13157 * layout.h: #include <map>.
13158 (class Kept_section): Change from struct to class. Add accessors
13159 and setters. Add section size to Comdat_group mapping. Change
13160 Comdat_group to std::map. Add is_comdat_ field. Add
13161 linkonce_size field in union.
13162 (class Layout): Update declaration of find_or_add_kept_section.
13163 Don't declare find_kept_object.
13164 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13165 parameter. Add object, shndx, is_comdat, and is_group_name
13166 parameters. Change all callers. Adjust for new Kept_section.
13167 (Layout::find_kept_object): Remove.
13168 * object.cc (Sized_relobj::include_section_group): Update use of
13169 Kept_section. Rename secnum to shndx. Only record
13170 Kept_comdat_section if sections are the same size.
13171 (Sized_relobj::include_linkonce_section): Update use of
13172 Kept_section. Only record Kept_comdat_section if sections are the
13173 same size. Set size of linkonce section.
13174 (Sized_relobj::map_to_kept_section): Update call to
13175 get_kept_comdat_section.
13176 * object.h (class Sized_relobj): Rename fields in
13177 Kept_comdat_section to drop trailing underscores; change object
13178 field to Relobj*. Change Kept_comdat_section_table to store
13179 struct rather than pointer.
13180 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13181 Add kept_object and kept_shndx parameters. Change all callers.
13182 (Sized_relobj::get_kept_comdat_section): Change return type to
13183 bool. Add kept_object and kept_shndx parameters. Change all
13184 callers.
13185 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13186 Layout::find_or_add_kept_section.
13187
37c3b7b0
ILT
131882009-07-09 Ian Lance Taylor <iant@google.com>
13189
13190 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13191 Reserve space in the hash table.
13192
98fa85cb
ILT
131932009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13194
13195 * fileread.cc (File_read::get_mtime): New method.
13196 * fileread.h (Timespec): New structure.
13197 (File_read::get_mtime): New method.
13198 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13199 Renamed from timestamp_nsec.
13200 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13201 Elf_Xword.
e1df38aa 13202 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13203 timestamp_nsec.
e1df38aa 13204 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13205 (Incremental_inputs::report_obejct): Save mtime; style fix.
13206 (Incremental_inputs::report_script): Save mtime; style fix.
13207 (Incremental_inputs::finalize_inputs): Style fix.
13208 (Incremental_inputs::finalize): Style fix.
13209 (Incremental_inputs::create_input_section_data): Store inputs
13210 mtime.
13211 * incremental.h (Incremental_inputs::report_script): Add mtime
13212 argument.
13213 (Incremental_inputs::Input_info::Input_info): Intialize only one
13214 union member.
13215 (Incremental_inputs::Input_info::archive): Move to nameless
13216 union.
13217 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13218 (Incremental_inputs::Input_info::script): Move to nameless union.
13219 (Incremental_inputs::mtime): New field.
13220 * script.cc (read_input_script): Pass file mtime to
13221 Incremental_input.
13222 * script.h (Script_info::inputs): Style fix.
13223
c9d70757
ILT
132242009-07-01 Ian Lance Taylor <ian@airs.com>
13225
13226 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13227 instead of 32.
13228
9c547ec3
ILT
132292009-06-24 Ian Lance Taylor <iant@google.com>
13230
13231 PR 10156
13232 * layout.cc (Layout::choose_output_section): If we find an
13233 existing section, update the flags.
13234 (Layout::create_notes): New function, broken out of
13235 Layout::finalize.
13236 (Layout::finalize): Don't create note sections.
13237 (Layout::create_note): Don't crash if linker script discards
13238 section.
13239 (Layout::create_gold_note): Likewise.
13240 (Layout::create_build_id): Likewise. Don't set
13241 after_input_sections on the section.
13242 (Layout::create_executable_stack_info): Remove target parameter.
13243 Change caller.
13244 * layout.h (class Layout): Declare create_notes. Update
13245 declaration of create_executable_stack_info.
13246 * gold.cc (queue_middle_tasks): Call create_notes.
13247 * output.cc (Output_section::update_flags_for_input_section): Move
13248 here from output.h. If SHF_ALLOC flag is newly set, mark address
13249 invalid.
13250 * output.h (Output_data::mark_address_invalid): New function.
13251 (class Output_section): Only declare, not define,
13252 update_flags_for_input_section. Remove set_flags.
13253
55458500
ILT
132542009-06-24 Ian Lance Taylor <iant@google.com>
13255
13256 * script-sections.cc (Output_section_definition::
13257 set_section_addresses): Rename shadowing local load_address to
13258 laddr.
13259
1307d6cd
ILT
132602009-06-24 Ian Lance Taylor <iant@google.com>
13261
13262 PR 10244
13263 * reloc.cc (relocate_sections): Skip empty relocation sections.
13264
ec3f783e
ILT
132652009-06-23 Ian Lance Taylor <iant@google.com>
13266
13267 PR 10156
13268 * layout.cc (Layout::create_note): Use choose_output_section
13269 rather than make_output_section.
13270
459c9f1c
ILT
132712009-06-23 Ian Lance Taylor <iant@google.com>
13272
13273 PR 10237
13274 * options.cc (General_options::parse_V): Set printed_version_.
13275 (General_options::General_options): Initialize printed_version_.
13276 * options.h (class General_options): Add printed_version_ field.
13277 * gold.cc (queue_initial_tasks): If there are no input files,
13278 don't give a fatal error if we printed the version information.
13279 (queue_middle_tasks): If using -r with a shared object, give a
13280 fatal error rather than an ordinary error.
13281
1518dc8f
ILT
132822009-06-23 Ian Lance Taylor <iant@google.com>
13283
13284 PR 10219
13285 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13286 (Layout::make_output_section): Set have_stabstr_section_ if we see
13287 a .stab*str section.
13288 (Layout::finalize): Call link_stabs_sections.
13289 (Layout::link_stabs_sections): New file.
13290 * layout.h (class Layout): Add have_stabstr_section_ field.
13291 Declare link_stabs_sections.
13292
3d857b98
DK
132932009-06-23 Doug Kwan <dougkwan@google.com>
13294
13295 * Makefile.am (libgold_a_LIBADD): New.
13296 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13297 * Makefile.in: Regenerate.
3d857b98
DK
13298 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13299 * configure: Regenerate.
13300 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13301 * fileread.cc: Include sys/state.h
13302 * gold.h: Declare memmem and strndup if found missing.
13303 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13304
0639a6f6
ILT
133052009-06-23 Ian Lance Taylor <iant@google.com>
13306
13307 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13308 * configure: Rebuild.
13309
8d63875c
ILT
133102009-06-23 Ian Lance Taylor <iant@google.com>
13311
13312 PR 10147
13313 * object.cc (Object::section_contents): Don't try to get a view if
13314 the section has length zero.
13315 (Object::handle_gnu_warning_section): If the section is empty, use
13316 the name of the section as the warning.
13317
f7c8a183
ILT
133182009-06-23 Ian Lance Taylor <iant@google.com>
13319
13320 PR 10133
13321 * stringpool.h (class Stringpool_template): Add optimize_ field.
13322 (Stringpool_template::set_optimize): New function.
13323 * stringpool.cc (Stringpool_template::Stringpool_template):
13324 Initialize optimize_ field.
13325 (Stringpool_template::set_string_offsets): Test local optimize
13326 fild rather than parameter.
13327 * layout.cc (Layout::Layout): Call set_optimize on the section
13328 name stringpool.
13329
e6a307ba
ILT
133302009-06-22 Ian Lance Taylor <iant@google.com>
13331
13332 PR 10030
13333 * yyscript.y: Parse TARGET.
13334 * script.cc (script_set_target): New function.
13335 * script-c.h (script_set_target): Declare.
13336 * options.cc (General_options::string_to_object_format): Rename
13337 from string_to_object_format in anonymous namespace. Change
13338 callers.
13339 * options.h (class General_options): Declare
13340 string_to_object_format.
13341
3ee173de
ILT
133422009-06-22 Ian Lance Taylor <iant@google.com>
13343
13344 * script-sections.cc (Script_sections::create_segments): Don't put
13345 program headers in a PT_LOAD segment if -n or -N.
13346
133472009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13348
13349 PR 10141
13350 * options.h (class General_options): Add -z lazy and -z now. Sort
13351 -z options into alphabetical order.
13352 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13353
cd6739a1 133542009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13355
13356 * layout.cc (Layout::make_output_section): Call
13357 Target::new_output_section.
13358 (Layout::attach_allocated_section_to_segment): Put large section
13359 sections in a separate load segment with the large segment flag
13360 set.
13361 (Layout::segment_precedes): Sort large data segments after other
13362 load segments.
13363 (align_file_offset): New static function.
13364 (Layout::set_segment_offsets): Use align_file_offset.
13365 * output.h (class Output_section): Add is_small_section_ and
13366 is_large_section_ fields.
13367 (Output_section::is_small_section): New function.
13368 (Output_section::set_is_small_section): New function.
13369 (Output_section::is_large_section): New function.
13370 (Output_section::set_is_large_section): New function.
13371 (Output_section::is_large_data_section): New function.
13372 (class Output_segment): Add is_large_data_segment_ field.
13373 (Output_segment::is_large_data_segment): New function.
13374 (Output_segment::set_is_large_data_segment): New function.
13375 * output.cc (Output_section::Output_section): Initialize new
13376 fields.
13377 (Output_segment::Output_segment): Likewise.
13378 (Output_segment::add_output_section): Add assertion that large
13379 data sections always go in large data segments. Force small data
13380 sections to the end of the list of data sections. Force small BSS
13381 sections to the start of the list of BSS sections. For large BSS
13382 sections to the end of the list of BSS sections.
13383 * symtab.h (class Symbol): Declare is_common_shndx.
13384 (Symbol::is_defined): Check Symbol::is_common_shndx.
13385 (Symbol::is_common): Likewise.
13386 (class Symbol_table): Define enum Commons_section_type. Update
13387 declarations. Add small_commons_ and large_commons_ fields.
13388 * symtab.cc (Symbol::is_common_shndx): New function.
13389 (Symbol_table::Symbol_table): Initialize new fields.
13390 (Symbol_table::add_from_object): Put small and large common
13391 symbols in the right list.
13392 (Symbol_table::sized_finalized_symbol): Check
13393 Symbol::is_common_shndx.
13394 (Symbol_table::sized_write_globals): Likewise.
13395 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13396 common symbol lists. Don't call do_allocate_commons_list if the
13397 list is empty.
13398 (Symbol_table::do_allocate_commons_list): Remove is_tls
13399 parameter. Add comons_section_type parameter. Change all
13400 callers. Handle small and large common symbols.
13401 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13402 Symbol::is_common_shndx.
13403 * resolve.cc (symbol_to_bits): Likewise.
13404 * target.h (Target::small_common_shndx): New function.
13405 (Target::small_common_section_flags): New function.
13406 (Target::large_common_shndx): New function.
13407 (Target::large_common_section_flags): New function.
13408 (Target::new_output_section): New function.
13409 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13410 small_common_section_flags, and large_common_section_flags
13411 fields.
13412 (Target::do_new_output_section): New virtual function.
13413 * arm.cc (Target_arm::arm_info): Initialize new fields.
13414 * i386.cc (Target_i386::i386_info): Likewise.
13415 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13416 Likewise.
13417 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13418 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13419 (Target_x86_64::do_new_output_section): New function.
13420 * configure.ac: Define conditional MCMODEL_MEDIUM.
13421 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13422 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13423 (large_LDFLAGS): Define.
13424 * testsuite/large.c: New file.
13425 * testsuite/testfile.cc (Target_test::test_target_info):
13426 Initialize new fields.
13427 * configure, testsuite/Makefile.in: Rebuild.
13428
bb04269c
DK
134292009-06-05 Doug Kwan <dougkwan@google.com>
13430
13431 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13432 * Makefile.in: Regenerate.
bb04269c
DK
13433 * i386.cc (class Target_i386): Define new virtual method to
13434 override do_is_local_label_name in parent.
13435 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13436 local symbols if --discard-locals or -X is given.
13437 * options.h (class General_options): Declare new options
13438 '--discard-locals' and '-X' for discarding locals.
13439 * target.h (class Target): Define new methods is_local_label_name.
13440 Declare new virtual method do_is_local_label_name.
13441 * target.cc: New file.
13442 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13443 (check_SCRIPTS): Add discard_locals_test.sh.
13444 (check_DATA): Add discard_local_tests.syms.
13445 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13446 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13447 * testsuite/Makefile.in: Regenerate.
13448 * testsuite/discard_locals_test.c: New file.
13449 * testsuite/discard_locals_test.sh: Same.
13450
805bb01c
DK
134512009-06-05 Doug Kwan <dougkwan@google.com>
13452
13453 * object.cc (Sized_relobj::Sized_relobj): Initialize
13454 discarded_eh_frame_shndx_ to -1U.
13455 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13456 section.
13457 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13458 a discarded .eh_frame section.
13459 (Sized_relobj::do_finalize_local_symbols): Ditto.
13460 * object.h (class Sized_relobj): Declare new member
13461 discarded_eh_frame_shndx_.
13462 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13463 (local_labels_test.o, local_labels_test): New rules.
13464 * testsuite/Makefile.in: Regenerate.
13465
1dcd334d
DK
134662009-06-04 Doug Kwan <dougkwan@google.com>
13467
13468 * layout.cc (Layout::section_name_mapping): Add mapping for
13469 special ARM sections.
13470
96d49306
DK
134712009-06-03 Doug Kwan <dougkwan@google.com>
13472
13473 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13474 (utils::has_overflow): Same.
13475
dff16297
ILT
134762009-06-03 Ian Lance Taylor <iant@google.com>
13477
13478 * layout.cc (Layout::section_name_mapping): New array, replacing
13479 Layout::linkonce_mapping.
13480 (Layout::section_name_mapping_count): New variable, replacing
13481 Layout::linkonce_mapping_count.
13482 (Layout::linkonce_output_name): Remove.
13483 (Layout::output_section_name): Rewrite.
13484 * layout.h (class Layout): Rename Linkonce_mapping to
13485 Section_name_mapping, linkonce_mapping to section_name_mapping,
13486 linkonce_mapping_count to section_name_mapping_count. Don't
13487 declare linkonce_output_name.
13488
c121c671
DK
134892009-06-03 Doug Kwan <dougkwan@google.com>
13490
13491 * gold/arm.cc (namespace utils): New.
13492 (Target_arm::reloc_is_non_pic): Define new method.
13493 (class Arm_relocate_functions): New.
13494 (Target_arm::Relocate::relocate): Handle relocation types used by
13495 Android.
13496
07800fab
ILT
134972009-06-03 Ian Lance Taylor <iant@google.com>
13498
13499 * arm.cc (Target_arm::scan::global): Use || instead of |.
13500
c121c671
DK
135012009-06-02 Doug Kwan <dougkwan@google.com>
13502
13503 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13504 issued_non_pic_error_.
13505 (class Target_arm::Scan): Declare new method check_non_pic.
13506 Define new method symbol_needs_plt_entry.
13507 Declare new data member issued_non_pic_error_.
13508 (class Target_arm::Relocate): Declare new method
13509 should_apply_static_reloc.
13510 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13511 (Target_arm::Scan::check_non_pic): Define new method.
13512 (Target_arm::Scan::local): Handle a small subset of reloc types used
13513 by Android.
13514 (Target_arm::Scan::local): Same.
13515 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13516
b19b0c6d
ILT
135172009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13518
13519 * incremental.cc (Incremental_inputs::report_command_line): Filter
13520 out --incremental-* options.
13521
94cdfcff
DK
135222009-05-29 Doug Kwan <dougkwan@google.com>
13523
13524 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13525 template class.
13526 (class Target_arm): Update comment.
13527 (Target_arm::Target_arm): Initialize new data members GOT_,
13528 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13529 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13530 and Target_arm::rel_dyn_section.
13531 Declare new_enum Target_arm::Got_type.
13532 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13533 and DYNBSS_.
13534 Update commments for member do_dynsym_value.
13535 (Target_arm::got_size, Target_arm::plt_section,
13536 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13537 new methods inside class defintion.
13538 (Target_arm::got_section): Define new method.
13539 (Target_arm::rel_dyn_section): Same.
13540 (Output_data_plt_arm): New template class.
13541 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13542 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13543 (Output_data_plt_arm::add_entry): Same.
13544 (Output_data_plt_arm::first_plt_entry): Define new
13545 static data member for PLT instruction template.
13546 (Output_data_plt_arm::plt_entry): Same.
13547 (Output_data_plt_arm::do_write): Define new method.
13548 (Target_arm::make_plt_entry): Same.
13549 (Target_arm::do_finalize_sections): Same.
13550 (Target_arm::do_dynsym_value): Same.
13551
4a657b0d
DK
135522009-05-28 Doug Kwan <dougkwan@google.com>
13553
13554 * Makefile.am (TARGETSOURCES): Add arm.cc.
13555 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13556 * Makefile.in: Regenerate.
13557 * arm.cc: New file.
13558 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13559
e7ae8c36
DK
135602009-05-26 Doug Kwan <dougkwan@google.com>
13561
13562 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13563 (General_options::check_excluded_libs): Strip off directories in
13564 archive name before matching like GNU ld does.
13565 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13566 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13567 (exclude_libs_test_LDFLAGS): Add linker option
13568 -Wl,--exclude-libs,libexclude_libs_test_3
13569 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13570 an explicit archive without using -l.
13571 (alt/libexclude_libs_test_3.a): New make rule.
13572 * testsuite/Makefile.in: Regenerate.
13573 * testsuite/exclude_libs_test.c : Declare lib3_default().
13574 (main): Call it.
13575 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13576 * exclude_libs_test_3.c: New file.
13577
f12e7348
NC
135782009-05-26 Nick Clifton <nickc@redhat.com>
13579
13580 * po/id.po: New Indonesian translation.
13581 * po/gold.pot: Updated template file.
13582
4daadc0d
ST
135832009-05-22 Sriraman Tallam <tmsriram@google.com>
13584
e1df38aa 13585 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13586 gc_comdat_test files. Add -Wl,--gc-sections to build
13587 gc_comdat_test.
13588 * testsuite/Makefile.in: Regenerate.
13589 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13590
531813ad
ST
135912009-05-21 Sriraman Tallam <tmsriram@google.com>
13592
13593 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13594 kept comdat section was garbage collected.
13595 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13596 * testsuite/Makefile.in: Regenerate.
13597 * testsuite/gc_comdat_test.sh: New file.
13598 * testsuite/gc_comdat_test_1.cc: New file.
13599 * testsuite/gc_comdat_test_2.cc: New file.
13600
65514900
CC
136012009-05-19 Doug Kwan <dougkwan@google.com>
13602
13603 * archive.cc (Archive::Archive): Move constructor from archive.h
13604 to here. Initialize no_export_.
13605 (Archive::get_elf_object_for_member): Set no_export flag of object.
13606 * archive.h (Archive::Archive): Move constructor body to
13607 archive.cc.
13608 (Archive::no_export): New method.
13609 (Archive::no_export_): New field.
13610 * object.h (Object::Object): Initialize no_export_ to false.
13611 (Object::no_export, Object::set_no_export): New methods.
13612 (Object::no_export_): New field.
13613 * options.cc (General_options::parse_exclude_libs): New method.
13614 (General_options::check_excluded_libs) Same.
13615 * options.h (exclude_libs): New option.
13616 (General_options::check_excluded_libs): New method declaration.
13617 (General_options::excluded_libs_): New field.
13618 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13619 default or protected visibility if an object has no-export flag set.
13620 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13621 (check_SCRIPTS): Add exclude_libs_test.sh.
13622 (check_DATA): Add exclude_libs_test.syms.
13623 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13624 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13625 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13626 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13627 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13628 libexclude_libs_test_2.a): New rules.
13629 * testsuite/Makefile.in: Regenerate.
13630 * testsuite/exclude_libs_test.c: New file.
13631 * testsuite/exclude_libs_test.sh: Ditto.
13632 * testsuite/exclude_libs_test_1.c: Ditto.
13633 * testsuite/exclude_libs_test_2.c: Ditto.
13634
1b77ea50
ILT
136352009-05-15 Ian Lance Taylor <iant@google.com>
13636
13637 * configure.ac: Check for declarations for cases where libiberty.h
13638 checks HAVE_DECL_xxx.
13639 * configure, config.in: Rebuild.
13640
072fe7ce
ILT
136412009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13642
13643 * gold.h (Incremental_argument_list): Remove (invalid) forward
13644 declaration.
13645 * incremental.cc (Incremental_inputs::report_achive): New method.
13646 (Incremental_inputs::report_object): New method.
13647 (Incremental_inputs::report_script): New method.
13648 (Incremental_inputs::finalize_inputs): New method.
13649 (Incremental_inputs::finalize): Call finalize_inputs().
13650 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13651 Create inputs entries.
13652 * incremental.h (Incremental_input_type): New enum.
13653 (Incremental_inputs::Incremental_input): Initialize new fields.
13654 (Incremental_inputs::report_inputs): New method.
13655 (Incremental_inputs::report_achive): New method.
13656 (Incremental_inputs::report_object): New method.
13657 (Incremental_inputs::report_script): New method.
13658 (Incremental_inputs::finalize_inputs): New method.
13659 (Incremental_inputs::Input_info): New struct.
13660 (Incremental_inputs::Input_info_map): New typedef.
13661 (Incremental_inputs::lock_): New field.
13662 (Incremental_inputs::Inputs_): New field.
13663 (Incremental_inputs::Inputs_map): New field.
13664 * main.cc (main): Call Incremental_input::report_inputs.
13665 * options.h (Input_argument_list): Typedef moved from
13666 Input_arguments.
13667 (Input_file_group::Files): Remove, use ::Input_argument_list.
13668 (Input_file_group::Input_argument_list): Remove, use
13669 ::Input_argument_list.
13670 * plugin.cc (Plugin_manager::add_input_file): Add error in
13671 incremental build.
13672 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13673 functions.
13674 * script.cc (read_input_script): Call
13675 Incremental_input::report_script.
13676 * script.h (Script_info): New class.
13677
b0481b0b
ILT
136782009-04-27 Ian Lance Taylor <iant@google.com>
13679
13680 * x86_64.cc (do_adjust_output_section): Set entsize to
13681 plt_entry_size.
13682
b22a5a41 136832009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13684
13685 * output.cc (Output_file::close): After short writes, continue
13686 writing from the correct offset in the buffer being written.
13687
40fde488
CD
136882009-04-23 Chris Demetriou <cgd@google.com>
13689
13690 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13691 * configure: Regenerate.
13692 * config.in: Regenerate.
13693 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13694 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13695
3ce2c28e
ILT
136962009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13697
13698 * incremental.cc (Incremental_inputs_header_data): Renamed from
13699 Incremental_input_header_data.
13700 (Incremental_inputs_header_data::data_size): New field.
13701 (Incremental_inputs_header_data::put_input_file_count): Renamed
13702 from input_file_count.
13703 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13704 from command_line_offset.
13705 (Incremental_inputs_header_data::put_reserved): Renamed from
13706 put_reserved.
13707 (Incremental_inputs_entry_data): Renamed from
13708 Incremental_input_entry_data.
13709 (Incremental_inputs_entry_data::data_size): New field.
13710 (Incremental_inputs::report_command_line): New method.
13711 (Incremental_inputs::finalize): New method.
13712 (Incremental_inputs::create_incremental_inputs_data): New method.
13713 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13714 * incremental.h: New file.
13715 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13716 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13717 incremental builds.
703d02da 13718 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13719 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13720 (Layout::create_incremental_info_sections): New method.
13721 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13722 * main.cc (main): Notify Incremental_input of the command line.
13723
e55bde5e
ILT
137242009-04-01 Ian Lance Taylor <iant@google.com>
13725 Mikolaj Zalewski <mikolajz@google.com>
13726
13727 * gold.h (reserve_unordered_map): Define, three versions, one for
13728 each version of Unordered_map.
13729 * layout.cc (Layout::Layout): Remove options parameter. Add
13730 number_of_input_files parameter. Don't initialize options_.
13731 Initialize number_of_input_files_ and resized_signatures_. Move
13732 sections_are_attached_.
13733 (Layout::layout_group): Reserve space for group_signatures_.
13734 (Layout::find_or_add_kept_section): Change name parameter to be a
13735 reference. Resize signatures_ map when it gets large enough.
13736 (Layout::layout_eh_frame): Use parameters->options() instead of
13737 this->options_.
13738 (Layout::make_output_section): Likewise.
13739 (Layout::attach_allocated_section_to_segment): Likewise.
13740 (Layout::finalize, Layout::create_executable_stack): Likewise.
13741 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13742 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13743 * layout.h (class Layout): Update declarations. Remove options_
13744 field. Add number_of_input_files_ and resized_signatures_
13745 fields. Move sections_are_attached_ field.
13746 * main.cc (main): Pass number of input files to Layout
13747 constructor. Don't pass options.
13748
154b857c
ILT
137492009-03-30 Ian Lance Taylor <iant@google.com>
13750
13751 * ffsll.c (ffsll): Correct implementation.
13752
2f35ab9b
ILT
137532009-03-27 Ian Lance Taylor <iant@google.com>
13754
fd03461a
ILT
13755 * ffsll.c: New file.
13756 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13757 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13758 * ftruncate.c (ftruncate): Declare before definition.
13759 * mremap.c (mremap): Likewise.
13760 * pread.c (pread): Likewise.
13761 * configure, Makefile.in, config.in: Rebuild.
13762
2f35ab9b
ILT
13763 * mremap.c: New file.
13764 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13765 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13766 (mremap): Declare if HAVE_MREMAP is not defined.
13767 * configure, Makefile.in, config.in: Rebuild.
13768
33aea2fd
CC
137692009-03-27 Cary Coutant <ccoutant@google.com>
13770
13771 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13772 position independent.
13773 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13774 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13775
6d479619
CC
137762009-03-24 Cary Coutant <ccoutant@google.com>
13777
13778 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13779 an executable.
13780 (needs_dynamic_reloc): Likewise.
13781
afc06bb8
ILT
137822009-03-24 Ian Lance Taylor <iant@google.com>
13783
13784 * yyscript.y (file_cmd): Recognize EXTERN.
13785 (extern_name_list, extern_name_list_body): New nonterminals.
13786 * script.cc (script_add_extern): Define.
13787 * script-c.h (script_add_extern): Declare.
13788
f6060a4d
ILT
137892009-03-24 Rafael Avila de Espindola <espindola@google.com>
13790
13791 * object.cc (is_elf_object): Define.
13792 * object.h (is_elf_object): Declare.
13793 * archive.cc (Archive::get_elf_object_for_member): Call
13794 is_elf_object.
33aea2fd 13795 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13796
26736d8e
ILT
137972009-03-24 Elliott Hughes <enh@google.com>
13798
13799 * output.cc (Output_file::map_anonymous): Define.
13800 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13801 try an anonymous one. Report the size if the mmap fails.
13802 * output.h (class Output_file): Declare map_anonymous.
13803
22fd9730
ILT
138042009-03-24 Ian Lance Taylor <iant@google.com>
13805
13806 * target-select.cc (instantiate_target): Don't acquire the lock if
13807 the instantiated_target_ field has already been set.
13808
cb010894
ILT
138092009-03-23 Ian Lance Taylor <iant@google.com>
13810
7f055c20
ILT
13811 * gold-threads.h (class Initialize_lock): Define.
13812 * gold-threads.cc (class Initialize_lock_once): Define.
13813 (initialize_lock_control): New static variable.
13814 (initialize_lock_pointer): New static variable.
13815 (initialize_lock_once): New static function.
13816 (Initialize_lock::Initialize_lock): Define.
13817 (Initialize_lock::initialize): Define.
13818 * target-select.h: Include "gold-threads.h".
13819 (class Target_selector): Add lock_ and initialize_lock_ fields.
13820 Don't define instantiate_target, just declare it.
13821 * target-select.cc (Target_selector::Target_selector): Initialize
13822 new fields.
13823 (Target_selector::instantiate_target): Define.
13824 * descriptors.h: Include "gold-threads.h".
13825 (class Descriptors): Add initialize_lock_ field.
13826 * descriptors.cc (Descriptors::Descriptors): Initialize new
13827 field.
13828 (Descriptors::open): Use initialize_lock_ field
13829 * errors.h (class Errors): Add initialize_lock_ field.
13830 * errors.cc (Errors::Errors): Initialize new field.
13831 (Errors::initialize_lock): Use initialize_lock_ field.
13832 * powerpc.cc (class Target_selector_powerpc): Remove
13833 instantiated_target_ field. In do_recognize call
13834 instantiate_target rather than do_instantiate_target. In
13835 do_instantiate_target just allocate a new target.
13836 * sparc.cc (class Target_selector_sparc): Likewise.
13837
36959681
ILT
13838 * freebsd.h: New file.
13839 * i386.cc: Include "freebsd.h".
13840 (Target_i386): Derive from Target_freebsd rather than
13841 Sized_target.
13842 (Target_selector_i386): Derive from Target_selector_freebsd rather
13843 than Target_selector.
13844 * x86_64.cc: Include "freebsd.h".
13845 (Target_x86_64): Derive from Target_freebsd rather than
13846 Sized_target.
13847 (Target_selector_x86_64): Derive from Target_selector_freebsd
13848 rather than Target_selector.
13849 * target.h (class Target): Add adjust_elf_header and
13850 do_adjust_elf_header.
13851 * output.cc (Output_file_header:: do_sized_write): Call target
13852 adjust_elf_header routine.
13853 * configure.tgt: Set targ_osabi.
13854 * configure.ac: Define GOLD_DEFAULT_OSABI.
13855 * parameters.cc (Parameters::default_target): Pass
13856 GOLD_DEFAULT_OSABI to select_target.
13857 * target-select.h (class Target_selector): Make instantiate_target
13858 protected rather than private.
13859 * Makefile.am (HFILES): Add freebsd.h.
13860 * configure, Makefile.in, config.in: Rebuild.
13861
cb010894
ILT
13862 * merge.cc (do_add_input_section): Correct pend value. Change
13863 message about last entry not being null terminated from error to
13864 warning.
13865
0e879927
ILT
138662009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13867
13868 * incremental.cc: New file.
13869 * Makefile.am (CCFILES): Add incremental.cc.
13870 * Makefile.in: Rebuild.
13871
41105937
PP
138722009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13873
13874 * layout.cc (Layout::output_section_name): Preserve names
13875 of '.note.' sections.
e1df38aa 13876
60439920
ILT
138772009-03-19 Ian Lance Taylor <iant@google.com>
13878
13879 * descriptors.cc (Descriptors::open): Check that the options are
13880 valid before using them.
13881
0d371ad3
ILT
138822009-03-18 Ian Lance Taylor <iant@google.com>
13883
13884 * script-sections.h: Include <list>.
13885 (class Script_sections): Change Sections_elements from std::vector
13886 to std::list. Typedef public Elements_iterator. Add
13887 orphan_section_placement_, data_segment_align_start_, and
13888 saw_data_segment_align_ fields. Remove data_segment_align_index_
13889 field.
13890 * script-sections.cc (class Orphan_section_placement): New class.
13891 (class Sections_element): Add virtual functions is_relro and
13892 orphan_section_init. Remove virtual function place_orphan_here.
13893 (class Output_section_definition): Add is_relro and
13894 orphan_section_init. Remove place_orphan_here.
13895 (class Orphan_output_section): Likewise.
13896 (Script_sections::Script_sections): Update for field changes.
13897 (Script_sections::data_segment_align): Set saw_data_segment_align_
13898 and data_segment_align_start_, not data_segment_align_index.
13899 (Script_sections::data_segment_relro_end): Check
13900 saw_data_segment_align_. Use data_segment_align_start_ rather
13901 than data_segment_align_index_.
13902 (Script_sections::place_orphan): Rewrite to use
13903 Orphan_section_placement.
13904
9201d894
ILT
139052009-03-17 Ian Lance Taylor <iant@google.com>
13906
9c5b8369
ILT
13907 * archive.cc (Archive::add_symbols): Check for a version attached
13908 to the symbol name in the archive map.
13909 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13910 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13911 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13912 (ver_test_11.a): New target.
13913 * testsuite/Makefile.in: Rebuild.
13914
9201d894
ILT
13915 * configure.ac: Check for chsize and posix_fallocate. Replace
13916 ftruncate.
13917 * ftruncate.c: New file, from gnulib.
13918 * output.cc (posix_fallocate): Define dummy version if not
13919 HAVE_POSIX_FALLOCATE.
13920 (Output_file::map): Call posix_fallocate rather than lseek and
13921 write.
13922 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13923 * configure, Makefile.in, config.in: Rebuild.
13924
ef4ab7a8 139252009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13926
ef4ab7a8
PP
13927 * layout.h (Layout::create_note): Add section_name parameter.
13928 * layout.cc (Layout::create_note): Likewise.
13929 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13930
8c500701
ILT
139312009-03-17 Ian Lance Taylor <iant@google.com>
13932
e85b18e1
ILT
13933 * descriptors.cc: Include "options.h".
13934 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13935 (Descriptors::open): Always use O_CLOEXEC when opening a new
13936 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13937 then set FD_CLOEXEC.
13938
9efe6174
ILT
13939 * sparc.cc (class Target_sparc): Add has_got_section.
13940 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13941 make sure we have a GOT section.
13942
13943 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13944 (Target_sparc::Scan::local): Likewise.
13945 (Target_sparc::Scan::global): Likewise.
13946 (Target_sparc::Relocate::relocate): Likewise.
13947 (Target_sparc::Relocate::relocate_tls): Likewise.
13948
8c500701
ILT
13949 * symtab.cc (Symbol_table::define_default_version): New function,
13950 broken out of add_from_object.
13951 (Symbol_table::add_from_object): Call define_default_version.
13952 (Symbol_table::define_special_symbol): Add resolve_oldsym
13953 parameter. Change all callers. If the version for a symbol comes
13954 from a version script, resolve it with the symbol with the same
13955 name with no version. Also add the symbol without a version if
13956 appropriate.
13957 (do_define_in_output_data): If resolving with oldsym, don't delete
13958 sym.
13959 (do_define_in_output_segment): Likewise.
13960 (do_define_as_constant): Likewise.
13961 * symtab.h (class Symbol_table): Update declarations.
13962
f1ed28fb
ILT
139632009-03-13 Ian Lance Taylor <iant@google.com>
13964
15f8229b
ILT
13965 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13966 (Read_symbols::requeue): New function.
13967 (Read_symbols::do_read_symbols): If make_elf_object fails because
13968 the target type is not configured, and the file was searched for,
13969 issue a warning and retry with the next directory.
13970 (Add_symbols::run): If the file has an incompatible format, and
13971 it was searched for, requeue the Read_symbols task. On error,
13972 release the object.
13973 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13974 dirindex parameter to constructor. Change all callers. Declare
13975 incompatible_warning and requeue.
13976 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13977 input_argument_ and input_group_ fields. Add them to
13978 constructor. Change all callers.
13979 (class Read_script): Add dirindex_ field. Add it to constructor.
13980 Change all callers.
13981 * archive.cc (Archive::setup): Remove input_objects parameter.
13982 Change all callers.
13983 (Archive::get_file_and_offset): Likewise.
13984 (Archive::read_all_symbols): Likewise.
13985 (Archive::read_symbols): Likewise.
13986 (Archive::get_elf_object_for_member): Remove input_objects
13987 parameter. Add punconfigured parameter. Change all callers.
13988 (Archive::add_symbols): Change return type to bool. Check return
13989 value of include_member.
13990 (Archive::include_all_members): Likewise.
13991 (Archive::include_member): Change return type to bool. Return
13992 false if first included object has incompatible target. Set
13993 included_member_ field.
13994 (Add_archive_symbols::run): If add_symbols returns false, requeue
13995 Read_symbols task.
13996 * archive.h (class Archive): Add included_member_ field.
13997 Initialize it in constructor. Add input_file and searched_for
13998 methods. Update declarations.
13999 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14000 input_argument_ fields. Add them to constructor. Change all
14001 callers.
14002 * script.cc: Include "target-select.h".
14003 (class Parser_closure): Add skip_on_incompatible_target_ and
14004 found_incompatible_target_ fields. Add
14005 skip_on_incompatible_target parameter to constructor. Change all
14006 callers. Add methods skip_on_incompatible_target,
14007 clear_skip_on_incompatible_target, found_incompatible_target, and
14008 set_found_incompatible_target.
14009 (read_input_script): Add dirindex parameter. Change all callers.
14010 If parser finds an incompatible target, requeue Read_symbols
14011 task.
14012 (script_set_symbol): Clear skip_on_incompatible_target in
14013 closure.
14014 (script_add_assertion, script_parse_option): Likewise.
14015 (script_start_sections, script_add_phdr): Likewise.
14016 (script_check_output_format): New function.
14017 * script.h (read_input_script): Update declaration.
14018 * script-c.h (script_check_output_format): Declare.
14019 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14020 (ignore_cmd): Remove OUTPUT_FORMAT.
14021 * fileread.cc (Input_file::Input_file): Add explicit this.
14022 (Input_file::will_search_for): New function.
14023 (Input_file::open): Add pindex parameter. Change all callers.
14024 * fileread.h (class Input_file): Add input_file_argument method.
14025 Declare will_search_for. Update declarations.
14026 * object.cc (make_elf_object): Add punconfigured parameter.
14027 Change all callers.
14028 * object.h (class Object): Make input_file public. Add
14029 searched_for method.
14030 (make_elf_object): Update declaration.
14031 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14032 restart search.
14033 * dirsearch.h (class Dirsearch): Update declaration.
14034 * options.h (class General_options): Add --warn-search-mismatch.
14035 * parameters.cc (Parameters::is_compatible_target): New function.
14036 * parameters.h (class Parameters): Declare is_compatible_target.
14037 * workqueue.cc (Workqueue::add_blocker): New function.
14038 * workqueue.h (class Workqueue): Declare add_blocker.
14039
f1ed28fb
ILT
14040 * fileread.cc (Input_file::open): Remove options parameter.
14041 Change all callers.
14042 (Input_file::open_binary): Likewise.
14043 * script.cc (read_input_script): Likewise.
14044 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14045 options parameter from constructor. Change all callers.
14046 (class Read_script): Likewise.
14047 * fileread.h (class Input_file): Update declarations.
14048 * script.h (read_input_script): Update declaration.
14049
34dd024a
NC
140502009-03-10 Nick Clifton <nickc@redhat.com>
14051
14052 * po/es.po: New Spanish translation.
14053
6d71b17c
CC
140542009-03-06 Cary Coutant <ccoutant@google.com>
14055
14056 * options.cc (parse_short_option): Keep dash_z from registering itself.
14057
031cdbed
ILT
140582009-03-03 Ian Lance Taylor <iant@google.com>
14059
14060 PR 9918
14061 * target-reloc.h (relocate_section): Pass output_section to
14062 relocate.
14063 * i386.cc (Target_i386::should_apply_static_reloc): Add
14064 output_section parameter. Change all callers.
14065 (Target_i386::Relocate::relocate): Add output_section parameter.
14066 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14067 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14068 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14069 * testsuite/two_file_shared.sh: New script.
14070 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14071 (check_DATA): Add two_file_shared.dbg.
14072 (two_file_shared.dbg): New target.
14073 * testsuite/Makefile.in: Rebuild.
14074
15d5fa16
ILT
140752009-03-01 Ian Lance Taylor <iant@google.com>
14076
14077 * configure.ac: Check for byteswap.h.
14078 * configure: Rebuild.
14079 * config.in: Rebuild.
14080
8a4c0b0d
ILT
140812009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14082
14083 * layout.cc (Layout::find_or_add_kept_section): New function.
14084 (Layout::add_comdat): Removed.
14085 * layout.h (struct Kept_section): Move out of class Layout.
14086 Remove trailing underscores from field names. Add group_sections
14087 field. Rename group_ field to is_group. Change all uses.
14088 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14089 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14090 comdat_groups_ field.
14091 (Sized_relobj::include_section_group): Use
14092 find_or_add_kept_section and Kept_section::group_sections.
14093 (Sized_relobj::include_linkonce_section): Likewise.
14094 * object.cc (class Sized_relobj): Don't define Comdat_group or
14095 Comdat_group_table. Remove find_comdat_group and
14096 add_comdat_group. Remove comdat_groups_ field.
14097 * plugin.cc (include_comdat_group): Use
14098 Layout::find_or_add_kept_section.
14099
b4ecf66b
ILT
141002009-02-28 Ian Lance Taylor <iant@google.com>
14101
14359ca0
ILT
14102 * README: --gc-sections and map files are now supported. Document
14103 some build requirements.
14104
b4ecf66b
ILT
14105 PR 6992
14106 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14107 relocatable link set the value of the section symbol to zero.
14108 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14109 relocatable link don't include the section address in the local
14110 symbol value.
14111
0602e05a
ILT
141122009-02-27 Ian Lance Taylor <iant@google.com>
14113
fd9d194f
ILT
14114 PR 6811
14115 * options.h (class Search_directory): Add is_system_directory.
14116 (class General_options): Declare is_in_system_directory.
14117 * options.cc (get_relative_sysroot): Make static.
14118 (get_default_sysroot): Make static.
14119 (General_optoins::is_in_system_directory): New function.
14120 * fileread.cc (Input_file::is_in_system_directory): New function.
14121 * fileread.h (class Input_file): Declare is_in_system_directory.
14122 * object.h (class Object): Add is_in_system_directory.
14123 (class Input_objects): Remove system_library_directory_ field.
14124 * object.cc (Input_objects::add_object): Don't set
14125 system_library_directory_.
14126 (input_objects::found_in_system_library_directory): Remove.
14127 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14128 parameter. Change all callers.
14129 (Symbol_table::sized_write_globals): Likewise.
14130 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14131 Call Object::is_in_system_directory.
14132 * symtab.h (class Symbol_table): Update declarations.
14133
61edd21f
ILT
14134 PR 5990
14135 * descriptors.h (Open_descriptor): Add is_on_stack field.
14136 * descriptors.cc (Descriptors::open): If the descriptor is on the
14137 top of the stack, remove it. Initialize is_on_stack field.
14138 (Descriptors::release): Only add pod to stack if it is not on the
14139 stack already.
14140 (Descriptors::close_some_descriptor): Clear stack_next and
14141 is_on_stack fields.
14142
e29e076a
ILT
14143 PR 7091
14144 * output.cc (Output_section::find_starting_output_address): Rename
14145 from starting_output_address; add PADDR parameter; change return
14146 type.
14147 * output.h (class Output_section): Declare
14148 find_starting_output_address instead of starting_output_address.
14149 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14150 section symbol for which we can't find a merge section.
14151
0602e05a
ILT
14152 PR 9836
14153 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14154 hidden or internal, force the symbol to be local.
14155 * resolve.cc (Symbol::override_visibility): Define.
14156 (Symbol::override_base): Use override_visibility.
14157 (Symbol_table::resolve): Likewise.
14158 (Symbol::override_base_with_special): Likewise.
14159 (Symbol_table::override_with_special): If the visibility is hidden
14160 or internal, force the symbol to be local.
14161 * symtab.h (class Symbol): Add set_visibility and
14162 override_visibility.
14163 * testsuite/ver_test_1.sh: New file.
14164 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14165 (check_DATA): Add ver_test_1.syms.
14166 (ver_test_1.syms): New target.
14167 * testsuite/Makefile.in: Rebuild.
14168
401a9a73
CC
141692009-02-25 Cary Coutant <ccoutant@google.com>
14170
14171 * layout.cc (Layout::choose_output_section): Don't rename sections
14172 when using a linker script that has a SECTIONS clause.
14173 * Makefile.in: Regenerate.
14174
14175 * testsuite/Makefile.am (script_test_5.sh): New test case.
14176 * testsuite/Makefile.in: Regenerate.
14177 * testsuite/script_test_5.cc: New file.
14178 * testsuite/script_test_5.sh: New file.
14179 * testsuite/script_test_5.t: New file.
14180
f488e4b0
CC
141812009-02-13 Rafael Avila de Espindola <espindola@google.com>
14182
14183 * archive.cc (Archive::include_member): Update calls to add_symbols.
14184 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14185 the Layout argument.
14186 * dynobj.h (do_add_symbols): Add the Layout argument.
14187 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14188 Layout argument.
14189 * object.h (Object::add_symbols): Add the Layout argument.
14190 (Object::do_add_symbols): Add the Layout argument.
14191 (Sized_relobj::do_add_symbols): Add the Layout argument.
14192 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14193 Unify the two versions.
14194 (Add_plugin_symbols): Remove.
14195 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14196 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14197 (Add_plugin_symbols): Remove.
14198 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14199 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14200 (Add_symbols::run): Make it work with Pulginobj.
14201
89dd1680
ILT
142022009-02-06 Ian Lance Taylor <iant@google.com>
14203
14204 * object.cc (Sized_relobj::do_layout): Make info message start
14205 with lower case letter.
14206
266d0a74
ILT
142072009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14208
602b464e
ILT
14209 * binary.cc: Fix file comment.
14210
266d0a74
ILT
14211 * options.h (enum Incremental_disposition): Define.
14212 (class General_options): Add new options: --incremental,
14213 --incremental_changed, --incremental_unchanged,
14214 --incremental_unknown. Add incremental_disposition_ and
14215 implicit_incremental_ fields.
14216 (General_options::incremental_disposition): New function.
14217 (class Position_dependent_options): Add incremental_disposition
14218 option.
14219 (Position_dependent_options::copy_from_options): Set incremental
14220 dispositions.
14221 * options.cc (General_options::parse_incremental_changed): New
14222 function.
2e702c99
RM
14223 (General_options::parse_incremental_unchanged): New function.
14224 (General_options::parse_incremental_unknown): New function.
14225 (General_options::General_options): Initialize new fields
266d0a74 14226 incremental_disposition_ and implicit_incremental_.
2e702c99 14227 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14228 without --incremental.
14229
f073bbf7
CD
142302009-02-06 Chris Demetriou <cgd@google.com>
14231
14232 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14233 pointer and to report location as the file name associated with
14234 the symbol.
14235 (gold_undefined_symbol_at_location): New function to replace the
14236 old gold_undefined_symbol functionality.
14237 * target-reloc.h (relocate_section): Update to use
14238 gold_undefined_symbol_at_location.
14239 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14240 Call gold_undefined_symbol function rather than gold_error.
14241 * errors.h (Errors::undefined_symbol): Take location as a
14242 string, rather than calculating it from a relocation.
14243 * errors.cc (Errors::fatal): Print "fatal error:" before the
14244 formatted message.
14245 (Errors::error, Errors::error_at_location): Print "error: "
14246 before the formatted message.
14247 (Errors::undefined_symbol): Take location as a string, rather
14248 than calculating it from a relocation.
14249 (gold_undefined_symbol_at_location): New function akin to
14250 old gold_undefined_symbol, calculates location from relocation.
14251 (gold_undefined_symbol): Change to take only a Symbol pointer
14252 and to report location as the file name associated with the symbol.
14253 * testsuite/debug_msg.sh: Update for changed error messages.
14254 * testsuite/undef_symbol.sh: Likewise.
14255
8e94a90c
ILT
142562009-02-04 Duncan Sands <baldrick@free.fr>
14257
14258 PR 9812
14259 * reduced_debug_output.h
14260 (Output_reduced_debug_abbrev_section::failed): Use format for
14261 gold_warning.
14262 (Output_reduced_debug_info_section::faild): Likewise.
14263
88a0e15b
ILT
142642009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14265
14266 * script.cc (Lazy_demangler): New class.
2e702c99 14267 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14268 symbol only once.
14269
5efc7cd2
CC
142702009-01-29 Cary Coutant <ccoutant@google.com>
14271
14272 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14273 to __tls_get_addr.
14274 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14275
e0ebcf42
ILT
142762009-01-28 Ian Lance Taylor <iant@google.com>
14277
5efc7cd2 14278 * version.cc (version_string): Bump to 1.9.
75fe7426 14279
e0ebcf42
ILT
14280 * gold.h: Include <cstring> and <stdint.h>.
14281 * version.cc: Include <cstdio>.
14282 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14283 warning.
14284 * reduced_debug_output.cc (insert_into_vector): Rename from
14285 Insert_into_vector; change all callers. Use Swap_unaligned to
14286 avoid aliasing issue; remove union since it is unnecessary.
14287
8e2813be 142882009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14289
14290 * Makefile.am (CCFILES): Add gc.cc.
14291 (HFILES): Add gc.h.
14292 * Makefile.in: Regenerate.
14293 * gold.cc (Gc_runner): New class.
14294 (queue_initial_tasks): Call garbage collection related tasks
14295 when corresponding options are invoked.
14296 (queue_middle_gc_tasks): New function.
14297 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14298 processed early before laying out sections during garbage collection.
14299 * gold.h (queue_middle_gc_tasks): New function.
14300 (is_prefix_of): Move from "layout.cc".
14301 * i386.cc (Target_i386::gc_process_relocs): New function.
14302 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14303 * main.cc (main): Create object of class "Garbage_collection".
14304 * object.cc (Relobj::copy_symbols_data): New function.
14305 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14306 (Sized_relobj::do_layout): Allow this function to be called twice
14307 during garbage collection and defer layout of section during the
6d03d481
ST
14308 first call.
14309 * object.h (Relobj::get_symbols_data): New function.
14310 (Relobj::is_section_name_included): New function.
14311 (Relobj::copy_symbols_data): New function.
14312 (Relobj::set_symbols_data): New function.
14313 (Relobj::get_relocs_data): New function.
14314 (Relobj::set_relocs_data): New function.
14315 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14316 (Relobj::gc_process_relocs): New function.
14317 (Relobj::do_gc_process_relocs): New pure virtual function.
14318 (Relobj::sd_): New data member.
14319 (Sized_relobj::is_output_section_offset_invalid): New function.
14320 (Sized_relobj::do_gc_process_relocs): New function.
14321 * options.h (General_options::gc_sections): Modify to not be a no-op.
14322 (General_options::print_gc_sections): New option.
14323 * plugin.cc (Plugin_finish::run): Remove function call to
14324 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14325 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14326 * reloc.cc (Read_relocs::run): Add task to process relocs and
14327 determine unreferenced sections when doing garbage collection.
14328 (Gc_process_relocs): New class.
14329 (Sized_relobj::do_gc_process_relocs): New function.
14330 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14331 sections that are garbage collected.
14332 * reloc.h (Gc_process_relocs): New class.
14333 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14334 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14335 symbols whose corresponding sections are garbage collected.
14336 (Symbol_table::Symbol_table): Add new parameter for the garbage
14337 collection object.
14338 (Symbol_table::gc_mark_undef_symbols): New function.
14339 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14340 (Symbol_table::gc_mark_dyn_syms): New function.
14341 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14342 as garbage.
14343 (Symbol_table::add_from_object): Likewise.
14344 (Symbol_table::add_from_relobj): When building shared objects, do not
14345 treat externally visible symbols as garbage.
14346 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14347 table information for static and relocatable links.
14348 * symtab.h (Symbol_table::set_gc): New function.
14349 (Symbol_table::gc): New function.
14350 (Symbol_table::gc_mark_undef_symbols): New function.
14351 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14352 (Symbol_table::gc_mark_dyn_syms): New function.
14353 (Symbol_table::gc_): New data member.
e1df38aa 14354 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14355 function.
14356 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14357 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14358
3b293544
CF
143592009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14360
14361 * options.h (General_options::gc_sections): Define as a no-op for now.
14362 (General_options::no_keep_memory): Ditto.
14363 (General_options::Bshareable): Define.
14364 * options.cc (General_options::finalize): Honor -Bshareable.
14365
83d22aa8
AS
143662009-01-20 Andreas Schwab <schwab@suse.de>
14367
14368 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14369 read the value in the contents, since we don't use it. Use the
14370 template endianness when writing.
14371 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14372
cd536b21
AS
143732009-01-19 Andreas Schwab <schwab@suse.de>
14374
14375 * configure.tgt (powerpc64-*): Fix targ_obj.
14376
99e9a495
ILT
143772009-01-15 Ian Lance Taylor <iant@google.com>
14378
14379 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14380 local symbols when stripping all symbols.
14381
bbbfea06
CC
143822009-01-14 Cary Coutant <ccoutant@google.com>
14383
99e9a495 14384 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14385
0f7c0701
CC
143862009-01-14 Cary Coutant <ccoutant@google.com>
14387
14388 * archive.cc (Archive::get_elf_object_for_member): Remove call
14389 to File_read::claim_for_plugin.
14390 * descriptors.cc (Descriptors::open): Remove reference to
14391 is_claimed.
14392 (Descriptors::claim_for_plugin): Remove.
14393 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14394 (Descriptors::is_claimed): Remove.
14395 (claim_descriptor_for_plugin): Remove.
14396 * fileread.cc (File_read::claim_for_plugin): Remove.
14397 * fileread.h (File_read::claim_for_plugin): Remove.
14398 (File_read::descriptor): Reopen descriptor if necessary.
14399 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14400 (Plugin_manager::all_symbols_read): Add task parameter. Change
14401 all callers.
14402 (Plugin_manager::get_input_file): New function.
14403 (Plugin_manager::release_input_file): New function.
14404 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14405 corresponding data member.
14406 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14407 and pass to base constructor. Change all callers.
14408 (get_input_file, release_input_file): New functions.
14409 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14410 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14411 (Plugin_manager::all_symbols_read): Add task parameter.
14412 (Plugin_manager::get_input_file): New function.
14413 (Plugin_manager::release_input_file): New function.
14414 (Plugin_manager::task_): New data member.
14415 (Pluginobj::Pluginobj): Add filesize parameter.
14416 (Pluginobj::filename): New function.
14417 (Pluginobj::descriptor): New function.
14418 (Pluginobj::filesize): New function.
14419 (Pluginobj::filesize_): New data member.
14420 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14421 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14422 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14423
14424 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14425 with archive libraries.
14426 * testsuite/Makefile.in: Regenerate.
14427 * testsuite/plugin_test.c (struct sym_info): New type.
14428 (get_input_file, release_input_file): New static variables.
14429 (onload): Capture new transfer vector entries.
14430 (claim_file_hook): Stop reading at end of file according to filesize.
14431 Factor out parsing of readelf output into separate function.
14432 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14433 APIs and get the source file name from the symbol table. Convert
14434 source file name to corresponding object file name. Print info
14435 message when adding new input files.
14436 (parse_readelf_line): New function.
14437 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14438 * testsuite/plugin_test_2.sh: Likewise.
14439 * testsuite/plugin_test_3.sh: Likewise.
14440 * testsuite/plugin_test_4.sh: New test case.
14441
62a6d109
ILT
144422009-01-07 Ian Lance Taylor <iant@google.com>
14443
14444 * version.cc (version_string): Bump to 1.8.
14445
483620e8
CC
144462008-12-23 Cary Coutant <ccoutant@google.com>
14447
14448 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14449 * plugin.cc (Plugin_manager::finish): Rename as
14450 layout_deferred_objects. Move cleanup to separate function.
14451 (Plugin_manager::cleanup): New function.
14452 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14453 separately.
14454 * plugin.h (Plugin_manager::finish): Rename as
14455 layout_deferred_objects.
14456 (Plugin_manager::cleanup): New function.
14457 (Plugin_manager::cleanup_done): New field.
14458
d66a9eb3
CC
144592008-12-23 Cary Coutant <ccoutant@google.com>
14460
14461 * plugin.cc (is_visible_from_outside): New function.
14462 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14463 so we don't return "IR only" status for exported symbols or -r links.
14464
14465 * testsuite/Makefile.am (plugin_test_3): New test case.
14466 * testsuite/Makefile.in: Regenerate.
14467 * testsuite/plugin_test_3.sh: New file.
14468
5995b570
CC
144692008-12-22 Cary Coutant <ccoutant@google.com>
14470
14471 * object.cc (Sized_relobj::layout_section): New function.
14472 (Sized_relobj::do_layout): Defer layout of input sections until after
14473 plugin has provided replacement files.
14474 (Sized_relobj::do_layout_deferred_sections): New function.
14475 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14476 (Relobj::layout_deferred_sections): New function.
14477 (Relobj::do_layout_deferred_sections): New function.
14478 (Sized_relobj::do_layout_deferred_sections): New function.
14479 (Sized_relobj::layout_section): New function.
14480 (Sized_relobj::Deferred_layout): New structure.
14481 (Sized_relobj::deferred_layout_): New field.
14482 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14483 Change all callers. Layout deferred sections.
14484 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14485 references.
14486 (Plugin_hook::run): Move code from do_plugin_hook inline.
14487 (Plugin_hook::do_plugin_hook): Remove.
14488 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14489 (Plugin_manager::finish): Renamed, was cleanup.
14490 (Plugin_manager::should_defer_layout): New function.
14491 (Plugin_manager::add_deferred_layout_object): New function.
14492 (Plugin_manager::Deferred_layout_list): New type.
14493 (Plugin_manager::deferred_layout_objects_): New field.
14494 (Plugin_hook::do_plugin_hook): Remove.
14495
ee769c88
ILT
144962008-12-17 Ian Lance Taylor <iant@google.com>
14497
14498 * options.h (class General_options): Add --no case for
14499 --export-dynamic.
14500
abc8dcba
CC
145012008-12-16 Cary Coutant <ccoutant@google.com>
14502
14503 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14504 vector.
14505 (Plugin_manager::claim_file): Create plugin object even if
14506 plugin did not call the add_symbols callback.
14507 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14508 asking for more symbols than were added.
14509 * testsuite/Makefile.am (plugin_test_1): Add test case with
14510 no global symbols.
14511 (empty.syms): New target.
14512 * testsuite/Makefile.in: Regenerate.
14513 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14514 message. Don't call add_symbols if no globals.
14515 (all_symbols_read_hook): Don't provide replacement for empty
14516 claimed file.
14517
b0074644
ILT
145182008-12-12 Ian Lance Taylor <iant@google.com>
14519
68943102
ILT
14520 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14521 r_type == 0 for a local symbol with r_sym == 0.
14522 (scan_relocatable_relocs): Pass r_sym to
14523 local_non_section_strategy.
14524 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14525 r_sym parameter.
14526
b0074644
ILT
14527 * configure.ac: Update test for TLS descriptors: they are
14528 supported as of glibc 2.9.
14529 * configure: Rebuild.
14530
c2508178
ILT
145312008-12-11 Ian Lance Taylor <iant@google.com>
14532
14533 PR 7091
14534 * target-reloc.h (Default_scan_relocatable_relocs): For each
14535 function, map r_type == 0 to RELOC_DISCARD.
14536
2756a258
CC
145372008-12-10 Cary Coutant <ccoutant@google.com>
14538
14539 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14540 object to override a kept COMDAT group from a plugin object.
14541
bb6f53d3
ILT
145422008-12-09 Ian Lance Taylor <iant@google.com>
14543
fbc558e1
ILT
14544 PR 7088
14545 * yyscript.y (file_cmd): Handle INPUT.
14546
bb6f53d3
ILT
14547 * testsuite/initpri1.c: Change all declarations to be full
14548 prototypes by adding void, to avoid compiler warnings.
14549
4674ecfc
CC
145502008-12-05 Rafael Avila de Espindola <espindola@google.com>
14551
14552 * options.cc (General_options::parse_plugin_opt): New.
14553 (General_options::add_plugin): The argument now is just the filename.
14554 (General_options::add_plugin_option): New.
14555 * options.h (plugin_opt): New.
14556 (add_plugin): Change argument name.
14557 (add_plugin_option): New.
14558 * plugin.cc (Plugin::load): Don't parse the plugin option.
14559 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14560 (Plugin::add_option): New.
14561 (Plugin::args_): Change type.
14562 (Plugin::filename_): New.
14563 (Plugin_manager::add_plugin_option): New.
14564 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14565 * testsuite/Makefile.in: Regenerate.
14566
fd06b4aa
CC
145672008-12-05 Cary Coutant <ccoutant@google.com>
14568
14569 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14570 Handle --strip-lto-sections option.
14571 * options.h (strip_lto_sections): New option.
14572
6c52134c
CC
145732008-12-01 Cary Coutant <ccoutant@google.com>
14574
14575 * plugin.cc (ld_plugin_message): Change format parameter to const.
14576 Fix mismatch between new[] and delete.
14577
a45248e0
CC
145782008-11-14 Cary Coutant <ccoutant@google.com>
14579
14580 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14581 instead of -1U.
14582
c82fbeee
CS
145832008-11-05 Craig Silverstein <csilvers@google.com>
14584
14585 * options.cc (General_options::parse_dynamic_list): New function.
14586 * options.h (General_options): New flags dynamic_list,
14587 dynamic_list_data, dynamic_list_cpp_new, and
14588 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14589 (General_options::in_dynamic_list): New function.
14590 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14591 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14592 (Lex::can_continue_name): Likewise.
14593 (yylex): Likewise.
14594 (read_script_file): New parameter script_options.
14595 (read_dynamic_list): New function.
14596 (Script_options::define_dynamic_list): New function.
14597 (dynamic_list_keyword_parsecodes): New variable.
14598 (dynamic_list_keywords): New variable.
14599 * script.h (Script_options::define_dynamic_list): New function
14600 prototype.
14601 (read_dynamic_list): New function prototype.
14602 * symtab.cc (strprefix): New macro.
14603 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14604 dynamic_list_data, dynamic_list_cpp_new, and
14605 dynamic_list_cpp_typeinfo.
14606 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14607 (dynamic_list_expr): New rule.
14608 (dynamic_list_nodes): Likewise.
14609 (dynamic_list_node): Likewise.
14610 * testsuite/Makefile.am (dynamic_list): New test.
14611 * testsuite/Makefile.in: Regenerated.
14612 * testsuite/dynamic_list.t: New file.
14613 * testsuite/dynamic_list.sh: New file.
14614
e0bb29a5
CS
146152008-11-05 Craig Silverstein <csilvers@google.com>
14616
14617 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14618 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14619 (t11_last): Likewise.
14620 * testsuite/ver_test_6.c (main): Likewise.
14621
4e1e25e0
CC
146222008-10-07 Cary Coutant <ccoutant@google.com>
14623
14624 * options.c (General_options::finalize): Add check for -static and
14625 -shared.
14626 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14627 is not empty.
14628
92f03fcb
CC
146292008-10-02 Cary Coutant <ccoutant@google.com>
14630
14631 * plugin.cc (make_sized_plugin_object): Fix conditional
14632 compilation to work when not all targets are enabled.
14633
fbd8a257
CC
146342008-09-29 Cary Coutant <ccoutant@google.com>
14635
14636 * archive.cc (Archive::get_file_and_offset): Use filename instead
14637 of name to get library path.
14638 (Archive::include_member): Unlock external member of a thin archive.
14639
14640 * testsuite/Makefile.am (TEST_AR): New variable.
14641 (thin_archive_test_1): New test.
14642 (thin_archive_test_2): New test.
81636b3f
CC
14643 * testsuite/Makefile.in: Regenerate.
14644 * testsuite/thin_archive_main.cc: New file.
14645 * testsuite/thin_archive_test_1.cc: New file.
14646 * testsuite/thin_archive_test_2.cc: New file.
14647 * testsuite/thin_archive_test_3.cc: New file.
14648 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14649
eff45813
CC
146502008-09-29 Cary Coutant <ccoutant@google.com>
14651
14652 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14653 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14654 instead of -1U.
14655 (Sized_relobj::do_finalize_local_symbols): Likewise.
14656 (Sized_relobj::map_to_kept_section): Likewise.
14657 * object.h (Sized_relobj::invalid_address): New constant.
14658 (Sized_relobj::do_output_section_offset): Check for invalid_address
14659 and return -1ULL.
14660 * output.cc (Output_reloc::local_section_offset): Use constant
14661 invalid_address instead of -1U.
14662 (Output_reloc::get_address): Likewise.
14663 (Output_section::output_address): Change -1U to -1ULL.
14664 * output.h (Output_reloc::invalid_address): New constant.
14665 * reloc.cc (Sized_relobj::write_sections): Use constant
14666 invalid_address instead of -1U.
14667 (Sized_relobj::relocate_sections): Likewise.
14668 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14669 values for merge sections.
14670 * target-reloc.h (relocate_for_relocatable): Use constant
14671 invalid_address instead of -1U.
14672
89fc3421
CC
146732008-09-19 Cary Coutant <ccoutant@google.com>
14674
14675 Add plugin functionality for link-time optimization (LTO).
14676 * configure.ac (plugins): Add --enable-plugins option.
14677 * configure: Regenerate.
14678 * config.in: Regenerate.
14679 * Makefile.am (LIBDL): New variable.
14680 (CCFILES): Add plugin.cc.
14681 (HFILES): Add plugin.h.
14682 (ldadd_var): Add LIBDL.
14683 * Makefile.in: Regenerate.
14684
14685 * archive.cc: Include "plugin.h".
14686 (Archive::setup): Don't preread archive symbols when using a plugin.
14687 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14688 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14689 files.
14690 (Archive::include_member): Add symbols from plugin objects.
14691 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14692 * descriptors.cc (Descriptors::open): Check for file descriptors
14693 abandoned by plugins.
14694 (Descriptors::claim_for_plugin): New function.
14695 * descriptors.h (Descriptors::claim_for_plugin): New function.
14696 (Open_descriptor::is_claimed): New field.
14697 (claim_descriptor_for_plugin): New function.
14698 * fileread.cc (File_read::claim_for_plugin): New function.
14699 * fileread.h (File_read::claim_for_plugin): New function.
14700 (File_read::descriptor): New function.
14701 * gold.cc: Include "plugin.h".
14702 (queue_initial_tasks): Add task to call plugin hooks for generating
14703 new object files.
14704 * main.cc: Include "plugin.h".
14705 (main): Load plugin libraries.
14706 * object.h (Pluginobj): Declare.
14707 (Object::pluginobj): New function.
14708 (Object::do_pluginobj): New function.
14709 (Object::set_target): New function.
14710 * options.cc: Include "plugin.h".
14711 (General_options::parse_plugin): New function.
14712 (General_options::General_options): Initialize plugins_ field.
14713 (General_options::add_plugin): New function.
14714 * options.h (Plugin_manager): Declare.
14715 (General_options): Add --plugin option.
14716 (General_options::has_plugins): New function.
14717 (General_options::plugins): New function.
14718 (General_options::add_plugin): New function.
14719 (General_options::plugins_): New field.
14720 * plugin.cc: New file.
14721 * plugin.h: New file.
14722 * readsyms.cc: Include "plugin.h".
14723 (Read_symbols::do_read_symbols): Check for archive before checking
14724 for ELF file. Call plugin hooks to claim files.
14725 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14726 from a real object file; force override when processing replacement
14727 files.
14728 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14729 (Symbol::init_base_object): Likewise.
14730 (Symbol::init_base_output_data): Likewise.
14731 (Symbol::init_base_output_segment): Likewise.
14732 (Symbol::init_base_constant): Likewise.
14733 (Symbol::init_base_undefined): Likewise.
14734 (Symbol::output_section): Assert that object is not a plugin.
14735 (Symbol_table::add_from_pluginobj): New function.
14736 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14737 undefined.
14738 (Symbol_table::sized_write_globals): Likewise.
14739 (Symbol_table::add_from_pluginobj): Instantiate template.
14740 * symtab.h (Sized_pluginobj): Declare.
14741 (Symbol::in_real_elf): New function.
14742 (Symbol::set_in_real_elf): New function.
14743 (Symbol::in_real_elf_): New field.
14744 (Symbol_table::add_from_pluginobj): New function.
14745
14746 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14747 (LIBDL): New variable.
14748 (LDADD): Add LIBDL.
14749 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14750 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14751 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14752 (MOSTLYCLEANFILES): Likewise.
14753 * testsuite/Makefile.in: Regenerate.
14754 * testsuite/plugin_test.c: New file.
14755 * testsuite/plugin_test_1.sh: New file.
14756 * testsuite/plugin_test_2.sh: New file.
14757
de31bda5
ILT
147582008-09-16 Ian Lance Taylor <iant@google.com>
14759
9c2d0ef9
ILT
14760 * target-reloc.h (relocate_section): Check whether a symbol is
14761 defined by the ABI before reporting an undefined symbol error.
14762 * target.h (Target::is_defined_by_abi): Make parameter const.
14763 (Target::do_is_defined_by_abi): Likewise.
14764 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14765 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14766 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14767 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14768 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14769 * testsuite/Makefile.in: Rebuild.
14770
de31bda5
ILT
14771 * fileread.cc (make_view): Add casts to avoid warning.
14772
9fa33bee
AO
147732008-09-16 Alexandre Oliva <aoliva@redhat.com>
14774
14775 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14776 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14777
183fd0e3
AO
147782008-09-16 Alexandre Oliva <aoliva@redhat.com>
14779
14780 * options.h (General_options::output_is_executable): New.
14781 (General_options::output_is_pie): New.
14782 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14783 for shared libraries.
14784 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14785
7be8330a
CD
147862008-09-11 Chris Demetriou <cgd@google.com>
14787
14788 * options.h (origin): New -z option.
14789 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14790 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14791 in DT_FLAGS_1.
14792
a9caad02
CC
147932008-09-05 Cary Coutant <ccoutant@google.com>
14794
14795 * fileread.cc (File_read::make_view): Add check for attempt to map
14796 beyond end of file.
14797
ae6dce4d
CC
147982008-09-05 Cary Coutant <ccoutant@google.com>
14799
14800 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14801 explicit instantiations.
14802
d7ab2a47
KVH
148032008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14804
14805 PR gold/6858
14806 * options.cc (General_options::finalize): Allow undefined symbols
14807 in shlibs if linking -shared.
14808
14809 PR gold/6859
14810 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14811 symbols as not needing a dynsym entry.
14812
1e52a9c1
CS
148132008-08-20 Craig Silverstein <csilvers@google.com>
14814
14815 * fileread.cc (File_read::open): Do not lock the file unless it
14816 was successfully opened.
14817
d85c80a3
CC
148182008-08-14 Cary Coutant <ccoutant@google.com>
14819
14820 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14821 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14822 * testsuite/tls_test.cc (struct int128): 128-bit struct
14823 for testing TLS relocs with non-zero addend.
14824 (v12): New TLS variable.
14825 (t12): New test.
14826 (t_last): Add check for v12.
14827 * testsuite/tls_test.h (t12): New function.
14828 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14829
2d924fd9
ILT
148302008-08-13 Ian Lance Taylor <iant@google.com>
14831
14832 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14833 set tls_segment_ or relro_segment_.
14834 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14835 when appropriate.
14836 * output.h (Output_section::clear_is_relro): New function.
14837 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14838 sections specially even when output_data_ is empty.
14839 (Output_segment::maximum_alignment): When first section is relro,
14840 only force alignment for PT_LOAD segments.
14841 * script.cc (script_data_segment_align): New function.
14842 (script_data_segment_relro_end): New function.
14843 * script-c.h (script_data_segment_align): Declare.
14844 (script_data_segment_relro_end): Declare.
14845 * script-sections.h (class Script_sections): Declare
14846 data_segment_align and data_segment_relro_end. Add fields
14847 segment_align_index_ and saw_relro_end_.
14848 * script-sections.cc (class Sections_element): Add set_is_relro
14849 virtual function. Add new bool* parameter to place_orphan_here.
14850 Add get_output_section virtual function.
14851 (class Output_section_definition): Add set_is_relro. Add new
14852 bool* parameter to place_orphan_here. Add get_output_section.
14853 Add is_relro_ field.
14854 (Output_section_definition::Output_section_definition): Initialize
14855 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14856 and is_relro_ fields.
14857 (Output_section_definition::place_orphan_here): Add is_relro
14858 parameter.
14859 (Output_section_definition::set_section_addresses): Set relro for
14860 output section.
14861 (Output_section_definition::alternate_constraint): Likewise.
14862 (class Orphan_output_section): Add new bool* parameter to
14863 place_orphan_here. Add get_output_section.
14864 (Orphan_output_section::place_orphan_here): Add is_relro
14865 parameter.
14866 (Script_sections::Script_sections): Initialize
14867 data_segment_align_index_ and saw_relro_end_.
14868 (Script_sections::data_segment_align): New function.
14869 (Script_sections::data_segment_relro_end): New function.
14870 (Script_sections::place_orphan): Set or clear is_relro.
14871 (Script_sections::set_section_addresses): Force alignment of first
14872 TLS section.
14873 * yyscript.y (exp): Call script_data_segment_align and
14874 script_data_segment_relro_end.
14875 * testsuite/relro_script_test.t: New file.
14876 * testsuite/relro_test.cc (using_script): Declare.
14877 (t1, t2): Test using_script.
14878 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14879 (relro_script_test_SOURCES): Define.
14880 (relro_script_test_DEPENDENCIES): Define.
14881 (relro_script_test_LDFLAGS): Define.
14882 (relro_script_test_LDADD): Define.
14883 (relro_script_test.so): New target.
14884 * testsuite/Makefile.in: Rebuild.
14885
f827c9a9
CC
148862008-08-06 Cary Coutant <ccoutant@google.com>
14887
14888 * archive.cc (Archive::total_archives, Archive::total_members)
14889 (Archive::total_members_loaded): New variables.
14890 (Archive::setup): Add parameter. Add option to preread
14891 archive symbols.
14892 (Archive::read_armap): Add counter.
14893 (Archive::get_file_and_offset): New function.
14894 (Archive::get_elf_object_for_member): New function.
14895 (Archive::read_all_symbols): New function.
14896 (Archive::read_symbols): New function.
14897 (Archive::add_symbols): Add counters.
14898 (Archive::include_all_members): Use armap to find members if it's
14899 already built.
14900 (Archive::include_member): Skip reading symbols if already read.
14901 Factored code into Archive::get_file_and_offset and
14902 Archive::get_elf_object_for_member. Changed call to
14903 Mapfile::report_include_archive_member.
14904 (Archive::print_stats): New function.
14905 * archive.h: Declare Object and Read_symbols_data classes.
14906 (Archive::Archive): Add initializers for new members.
14907 (Archive::setup): Add parameter.
14908 (Archive::print_stats): New function.
14909 (Archive::total_archives, Archive::total_members)
14910 (Archive::total_members_loaded): New variables.
14911 (Archive::get_file_and_offset): New function.
14912 (Archive::get_elf_object_for_member): New function.
14913 (Archive::read_all_symbols): New function.
14914 (Archive::read_symbols): New function.
14915 (Archive::Archive_member): New class.
14916 (Archive::members_): New member.
14917 (Archive::num_members_): New member.
14918 * main.cc: Include archive.h.
14919 (main): Call Archive::print_stats.
14920 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14921 archive parameter; member_name is now the fully-decorated name.
14922 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14923 * options.h: (General_options): Add --preread-archive-symbols option.
14924 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14925 Archive::setup.
14926
de4c45bd
ILT
149272008-08-04 Ian Lance Taylor <iant@google.com>
14928
14929 * symtab.h (Symbol::use_plt_offset): New function.
14930 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14931 * powerpc.cc (Relocate::relocate): Likewise.
14932 * sparc.cc (Relocate::relocate): Likewise.
14933 * x86_64.cc (Relocate::relocate): Likewise.
14934 * testsuite/weak_plt.sh: New test.
14935 * testsuite/weak_plt_main.cc: New test.
14936 * testsuite/weak_plt_shared.cc: New test.
14937 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14938 (check_PROGRAMS): Add weak_plt.
14939 (check_DATA): Add weak_plt_shared.so.
14940 (weak_plt_main_pic.o, weak_plt): New targets.
14941 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14942 * testsuite/Makefile.in: Rebuild.
14943
14944 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14945 gcctestdir/ld.
14946 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14947 * testsuite/Makefile.in: Rebuild.
14948
323ee3f4
AM
149492008-08-04 Alan Modra <amodra@bigpond.net.au>
14950
14951 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14952 * Makefile.in: Regenerate.
14953 * po/POTFILES.in: Regenerate.
14954
7c07ecec
ILT
149552008-07-29 Ian Lance Taylor <iant@google.com>
14956
14957 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14958 symbols before other symbols.
14959 * testsuite/script_test_2.cc (test_addr): Declare.
14960 (test_addr_alias): Declare.
14961 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14962 values.
7c07ecec
ILT
14963 * testsuite/script_test_2.t: Define test_addr_alias and
14964 test_addr.
14965
5778530e
ILT
149662008-07-24 Ian Lance Taylor <iant@google.com>
14967
2a00e4fb
ILT
14968 PR 5990
14969 * descriptors.cc: New file.
14970 * descriptors.h: New file.
14971 * gold-threads.h (class Hold_optional_lock): New class.
14972 * fileread.cc: Include "descriptors.h".
14973 (File_read::~File_read): Release descriptor rather than closing
14974 it.
14975 (File_read::open) [file]: Call open_descriptor rather than open.
14976 Set is_descriptor_opened_.
14977 (File_read::open) [memory]: Assert that descriptor is not open.
14978 (File_read::reopen_descriptor): New function.
14979 (File_read::release): Release descriptor.
14980 (File_read::do_read): Make non-const. Reopen descriptor.
14981 (File_read::read): Make non-const.
14982 (File_read::make_view): Reopen descriptor.
14983 (File_read::do_readv): Likewise.
14984 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14985 Update declarations.
14986 * layout.cc: Include "descriptors.h".
14987 (Layout::create_build_id): Use open_descriptor rather than open.
14988 * output.cc: Include "descriptors.h".
14989 (Output_file::open): Use open_descriptor rather than open.
14990 * archive.cc (Archive::const_iterator): Change Archive to be
14991 non-const.
14992 (Archive::begin, Archive::end): Make non-const.
14993 (Archive::count_members): Likewise.
14994 * archive.h (class Archive): Update declarations.
14995 * object.h (Object::read): Make non-const.
14996 * Makefile.am (CCFILES): Add descriptors.cc.
14997 (HFILES): Add descriptors.h.
14998 * Makefile.in: Rebuild.
14999
801647d1
ILT
15000 PR 6716
15001 * gold.h: Always include <clocale>. Add Solaris workarounds
15002 following code in binutils/sysdep.h.
15003
5edd166e
ILT
15004 PR 6048
15005 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15006 this->eh_frame_hdr_ is NULL before using it.
15007
c89ad728
ILT
15008 * dynobj.cc (Versions::Versions): Update comment.
15009
aa86f06b
ILT
15010 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15011 the base version name.
15012
5778530e
ILT
15013 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15014 array size plus one.
15015 (Stringpool_template::set_string_offsets): Subtract one from key
15016 before using it as an array index.
15017 (Stringpool_template::get_offset_with_length): Likewise.
15018 (Stringpool_template::write_to_buffer): Likewise.
15019 * stringpool.h (Stringpool_template::get_offset_from_key):
15020 Likewise.
15021
057ead22
ILT
150222008-07-23 Ian Lance Taylor <iant@google.com>
15023
7f649c59
ILT
15024 PR 6658
15025 * object.h (Merged_symbol_value::value): Do our best to handle a
15026 negative addend.
15027
057ead22
ILT
15028 PR 6647
15029 * script.cc (Version_script_info::get_versions): Don't add empty
15030 version tag to return value.
15031 (Version_script_info::get_symbol_version_helper): Change return
15032 type to bool. Add pversion parameter. Change all callers.
15033 (script_register_vers_node): Don't require a non-NULL tag.
15034 * script.h (class Version_script_info): Update declarations.
15035 (Version_script_info::get_symbol_version): Change return type to
15036 bool. Add version parameter. Change all callers.
15037 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15038 handling. Handle an empty version from a version script.
15039 (Symbol_table::define_special_symbol): Likewise.
15040 * testsuite/ver_test_10.script: New file.
15041 * testsuite/ver_test_10.sh: New file.
15042 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15043 (check_DATA): Add ver_test_10.syms.
15044 (ver_test_10.syms, ver_test_10.so): New target.
15045 * testsuite/Makefile.in: Rebuild.
15046
58e54ac2
CD
150472008-07-23 Simon Baldwin <simonb@google.com>
15048
15049 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15050 to zero for undefined symbols from dynamic libraries.
15051
95d14cd3
ILT
150522008-07-23 Ian Lance Taylor <iant@google.com>
15053
15054 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15055 Change all callers.
15056 * symtab.h (class Symbol_table): Update declaration.
15057 * testsuite/ver_test_9.cc: New file.
15058 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15059 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15060 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15061 (ver_test_9.so, ver_test_9.o): New targets.
15062 * testsuite/Makefile.in: Rebuild.
15063
92de84a6
ILT
150642008-07-22 Ian Lance Taylor <iant@google.com>
15065
34810851
ILT
15066 * options.h (class General_options): Define --check-sections.
15067 * layout.cc (Layout::set_segment_offsets): Handle
15068 --check-sections.
15069
af6156ef
ILT
15070 * options.h (class General_options): Define -n/--nmagic and
15071 -N/--omagic.
15072 * options.cc (General_options::finalize): For -n/--nmagic or
15073 -N/--omagic, set -static.
15074 * layout.cc (Layout::attach_allocated_section_to_segment): If
15075 -N/--omagic, don't put read-only and read-write sections in
15076 different segments.
15077 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15078 finding a read-only segment.
15079 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15080 don't set the minimum segment alignment to the common page size,
15081 and don't set the file offset to the address modulo the page size.
15082 * script-sections.cc (Script_sections::create_segments): If
15083 -n/--omagic, don't put read-only and read-write sections in
15084 different segments.
15085
92de84a6
ILT
15086 * cref.cc: New file.
15087 * cref.h: New file.
15088 * options.h (class General_options): Add --print-symbol-counts.
15089 * main.cc (main): Issue defined symbol report if requested.
15090 * archive.cc (Archive::interpret_header): Make into a const member
15091 function.
15092 (Archive::add_symbols): Call Input_objects::archive_start and
15093 archive_stop.
15094 (Archive::const_iterator): Define new class.
15095 (Archive::begin, Archive::end): New functions.
15096 (Archive::include_all_members): Rewrite to use iterator.
15097 (Archive::count_members): New function.
15098 * archive.h (class Archive): Update declarations.
15099 (Archive::filename): New function.
15100 * object.cc: Include "cref.h".
15101 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15102 (Sized_relobj::do_get_global_symbol_counts): New function.
15103 (Input_objects::add_object): Add object to cross-referencer.
15104 (Input_objects::archive_start): New function.
15105 (Input_objects::archive_stop): New function.
15106 (Input_objects::print_symbol_counts): New function.
15107 * object.h: Declare Cref and Archive.
15108 (Object::get_global_symbol_counts): New function.
15109 (Object::do_get_global_symbol_counts): New pure virtual function.
15110 (class Sized_relobj): Add defined_count_ field. Update
15111 declarations.
15112 (class Input_objects): Add cref_ field. Update constructor.
15113 Update declarations.
15114 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15115 defined_count_.
15116 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15117 symbol counts.
15118 (Sized_dynobj::do_get_global_symbol_counts): New function.
15119 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15120 defined_count_. Update declarations. Define Symbols typedef.
15121 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15122 parameter. Change all callers.
15123 (Symbol_table::add_from_dynobj): Add sympointers and defined
15124 parameters. Change all callers.
15125 * symtab.h (class Symbol_table): Update declarations.
15126 * Makefile.am (CCFILES): Add cref.cc.
15127 (HFILES): Add cref.h.
15128 * Makefile.in: Rebuild.
15129
3f7c5e1d
CD
151302008-07-22 Simon Baldwin <simonb@google.com>
15131
15132 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15133 to zero when writing undefined symbols.
15134
e0b64032
ILT
151352008-07-22 Ian Lance Taylor <iant@google.com>
15136
15137 * output.cc (Output_section::add_input_section): Don't try to
15138 merge empty merge sections.
15139
096b02cf
CS
151402008-07-21 Craig Silverstein <csilvers@google.com>
15141
15142 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15143 Include symbol version in error message.
cd536b21 15144
1d1f116d
CD
151452008-07-20 Chris Demetriou <cgd@google.com>
15146
cd536b21 15147 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15148 (RANDOM_SEED_CFLAGS): New substituted variable.
15149 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15150 * configure: Rebuild.
15151 * Makefile.in: Likewise.
15152 * testsuite/Makefile.in: Likewise.
15153
a18f591e
ILT
151542008-07-18 Ian Lance Taylor <iant@google.com>
15155
15156 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15157 where we see NAME/NULL and NAME/VERSION as separate symbols.
15158 * testsuite/ver_test_main.cc (main): Call t4.
15159 (t4, t4_2a): Define.
15160 * testsuite/ver_test_2.cc (t4_2): Define.
15161 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15162 * testsuite/ver_test_4.cc (t4_2a): Define.
15163 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15164 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15165
c6e3f6ed
ILT
151662008-07-17 Ian Lance Taylor <iant@google.com>
15167
15168 * dynobj.cc (Versions::add_def): If we give an error about a
15169 missing version, go ahead and create the version anyhow.
15170
ef9beddf
ILT
151712008-07-10 Ian Lance Taylor <iant@google.com>
15172
15173 Handle output sections with more than 0x7fffffff bytes.
15174 * object.h (class Relobj): Change map_to_output_ to
15175 output_sections_, and just keep a section pointer. Change all
15176 uses. Move comdat group support to Sized_relobj.
15177 (Relobj::is_section_specially_mapped): Remove.
15178 (Relobj::output_section): Remove poff parameter. Change all
15179 callers.
15180 (Relobj::output_section_offset): New function.
15181 (Relobj::set_section_offset): Rewrite.
15182 (Relobj::map_to_output): Remove.
15183 (Relobj::output_sections): New function.
15184 (Relobj::do_output_section_offset): New pure virtual function.
15185 (Relobj::do_set_section_offset): Likewise.
15186 (class Sized_relobj): Add section_offsets_ field. Add comdat
15187 group support from Relobj. Update declarations.
15188 (Sized_relobj::get_output_section_offset): New function.
15189 (Sized_relobj::do_output_section_offset): New function.
15190 (Sized_relobj::do_set_section_offset): New function.
15191 * object.cc (Relobj::output_section_address): Remove.
15192 (Sized_relobj::Sized_relobj): Initialize new fields.
15193 (Sized_relobj::include_section_group): Cast find_kept_object to
15194 Sized_relobj.
15195 (Sized_relobj::include_linkonce_section): Likewise.
15196 (Sized_relobj::do_layout): Use separate arrays for output section
15197 and output offset.
15198 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15199 output_sections.
15200 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15201 output_sections and section_offsets.
15202 (Sized_relobj::write_local_symbols): Likewise.
15203 (map_to_kept_section): Compute output address directly.
15204 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15205 output_sections and section_offsets.
15206 (Sized_relobj::write_sections): Likewise.
15207 (Sized_relobj::relocate_sections): Likewise.
15208 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15209 * output.h (class Output_reloc): Update declarations. Change
15210 u2_.relobj to Sized_relobj*.
15211 (class Output_data_reloc): Change add functions to use
15212 Sized_relobj*.
15213 * output.cc (Output_reloc::Output_reloc): Change relobj to
15214 Sized_relobj*.
15215 (Output_reloc::local_section_offset): Change return type to
15216 Elf_Addr. Use get_output_section_offset.
15217 (Output_reloc::get_address): Likewise.
15218 (Output_section::is_input_address_mapped): Don't call
15219 is_section_specially_mapped.
15220 (Output_section::output_offset): Likewise.
15221 (Output_section::output_address): Likewise.
15222 (Output_section::starting_output_address): Likewise.
15223 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15224 parameter to Sized_relobj*.
15225 (Copy_relocs::need_copy_reloc): Likewise.
15226 (Copy_relocs::save): Likewise.
15227 * copy-relocs.h (class Copy_relocs): Update declarations.
15228 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15229 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15230 * target-reloc.h (relocate_for_relocatable): Change
15231 offset_in_output_section type to Elf_Addr. Change code that uses
15232 it as well.
15233 * layout.cc (Layout::layout): Always set *off.
15234 * mapfile.cc (Mapfile::print_input_section): Use
15235 output_section_offset.
15236 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15237 Sized_relobj*.
15238 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15239 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15240 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15241
5cb66f97
ILT
152422008-07-03 Ian Lance Taylor <iant@google.com>
15243
15244 * layout.cc (Layout::include_section): Do not discard unrecognized
15245 SHT_STRTAB sections.
15246
afe47622
CS
152472008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15248
15249 * script.cc (Lex::can_continue_name): Make '?' allowable in
15250 version-script names.
15251 * testsuite/version_script.map: Change glob pattern to use '?'
15252
5adf9721
ILT
152532008-06-30 Manish Singh <yosh@gimp.org>
15254
15255 PR 6585
15256 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15257 Correct typo.
15258
e6fde208
ILT
152592008-06-30 Ian Lance Taylor <iant@google.com>
15260
15261 PR 6660
15262 PR 6682
15263 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15264 versions]: Don't try to read the value in the contents, since we
15265 don't use it. Use the template endianness when writing.
15266
3f2e6a2d
CC
152672008-06-25 Cary Coutant <ccoutant@google.com>
15268
15269 * fileread.cc (File_read::make_view): Assert on zero-length view.
15270 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15271 symbol table when there are no symbols to read.
15272
c43d3a48
CS
152732008-06-23 Craig Silverstein <csilvers@google.com>
15274
15275 * version.cc (version_string): Bump to 1.7
15276
5f494ea0
CS
152772008-06-18 Craig Silverstein <csilvers@google.com>
15278
15279 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15280 constant 0xFFFF to type Valtype.
15281 (Powerpc_relocate_functions::rel16_ha): Likewise.
15282
c42e122e
ILT
152832008-06-17 Ian Lance Taylor <iant@google.com>
15284
f34787f8
ILT
15285 * output.h (Output_section::Input_section): Initialize p2align_ to
15286 zero for Output_section_data constructors.
15287 (Output_section::Input_section::addralign): If not an input
15288 section, return the alignment of the Output_section_data.
15289 * testsuite/copy_test.cc: New file.
15290 * testsuite/copy_test_1.cc: New file.
15291 * testsuite/copy_test_2.cc: New file.
15292 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15293 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15294 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15295 (copy_test_1_pic.o, copy_test_1.so): New targets.
15296 (copy_test_2_pic.o, copy_test_2.so): New targets.
15297 * testsuite/Makefile.in: Rebuild.
15298
c42e122e
ILT
15299 * script-sections.cc (Script_sections::place_orphan): Initialize
15300 local variable exact.
15301
ce3ac18a
DE
153022008-06-13 David Edelsohn <edelsohn@gnu.org>
15303
15304 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15305
42cacb20
DE
153062008-06-12 David Edelsohn <edelsohn@gnu.org>
15307 David S. Miller <davem@davemloft.net>
15308
15309 * powerpc.cc: New file.
15310 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15311 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15312 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15313 * Makefile.in: Rebuild.
15314
7b308235
ILT
153152008-06-09 Ian Lance Taylor <iant@google.com>
15316
15317 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15318 <exception>.
15319 (throwing, orig_terminate): New static variables.
15320 (terminate_handler): New static function.
15321 (t2): Set terminate handler.
15322
f0b886e3
ILT
153232008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15324
15325 PR 6584
cd536b21 15326 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15327 alignment.
15328
3e90f135
CC
153292008-05-30 Cary Coutant <ccoutant@google.com>
15330
15331 * archive.cc (Archive::include_all_members) Correct to step
15332 over symbol table and extended name table in thin archives.
15333
e09ad04a
ILT
153342008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15335
15336 PR 6407
15337 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15338 calculation.
15339
62b01cb5
ILT
153402008-05-28 Caleb Howe <cshowe@google.com>
15341
15342 * reduced_debug_output.cc: New file.
15343 * reduced_debug_output.h: New file.
92de84a6 15344 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15345 * options.cc (General_options::finalize): Add strip_debug_non_line
15346 to the strip heirarchy.
15347 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15348 fields.
15349 * layout.cc: Include "reduced_debug_output.h".
15350 (Layout::Layout): Initialize new fields.
15351 (line_only_debug_sections): New static array.
15352 (is_lines_only_debug_sections): New static inline function.
15353 (Layout::include_section): Handle --strip-debug-non-line.
15354 (Layout::make_output_section): If --strip-debug-non-line, build
15355 new output sections for .debug_abbrev and .debug_info.
15356 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15357 gold. Warn about possible overflow.
15358 (read_signed_LEB_128): Likewise.
15359 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15360 (read_signed_LEB_128): Declare.
15361 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15362 (HFILES): Add reduced_debug_output.h.
15363 * Makefile.in: Rebuild.
15364
7d9e3d98
ILT
153652008-05-21 Ian Lance Taylor <iant@google.com>
15366
15367 * mapfile.cc: New file.
15368 * mapfile.h: New file.
15369 * options.h (class General_options): Add -M/--print-map and -Map.
15370 * options.cc (General_options::finalize): Make -M equivalent to
15371 -Map -.
15372 * main.cc: Include <cstdio> and "mapfile.h".
15373 (main): Open mapfile if requested.
15374 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15375 constructor. Change caller.
15376 (queue_initial_tasks): Add mapfile parameter. Change caller.
15377 (queue_middle_tasks): Likewise.
15378 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15379 declarations.
15380 * archive.cc: Include "mapfile.h".
15381 (Archive::add_symbols): Add mapfile parameter. Change all
15382 callers. Pass mapfile, symbol, and reason to include_member.
15383 (Archive::include_all_members): Add mapfile parameter. Change all
15384 callers.
15385 (Archive::include_member): Add mapfile, sym, and why parameters.
15386 Change all callers. Report inclusion to map file.
15387 * archive.h: Include "fileread.h".
15388 (class Archive): Update declarations.
15389 (Archive::file): New const method.
15390 (class Add_archive_symbols): Add mapfile_ field. Update
15391 constructor. Change all callers.
15392 * readsyms.h (class Read_symbols): Likewise.
15393 (class Finish_group): Likewise.
15394 (class Read_script): Likewise.
15395 * common.cc: Include "mapfile.h".
15396 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15397 all callers.
15398 (Symbol_table::do_allocate_commons): Likewise.
15399 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15400 symbol allocation to mapfile.
15401 * common.h (class Allocate_commons_task): Add mapfile_ field.
15402 Update constructor. Change all callers.
15403 * symtab.h (class Symbol_table): Update declarations.
15404 * layout.cc: Include "mapfile.h".
15405 (Layout_task_runner::run): Print information to mapfile.
15406 (Layout::create_gold_note): Change Output_data_fixed_space to
15407 Output_data_zero_fill.
15408 (Layout::create_build_id): Likewise.
15409 (Layout::print_to_mapfile): New function.
15410 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15411 constructor. Change caller.
15412 (class Layout): Declare print_to_mapfile.
15413 * output.cc (Output_section::Input_section::print_to_mapfile): New
15414 function.
15415 (Output_section::add_input_section): If producing a map, always
15416 add to input_sections_ list.
15417 (Output_section::do_print_to_mapfile): New function.
15418 (Output_segment::print_sections_to_mapfile): New function.
15419 (Output_segment::print_section_list_to_mapfile): New function.
15420 * output.h: Include "mapfile.h".
15421 (Output_data::print_to_mapfile): New function.
15422 (Output_data::do_print_to_mapfile): New virtual function.
15423 (Output_segment_headers::do_print_to_mapfile): New function.
15424 (Output_file_header::do_print_to_mapfile): New function.
15425 (Output_data_const::do_print_to_mapfile): New function.
15426 (class Output_data_const_buffer): Add map_name_ field. Update
15427 constructor. Change all callers. Add do_print_to_mapfile
15428 function.
15429 (class Output_data_fixed_space): Likewise.
15430 (class Output_data_space): Likewise.
15431 (class Output_data_zero_fill): New class.
15432 (Output_data_strtab::do_print_to_mapfile): New function.
15433 (Output_data_reloc_base::do_print_to_mapfile): New function.
15434 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15435 (Output_data_group::do_print_to_mapfile): New function.
15436 (Output_data_got::do_print_to_mapfile): New function.
15437 (Output_data_dynamic::do_print_to_mapfile): New function.
15438 (Output_symtab_xindex::do_print_to_mapfile): New function.
15439 (class Output_section): Declare do_print_to_mapflie. Declare
15440 print_to_mapfile in Input_section.
15441 (class Output_segment): Declare new functions.
15442 * object.h (Sized_relobj::symbol_count): New function.
15443 * script-sections.cc
15444 (Output_section_element_dot_assignment::set_section_addresses):
15445 Change Output_data_fixed_space to Output_data_zero_fill.
15446 (Output_data_expression::do_print_to_mapfile): New function.
15447 * script.cc (read_input_script): Add mapfile parameter. Change
15448 all callers.
15449 * script.h (read_input_script): Update declaration.
15450 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15451 (Eh_frame::do_print_to_mapfile): New function.
15452 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15453 (Output_merge_string::do_print_to_mapfile): New function.
15454 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15455 function.
15456 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15457 function.
15458 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15459 function.
15460 * Makefile.am (CCFILES): Add mapfile.cc.
15461 (HFILES): Add mapfile.h.
15462 * Makefile.in: Rebuild.
15463
9f1d377b
ILT
154642008-05-19 Ian Lance Taylor <iant@google.com>
15465
15466 * options.h (class General_options): Add -z relro.
15467 * layout.cc (Layout::Layout): Initialize relro_segment_.
15468 (Layout::add_output_section_data): Return the output section.
15469 (Layout::make_output_section): Rcognize relro sections and mark
15470 them appropriately.
15471 (Layout::attach_allocated_section_to_segment): Put relro sections
15472 in a PT_GNU_RELRO segment.
15473 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15474 section as relro.
15475 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15476 PT_TLS segments.
15477 (Layout::linkonce_mapping): Map d.rel.ro.local to
15478 .data.rel.ro.local.
15479 (Layout::output_section_name): Us .data.rel.ro.local for any
15480 section which begins with that.
15481 * layout.h (class Layout): Update add_output_section_data
15482 declaration. Add relro_segment_ field.
15483 * output.cc (Output_section::Output_section): Initialize is_relro_
15484 and is_relro_local_ fields.
15485 (Output_segment::add_output_section): Group relro sections.
15486 (Output_segment::is_first_section_relro): New function.
15487 (Output_segment::maximum_alignment): If there is a relro section,
15488 align the segment to the common page size.
15489 (Output_segment::set_section_addresses): Track whether we are
15490 looking at relro sections. If the last section is a relro
15491 section, align to the common page size.
15492 (Output_segment::set_section_list_addresses): Add in_relro
15493 parameter. Change all callers. Align to the page size when
15494 moving from relro to non-relro section.
15495 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15496 segment.
15497 * output.h (class Output_section): Add is_relro_ and
15498 is_relro_local_ fields.
15499 (Output_section::is_relro): New function.
15500 (Output_section::set_is_relro): New function.
15501 (Output_section::is_relro_local): New function.
15502 (Output_section::set_is_relro_local): New function.
15503 (class Output_segment): Update declarations.
15504 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15505 * sparc.cc (Target_sparc::got_section): Likewise.
15506 * x86_64.cc (Target_x86_64::got_section): Likewise.
15507 * testsuite/relro_test_main.cc: New file.
15508 * testsuite/relro_test.cc: New file.
15509 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15510 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15511 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15512 (relro_test.so, relro_test_pic.o): New targets.
15513 * testsuite/Makefile.in: Rebuild.
15514
a984ee1d
ILT
155152008-05-16 Ian Lance Taylor <iant@google.com>
15516
01676dcd
ILT
15517 * output.cc (Output_segment::add_output_section): Remove front
15518 parameter.
15519 * output.h (class Output_segment): Remove
15520 add_initial_output_section and overloaded add_output_section.
15521 Update declaration of remaining add_output_section.
15522 * layout.cc (Layout::create_interp): Call add_output_section
15523 rather than add_initial_output_section.
15524 (Layout::finish_dynamic_section): Likewise.
15525
497897f9
ILT
15526 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15527 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15528 know the dynamic type.
15529 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15530 field. Initialize it in constructor.
15531 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15532 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15533 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15534 reloc.
15535
a984ee1d
ILT
15536 * output.cc (Output_reloc::get_address): Change return type to
15537 Elf_Addr.
15538 * output.h (class Output_reloc): Update get_address declaration.
15539 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15540 for section addresses.
15541
55ba0940
ILT
155422008-05-09 Ian Lance Taylor <iant@google.com>
15543
15544 PR 6493
15545 * gold.cc (gold_nomem): Use return value of write.
15546
75517b77
ILT
155472008-05-08 Ian Lance Taylor <iant@google.com>
15548
15549 * symtab.c (Symbol::init_base_output_data): Add version
15550 parameter. Change all callers.
15551 (Symbol::init_base_output_segment): Likewise.
15552 (Symbol::init_base_constant): Likewise.
15553 (Symbol::init_base_undefined): Likewise.
15554 (Sized_symbol::init_output_data): Likewise.
15555 (Sized_symbol::init_output_segment): Likewise.
15556 (Sized_symbol::init_constant): Likewise.
15557 (Sized_symbol::init_undefined): Likewise.
15558 (Symbol_table::do_define_in_output_data): If the new symbol has a
15559 version, mark it as the default.
15560 (Symbol_table::do_define_in_output_segment): Likewise.
15561 (Symbol_table::do_define_as_constant): Likewise.
15562 * symtab.h (class Symbol): Update declarations.
15563 (class Sized_symbol): Likewise.
15564 * resolve.cc (Symbol::override_version): New function.
c42e122e 15565 (Symbol::override_base): Call override_version.
75517b77
ILT
15566 (Symbol::override_base_with_special): Likewise.
15567 * testsuite/ver_script_8.script: New file.
15568 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15569 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15570 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15571 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15572
f1f70eae
ILT
155732008-05-06 Ian Lance Taylor <iant@google.com>
15574
f3e9c5c5
ILT
15575 PR 6049
15576 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15577 functions.
15578 (class General_options): Remove existing --undefined, and add
15579 --no-undefined instead. Add new --undefined as synonym for -u.
15580 * archive.cc (Archive::add_symbols): Check whether symbol was
15581 named with -u.
15582 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15583 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15584 all uses. Add IS_UNDEFINED. Update declarations to split
15585 different versions of init_base. Declare init_base_undefined.
15586 (Symbol::is_defined): Handle IS_UNDEFINED.
15587 (Symbol::is_undefined): Likewise.
15588 (Symbol::is_weak_undefined): Call is_undefined.
15589 (Symbol::is_absolute): Handle IS_CONSTANT.
15590 (class Sized_symbol): Update declarations to split different
15591 versions of init. Declare init_undefined.
15592 (class Symbol_table): Declare new functions.
15593 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15594 Change all callers.
15595 (Symbol::init_base_output_data): Likewise.
15596 (Symbol::init_base_output_segment): Likewise.
15597 (Symbol::init_base_constant): Likewise.
15598 (Symbol::init_base_undefined): New function.
15599 (Sized_symbol::init_object): Rename from init. Change all
15600 callers.
15601 (Sized_symbol::init_output_data): Likewise.
15602 (Sized_symbol::init_output_segment): Likewise.
15603 (Sized_symbol::init_constant): Likewise.
15604 (Sized_symbol::init_undefined): New function.
15605 (Symbol_table::add_undefined_symbols_from_command_line): New
15606 function.
15607 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15608 function.
15609 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15610 (Symbol::output_section): Likewise.
15611 (Symbol::set_output_section): Likewise.
15612 (Symbol_table::sized_finalize_symbol): Likewise.
15613 (Symbol_table::sized_write_globals): Likewise.
15614 * resolve.cc (Symbol_table::should_override): Likewise.
15615 (Symbol::override_base_with_special): Likewise.
15616
8bdcdf2c
ILT
15617 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15618 symbol, change it to have default visibility.
15619 * testsuite/protected_1.cc: New file.
15620 * testsuite/protected_2.cc: New file.
15621 * testsuite/protected_3.cc: New file.
15622 * testsuite/protected_main_1.cc: New file.
15623 * testsuite/protected_main_2.cc: New file.
15624 * testsuite/protected_main_3.cc: New file.
15625 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15626 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15627 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15628 (protected_1.so): New target.
15629 (protected_1_pic.o, protected_2_pic.o): New targets.
15630 (protected_3_pic.o): New target.
15631 (check_PROGRAMS): Add protected_2.
15632 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15633 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15634 * testsuite/Makefile.in: Rebuild.
15635
2b706932
ILT
15636 * options.h (DEFINE_var): Add set_user_set_##varname__.
15637 (DEFINE_bool_alias): New macro.
15638 (class General_options): Define -Bstatic using DEFINE_bool_alias
15639 rather than DEFINE_special. Add --undefined as an alias for -z
15640 defs.
15641 * options.cc (General_options::parse_Bstatic): Remove.
15642
d82a5bcc
ILT
15643 * options.h (class General_options): Add --fatal-warnings.
15644 * main.cc (main): Implement --fatal-warnings.
15645 * errors.h (Errors::warning_count): New function.
15646
f1f70eae
ILT
15647 * options.h (class General_options): Add -Bsymbolic-functions.
15648 * symtab.h (Symbol::is_preemptible): Check for
15649 -Bsymbolic-functions.
15650
8825ac63
ILT
156512008-05-05 Ian Lance Taylor <iant@google.com>
15652
d98bc257
ILT
15653 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15654 as noVARNAME rather than no-VARNAME.
15655 (class General_options): Add option -z combreloc.
15656 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15657 get_address.
15658 (Output_reloc::sort_before) [SHT_REL]: New function.
15659 (Output_reloc::sort_before) [SHT_RELA]: New function.
15660 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15661 Sort_relocs_comparison.
15662 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15663 parameter. Change all callers.
15664 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15665 sort_relocs parameter. Change all callers.
15666 * output.cc (Output_reloc::get_address): New function, broken out
15667 of write_rel.
15668 (Output_reloc::write_rel): Call it.
15669 (Output_reloc::compare): New function.
15670 (Output_data_reloc_base::do_write): Optionally sort relocs.
15671
60b2b4e7
ILT
15672 * configure.ac: If targ_extra_obj is set, link it in.
15673 * configure.tgt: Initialize all variables.
15674 (x86_64*): Set targ_extra_obj and targ_extra_size.
15675 * configure: Rebuild.
15676
8825ac63
ILT
15677 * object.cc (Sized_relobj::include_section_group): Adjust section
15678 indexes read from group data. Build vector to pass to
15679 layout_group.
15680 * layout.cc (Layout::layout_group): Add flags and shndxes
15681 parameters. Remove contents parameter. Change caller. Update
15682 explicit instantiations.
15683 * layout.h (class Layout): Update layout_group declaration.
15684 * output.cc (Output_data_group::Output_data_group): Add flags and
15685 input_shndxes parameters. Remove contents parameter. Change
15686 caller.
15687 (Output_data_group::do_write): Change input_sections_ to
15688 input_shndxes_.
15689 * output.h (class Output_data_group): Update constructor
15690 declaration. Rename input_sections_ to input_shndxes_.
15691 * testsuite/many_sections_test.cc: Add template.
15692
e94cf127
CC
156932008-04-30 Cary Coutant <ccoutant@google.com>
15694
4418b2d5
CC
15695 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15696
e94cf127
CC
15697 * layout.cc (Layout::include_section): Refactored check for debug
15698 info section.
15699 (Layout::add_comdat): Add new parameters. Change type
15700 of signature parameter. Add object and shndx to signatures table.
15701 (Layout::find_kept_object): New function.
15702 * layout.h: Include <cstring>.
15703 (Layout::is_debug_info_section): New function.
15704 (Layout::add_comdat): Add new parameters.
15705 (Layout::find_kept_object): New function.
15706 (Layout::Kept_section): New struct.
15707 (Layout::Signatures): Change type of map range.
15708 * object.cc (Relobj::output_section_address): New function.
15709 (Sized_relobj::include_section_group): Add new parameters. Change
15710 calls to Layout::add_comdat. Change to build table of kept comdat
15711 groups and table mapping discarded sections to kept sections.
15712 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15713 (Sized_relobj::do_layout): Change calls to include_section_group and
15714 include_linkonce_section.
15715 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15716 value to zero when section is discarded.
15717 (Sized_relobj::map_to_kept_section): New function.
15718 * object.h (Relobj::output_section_address): New function.
15719 (Relobj::Comdat_group): New type.
15720 (Relobj::find_comdat_group): New function.
15721 (Relobj::Comdat_group_table): New type.
15722 (Relobj::Kept_comdat_section): New type.
15723 (Relobj::Kept_comdat_section_table): New type.
15724 (Relobj::add_comdat_group): New function.
15725 (Relobj::set_kept_comdat_section): New function.
15726 (Relobj::get_kept_comdat_section): New function.
15727 (Relobj::comdat_groups_): New field.
15728 (Relobj::kept_comdat_sections_): New field.
15729 (Symbol_value::input_value): Update comment.
15730 (Sized_relobj::map_to_kept_section) New function.
15731 (Sized_relobj::include_linkonce_section): Add new parameter.
15732 * target-reloc.h (Comdat_behavior): New type.
15733 (get_comdat_behavior): New function.
15734 (relocate_section): Add code to map a discarded section to the
15735 corresponding kept section when applying a relocation.
15736
e4e5049b
CS
157372008-04-30 Craig Silverstein <csilvers@google.com>
15738
15739 * dwarf_reader.cc (next_generation_count): New static var.
15740 (Addr2line_cache_entry): New struct.
15741 (addr2line_cache): New static var.
15742 (Dwarf_line_info::one_addr2line): Added caching.
15743 (Dwarf_line_info::clear_addr2line_cache): New function.
15744 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15745 cache-size parameter.
15746 (Dwarf_line_info::one_addr2line_cache): New function.
15747 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15748 new cache-size argument to one_addr2line(), and clear cache.
15749
d09e9154
CC
157502008-04-28 Cary Coutant <ccoutant@google.com>
15751
15752 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15753 R_386_PC8 relocations.
15754
7ef73768
ILT
157552008-04-23 Ian Lance Taylor <iant@google.com>
15756
55438702
ILT
15757 * object.cc (Sized_relobj::include_section_group): Check for
15758 invalid section group.
15759
c165fb93
ILT
15760 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15761 header size.
15762
7ef73768
ILT
15763 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15764 than read for file header.
15765 * archive.cc (Archive::include_member): Likewise.
15766
6194aaab
L
157672008-04-23 Paolo Bonzini <bonzini@gnu.org>
15768
15769 * aclocal.m4: Regenerate.
15770 * configure: Regenerate.
15771
d491d34e
ILT
157722008-04-19 Ian Lance Taylor <iant@google.com>
15773
5ea2bac6
ILT
15774 * version.cc (version_string): Bump to 1.6.
15775
7bc3e21a
ILT
15776 * testsuite/Makefile.am (many_sections_r_test): New target.
15777 (many_sections_r_test_SOURCES): Remove.
15778 (many_sections_r_test_DEPENDENCIES): Remove.
15779 (many_sections_r_test_LDFLAGS): Remove.
15780 (many_sections_r_test_LDADD): Remove.
15781
7fcd3aa9
ILT
15782 * object.cc (Sized_relobj::do_add_symbols): Always pass
15783 local_symbol_count_ to add_from_relobj.
15784
4c94d6ae
ILT
15785 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15786 every thousand variables.
15787 * testsuite/Makefile.in: Rebuild.
15788
d491d34e
ILT
15789 * object.cc (Xindex::initialize_symtab_xindex): New function.
15790 (Xindex::read_symtab_xindex): New function.
15791 (Xindex::sym_xindex_to_shndx): New function.
15792 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15793 available.
15794 (Sized_relobj::do_initialize_xindex): New function.
15795 (Sized_relobj::do_read_symbols): Adjust section links.
15796 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15797 parameter. Change all callers.
15798 (Sized_relobj::include_section_group): Adjust section links and
15799 symbol section indexes.
15800 (Sized_relobj::do_layout): Adjust section links.
15801 (Sized_relobj::do_count_local_symbols): Adjust section links and
15802 symbol section indexes.
15803 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15804 ordinary and special symbols.
15805 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15806 dynsym_xindex parameters. Change all callers. Adjust section
15807 links. Use SHN_XINDEX when needed.
15808 (Sized_relobj::get_symbol_location_info): Adjust section links.
15809 Don't get fooled by special symbols.
15810 * object.h (class Xindex): Define.
15811 (class Object): Add xindex_ parameter. Declare virtual functoin
15812 do_initialize_xindex.
15813 (Object::adjust_sym_shndx): New function.
15814 (Object::set_xindex): New protected function.
15815 (class Symbol_value): Add is_ordinary_shndx_ field.
15816 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15817 (Symbol_value::value): Assert ordinary section.
15818 (Symbol_value::initialize_input_to_output_map): Likewise.
15819 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15820 Change all callers.
15821 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15822 all callers.
15823 (class Sized_relobj): Update declarations.
15824 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15825 parameter. Change all callers.
15826 (Sized_relobj::adjust_shndx): New function.
15827 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15828 field.
15829 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15830 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15831 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15832 (Sized_dynobj::read_dynsym_section): Adjust section links.
15833 (Sized_dynobj::read_dynamic): Likewise.
15834 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15835 section links.
15836 (Sized_dynobj::do_initialize_xindex): New function.
15837 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15838 do_initialize_xindex.
15839 (Sized_dynobj::adjust_shndx): New function.
15840 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15841 dynsym_xindex_ fields.
15842 (Layout::finalize): Add a call to set_section_indexes before
15843 creating the symtab sections.
15844 (Layout::set_section_indexes): Don't do anything if the section
15845 already has a section index.
15846 (Layout::create_symtab_sections): Add shnum parameter. Change
15847 caller. Create .symtab_shndx section if needed.
15848 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15849 caller.
15850 (Layout::allocated_output_section_count): New function.
15851 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15852 needed.
15853 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15854 fields. Update declarations.
15855 (Layout::symtab_xindex): New function.
15856 (Layout::dynsym_xindex): New function.
15857 (class Write_symbols_task): Add layout_ field.
15858 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15859 Change caller.
15860 * output.cc (Output_section_headers::Output_section_headers): Add
15861 shstrtab_section parameter. Change all callers.
15862 (Output_section_headers::do_sized_write): Store overflow values
15863 for section count and section string table section index in
15864 section header zero.
15865 (Output_file_header::do_sized_write): Check for overflow of
15866 section count and section string table section index.
15867 (Output_symtab_xindex::do_write): New function.
15868 (Output_symtab_xindex::endian_do_write): New function.
15869 * output.h (class Output_section_headers): Add shstrtab_section_.
15870 Update declarations.
15871 (class Output_symtab_xindex): Define.
15872 (Output_section::has_out_shndx): New function.
15873 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15874 field.
15875 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15876 Change all callers.
15877 (Sized_symbol::init): Likewise.
15878 (Symbol::output_section): Check for ordinary symbol.
15879 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15880 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15881 callers.
15882 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15883 Change all callers. Simplify handling of symbols from sections
15884 not included in the link.
15885 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15886 distinction.
15887 (Weak_alias_sorter::operator()): Assert that symbols are
15888 ordinary.
15889 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15890 distinction.
15891 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15892 parameters. Change all callers.
15893 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15894 symbol distinction. Use SHN_XINDEX when needed.
15895 (Symbol_table::write_section_symbol): Add symtab_xindex
15896 parameter. Change all callers.
15897 (Symbol_table::sized_write_section_symbol): Likewise. Use
15898 SHN_XINDEX when needed.
15899 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15900 declarations.
15901 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15902 (Symbol::is_defined): Check is_ordinary.
15903 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15904 (Symbol::is_absolute, Symbol::is_common): Likewise.
15905 (class Sized_symbol): Update declarations.
15906 (class Symbol_table): Update declarations.
15907 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15908 parameters. Change all callers.
15909 (Sized_symbol::override): Likewise.
15910 (Symbol_table::override): Likewise.
15911 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15912 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15913 is_ordinary, and orig_st_shndx parameters. Change all callers.
15914 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15915 to be in an ordinary section.
15916 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15917 object and is_ordinary parameters. Change all callers.
15918 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15919 Change all callers. Don't add undefined or non-ordinary symbols
15920 to reloc_map_.
15921 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15922 Change all callers.
15923 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15924 declarations.
15925 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15926 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15927 (Sized_relobj::relocate_sections): Likewise.
15928 * target-reloc.h (scan_relocs): Adjust section symbol index.
15929 (scan_relocatable_relocs): Likewise.
15930 * i386.cc (Scan::local): Check for ordinary symbols.
15931 * sparc.cc (Scan::local): Likewise.
15932 * x86_64.cc (Scan::local): Likewise.
15933 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15934 to symbol_section_and_value.
15935 * testsuite/many_sections_test.cc: New file.
15936 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15937 (check_PROGRAMS): Add many_sections_test.
15938 (many_sections_test_SOURCES): Define.
15939 (many_sections_test_DEPENDENCIES): Define.
15940 (many_sections_test_LDFLAGS): Define.
15941 (BUILT_SOURCES): Add many_sections_define.h.
15942 (many_sections_define.h): New target.
15943 (BUILT_SOURCES): Add many_sections_check.h.
15944 (many_sections_check.h): New target.
15945 (check_PROGRAMS): Add many_sections_r_test.
15946 (many_sections_r_test_SOURCES): Define.
15947 (many_sections_r_test_DEPENDENCIES): Define.
15948 (many_sections_r_test_LDFLAGS): Define.
15949 (many_sections_r_test_LDADD): Define.
15950 (many_sections_r_test.o): New target.
15951 * testsuite/Makefile.in: Rebuild.
15952
c5818ff1
CC
159532008-04-17 Cary Coutant <ccoutant@google.com>
15954
15955 * errors.cc (Errors::info): New function.
15956 (gold_info): New function.
15957 * errors.h (Errors::info): New function.
15958 * gold.h (gold_info): New function.
15959 * object.cc (Input_objects::add_object): Print trace output.
15960 * options.cc (options::parse_set): New function.
15961 (General_options::parse_wrap): Deleted.
15962 (General_options::General_options): Deleted initializer.
15963 * options.h (options::String_set): New typedef.
15964 (options::parse_set): New function.
15965 (DEFINE_set): New macro.
15966 (General_options::wrap): Changed to use DEFINE_set. Changed
15967 callers of any_wrap_symbols and is_wrap_symbol.
15968 (General_options::trace, General_options::trace_symbol):
15969 New options.
15970 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15971 (General_options::wrap_symbols_): Deleted.
15972 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15973
b5be4a7c
DM
159742008-04-17 David S. Miller <davem@davemloft.net>
15975
15976 * options.cc (General_options::parse_V): New function.
15977 * options.h: Add entries for -V and -Qy.
15978
155a0dd7
ILT
159792008-04-17 Ian Lance Taylor <iant@google.com>
15980
15981 * common.cc (Symbol_table::allocate_commons): Remove options
15982 parameter. Change caller.
15983 (Symbol_table::do_allocate_commons): Remove options parameter.
15984 Change caller. Just call do_allocate_commons_list twice.
15985 (Symbol_table::do_allocate_commons_list): New function, broken out
15986 of do_allocate_commons.
15987 * common.h (class Allocate_commons_task): Remove options_ field.
15988 Update constructor.
15989 * symtab.cc (Symbol_table::Symbol_table): Initialize
15990 tls_commons_.
15991 (Symbol_table::add_from_object): Put TLS common symbols on
15992 tls_commons_ list.
15993 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15994 which are IN_OUTPUT_DATA.
15995 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15996 allocate_commons and do_allocate_commons declarations. Declare
15997 do_allocate_commons_list.
15998 * gold.cc (queue_middle_tasks): Update creation of
15999 Allocate_commons_task to not pass options.
16000 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16001 (TLS_TEST_C_FLAGS): New variable.
16002 (tls_test_c_pic.o): New target.
16003 (tls_test_shared.so): Link in tls_test_c_pic.o.
16004 (tls_test_c_pic_ie.o): New target.
16005 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16006 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16007 (tls_test_c.o): New target.
16008 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16009 (tls_pic_test_LDADD): Likewise.
16010 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16011 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16012 (tls_test_c_gnu2.o): New target.
16013 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16014 tls_test_c_gnu2.o.
16015 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16016 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16017 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16018 * testsuite/tls_test.cc: Include "config.h".
16019 (t_last): Call t11_last.
16020 * testsuite/tls_test.h (t11, t11_last): Declare.
16021 * testsuite/tls_test_c.c: New file.
16022 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16023 * configure.ac: Check for OpenMP support.
16024 * configure, config.in, Makefile.in: Rebuild.
16025 * testsuite/Makefile.in: Rebuild.
16026
edfbb029
CC
160272008-04-16 Cary Coutant <ccoutant@google.com>
16028
16029 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16030 (Target_i386::tls_base_symbol_defined_): New field.
16031 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16032 (Target_i386::Scan::global): Likewise.
16033 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16034 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16035 (Target_x86_64::tls_base_symbol_defined_): New field.
16036 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16037 (Target_x86_64::Scan::global): Likewise.
16038
f3c69fca
CC
160392008-04-16 Cary Coutant <ccoutant@google.com>
16040
16041 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16042 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16043 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16044 building shared libraries.
16045 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16046 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16047 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16048 * testsuite/Makefile.in: Rebuild.
16049 * testsuite/weak_undef.h: New file.
16050 * testsuite/weak_undef_file1.cc: Add extra test cases.
16051 * testsuite/weak_undef_file2.cc: Likewise.
16052 * testsuite/weak_undef_test.cc: Likewise.
16053
7c414435
DM
160542008-04-16 David S. Miller <davem@davemloft.net>
16055
32b769e1
DM
16056 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16057 Add issued_non_pic_error_ field. Declare check_non_pic.
16058 (Target_sparc::Scan::check_non_pic): New function.
16059 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16060 (Target_sparc::Scan::global): Likewise.
16061
11936fb1
DM
16062 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16063 * configure: Rebuild.
16064
7c414435
DM
16065 * options.h (DEFINE_enable): New macro.
16066 (new_dtags): New enable option.
16067 (initfirst, interpose, loadfltr, nodefaultlib,
16068 nodelete, nodlopen, nodump): New -z options.
16069 * layout.cc (Layout:finish_dynamic_section): If new
16070 dtags enabled, emit DT_RUNPATH. Also, emit a
16071 DT_FLAGS_1 containing any specified -z flags.
16072
85c7bf8b
ILT
160732008-04-16 Ian Lance Taylor <iant@google.com>
16074
12c0daef
ILT
16075 * copy-relocs.cc: New file.
16076 * copy-relocs.h: New file.
16077 * reloc.cc: Remove Copy_relocs code.
16078 * reloc.h: Likewise.
16079 * reloc-types.h (struct Reloc_types) [both versions]: Add
16080 get_reloc_addend_noerror.
16081 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16082 variants of add_global which take an addend which must be zero.
16083 * i386.cc: Include "copy-relocs.h".
16084 (class Target_i386): Change type of copy_relocs_ to variable,
16085 update initializer.
16086 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16087 Change all callers.
16088 (Target_i386::do_finalize_sections): Change handling of
16089 copy_relocs_.
16090 * sparc.cc: Include "copy-relocs.h".
16091 (class Target_sparc): Change type of copy_relocs_ to variable,
16092 update initializer.
16093 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16094 Change all callers.
16095 (Target_sparc::do_finalize_sections): Change handling of
16096 copy_relocs_.
16097 * x86_64.cc: Include "copy-relocs.h".
16098 (class Target_x86_64): Change type of copy_relocs_ to variable,
16099 update initializer.
16100 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16101 class. Change all callers.
16102 (Target_x86_64::do_finalize_sections): Change handling of
16103 copy_relocs_.
16104 * Makefile.am (CCFILES): Add copy-relocs.cc.
16105 (HFILES): Add copy-relocs.h.
16106
4f4995b6
ILT
16107 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16108
85c7bf8b
ILT
16109 * testsuite/script_test_4.sh: Permit leading zeroes.
16110
4f2a9edd
ILT
161112008-04-15 Ian Lance Taylor <iant@google.com>
16112
e6188289
ILT
16113 * script-sections.cc (Script_sections::create_segments): Use
16114 header_size_adjustment even when there is enough room for the
16115 headers.
16116 * testsuite/script_test_4.sh: New file.
16117 * testsuite/script_test_4.t: New file.
16118 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16119 (check_DATA): Add script_test_4.stdout.
16120 (MOSTLYCLEANFILES): Likewise.
16121 (script_test_4): New target.
16122 (script_test_4.stdout): New target.
16123 * testsuite/Makefile.in: Rebuild.
16124
4f2a9edd
ILT
16125 * sparc.cc: Add definitions for Output_data_plt_sparc class
16126 constants.
16127
f5314dd5
DM
161282008-04-14 David S. Miller <davem@davemloft.net>
16129
16130 * sparc.cc: New file.
16131 * Makefile.am (TARGETSOURCES): Add sparc.cc
16132 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16133 * configure.tgt: Document targ_extra_size and
16134 targ_extra_big_endian. Add entries for sparc-* and
16135 sparc64-*.
16136 * configure.ac: Handle targ_extra_size and
16137 targ_extra_big_endian.
16138 * Makefile.in: Rebuild.
16139 * configure: Likewise.
16140 * po/POTFILES.in: Likewise.
16141 * po/gold.pot: Likewise.
16142
154e0e9a
ILT
161432008-04-14 Ian Lance Taylor <iant@google.com>
16144
16145 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16146 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16147 in the name/type/flags to section mapping. Don't call
16148 allocate_output_section.
16149 (Layout::choose_output_section): Change parameter from adjust_name
16150 to is_input_section. Don't permit input sections after sections
16151 are attached to segments. Don't call allocate_output_section.
16152 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16153 not write_enable_output_section.
16154 (Layout::make_output_section): Don't push to
16155 unattached_section_list_ nor call attach_to_segment. Call
16156 attach_section_to_segment if sections are attached.
16157 (Layout::attach_sections_to_segments): New function.
16158 (Layout::attach_section_to_segment): New function.
16159 (Layout::attach_allocated_section_to_segment): Rename from
16160 attach_to_segment. Remove flags parameter.
16161 (Layout::allocate_output_section): Remove function.
16162 (Layout::write_enable_output_section): Remove function.
16163 * layout.h (class Layout): Update for above changes. Add new
16164 field sections_are_attached_.
16165 * output.h (Output_section::update_flags_for_input_section): New
16166 function.
16167 * output.cc (Output_section::add_input_section): Call
16168 update_flags_for_input_section.
16169 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16170
009a67a2
CC
161712008-04-11 Cary Coutant <ccoutant@google.com>
16172
16173 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16174 thought unnecessary.
16175 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16176
759b1a24
ILT
161772008-04-11 Ian Lance Taylor <iant@google.com>
16178
16179 * output.h (class Output_section_data): Remove inline definition
16180 of set_addralign.
16181 * output.cc (Output_section_data::set_addralign): New function.
16182
c2b45e22
CC
161832008-04-11 Cary Coutant <ccoutant@google.com>
16184
16185 Add support for TLS descriptors for i386 and x86_64.
16186 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16187 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16188 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16189 GOT_TYPE_TLS_DESC.
16190 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16191 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16192 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16193 relocations.
16194 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16195 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16196 Fix problem with initial-exec relocations.
16197 (Target_i386::Relocate::relocate_tls): Likewise.
16198 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16199 relaxation.
16200 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16201 support for section-plus-offset dynamic table entries.
16202 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16203 (Output_data_dynamic::Dynamic_entry): Add support for
16204 section-plus-offset dynamic table entries.
16205 (Output_data_dynamic::Classification): Likewise.
16206 (Output_data_dynamic::classification_): Renamed offset_.
16207 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16208 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16209 (Target_x86_64::make_plt_section): New function.
16210 (Target_x86_64::reserve_tlsdesc_entries): New function.
16211 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16212 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16213 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16214 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16215 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16216 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16217 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16218 add extra PLT entry for TLS descriptors.
16219 (Output_data_plt_x86_64::got_): New field.
16220 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16221 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16222 fields.
16223 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16224 descriptors.
16225 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16226 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16227 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16228 R_386_TLS_DESC_CALL relocations.
16229 (Target_x86_64::Scan::global): Likewise.
16230 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16231 for TLS descriptors.
16232 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16233 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16234 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16235 GD-to-IE relaxation.
16236 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16237 and TLS_DESCRIPTORS.
16238 * Makefile.in: Rebuild.
16239 * configure: Rebuild.
16240 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16241 (tls_test_shared2.so): New target.
16242 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16243 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16244 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16245 (tls_shared_gd_to_ie_test_LDADD): New variable.
16246 (tls_shared_gnu2_gd_to_ie_test): New target.
16247 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16248 New targets.
16249 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16250 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16251 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16252 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16253 (tls_shared_gnu2_test): New target.
16254 (tls_test_gnu2_shared.so): New target.
16255 (tls_shared_gnu2_test_SOURCES): New variable.
16256 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16257 (tls_shared_gnu2_test_LDFLAGS): New variable.
16258 (tls_shared_gnu2_test_LDADD): New variable.
16259 * testsuite/Makefile.in: Rebuild.
16260 * testsuite/Makefile.
16261
83bfb6b7
ILT
162622008-04-11 Ian Lance Taylor <iant@google.com>
16263
16264 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16265 justsyms.t.
16266 * testsuite/Makefile.in: Rebuild.
16267
16268 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16269 long.
16270 * testsuite/script_test_2.cc (main): Adjust test.
16271
706e1f5e
ILT
162722008-04-11 David S. Miller <davem@davemloft.net>
16273 Ian Lance Taylor <iant@google.com>
16274
16275 * options.h (General_options): Add entries for '-Y' and
16276 '-relax'.
16277 * options.cc (General_options:finalize): If -Y was used, add those
16278 entries to the library path instead of the default "/lib" and
16279 "/usr/lib".
16280
7c98e6bb
DM
162812008-04-11 David S. Miller <davem@davemloft.net>
16282
16283 * testsuite/justsyms.t: Start at 0x100.
16284 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16285 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16286 long.
16287 * testsuite/script_test_2.cc: Adjust string and section length
16288 checks.
7c98e6bb 16289
99a37bfd
ILT
162902008-04-09 Ian Lance Taylor <iant@google.com>
16291
2cefc357
ILT
16292 PR gold/5996
16293 * script-sections.cc (Sections_element::allocate_to_segment): Add
16294 orphan parameter.
16295 (Output_section_definition::allocate_to_segment): Likewise.
16296 (Orphan_output_section::allocate_to_segment): Likewise.
16297 (Script_sections::attach_sections_using_phdrs_clause): Don't
16298 propagate non-PT_LOAD segments to orphan sections.
16299 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16300 readelf rather than objdump.
16301 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16302 .interp section and PT_INTERP segment are the same size.
16303 * testsuite/Makefile.in: Rebuild.
16304
99a37bfd
ILT
16305 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16306 aliases for symbols defined in the same object.
16307 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16308 (weak_alias_test_SOURCES): New variable.
16309 (weak_alias_test_DEPENDENCIES): New variable.
16310 (weak_alias_test_LDFLAGS): New variable.
16311 (weak_alias_test_LDADD): New variable.
16312 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16313 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16314 (weak_alias_test_3.o): New target.
16315 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16316 * testsuite/weak_alias_test_main.cc: New file.
16317 * testsuite/weak_alias_test_1.cc: New file.
16318 * testsuite/weak_alias_test_2.cc: New file.
16319 * testsuite/weak_alias_test_3.cc: New file.
16320
780e49c5
ILT
163212008-04-08 Ian Lance Taylor <iant@google.com>
16322
cdb0b8f5
ILT
16323 * options.h (class General_options): Add --noinhibit-exec option.
16324 * main.cc (main): Check --noinhibit-exec.
16325
0864d551
ILT
16326 * options.h (class General_options): Define --wrap as a special
16327 option. Add wrap_symbols_ field.
16328 (General_options::any_wrap_symbols): New function.
16329 (General_options::is_wrap_symbol): New function.
16330 * options.cc (General_options::parse_wrap): New function.
16331 (General_options::General_options): Initialize wrap_symbols_.
16332 * symtab.cc (Symbol_table::wrap_symbol): New function.
16333 (Symbol_table::add_from_object): Handle --wrap.
16334 * symtab.h (class Symbol_table): Declare wrap_symbol.
16335 * target.h (Target::wrap_char): New function.
16336 (Target::Target_info): Add wrap_char field.
16337 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16338 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16339 * testsuite/testfile.cc (Target_test::test_target_info):
16340 Likewise.
16341
789aa6de
ILT
16342 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16343 there is one.
16344
2c38906f
ILT
16345 * layout.h (class Layout): Add added_eh_frame_data_ field.
16346 * layout.cc (Layout::Layout): Initialize new field.
16347 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16348 output section until we find a section we merged successfully.
16349 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16350 that the size be non-zero.
16351
780e49c5
ILT
16352 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16353 qualifier.
16354
7fcd0256
ILT
163552008-04-08 Craig Silverstein <csilvers@google.com>
16356
16357 * configure.ac: Export new conditional variable HAVE_ZLIB.
16358 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16359 on HAVE_ZLIB.
16360 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16361 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16362
6835af53
ILT
163632008-04-07 Ian Lance Taylor <iant@google.com>
16364
e24f324c
ILT
16365 * version.cc (version_string): Set to "1.5".
16366
a036edd8
ILT
16367 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16368 Add issued_non_pic_error_ field. Declare check_non_pic.
16369 (Target_x86_64::Scan::check_non_pic): New function.
16370 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16371 (Target_x86_64::Scan::global): Likewise.
16372
624f8810
ILT
16373 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16374 addend parameter. Change caller. Handle merge sections.
16375 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16376 Address to Addend. Don't add in the result of
16377 local_section_offset, pass down the addend and use the returned
16378 value.
16379 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16380 Update declarations of local_section_offset and symbol_value.
16381 * testsuite/two_file_test_1.cc (t18): New function.
16382 * testsuite/two_file_test_2.cc (f18): New function.
16383 * testsuite/two_file_test_main.cc (main): Call t18.
16384 * testsuite/two_file_test.h (t18, f18): Declare.
16385
6835af53
ILT
16386 * configure.ac: Don't test for objdump, c++filt, or readelf.
16387 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16388 conditionals.
16389 (TEST_READELF): New variable.
16390 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16391 (check_PROGRAMS): Add two_file_strip_test.
16392 (two_file_strip_test): New target.
16393 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16394 (two_file_same_shared_strip_test_SOURCES): New variable.
16395 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16396 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16397 (two_file_same_shared_strip_test_LDADD): New variable.
16398 (two_file_shared_strip.so): New target.
16399 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16400 (ver_test_5.syms, ver_test_7.syms): Likewise.
16401 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16402 (strip_test_3.stdout): Use TEST_OBJDUMP.
16403 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16404
86925eef
CC
164052008-04-04 Cary Coutant <ccoutant@google.com>
16406
16407 * symtab.h (Symbol::is_weak_undefined): New function.
16408 (Symbol::is_strong_undefined): New function.
16409 (Symbol::is_absolute): New function.
16410 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16411 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16412 absolute symbols.
16413 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16414 (weak_undef_test): New target.
16415 * testsuite/Makefile.in: Rebuild.
16416 * testsuite/weak_undef_file1.cc: New file.
16417 * testsuite/weak_undef_file2.cc: New file.
16418 * testsuite/weak_undef_test.cc: New file.
16419
126f3ece
ILT
164202008-04-03 Craig Silverstein <csilvers@google.com>
16421
16422 * compressed_output.h (class Output_compressed_section): Use
16423 unsigned buffer.
16424 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16425 add zlib header.
16426 (zlib_compressed_suffix): Removed.
16427 (Output_compressed_section::set_final_data_size): Use unsigned
16428 buffers.
16429 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16430 Fix linker invocation.
16431 (flagstest_o_specialfile_and_compress_debug_sections):
16432 Likewise.
16433 * testsuite/Makefile.in: Regenerated.
16434
deae2a14
DM
164352008-04-02 David S. Miller <davem@davemloft.net>
16436
16437 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16438 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16439
70752818
ILT
164402008-04-02 Craig Silverstein <csilvers@google.com>
16441
16442 * TODO: New file.
16443
39d0cb0e
ILT
164442008-04-02 Ian Lance Taylor <iant@google.com>
16445
16446 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16447 parameters. Update for new key type to views_. Change all
16448 callers.
16449 (File_read::read): Adjust for byteshift in returned view.
16450 (File_read::add_view): New function, broken out of
16451 find_and_make_view.
16452 (File_read::make_view): New function, broken out of
16453 find_and_make_view.
16454 (File_read::find_or_make_view): Add offset and aligned
16455 parameters. Rewrite accordingly. Change all callers.
16456 (File_read::get_view): Add offset and aligned parameters. Adjust
16457 for byteshift in return value.
16458 (File_read::get_lasting_view): Likewise.
16459 * fileread.h (class File_read): Update declarations.
16460 (class File_read::View): Add byteshift_ field. Add byteshift to
16461 constructor. Add byteshift method.
16462 * archive.h (Archive::clear_uncached_views): New function.
16463 (Archive::get_view): Add aligned parameter. Change all callers.
16464 * object.h (Object::get_view): Add aligned parameter. Change all
16465 callers.
16466 (Object::get_lasting_view): Likewise.
16467
16468 * fileread.cc (File_read::release): Don't call clear_views if
16469 there are multiple objects.
16470 * fileread.h (File_read::clear_uncached_views): New function.
16471 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16472 on the archive.
16473
a1207466
CC
164742008-03-31 Cary Coutant <ccoutant@google.com>
16475
16476 Add thin archive support.
16477 * archive.cc (Archive::armagt): New const.
16478 (Archive::setup): Remove task parameter and calls to unlock.
16479 (Archive::unlock_nested_archives): New function.
16480 (Archive::read_header): Add nested_off parameter. Change
16481 all callers.
16482 (Archive::interpret_header): Likewise.
16483 (Archive::include_all_members): Change to handle thin
16484 archives.
16485 (Archive::include_member): Likewise.
16486 * archive.h (Archive::Archive): Add new parameters and
16487 initializers.
16488 (Archive::armagt): New const.
16489 (Archive::setup): Remove task parameter.
16490 (Archive::unlock_nested_archives): New function.
16491 (Archive::read_header): Add nested_off parameter.
16492 (Archive::interpret_header): Likewise.
16493 (Archive::Nested_archive_table): New typedef.
16494 (Archive::is_thin_archive_): New field.
16495 (Archive::nested_archives_): New field.
16496 (Archive::options_): New field.
16497 (Archive::dirpath_): New field.
16498 (Archive::task_): New field.
16499 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16500 for thin archives. Pass additional parameters to
16501 Archive::Archive. Unlock the archive file after calling
16502 Archive::setup.
cd536b21 16503
479f6503
ILT
165042008-03-29 Ian Lance Taylor <iant@google.com>
16505
686c8caf
ILT
16506 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16507 version symbol to be local.
16508 * testsuite/ver_test_4.sh: New file.
16509 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16510 (check_DATA): Add ver_test_4.syms.
16511 (ver_test_4.syms): New target.
16512 * testsuite/Makefile.in: Rebuild.
16513
ab794b6b
ILT
16514 * output.cc
16515 (Output_section::Input_section_sort_entry::has_priority): New
16516 function.
16517 (Output_section::Input_section_sort_entry::match_file_name): New
16518 function.
16519 (Output_section::Input_section_sort_entry::match_section_name):
16520 Remove.
16521 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16522 Remove.
16523 (Output_section::Input_section_sort_entry::match_section_file):
16524 Remove.
16525 (Output_section::Input_section_sort_compare::operator()): Rewrite
16526 using new Input_section_sort_entry functions. Sort crtbegin and
16527 crtend first. Sort sections with no priority before sections with
16528 a priority.
16529 * testsuite/initpri1.c (d3): Check j != 4.
16530 (cd5): New constructor/destructor function.
16531 (main): Check j != 2.
16532
479f6503
ILT
16533 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16534 new symbol when resolving, don't call set_is_default.
16535 * testsuite/ver_test_7.cc: New file.
16536 * testsuite/ver_test_7.sh: New file.
16537 * testsuite/Makefile.am (ver_test_7.so): New target.
16538 (ver_test_7.o): New target.
16539 (check_SCRIPTS): Add ver_test_7.sh.
16540 (check_DATA): Add ver_test_7.syms.
16541 (ver_test_7.syms): New target.
16542
2fd32231
ILT
165432008-03-28 Ian Lance Taylor <iant@google.com>
16544
16545 * layout.cc (Layout::layout): If we see an input section with a
16546 name that needs sorting, set the must_sort flag for the output
16547 section.
16548 (Layout::make_output_section): If the name of the output section
16549 indicates that it might require sorting, set the may_sort flag.
16550 * output.h (Output_section::may_sort_attached_input_sections): New
16551 function.
16552 (Output_section::set_may_sort_attached_input_sections): New
16553 function.
16554 (Output_section::must_sort_attached_input_sections): New
16555 function.
16556 (Output_section::set_must_sort_attached_input_sections): New
16557 function.
16558 (class Output_section): Declare Input_section_sort_entry. Define
16559 Input_section_sort_compare. Declare
16560 sort_attached_input_sections. Add new fields:
16561 may_sort_attached_input_sections_,
16562 must_sort_attached_input_sections_,
16563 attached_input_sections_are_sorted_.
16564 * output.cc (Output_section::Output_section): Initialize new
16565 fields.
16566 (Output_section::add_input_section): Add an entry to
16567 input_sections_ if may_sort or must_sort are true.
16568 (Output_section::set_final_data_size): Call
16569 sort_attached_input_sections if necessary.
16570 (Output_section::Input_section_sort_entry): Define new class.
16571 (Output_section::Input_section_sort_compare::operator()): New
16572 function.
16573 (Output_section::sort_attached_input_sections): New function.
16574 * configure.ac: Check whether the compiler supports constructor
16575 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16576 * testsuite/initpri1.c: New file.
16577 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16578 CONSTRUCTOR_PRIORITY.
16579 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16580 (initpri1_LDFLAGS): New variable.
16581 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16582
18e6b24e
ILT
165832008-03-27 Ian Lance Taylor <iant@google.com>
16584
49bdd526
ILT
16585 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16586 * testsuite/common_test_1.c: New file.
16587 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16588 (common_test_1_SOURCES): New variable.
16589 (common_test_1_DEPENDENCIES): New variable.
16590 (common_test_1_LDFLAGS): New variable.
16591
18e6b24e
ILT
16592 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16593 and commons_ correctly when NAME/VERSION does not override
16594 NAME/NULL.
16595 * testsuite/ver_test_6.c: New file.
16596 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16597 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16598 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16599
04bf7072
ILT
166002008-03-26 Ian Lance Taylor <iant@google.com>
16601
5871526f
ILT
16602 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16603 of an undefined symbol from a version script.
16604 * testsuite/Makefile.am (ver_test_5.so): New target.
16605 (ver_test_5.o): New target.
16606 (check_SCRIPTS): Add ver_test_5.sh.
16607 (check_DATA): Add ver_test_5.syms.
16608 (ver_test_5.syms): New target.
16609 * testsuite/ver_test_5.cc: New file.
16610 * testsuite/ver_test_5.script: New file.
16611 * testsuite/ver_test_5.sh: New file.
16612 * Makefile.in, testsuite/Makefile.in: Rebuild.
16613
04bf7072
ILT
16614 PR gold/5986
16615 Fix problems building gold with gcc 4.3.0.
16616 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16617 (gold_error_at_location, gold_warning_at_location): Use it.
16618 * configure.ac: Check whether we can compile and use a template
16619 function with a printf attribute.
16620 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16621 when jumping over bytes.
16622 * object.cc: Instantiate Object::read_section_data.
16623 * debug.h: Include <cstring>
16624 * dwarf_reader.cc: Include <algorithm>
16625 * main.cc: Include <cstring>.
16626 * options.cc: Include <cstring>.
16627 * output.cc: Include <cstring>.
16628 * script.cc: Include <cstring>.
16629 * script.h: Include <string>.
16630 * symtab.cc: Include <cstring> and <algorithm>.
16631 * target-select.cc: Include <cstring>.
16632 * version.cc: Include <string>.
16633 * testsuite/testmain.cc: Include <cstdlib>.
16634 * configure, config.in: Rebuild.
16635
874c5b28
ILT
166362008-03-25 Ian Lance Taylor <iant@google.com>
16637
819d6c3a
ILT
16638 * options.cc: Include "../bfd/bfdver.h".
16639 (options::help): Print bug reporting address.
16640
f4b2c6f5
ILT
16641 * version.cc (print_version): Adjust output for current value of
16642 BFD_VERSION_STRING.
16643
16644 * NEWS: New file.
16645
e96caa79
ILT
16646 * options.cc (options::help): Print list of supported targets.
16647 * target-select.h: Include <vector>.
16648 (class Target_selector): Make machine_, size_, and is_big_endian_
16649 fields const. Add bfd_name_ and instantiated_target_ fields.
16650 (Target_selector::Target_selector): Add bfd_name parameter.
16651 (Target_selector::recognize): Make non-virtual, call
16652 do_recognize.
16653 (Target_selector::recognize_by_name): Make non-virtual, call
16654 do_recognize_by_name.
16655 (Target_selector::supported_names): New function.
16656 (Target_selector::bfd_name): New function.
16657 (Target_selector::do_instantiate_target): New pure virtual
16658 function.
16659 (Target_selector::do_recognize): New virtual function.
16660 (Target_selector::do_recognize_by_name): New virtual function.
16661 (Target_selector::instantiate_target): New private function.
16662 (supported_target_names): Declare.
16663 * target-select.cc (Target_selector::Target_selector): Update for
16664 new parameter and fields.
16665 (select_target_by_name): Check that the name matches before
16666 calling recognize_by_name.
16667 (supported_target_names): New function.
16668 * i386.cc (class Target_selector_i386): Update Target_selector
16669 constructor call. Remove recognize and recognize_by_name. Add
16670 do_instantiate_target.
16671 * x86_64.cc (class Target_selector_x86_64): Likewise.
16672 * testsuite/testfile.cc (class Target_selector_test): Update for
16673 changes to Target_selector.
16674
874c5b28
ILT
16675 * README: Rewrite, with some notes on unsupported features.
16676
0a65a3a7
CC
166772008-03-24 Cary Coutant <ccoutant@google.com>
16678
16679 * i386.cc (Target_i386::Got_type): New enum declaration.
16680 (Target_i386::Scan::local): Updated callers of Output_data_got
16681 member functions.
16682 (Target_i386::Scan::global): Likewise.
16683 (Target_i386::Relocate::relocate): Likewise.
16684 (Target_i386::Relocate::relocate_tls): Likewise.
16685 * object.h (Got_offset_list): New class.
16686 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16687 (Sized_relobj::local_got_offset): Likewise.
16688 (Sized_relobj::set_local_got_offset): Likewise.
16689 (Sized_relobj::local_has_tls_got_offset): Removed.
16690 (Sized_relobj::local_tls_got_offset): Removed.
16691 (Sized_relobj::set_local_tls_got_offset): Removed.
16692 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16693 * output.cc (Output_data_got::add_global): Added got_type parameter.
16694 (Output_data_got::add_global_with_rel): Likewise.
16695 (Output_data_got::add_global_with_rela): Likewise.
16696 (Output_data_got::add_global_pair_with_rel): New function.
16697 (Output_data_got::add_global_pair_with_rela): New function.
16698 (Output_data_got::add_local): Added got_type parameter.
16699 (Output_data_got::add_local_with_rel): Likewise.
16700 (Output_data_got::add_local_with_rela): Likewise.
16701 (Output_data_got::add_local_pair_with_rel): New function.
16702 (Output_data_got::add_local_pair_with_rela): New function.
16703 (Output_data_got::add_global_tls): Removed.
16704 (Output_data_got::add_global_tls_with_rel): Removed.
16705 (Output_data_got::add_global_tls_with_rela): Removed.
16706 (Output_data_got::add_local_tls): Removed.
16707 (Output_data_got::add_local_tls_with_rel): Removed.
16708 (Output_data_got::add_local_tls_with_rela): Removed.
16709 * output.h (Output_data_got::add_global): Added got_type parameter.
16710 (Output_data_got::add_global_with_rel): Likewise.
16711 (Output_data_got::add_global_with_rela): Likewise.
16712 (Output_data_got::add_global_pair_with_rel): New function.
16713 (Output_data_got::add_global_pair_with_rela): New function.
16714 (Output_data_got::add_local): Added got_type parameter.
16715 (Output_data_got::add_local_with_rel): Likewise.
16716 (Output_data_got::add_local_with_rela): Likewise.
16717 (Output_data_got::add_local_pair_with_rel): New function.
16718 (Output_data_got::add_local_pair_with_rela): New function.
16719 (Output_data_got::add_global_tls): Removed.
16720 (Output_data_got::add_global_tls_with_rel): Removed.
16721 (Output_data_got::add_global_tls_with_rela): Removed.
16722 (Output_data_got::add_local_tls): Removed.
16723 (Output_data_got::add_local_tls_with_rel): Removed.
16724 (Output_data_got::add_local_tls_with_rela): Removed.
16725 * resolve.cc (Symbol::override_base_with_special): Removed
16726 reference to has_got_offset_ field.
16727 * symtab.cc (Symbol::init_fields): Replaced initialization
16728 of got_offset_ with got_offsets_. Removed initialization
16729 of has_got_offset_
53fcba31 16730 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16731 (Symbol::got_offset): Likewise.
16732 (Symbol::set_got_offset): Likewise.
16733 (Symbol::has_tls_got_offset): Removed.
16734 (Symbol::tls_got_offset): Removed.
16735 (Symbol::set_tls_got_offset): Removed.
16736 (Symbol::got_offset_): Removed.
16737 (Symbol::tls_mod_got_offset_): Removed.
16738 (Symbol::tls_pair_got_offset_): Removed.
16739 (Symbol::got_offsets_): New field.
16740 (Symbol::has_got_offset): Removed.
16741 (Symbol::has_tls_mod_got_offset): Removed.
16742 (Symbol::has_tls_pair_got_offset): Removed.
16743 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16744 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16745 member functions.
16746 (Target_x86_64::Scan::global): Likewise.
16747 (Target_x86_64::Relocate::relocate): Likewise.
16748 (Target_x86_64::Relocate::relocate_tls): Likewise.
16749
bd52eafb
BE
167502008-03-25 Ben Elliston <bje@au.ibm.com>
16751
16752 * yyscript.y: Fix spelling error in comment.
16753
8b105e34
ILT
167542008-03-24 Ian Lance Taylor <iant@google.com>
16755
8ed814a9
ILT
16756 * options.h (class General_options): Define build_id option.
16757 * layout.h (class Layout): Declare write_build_id, create_note,
16758 create_build_id. Add build_id_note_ member.
16759 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16760 "libiberty.h", "md5.h", "sha1.h".
16761 (Layout::Layout): Initialize eh_frame_data_,
16762 eh_frame_hdr_section_, and build_id_note_.
16763 (Layout::finalize): Call create_build_id.
16764 (Layout::create_note): New function, broken out of
16765 Layout::create_gold_note.
16766 (Layout::create_gold_note): Call create_note.
16767 (Layout::create_build_id): New function.
16768 (Layout::write_build_id): New function.
16769 (Close_task_runner::run): Call write_build_id.
16770
8b105e34
ILT
16771 * x86_64.cc: Correct license to GPLv3.
16772
086a1841
ILT
167732008-03-23 Ian Lance Taylor <iant@google.com>
16774
16775 * options.cc: Include "demangle.h".
16776 (parse_optional_string): New function.
16777 (parse_long_option): Handle takes_optional_argument.
16778 (parse_short_option): Update dash_z initializer. Handle
16779 takes_optional_argument.
16780 (General_options::General_options): Initialize do_demangle_.
16781 (General_options::finalize): Set do_demangle_. Handle demangling
16782 style.
16783 * options.h (parse_optional_string): Declare.
16784 (struct One_option): Add optional_arg field. Update constructor.
16785 Update call constructor calls. Add takes_optional_argument
16786 function.
16787 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16788 (DEFINE_optional_string): Define.
16789 (General_options::demangle): Change from DEFINE_bool to
16790 DEFINE_optional_string.
16791 (General_options::no_demangle): New function.
16792 (General_options::do_demangle): New function.
16793 (General_options::set_do_demangle): New function.
16794 (General_options::execstack_status_): Move definition to end of
16795 class definition.
16796 (General_options::static_): Likewise.
16797 (General_options::do_demangle_): New field.
16798 * object.cc (big_endian>::get_symbol_location_info): Call
16799 Options::do_demangle, not Options::demangle.
16800 * symtab.cc (demangle): Likewise.
16801
cbb93e63
ILT
168022008-03-22 Ian Lance Taylor <iant@google.com>
16803
16804 * gold.h: Include <cstddef> and <sys/types.h>
16805 * options.h: Include <cstring>.
16806
ec531623
ILT
168072008-03-21 Ian Lance Taylor <iant@google.com>
16808
16809 * Added source code to GNU binutils.
752937aa 16810\f
b90efa5b 16811Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16812
16813Copying and distribution of this file, with or without modification,
16814are permitted in any medium without royalty provided the copyright
16815notice and this notice are preserved.
16816
16817Local Variables:
16818mode: change-log
16819left-margin: 8
16820fill-column: 74
16821version-control: never
16822End:
This page took 1.343754 seconds and 4 git commands to generate.