Fix internal error in do_relocate_sections when using plugins.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
bd9e0d46
CC
12015-03-21 Cary Coutant <ccoutant@google.com>
2
3 PR gold/18152
4 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
5 deferred objects.
6
943c8b43
CC
72015-03-11 Cary Coutant <ccoutant@google.com>
8
9 * options.cc (General_options::finalize): Don't allow -z relro
10 with incremental linking.
11 * testsuite/Makefile.am (incremental_test): Add -z norelro.
12 (incremental_test_2): Likewise.
13 (incremental_test_3): Likewise.
14 (incremental_test_4): Likewise.
15 (incremental_test_5): Likewise.
16 (incremental_test_6): Likewise.
17 (incremental_copy_test): Likewise.
18 (incremental_common_test_1): Likewise.
19 (incremental_comdat_test_1): Likewise.
20 * testsuite/Makefile.in: Regenerate.
21
e1663197
CC
222015-03-09 Cary Coutant <ccoutant@google.com>
23
24 PR gold/14675
25 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
26 return enum indicating whether .eh_frame section is empty, optimizable,
27 unrecognized, or an end marker. Adjust explicit instantiations.
28 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
29 (Eh_frame::add_ehframe_input_section): Change return type.
30 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
31 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
32 to the .eh_frame output section until we see the end marker.
33 (Layout::finalize_eh_frame_section): New.
34 * layout.h: (Layout::finalize_eh_frame_section): New.
35
beb8418f
L
362015-03-05 H.J. Lu <hongjiu.lu@intel.com>
37
38 * output.cc (Relobj::initialize_input_to_output_map<size>):
39 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
40
48c73428
CC
412015-03-04 Cary Coutant <ccoutant@google.com>
42
43 * parameters.cc (Parameters::set_target_once): Call
44 Target::select_as_default_target just once from here...
45 (set_parameters_target): ...instead of from here.
46
472015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
48
49 * ehframe.cc (Cie::set_output_offset): Pass in and use a
50 Output_section_data instead of a Merge_map.
51 (Eh_frame::Eh_frame): Don't initialize merge_map_.
52 (Eh_frame::read_cie): Use add_merge_mapping instead of
53 Merge_map::add_mapping.
54 (Eh_frame::read_fde): Ditto.
55 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
56 (Eh_frame::do_output_offset): Use merge_output_offset istead of
57 merge_map_->get_output_offset.
58 (Eh_frame::do_is_merge_section_for): Delete.
59 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
60 instead of a Merge_map.
61 (Cie::set_output_offset): Pass in a Output_section_data instead of a
62 Merge_map.
63 (Eh_frame::do_is_merge_section_for): Delete.
64 (Eh_frame::merge_map_): Delete.
65 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
66 and use a Output_section_data instead of a Merge_map.
67 (Object_merge_map::add_mapping): Ditto.
68 (Object_merge_map::get_output_offset): Remove the merge_map argument.
69 (Object_merge_map::is_merge_section_for): Pass in and use a
70 Output_section_data instead of a Merge_map.
71 (Merge_map): Delete.
72 (Output_merge_base::do_output_offset): Use merge_output_offset instead
73 of merge_map_.get_output_offset.
74 (Output_merge_base::do_is_merge_section_for): Delete.
75 (Output_merge_data::do_add_input_section): Use
76 object->add_merge_mapping instead of add_mapping.
77 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
78 * merge.h (Merge_map): Delete forward declaration.
79 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
80 instead of a Merge_map.
81 (Object_merge_map::get_output_offset): Remove the merge_map argument.
82 (Object_merge_map::is_merge_section_for): Pass in and use a
83 Output_section_data instead of a Merge_map.
84 (Input_merge_map::Object_merge_map::merge_map): Replace with
85 output_data.
86 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
87 Output_section_data instead of a Merge_map.
88 (Merge_map): Delete.
89 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
90 (Output_merge_base::do_is_merge_section_for): Delete.
91 (Output_merge_base::add_mapping): Delete.
92 (Output_merge_base::merge_map_): Delete.
93 * object.cc (Relobj::initialize_input_to_output_map): New.
94 (Relobj::initialize_input_to_output_map): New.
95 (Relobj::merge_output_offset): New.
96 (Relobj::is_merge_section_for): New.
97 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
98 bits.
99 * object.h (Relobj::merge_map): Delete.
100 (initialize_input_to_output_map): New.
101 (set_merge_map): Delete.
102 (add_merge_mapping): New.
103 (merge_output_offset): New.
104 (is_merge_section_for): New.
105 * output.cc (Output_section::Input_section::is_merge_section_for):
106 Use object->is_merge_section_for.
107 * output.h (Output_section_data::is_merge_section_for): Delete.
108 (Output_section_data::do_is_merge_section_for): Delete.
109 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
110 Use object->initialize_input_to_output_map.
111 (Merged_symbol_value<size>::value_from_output_section): Use
112 object->merge_output_offset.
113
48c73428 1142015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
115 Cary Coutant <ccoutant@google.com>
116
117 * output.cc (Output_section::add_merge_input_section): Do not
118 attempt to merge sections with an entsize of 0.
119
48c73428 1202015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
121
122 * attributes.h (class Output_attributes_section_data ): Add
123 do_print_to_mapfile function.
124
ec86f434
AM
1252015-02-24 Alan Modra <amodra@gmail.com>
126
127 PR 18010
128 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
129 complain if value is not a multiple of four.
130 (Target_powerpc::Relocate::relocate): Correct handling of
131 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
132
be66981e
L
1332015-02-21 H.J. Lu <hongjiu.lu@intel.com>
134
135 * configure.ac (default_size): Set to 32 for x32.
136 * configure: Regenerated.
137
e3ee8ed4
AM
1382015-02-18 Alan Modra <amodra@gmail.com>
139
140 PR 17954
141 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
142 visibility.
143
3a935c6c
RÁE
1442015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
145
146 * gc.h (Garbage_collection::add_reference): Don't use find.
147
e0a1e121
RÁE
1482015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
149
150 * object.cc (write_local_symbols): avoid std::vector copy.
151
45a4fb1a
RÁE
1522015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
153
154 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
155
2d9afefe
MW
1562015-02-09 Mark Wielaard <mjw@redhat.com>
157
158 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
159 DW_LANG_Fortran03 and DW_LANG_Fortran08.
160
e9c1bdad
CC
1612015-02-16 Cary Coutant <ccoutant@google.com>
162
163 PR gold/13577
164 PR gold/16992
165 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
166 DF_SYMBOLIC if --dynamic-list option is used.
167 * options.cc (General_options::finalize): --dynamic-list is not
168 mutually exclusive with -Bsymbolic.
169 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
170 listed in --dynamic-list.
171 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
172 -Bsymbolic-functions.
173 * testsuite/Makefile.in: Regenerate.
174
0ed4b0bf
CC
1752015-02-16 Cary Coutant <ccoutant@google.com>
176
177 PR gold/17971
178 * incremental.cc: Remove redundant include of "output.h".
179
1a920511
JY
1802015-02-12 Jing Yu <jingyu@google.com>
181
182 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
183 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
184 New relocation.
185 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
186 TLSLE_MOVW_* relocations.
187 (Target_aarch64::Scan::global): Likewise.
188 (Target_aarch64::Relocate::relocate): Likewise.
189 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
190 for new TLSLE_MOVW_* relocations.
191
07f107f3
WN
1922015-02-11 Will Newton <will.newton@linaro.org>
193
194 PR gold/13321
195 * arm.cc (Target_arm::make_plt_section): Create an ARM
196 state mapping symbol at the start of the PLT.
197
e051a5b5
L
1982015-02-09 H.J. Lu <hongjiu.lu@intel.com>
199
200 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
201 Replace two_file_shared_2.so with two_file_shared_1.so.
202 * testsuite/Makefile.in: Regenerated.
203
dddcc5b9
AM
2042015-02-09 Alan Modra <amodra@gmail.com>
205
206 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
207 plugin_test_thin.a and defsym_test.
208 * testsuite/Makefile.in: Regenerate.
209
b39b8b9d
RÁE
2102015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
211
212 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
213 body.
214
b66d1c52
CC
2152015-02-04 Peter Collingbourne <pcc@google.com>
216
217 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
218 forwarding symbols when computing symbol resolution info for plugins.
219 * plugin.h (Plugin_manager::symtab): New method.
220 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
221
23081de0
CC
2222015-02-03 Cary Coutant <ccoutant@google.com>
223 Peter Collingbourne <pcc@google.com>
224
225 PR gold/15660
226 * archive.cc (Thin_archive_object_unlocker): New class.
227 (Archive::include_member): Unlock external members of thin archives.
228 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
229 (plugin_test_2): Likewise.
230 (plugin_test_3): Likewise.
231 (plugin_test_4): Likewise.
232 (plugin_test_5): Likewise.
233 (plugin_test_6): Likewise.
234 (plugin_test_7): Likewise.
235 (plugin_test_8): Likewise.
236 (plugin_test_9): Likewise.
237 (plugin_test_10): Likewise.
238 (plugin_test_11): New test case.
239 * testsuite/Makefile.in: Regenerate.
240 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
241 file to decide whether to claim file.
242 (all_symbols_read_hook): Likewise.
243 * testsuite/plugin_test_1.sh: Adjust expected output.
244 * testsuite/plugin_test_2.sh: Likewise.
245 * testsuite/plugin_test_3.sh: Likewise.
246 * testsuite/plugin_test_6.sh: Likewise.
247 * testsuite/plugin_test_tls.sh: Likewise.
248 * testsuite/plugin_test_11.sh: New testcase.
249
2502015-02-03 Cary Coutant <ccoutant@google.com>
251
252 * descriptors.cc (Descriptors::open): Set artificially-low limit for
253 file descriptors when debugging enabled. Add debug output.
254 (Descriptors::release): Add debug output.
255 (Descriptors::close_some_descriptor): Likewise.
256 (Descriptors::close_all): Likewise.
257 * fileread.cc (File_read::lock): Likewise.
258 (File_read::unlock): Likewise.
259
24dd5808
CC
2602015-02-02 Cary Coutant <ccoutant@google.com>
261
262 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
263 executable output file.
264
fa89cc82
HS
2652015-01-22 Han Shen <shenhan@google.com>
266
267 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
268 (Target_arm::do_plt_address_for_global): New method.
269 (Target_arm::do_plt_address_for_local): New method.
270 (Target_arm::rel_irelative_section): New method.
271 (Target_arm::make_data_plt): Add more parameters for plt ctor.
272 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
273 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
274 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
275 (Target_arm::Scan::check_non_pic): Add ifunc support.
276 (Target_arm::Scan::local): Add ifunc support.
277 (Target_arm::Scan::global): Add ifunc support.
278 (Target_arm::make_plt_section): New method.
279 (Target_arm::make_plt_entry): Change to call to make_plt_section.
280 (Target_arm::make_local_ifunc_plt_entry): New method.
281 (Target_arm::got_irelative_): New member.
282 (Target_arm::rel_irelative_): New member.
283 (Target_arm::got_section): Add creation for got_irelative_.
284 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
285 (Target_arm::Relocate::relocate): Properly set local ifunc address.
286 (Target_arm::do_dynsym_value): Properly set global ifunc address.
287 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
288 (Output_data_plt_arm::IRelative_data): New type.
289 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
290 (Output_data_plt_arm::add_entry): Add more parameters.
291 (Output_data_plt_arm::add_relocation): New method.
292 (Output_data_plt_arm::add_local_ifunc_entry): New method.
293 (Output_data_plt_arm::rel_irelative): New method.
294 (Output_data_plt_arm::entry_count): Modified.
295 (Output_data_plt_arm::address_for_global): New method.
296 (Output_data_plt_arm::address_for_local): New method.
23081de0 297gold/
fa89cc82
HS
298 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
299 (Output_data_plt_arm::insert_irelative_data): New method.
300 (Output_data_plt_arm::irelative_rel_): New member.
301 (Output_data_plt_arm::got_): New member.
302 (Output_data_plt_arm::got_irelative_): New member.
303 (Output_data_plt_arm::irelative_count_): New member.
304 (Output_data_plt_arm::IRelative_data_vec): New typedef.
305 (Output_data_plt_arm::irelative_data_vec_): New member.
306 (Output_data_plt_arm::do_write): Write out irelative entries.
307 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
308 more parameters to ctor.
309 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
310 more parameters to ctor.
311 * output.h (Output_data_reloc::add_local_relative): New method.
312 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
313
0f81d3f0
AM
3142015-01-29 Alan Modra <amodra@gmail.com>
315
316 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
317 and GOT_TLSGD to LE optimization.
318
65d92137
CC
3192015-01-28 Cary Coutant <ccoutant@google.com>
320
321 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
322 for undef TLS symbols.
323 (Target_x86_64::Relocate::relocate_tls): Likewise.
324 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
325
5485698a
CC
3262015-01-25 Cary Coutant <ccoutant@google.com>
327
328 * output.cc (Output_segment::set_section_addresses): Fix calculation
329 of size of relro segment.
330
b01a4b04
AM
3312015-01-22 Alan Modra <amodra@gmail.com>
332
333 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
334 condition for need of ifunc plt entry.
335 (Target_powerpc::Scan::global <got relocs>): Likewise.
336
3d0064a9
CC
3372015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
338
339 * mips.cc (reloc_high): Add r_sym.
340 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
341 reloc_high constructor.
342 (Mips_relocate_functions::relgot16_local): Likewise.
343 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
344 r_type to decide whether LO16 matches HI16.
345 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
346 rello16 and relgot16_local.
347
a5cd8f05
CC
3482015-01-09 Cary Coutant <ccoutant@google.com>
349
350 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
351 unless alignment is larger than page size.
352
4fc1b9d4
L
3532015-01-06 H.J. Lu <hongjiu.lu@intel.com>
354 Cary Coutant <ccoutant@google.com>
355
356 PR gold/17729
357 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
358 (DEFAULT_TARGET_X32): Set for x32.
359 * x86_64.cc (cmp_insn_32): New.
360 (lea_r10_insn_32): Likewise.
361 (lea_r11_insn_32): Likewise.
362 (cmp_insn_64): Likewise.
363 (lea_r10_insn_64): Likewise.
364 (lea_r11_insn_64): Likewise.
365 (Target_x86_64<size>::do_calls_non_split): Handle x32.
366 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
367 (check_DATA): Add split_x32 files.
368 (split_x32_[1234n].o): New targets.
369 (split_x32_[124]): New targets.
370 (split_x32_[1234r].stdout): New targets.
371 * testsuite/split_x32.sh: New file.
372 * testsuite/split_x32_1.s: Likewise.
373 * testsuite/split_x32_2.s: Likewise.
374 * testsuite/split_x32_3.s: Likewise.
375 * testsuite/split_x32_4.s: Likewise.
376 * testsuite/split_x32_n.s: Likewise.
377 * configure: Regenerated.
378 * testsuite/Makefile.in: Likewise.
379
e749cab8
L
3802015-01-06 H.J. Lu <hongjiu.lu@intel.com>
381
382 PR gold/17809
383 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
384 x32.
385
af759df0
AM
3862015-01-02 Alan Modra <amodra@gmail.com>
387
388 * version.cc (print_version): Just print current year.
389 * dwp.cc (print_version): Likewise.
390
b90efa5b
AM
3912015-01-01 Alan Modra <amodra@gmail.com>
392
393 Update year range in copyright notice of all files.
394
f12d1e8a
AM
3952014-12-25 Alan Modra <amodra@gmail.com>
396
397 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
398 new enums.
399 (Target_arm::merge_object_attributes, ): Likewise.
400
5c294fee
TG
4012014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
402
403 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
404 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
405 AEABI_VFP_args_vfp to check that.
406 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
407 value and replace hardcoded values by enum values.
408
e30880c2
CC
4092014-12-22 Cary Coutant <ccoutant@google.com>
410
411 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
412
bd040da1
L
4132014-12-20 H.J. Lu <hongjiu.lu@intel.com>
414
415 PR gold/14608
416 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
417 to "return i * i * 3;".
418
e02a4046
CC
4192014-12-16 Cary Coutant <ccoutant@google.com>
420
421 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
422 (Mapfile::print_output_data): Use current_data_size() to avoid
423 assert for sections requiring postprocessing; if address is not valid,
424 print 0.
425 (Mapfile::print_output_section): Use current_data_size(); print note
426 that addresses and sizes are before compression.
427
add6016b
L
4282014-12-14 H.J. Lu <hongjiu.lu@intel.com>
429
430 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
431 Cast current_group_size to unsigned long when reporting error.
432
0bf32ea9
JY
4332014-12-10 Jing Yu <jingyu@google.com>
434
435 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
436 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
437 Update error message.
438 (Target_aarch64::do_relax): Use absolute value of option
439 stub_group_size. Replace local variable with class member
440 stub_group_size_.
441
cbcb23fa
AM
4422014-12-04 Alan Modra <amodra@gmail.com>
443
444 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
445 addend of PLTREL24 reloc when not generating a plt stub. Make
446 max_branch_offset an "Address".
fbad6518 447 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
448 (Target_powerpc::Relocate::relocate): Likewise.
449
1611bc4a
AM
4502014-12-04 Alan Modra <amodra@gmail.com>
451
452 PR 17670
453 * symtab.cc (Symbol::set_undefined): Remove assertion.
454 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
455 on symbols defined in discarded sections, instead return false.
456 Rearrange params, update all callers.
457 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
458 branches to syms in discarded sections.
459 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
460 undefined and flag as discarded.
461 (Target_powerpc::Relocate::relocate): Localize variable.
462
4759c34e
L
4632014-12-03 H.J. Lu <hongjiu.lu@intel.com>
464
465 PR gold/17675
466 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
467 * testsuite/Makefile.in: Regenerated.
468
1f98a074
AM
4692014-12-03 Alan Modra <amodra@gmail.com>
470
471 PR 17566
472 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
473 when adding dynamic relocations against section symbols.
474
fb257835
DI
4752014-12-01 Dimitry Ivanov <dimitry@google.com>
476
477 * layout.cc (Layout::finish_dynamic_section): When '-z global'
478 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
479 * options.h (General_options): New -z option (global).
480
d8e60314
CC
4812014-12-01 Cary Coutant <ccoutant@google.com>
482
483 PR gold/17578
484 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
485 is given.
486 (Layout::create_executable_stack_info): Warn when -z noexecstack is
487 given but some inputs require executable stack.
488
982bbd97
CC
4892014-11-26 Cary Coutant <ccoutant@google.com>
490
491 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
492 .debug_str_offsets; strip .debug_gnu_pubnames and
493 .debug_gnu_pubtypes.
494 (lines_only_debug_sections): Strip all four new sections.
495
bb779192
HS
4962014-11-26 Jing Yu <jingyu@google.com>
497
498 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
499 register to be x0 when to relax TLSDESC_LD64_LO12.
500
a3e60ddb
AM
5012014-11-26 Alan Modra <amodra@gmail.com>
502
503 * powerpc.cc (struct Stub_table_owner): New.
504 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
505 unsigned int vector. Update all references.
506 (powerpc_relobj::set_stub_table): Take an unsigned int param
507 rather than a Stub_table. Update callers.
508 (Powerpc_relobj::clear_stub_table): New function.
509 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
510 stub_group_size_ vars.
511 (Target_powerpc::new_stub_table): Delete.
512 (max_branch_delta): New function, extracted from..
513 (Target_powerpc::Relocate::relocate): ..here..
514 (Target_powerpc::Branch_info::make_stub): ..and here. Return
515 status on whether stub created successfully.
516 (Stub_control::Stub_control): Add "no_size_errors" param. Move
517 default sizing to..
518 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
519 reduce on relax failure.
520 (Target_powerpc::group_sections): Add "no_size_errors" param.
521 Use stub_group_size_. Set up group info in a temp vector,
522 before building Stub_table vector. Account for input sections
523 possibly already converted to relaxed sections.
524 (Stub_table::init): Delete. Merge into..
525 (Stub_table::Stub_table): ..here.
526 (Stub_table::can_reach_stub): New function.
527 (Stub_table::add_plt_call_entry): Add "from" parameter and
528 return true iff stub could be reached.
529 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
530 param too.
531 (Stub_table::clear_stubs): Add "all" param.
532
a20605cf
AM
5332014-11-26 Alan Modra <amodra@gmail.com>
534
535 * powerpc.cc (Stub_control::set_output_and_owner): New function.
536 (Target_powerpc::group_sections): Use it.
537
43b64deb
CC
5382014-11-25 Cary Coutant <ccoutant@google.com>
539
540 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
541 (Binary_to_elf::write_symbol): Add st_size parameter.
542 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
543
c924eb67
CC
5442014-11-25 Cary Coutant <ccoutant@google.com>
545
546 PR gold/17639
547 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
548 (Sized_relobj_file::do_layout): Handle deferred sections properly
549 during GC pass 1. Don't add reloc sections to deferred list twice.
550 * object.h (Sized_relobj_file::is_deferred_layout): New function.
551 (Sized_relobj_file::is_deferred_layout_): New data member.
552
9d585188
L
5532014-11-21 H.J. Lu <hongjiu.lu@intel.com>
554
555 PR gold/17619
556 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
557 Check PC-relative offset overflow in PLT entry.
558
3ffaac20
AM
5592014-11-21 Alan Modra <amodra@gmail.com>
560
561 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
562 for undefined weaks.
563
0cfb0717
AM
5642014-11-20 Alan Modra <amodra@gmail.com>
565
566 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
567 from --stub-group-size parameter divided by 1024.
568 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
569 template parameter. Update all uses.
570 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
571 has_stub_value. Set for long branches. Don't report overflow for
572 branch to undefined weak symbols. Print info message on
573 overflowing branch to stub.
574
f9dffbf0
AM
5752014-11-20 Alan Modra <amodra@gmail.com>
576
577 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
578
e88ba8d5
L
5792014-11-13 H.J. Lu <hongjiu.lu@intel.com>
580
581 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
582 entry for R_X86_64_GOTPLT64.
583 (Target_x86_64<size>::Relocate::relocate): Update comments for
584 R_X86_64_GOTPLT64.
585
d37ffe25
ED
5862014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
587
588 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
589 * plugin.h: add lock definition
590
9726c3c1
HS
5912014-10-29 Han Shen <shenhan@google.com>
592 Jing Yu <jingyu@google.com>
593
594 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
595 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
596 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
597 Symbol::TLS_REF.
598 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
599 method.
600 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
601 (Target_aarch64::tls_ld_to_le): New method.
602 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
603 for 64bit targets.
604 (Output_data_plt_aarch64::irelative_rel_): New data member.
605 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
606 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
607 (Output_data_plt_aarch64::add_relocation): New method.
608 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
609 offset. Add got_irelative size to got size.
610 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
611 type string with the new typename.
612 (AArch64_relocate_functions::update_adr): Replace parameter x with
613 immed.
614 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
615 (AArch64_relocate_functions::reloc_common): New method.
616 (AArch64_relocate_funcsions::rela_general): Extract common part out
617 into reloc_common method.
618 (AArch64_relocate_functions::rela_general): Likewise.
619 (AArch64_relocate_functions::pcrela_general): Likewise.
620 (AArch64_relocate_functions::adr): New method.
621 (AArch64_relocate_functions::adrp): Calculate immed before calling
622 update_adr.
623 (AArch64_relocate_functions::adrp): Likewise.
624 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
625 comparing x to 0. Calculate immed from ~x when x < 0.
626 (Target_aarch64::optimize_tls_reloc): Add new cases for
627 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
628 TLSLD_MOVW_DTPREL_G0_NC.
629 (Target_aarch64::possible_function_pointer_reloc): Implement this
630 method.
631 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
632 comment.
633 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
634 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
635 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
636 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
637 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
638 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
639 (Target_aarch64::make_plt_entry): Call add_entry with two more
640 parameters.
641 (Target_aarch64::make_local_ifunc_plt_entry): New method.
642 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
643 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
644 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
645 (Target_aarch64::Relocate::relocate_tls): Add cases for
646 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
647 TLSLD_MOVW_DTPREL_G0_NC.
648 * testsuite/icf_safe_so_test.cc: Correct test comment.
649 * testsuite/icf_safe_test.sh: Add AArch64 arch.
650
80272b8c
AM
6512014-10-22 Alan Modra <amodra@gmail.com>
652
653 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
654 thread_starter.
655
998a69f4
AS
6562014-10-18 Andreas Schwab <schwab@linux-m68k.org>
657
658 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
659
aed56ec5
CC
6602014-10-17 Cary Coutant <ccoutant@google.com>
661
662 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
663 Add "typename" keyword.
664
bb779192 6652014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
666 Jing Yu <jingyu@google.com>
667
668 Patch for gold aarch64 backend to support relaxation.
669 * aarch64-reloc.def: Change format.
670 * aarch64.cc (class Reloc_stub): New class.
671 (class Stub_table): New class.
672 (class AArch64_relobj): New class.
673 (class AArch64_input_section): New class.
674 (class AArch64_output_section): New class.
675 (Target_aarch64::new_stub_table): New method.
676 (Target_aarch64::new_aarch64_input_section): New method.
677 (Target_aarch64::find_aarch64_input_section): New method.
678 (Target_aarch64::scan_section_for_stubs): New method.
679 (Target_aarch64::scan_reloc_section_for_stubs): New method.
680 (Target_aarch64::relocate_stub): New method.
681 (Target_aarch64::current_target): New method.
682 (Target_aarch64::do_make_elf_object): New method.
683 (Target_aarch64::do_may_relax): New method.
684 (Target_aarch64::do_relax): New method.
685 (Target_aarch64::group_sections): New method.
686 (Target_aarch64::scan_reloc_for_stub): New method.
687 (Target_aarch64::do_make_output_section): New method.
688 (Target_aarch64::stub_tables_): New data member.
689 (Target_aarch64::aarch64_input_section_map_): New data member.
690 (AArch64_relocate_functions::maybe_apply_stub): New method.
691
db4c9594
CC
6922014-09-30 Cary Coutant <ccoutant@google.com>
693
694 PR gold/17432
695 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
696
cd6da036
KC
6972014-09-30 Kito Cheng <kito@0xlab.org>
698
699 PR gold/13597
700 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
701 hash table before sysv-style hash table.
702
5f772412
ST
7032014-09-29 Sriraman Tallam <tmsriram@google.com>
704
705 * options.h (--pic-executable): Add negative to alias to -no-pie.
706
5efeedf6
CC
7072014-09-26 Cary Coutant <ccoutant@google.com>
708
709 PR gold/16773
710 * object.cc (Sized_relobj_file): Compute value of section symbols
711 for TLS sections the same as TLS symbols.
712
1707f183
CC
7132014-09-25 Cary Coutant <ccoutant@google.com>
714
715 PR gold/17432
716 * resolve.cc (Symbol_table::resolve): Override common placeholder
717 symbols, but adjust sizes.
718 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
719 symbols to common lists.
720
00cac886
AM
7212014-09-24 Alan Modra <amodra@gmail.com>
722
723 * po/POTFILES.in: Regenerate.
724
635aa30e
CC
7252014-09-23 Taiju Tsuiki <tzik@google.com>
726 Cary Coutant <ccoutant@google.com>
727
71b9b91b 728 PR gold/14860
635aa30e
CC
729 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
730 on input_sections_blocker.
731 * layout.cc (Write_sections_task::locks): Unblock
732 input_sections_blocker_.
733 * layout.h (Write_sections_task::Write_sections_task): Add
734 input_sections_blocker.
735 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
736 to DEPENDENCIES.
737 * testsuite/Makefile.in: Regenerate.
738
c0c71592
RÁE
7392014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
740
741 * testsuite/Makefile.am (plugin_test_10): New test.
742 * testsuite/Makefile.in: Regenerate
743 * testsuite/plugin_common_test_2.c (c1): Align to 8.
744 * testsuite/plugin_test_10.sh: New file.
745
6168c2a1
RÁE
7462014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
747
748 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
749 * resolve.cc (Symbol_table::resolve): Don't override common symbols
750 during the replacement phase.
751
3a531937
JY
7522014-09-17 Han Shen <shenhan@google.com>
753 Jing Yu <jingyu@google.com>
754
755 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
756 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
757 * aarch64.cc (Target_aarch64): Add data members
758 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
759 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
760 constructor.
761 (Target_aarch64::do_reloc_symbol_index): New method.
762 (Target_aarch64::do_reloc_addend): New method.
763 (Target_aarch64::add_tlsdesc_info): New method.
764 (Target_aarch64::do_dynsym_value): New method.
765 (Target_aarch64::do_make_data_plt): Add new parameters: got,
766 got_irelative. Pass them to Output_data_plt_aarch64_standard.
767 (Target_aarch64::make_data_plt): Add new parameters: got,
768 got_irelative. Pass them to do_make_data_plt.
769 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
770 (Target_aarch64::Relocate:tls_gd_to_le): New method.
771 (Target_aarch64::Relocate:tls_ie_to_le): New method.
772 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
773 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
774 (Target_aarch64::got_tlsdesc_section): New method.
775 (Target_aarch64::make_local_ifunc_plt_entry): New method.
776 (Target_aarch64::define_tls_base_symbol): New method.
777 (Target_aarch64::reserve_tlsdesc_entries): New method.
778 (Target_aarch64::got_mod_index_entry): New method.
779 (Target_aarch64::rela_tlsdesc_section): New method.
780 (Target_aarch64::rela_irelative_section): New method.
781 (Target_aarch64::Tlsdesc_info): New struct.
782 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
783 relocations and tlsdesc relocations.
784 (Target_aarch64::optimize_tls_reloc): Implement method.
785 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
786 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
787 in constructor.
788 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
789 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
790 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
791 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
792 (Output_data_plt_aarch64::rela_tlsdesc): New method.
793 (Output_data_plt_aarch64::rela_irelative): New method.
794 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
795 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
796 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
797 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
798 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
799 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
800 (Output_data_plt_aarch64_standard): New member variables:
801 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
802 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
803 New parameter: got, got_irelative.
804 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
805 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
806 (Output_data_plt_aarch64::do_write): Replace got_address with
807 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
808 (AArch64_relocate_functions::update_movnz): New method.
809 (AArch64_relocate_functions): Correct format.
810 (AArch64_relocate_functions::movnz): New method.
811 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
812 before the switch. Add new cases to switch.
00cac886 813 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
814 tlsgd tlsdesc cases.
815 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
816 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
817 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
818 Call reloc_name_in_error_message to print unsupported reloc.
819 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
820 make_data_plt.
821 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
822 relocs. Fill in some more dynamic tags.
823 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
824 Skip call tls_get_addr when tlsgd is relaxed.
825 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
826 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
827 tlsdesc->ie relaxation.
828
62661c93
SS
8292014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
830
831 * mips.cc (Target_mips_nacl): New class.
832 (Target_selector_mips_nacl): New class.
833 (target_selector_mips32): Rename from target_selector_mips32be and use
834 Target_selector_mips_nacl instead of Target_selector_mips.
835 (target_selector_mips32el): Rename from target_selector_mips32 and use
836 Target_selector_mips_nacl instead of Target_selector_mips.
837 (target_selector_mips64): Rename from target_selector_mips64be and use
838 Target_selector_mips_nacl instead of Target_selector_mips.
839 (target_selector_mips64el): Rename from target_selector_mips64 and use
840 Target_selector_mips_nacl instead of Target_selector_mips.
841 (Target_mips::mips_info): Add const attribute.
842
54674d38
CC
8432014-09-02 Cary Coutant <ccoutant@google.com>
844
845 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
846 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
847 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
848 (Sized_incr_dynobj::do_section_name): Likewise.
849 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
850 (Sized_incr_dynobj::do_section_name): Likewise.
851 * object.h (Object::section_name): Likewise.
852 (Object::do_section_name): Likewise.
853 (Sized_relobj_file::do_section_name): Likewise.
854 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
855 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
856
9860cbcf
CC
8572014-09-02 Cary Coutant <ccoutant@google.com>
858
859 PR gold/17005
860 * ehframe.cc (Fde::write): Add output_offset parameter.
861 (Cie::write): Likewise.
862 (Eh_frame::set_final_data_size): Account for offset within output
863 section.
864 (Eh_frame::do_sized_write): Likewise.
865 * ehframe.h (Fde::write): Add output_offset parameter.
866 (Cie::write): Likewise.
867 * output.cc (Output_section::Input_section_sort_entry): Remove
868 section_has_name_; add output_section_name parameter. Use
869 output section name for non-input sections.
870 (Output_section::Input_section_sort_entry::section_has_name): Remove.
871 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
872 (Output_section::Input_section_sort_compare): Remove logic for
873 sections without names.
874 (Output_section::Input_section_sort_init_fini_compare): Likewise.
875 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
876 Likewise.
877 (Output_section::Input_section_sort_section_name_compare): Likewise.
878
8e33481e
HS
8792014-08-29 Han Shen <shenhan@google.com>
880 Jing Yu <jingyu@google.com>
881
882 * aarch64-reloc-property.cc
883 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
884 reference reloc property in the table.
885 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
886 3 other entries.
887 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
888 2 new overloaded methods.
889 (Output_data_got_aarch64::do_write): Add code to write out
890 static relocs.
891 (class Output_data_got_aarch64::Static_reloc): New class to wrap
892 static relocs.
893 (Output_data_got_aarch64::static_relocs): New vector to
894 hold static relocs.
895 (Target_aarch64::TCB_SIZE): New const static memeber.
896 (Target_aarch64::tcb_size): New method.
897 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
898 (Target_aarch64::Relocate::relocate_tls): New method.
899 (Target_aarch64::Scan::local): Add code handling new reloc types.
900 (Target_aarch64::Scan::global): Add code handling new reloc types.
901
81233653
ST
9022014-08-13 Sriraman Tallam <tmsriram@google.com>
903
904 * options.h (-no-pie): Add option.
905
9363c7c3
JY
9062014-08-08 Jing Yu <jingyu@google.com>
907 Han Shen <shenhan@google.com>
908
909 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
910 (DEFFILES): add aarch64-reloc.def.
911 (TARGETSOURCES): Add aarch64-reloc-property.cc.
912 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
913 * Makefile.in: Regenerate.
914 * aarch64-reloc-property.cc: New file.
915 * aarch64-reloc-property.h: New file.
916 * aarch64-reloc.def: New file.
917 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
918 with tab to make the format consistent.
919 (Output_data_got_aarch64::symbol_table_): New method.
920 (Target_aarch64::do_plt_address_for_global): New method.
921 (Target_aarch64::do_plt_address_for_local): New method.
922 (Target_aarch64::do_select_as_default_target): New method.
923 (Target_aarch64::do_make_data_plt): New method.
924 (Target_aarch64::make_data_plt): New method.
925 (Output_data_plt_aarch64::has_irelative_section): New method.
926 (Output_data_plt_aarch64::address_for_global): New method.
927 (Output_data_plt_aarch64::address_for_local): New method.
928 (Output_data_plt_aarch64::irelative_rel_): New parameter.
929 (Output_data_plt_aarch64::add_entry): Implement contents.
930 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
931 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
932 the got_pov entry to plt0.
933 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
934 Implement contents.
935 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
936 (AArch64_howto): New struct.
937 (aarch64_howto[]): New static const array.
938 (AArch64_relocate_functions): New class.
939 (Target_aarch64::Scan::get_reference_flags): Remove method.
940 (Target_aarch64::Scan::local): Implement to support a few relocations.
941 (Target_aarch64::Scan::global): Implement to support a few relocations.
942 (Target_aarch64::make_plt_section): Implement contents.
943 (Target_aarch64::make_plt_entry): Implement contents.
944 (Target_aarch64::do_finalize_sections): Implement contents.
945 (Target_aarch64::Relocate::relocate): Implement a few relocations.
946 (Target_aarch64::relocate_section): Implement contents.
947
ad9fe6c1
AM
9482014-08-06 Alan Modra <amodra@gmail.com>
949
950 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
951
7cd4e5b7
AM
9522014-08-06 Alan Modra <amodra@gmail.com>
953
954 PR 13227
955 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
956
5ad9b0a7
ST
9572014-07-21 Sriraman Tallam <tmsriram@google.com>
958
959 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 960 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 961
e051745c
CC
9622014-07-08 Cary Coutant <ccoutant@google.com>
963
964 * expression.cc (struct Expression::Expression_eval_info): Add
965 new fields type_pointer, vis_pointer, and nonvis_pointer.
966 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
967 nonvis_pointer parameters. Adjust all calls.
968 (Symbol_expression::value): Update type, visibility, and nonvis bits
969 in caller.
970 * script.cc (Symbol_assignment::sized_finalize): Update type,
971 visibility, and remaining st_other bits for new symbol.
972 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
973 vis_pointer, and nonvis_pointer parameters.
974 * symtab.h (Symbol::set_type): New method.
975
976 * testsuite/Makefile.am (defsym_test): New test.
977 * testsuite/Makefile.in: Regenerate.
978 * testsuite/defsym_test.c: New file.
979 * testsuite/defsym_test.sh: New file.
980
f35c4853
CC
9812014-07-08 Cary Coutant <ccoutant@google.com>
982
983 PR gold/15639
984 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
985 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
986 (Sized_dynobj::base_read_symbols): ...new method.
987 * object.h (Sized_relobj_file::base_read_symbols): New method.
988 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
989 (Sized_relobj_file::base_read_symbols): ...new method.
990 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
991 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
992 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
993
2900af2d
AM
9942014-07-04 Alan Modra <amodra@gmail.com>
995
996 * po/POTFILES.in: Regenerate.
997
053a4d68
JY
9982014-07-02 Jing Yu <jingyu@google.com>
999
1000 * aarch64.cc: New file
1001 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1002 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1003 * Makefile.in: Regenerate.
1004 * configure.tgt: Add entries for aarch64*.
1005 * configure.ac: Likewise.
1006 * configure: Likewise.
1007
7b549045
AM
10082014-06-27 Alan Modra <amodra@gmail.com>
1009
1010 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1011
cb818dbf
CC
10122014-06-24 Cary Coutant <ccoutant@google.com>
1013
1014 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1015 sections.
1016 (Dwo_file::sized_read_unit_index): Likewise.
1017
9810d34d
SS
10182014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1019
1020 * mips.cc: New file.
1021 * Makefile.am (TARGETSOURCES): Add mips.cc
1022 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1023 * configure.tgt: Add entries for mips*.
1024 * configure.ac: Likewise.
1025 * Makefile.in: Regenerate.
1026 * configure: Likewise.
1027
9baa787b
CC
10282014-06-09 Cary Coutant <ccoutant@google.com>
1029
1030 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1031 unit_length is within section bounds.
1032
8f89af0a
CC
10332014-06-09 Cary Coutant <ccoutant@google.com>
1034
1035 PR gold/16980
1036 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1037 map.
1038
a47622ac
AM
10392014-06-07 Alan Modra <amodra@gmail.com>
1040
1041 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1042
4320c691
CC
10432014-06-06 Cary Coutant <ccoutant@google.com>
1044
1045 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1046 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1047 (Dwarf_pubnames_table::read_header): Likewise.
1048 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1049 .debug_gnu_pubtypes.
1050
270c9937
JB
10512014-06-05 Joel Brobecker <brobecker@adacore.com>
1052
1053 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1054 * Makefile.in, configure: Regenerate.
1055
397998fc
AM
10562014-06-03 Alan Modra <amodra@gmail.com>
1057
1058 * powerpc.cc (addis_12_2): Define.
1059 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1060
61f5c66f
AM
10612014-06-03 Alan Modra <amodra@gmail.com>
1062
1063 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1064 st_other output.
1065
f6971787
AM
10662014-06-02 Alan Modra <amodra@gmail.com>
1067
1068 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1069 Only ignore relocs on ELFv1.
1070 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1071
f6fb8322
CC
10722014-05-30 Cary Coutant <ccoutant@google.com>
1073
1074 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1075 * testsuite/Makefile.in: Regenerate.
1076 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1077
c23dd342
L
10782014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1079
1080 PR gold/16945
1081 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1082 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1083
5fe7ffdc
AM
10842014-05-15 Alan Modra <amodra@gmail.com>
1085
1086 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1087 Compare FDE contents with DW_CFA_nop rather than 0.
1088
a82bef93
ST
10892014-05-13 Sriraman Tallam <tmsriram@google.com>
1090
1091 * symtab.h (may_need_copy_reloc): Remove check for position independent
1092 code.
1093 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1094 position independence before pc absolute may_need_copy_reloc call.
1095 Add check for executable output befor pc relative may_need_copy_reloc
1096 call.
1097 * i386.cc: Ditto.
1098 * arm.cc: Ditto.
1099 * sparc.cc: Ditto.
1100 * tilegx.cc: Ditto.
1101 * powerpc.cc: Add check for no position independence before
1102 may_need_copy_reloc calls.
1103 * testsuite/pie_copyrelocs_test.cc: New file.
1104 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1105 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1106 * Makefile.in: Regenerate.
a82bef93 1107
53c66605
ML
11082014-05-08 Martin Liška <mliska@suse.cz>
1109
1110 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1111
57b2284c
CC
11122014-05-06 Cary Coutant <ccoutant@google.com>
1113
1114 PR gold/16900
1115 * i386.cc (Output_data_got_plt_i386): New class.
1116 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1117 parameter. Change all callers.
1118 (Output_data_plt_i386::layout_): Remove.
1119 (Output_data_plt_i386::got_plt_): Change type.
1120 (Target_i386::got_plt_): Change type. Change all references.
1121 (Target_i386::got_section): Create instance of new class.
1122 (Output_data_got_plt_i386::do_write): New function.
1123 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1124 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1125 parameter. Change all callers.
1126 (Output_data_plt_x86_64::layout_): Remove.
1127 (Output_data_plt_x86_64::got_plt_): Change type.
1128 (Target_x86_64::got_plt_): Change type. Change all references.
1129 (Target_x86_64::got_section): Create instance of new class.
1130 (Output_data_got_plt_x86_64::do_write): New function.
1131 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1132 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1133 class.
1134
6b97515d 11352014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1136
6b97515d
CC
1137 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1138 if we have pubnames/pubtypes.
1139
d1bddd3c
CC
11402014-05-02 Cary Coutant <ccoutant@google.com>
1141
5fe7ffdc
AM
1142 * defstd.cc (in_segment): Define __ehdr_start here...
1143 * layout.cc (Layout::finalize): ...Instead of here. Set the
1144 output segment when known.
1145 * resolve.cc (Symbol::override_base_with_special): Remember
1146 the original binding.
1147 * symtab.cc (Symbol::set_output_segment): New function.
1148 (Symbol::set_undefined): New function.
1149 * symtab.h (Symbol::is_weak_undefined): Check original undef
1150 binding.
1151 (Symbol::is_strong_undefined): New function.
1152 (Symbol::set_output_segment): New function.
1153 (Symbol::set_undefined): New function.
1154 * target-reloc.h (is_strong_undefined): Remove.
1155 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1156 Check for hidden undefs.
1157 (relocate_section): Call Symbol::is_strong_undefined.
1158
1159 * testsuite/Makefile.am (ehdr_start_test_1)
1160 (ehdr_start_test_2, ehdr_start_test_3)
1161 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1162 * testsuite/Makefile.in: Regenerate.
1163 * testsuite/ehdr_start_def.cc: New source file.
1164 * testsuite/ehdr_start_test.cc: New source file.
1165 * testsuite/ehdr_start_test.t: New linker script.
1166 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1167
7849f6d8
CC
11682014-04-23 Cary Coutant <ccoutant@google.com>
1169
bf2cc635 1170 PR gold/16870
7849f6d8
CC
1171 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1172
99fd8cff
CC
11732014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1174
1175 * layout.cc (Layout::include_section): Allow a target to decide
1176 whether to include a section.
1177 * target.h (Target::should_include_section): New function.
1178 (Target::do_should_include_section): New function.
1179
91f43acd
CC
11802014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1181
1182 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1183 inline into ...
1184 (Copy_relocs::emit): ... here.
1185 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1186 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1187 (Copy_reloc_entry::entries_): Change from private to protected.
1188
c4eb27e1
ST
11892014-04-02 Sriraman Tallam <tmsriram@google.com>
1190
1191 * icf.cc (get_section_contents): Replace copies of reloc
1192 vectors with const references.
1193
ae447ddd
CC
11942014-04-02 Cary Coutant <ccoutant@google.com>
1195
1196 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1197 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1198 * configure: Regenerate.
1199 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1200 -fno-use-linker-plugin.
1201 (LINK1, CXXLINK1): Add it to the link command.
1202 * testsuite/Makefile.in: Regenerate.
1203
fa47fa92
AM
12042014-03-12 Alan Modra <amodra@gmail.com>
1205
1206 * Makefile.in: Regenerate.
1207
9b12c500
CC
12082014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1209
1210 * symtab.h (Symbol::set_nonvis): New function.
1211
beacaa96
CC
12122014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1213
1214 * symtab.cc (Sized_symbol<32>::init_output_data):
1215 Instantiate the template.
1216 (Sized_symbol<64>::init_output_data): Likewise.
1217
800d9823
CC
12182014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1219
1220 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1221 adjust dynamic symbol value.
1222 * target.h (Target::adjust_dyn_symbol): New function.
1223 (Target::do_adjust_dyn_symbol): New function.
1224
918fc1f8 12252014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1226
918fc1f8
CC
1227 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1228 Get the value of DYNAMIC_CUSTOM dynamic entry.
1229 * output.h (Output_data_dynamic::add_custom): New function.
1230 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1231 dynamic entry.
1232 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1233 * target.h (Target::dynamic_tag_custom_value): New function.
1234 (Target::do_dynamic_tag_custom_value): New function.
1235
98ff9231
CC
12362014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1237
1238 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1239 dynsym indexes.
1240 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1241 (Target::do_has_custom_set_dynsym_indexes): New function.
1242 (Target::set_dynsym_indexes): New function.
1243 (Target::do_set_dynsym_indexes): New function.
1244
b80eed39
AM
12452014-03-07 Alan Modra <amodra@gmail.com>
1246
1247 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1248 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1249 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1250 (Powerpc_relocate_functions::has_overflow_bitfield,
1251 overflowed): Use the above.
1252 (Target_powerpc::Relocate::relocate): Correct overflow checking
1253 for a number of relocations. Modify overflow test for 16-bit
1254 fields in instructions to signed/unsigned according to whether
1255 the field takes a signed or unsigned value.
1256
4b95cf5c
AM
12572014-03-05 Alan Modra <amodra@gmail.com>
1258
1259 Update copyright years.
1260
45965137
AM
12612014-03-05 Alan Modra <amodra@gmail.com>
1262
1263 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1264 R_PPC64_ADDR64_LOCAL.
1265 (Target_powerpc::Relocate::relocate): Likewise.
1266
2c80b753
AM
12672014-03-03 Alan Modra <amodra@gmail.com>
1268
1269 * dwp.cc (print_version): Update copyright year to current.
1270
c1c69e83
AM
12712014-02-10 Alan Modra <amodra@gmail.com>
1272
1273 * po/gold.pot: Regenerate.
1274
dd0c4e70
CC
12752014-02-06 Cary Coutant <ccoutant@google.com>
1276
1277 Fix problem where -u is ignored when a weak undef is seen.
1278
1279 * archive.cc (Library_base::should_include_member): Reorder
1280 code to check for -u option if a weak undef has already been seen.
1281 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1282 * testsuite/Makefile.in: Regenerate.
1283 * testsuite/weak_undef_file3.cc: New file.
1284 * testsuite/weak_undef_file4.cc: New file.
1285 * testsuite/weak_undef_test_2.cc: New file.
1286
1a221d3d
CC
12872014-02-05 Cary Coutant <ccoutant@google.com>
1288
1289 Fix issues with gold undefined symbol diagnostics.
1290
1291 PR binutils/15435
1292 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1293 check to here.
1294 * target-reloc.h (is_strong_undefined): New function.
1295 (relocate_section): Move undef vtable symbol check from here.
1296 Check for is_strong_undefined.
1297
e889f0a4 12982014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1299
e889f0a4
CC
1300 Fix problems with the --dynamic-list option.
1301
1302 PR gold/13577
1303 * options.cc (General_options::parse_dynamic_list):
1304 Set have_dynamic_list_.
1305 (General_options::General_options): Initialize have_dynamic_list_.
1306 (General_options::finalize): Turn off -Bsymbolic and
1307 -Bsymbolic-functions if --dynamic-list provided.
1308 * options.h (General_options::have_dynamic_list): New function.
1309 (General_options::have_dynamic_list_): New data member.
1310 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1311 correctly.
5fe7ffdc 1312
e889f0a4
CC
1313 PR gold/16530
1314 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1315 in --dynamic-list, mark it.
5fe7ffdc 1316
e889f0a4
CC
1317 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1318 (dynamic_list_2): New test case.
1319 * testsuite/Makefile.in: Regenerate.
1320 * testsuite/dynamic_list_2.cc: New file.
1321 * testsuite/dynamic_list_2.t: New file.
1322 * testsuite/dynamic_list_lib1.cc: New file.
1323 * testsuite/dynamic_list_lib2.cc: New file.
1324 * testsuite/gc_dynamic_list_test.c: New file.
1325 * testsuite/gc_dynamic_list_test.sh: New file.
1326 * testsuite/gc_dynamic_list_test.t: New file.
1327
ec673e64
CC
13282014-01-28 Cary Coutant <ccoutant@google.com>
1329
1330 Add .gdb_index version 7 support.
1331
1332 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1333 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1334 debug sections.
1335 (Dwarf_ranges_table::read_ranges_table): Likewise.
1336 (Dwarf_pubnames_table::read_section): Check for GNU-style
1337 sections, and for compressed debug sections.
1338 (Dwarf_pubnames_table::read_header): Compute end address of table.
1339 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1340 for end of list by offset, not by offset == 0.
1341 (Dwarf_info_reader::do_read_string_table): Check for compressed
1342 debug sections.
1343 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1344 Initialize new data members.
1345 (Dwarf_pubnames_table::next_name): return flag_byte.
1346 (Dwarf_pubnames_table::end_of_table_): New data member.
1347 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1348 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1349 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1350 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1351 read skeleton type unit DIEs.
1352 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1353 (Gdb_index::do_write): Write flag_byte.
1354 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1355 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1356 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1357 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1358
221fd5d5
L
13592014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1360
1361 * version.cc (print_version): Update copyright year to 2014.
1362
6c09fb0b
ILT
13632013-12-19 Dimitry Andric <dimitry@andric.com>
1364
1365 * stringpool.cc (Stringpool_template::reserve): Add
1366 HAVE_UNORDERED_MAP case.
1367 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1368
8356f2d0
CC
13692013-12-18 Cary Coutant <ccoutant@google.com>
1370
1371 * configure.ac: Check for <unordered_set> and <unordered_map>.
1372 * config.in: Regenerate.
1373 * configure: Regenerate.
1374 * system.h: Use <unordered_set> and <unordered_map> if available.
1375
f2c7d7ee
RM
13762013-12-10 Roland McGrath <mcgrathr@google.com>
1377
1378 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1379 with $(INSTALL_PROGRAM_ENV).
1380 * Makefile.in: Regenerate.
1381
6632e8cc
CC
13822013-11-22 Cary Coutant <ccoutant@google.com>
1383
1384 * configure.ac: Add check for which library is needed for
1385 dlopen.
1386 * configure: Regenerate.
1387
0c075858
CC
13882013-11-22 Cary Coutant <ccoutant@google.com>
1389
1390 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1391 assembler.
1392 * testsuite/Makefile.in: Regenerate.
1393
f49fe902
L
13942013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1395
1396 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1397 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1398 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1399 (Target_x86_64<size>::Scan::local): Likewise.
1400 (Target_x86_64<size>::Scan::global): Likewise.
1401 (Target_x86_64<size>::Relocate::relocate): Likewise.
1402 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1403 Likewise.
1404 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1405 R_X86_64_PC32_BND.
1406
1407 * testsuite/Makefile.am (check_PROGRAMS): Add
1408 exception_x86_64_bnd_test.
1409 (exception_x86_64_bnd_test_SOURCES): New macro.
1410 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1411 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1412 (exception_x86_64_bnd_test_LDADD): Likewise.
1413 (exception_x86_64_bnd_1.o): New rule.
1414 (exception_x86_64_bnd_2.o): Likewise.
1415 * testsuite/Makefile.in: Regenerated.
1416
9055360d
AM
14172013-11-15 Alan Modra <amodra@gmail.com>
1418
1419 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1420 accessor.
1421 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1422 Only call ppc64_local_entry_offset for 64-bit. Restrict
1423 symval_for_branch lookup to ELFv1.
1424 (Stub_table::add_plt_call_entry): Use unsigned int off.
1425 (Output_data_glink::Address, invalid_address): New.
1426 (Output_data_glink::add_eh_frame): Move out of line. Add
1427 support for ELFv2.
1428 (Output_data_glink::add_global_entry, find_global_entry,
1429 global_entry_address): New functions.
1430 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1431 ge_size): New variables.
1432 (Output_data_glink::set_final_data_size): Add global entry
1433 stub sizing.
1434 (Output_data_glink::do_write): Write global entry stubs.
1435 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1436 parameter. Return true for ELFv2. Adjust callers.
1437 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1438 ELFv1. Similarly for ifunc and dynamic relocation processing
1439 specific to ELFv1. Recognize that symbols are defined on
1440 their plt entries for ELFv2.
1441 (Target_powerpc::symval_for_branch): Assert if called for
1442 ELFv2 or ppc32.
1443 (Target_powerpc::Relocate::relocate): Use global entry plt
1444 stub for symbol value if such exists on ELFv2.
1445 (Target_powerpc::Relocate::relocate): Don't call
1446 symval_for_branch when ELFv2. Do adjust for local entry
1447 offset when ELFv2.
1448 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1449 plt stub for ELFv2.
1450 (Target_powerpc::do_plt_address_for_global): Similarly.
1451
cafdd569
CC
14522013-11-14 Cary Coutant <ccoutant@google.com>
1453
1454 Revert patch -- this did not fix the problem, and there is
1455 no race there.
1456
1457 2013-11-14 Cary Coutant <ccoutant@google.com>
1458
1459 PR gold/14860
1460 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1461 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1462 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1463 updating fde_offsets_.
1464 (Eh_frame_hdr::lock_): New data member.
1465
94e49e16
CC
14662013-11-14 Cary Coutant <ccoutant@google.com>
1467
1468 * dwp.cc (Dwo_file_entry): New type.
1469 (File_list): Use Dwo_file_entry.
1470 (Dwo_file::verify): New function.
1471 (Dwo_file::verify_dwo_list): New function.
1472 (Dwo_file::sized_verify_dwo_list): New function.
1473 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1474 list.
1475 (Dwp_options): New enum type.
1476 (dwp_options): Add --verify-only.
1477 (usage): Likewise.
1478 (main): Likewise.
1479 * dwp.h (gold_info): Add declaration.
1480
7cdd7d57
CC
14812013-11-14 Cary Coutant <ccoutant@google.com>
1482
1483 PR gold/14860
1484 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1485 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1486 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1487 updating fde_offsets_.
1488 (Eh_frame_hdr::lock_): New data member.
1489
1d946cb3
CC
14902013-11-06 Cary Coutant <ccoutant@google.com>
1491
1492 PR gold/15758
1493 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1494 before reloc sections.
1495
4f65b40e
AM
14962013-11-04 Alan Modra <amodra@gmail.com>
1497
1498 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1499 (Symbol::needs_dynamic_reloc): Test new flag.
1500 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1501 (Target_powerpc::Scan::get_reference_flags): Add target param.
1502 Return FUNC_DESC_ABI for 64-bit ELFv1.
1503 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1504 call.
1505 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1506 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1507
908794a9
CC
15082013-10-31 Cary Coutant <ccoutant@google.com>
1509
1510 Restore support for dwp v2 DWARF package file format.
1511
1512 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1513 tu_length parameter. Adjust all callers.
1514 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1515 * dwp.cc: Include dwarf.h.
1516 (Section_bounds): New struct type.
1517 (Unit_set): New struct type.
1518 (Dwo_file::Dwo_file): Initialize new data member.
1519 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1520 Combine and rename to...
1521 (Dwo_file::read_unit_index): ...this.
1522 (Dwo_file::sized_read_compunit_index)
1523 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1524 (Dwo_file::sized_read_unit_index): ...this.
1525 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1526 parameters; add section_id parameter.
1527 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1528 (Dwo_file::add_unit_set): ...this.
1529 (Dwo_file::shndx_map_): Remove.
1530 (Dwo_file::sect_offsets_): New data member.
1531 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1532 (Dwp_output_file::add_section): Rename to...
1533 (Dwp_output_file::add_contribution): ...this.
1534 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1535 (Dwp_output_file::add_tu_set): Likewise.
1536 (Dwp_output_file::Contribution): New type.
1537 (Dwp_output_file::Section::contributions): New data member.
1538 (Dwp_output_file::Cu_or_tu_set): Remove.
1539 (Dwp_output_file::Section::Section): New ctor.
1540 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1541 (Dwp_output_file::Dwp_index::Section_table): New type.
1542 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1543 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1544 parameter.
1545 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1546 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1547 (Dwp_output_file::Dwp_index::section_table): New member function.
1548 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1549 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1550 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1551 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1552 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1553 (Dwp_output_file::Dwp_index::section_table_): New data member.
1554 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1555 (Dwp_output_file::add_output_section): New member function.
1556 (Dwp_output_file::write_new_section): New member function.
1557 (Dwp_output_file::write_contributions): New member function.
1558 (Dwp_output_file::section_id_map_): New data member.
1559 (class Dwo_id_info_reader): Remove.
1560 (class Unit_reader): New class.
1561 (get_dwarf_section_name): New function.
1562 (Dwo_file::read_executable): Adjust initializations of class data.
1563 (Dwo_file::read): Add support for v2 package file format.
1564 (Dwo_file::read_unit_index): Likewise.
1565 (Dwo_file::sized_read_unit_index): Likewise.
1566 (Dwo_file::copy_section): Likewise.
1567 (Dwo_file::add_unit_set): Likewise.
1568 (Dwp_output_file::add_output_section): Likewise.
1569 (Dwp_output_file::add_contribution): Likewise.
1570 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1571 for empty slot.
1572 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1573 file format.
1574 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1575 slot.
1576 (Dwp_output_file::initialize): Remove unused function.
1577 (Dwp_output_file::finalize): Add support for v2 package file format.
1578 (Dwp_output_file::write_index): Likewise.
1579 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1580 function prototype.
1581
2500c017
CC
15822013-10-31 Cary Coutant <ccoutant@google.com>
1583
1584 * configure.ac: Fix check for -fmerge-constants.
1585 * configure.ac: Regenerate.
1586
dd0845d7
RM
15872013-10-30 Roland McGrath <mcgrathr@google.com>
1588
1589 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1590 Correct 9-byte nop sequence to match what the assembler generates.
1591
b4f7960d
AM
15922013-10-30 Alan Modra <amodra@gmail.com>
1593
1594 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1595 ppc64_local_entry_offset, ppc64_local_entry_offset,
1596 do_read_symbols): New functions.
1597 (Powerpc_relobj::e_flags_, st_other_): New vars.
1598 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1599 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1600 (Powerpc_relobj::e_flags_): New var.
1601 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1602 and adjust for ELFv2.
1603 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1604 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1605 (Powerpc_dynobj::do_find_special_sections): Likewise.
1606 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1607 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1608 to ELFv2 local entry.
1609 (Target_powerpc::do_relax): No thread safe barriers needed for
1610 ELFv2.
1611 (Output_data_plt_powerpc::initial_plt_entry_size_,
1612 plt_entry_size): Delete. Replace all uses with
1613 first_plt_entry_offset() and plt_entry_size().
1614 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1615 reserved_size parm. Update callers.
1616 (Output_data_plt_powerpc::entry_count): Update.
1617 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1618 and use Target_powerpc::first_plt_entry_offset().
1619 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1620 rename to plt_entry_size.
1621 (Output_data_plt_powerpc::add_ifunc_entry,
1622 add_local_ifunc_entry): Adjust reloc for ELFv2.
1623 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1624 (glink_eh_frame_fde_64v2): New.
1625 (Stub_table::plt_call_size): Support ELFv2 sizing.
1626 (Output_data_glink::add_eh_frame): Use the new FDE.
1627 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1628 (Stub_table::do_write): Write ELFv2 stubs and glink.
1629 (Target_powerpc::Relocate::relocate): Replaces nop after call
1630 with ld 2,24(1) and adjust local offset destination for ELFv2.
1631
f9c6b907
AM
16322013-10-30 Alan Modra <amodra@gmail.com>
1633
1634 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1635 (Target_powerpc::Scan::global, local): Likewise.
1636 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1637 on all ppc64 @h and @ha relocs.
1638
e84fe78f
AM
16392013-10-14 Alan Modra <amodra@gmail.com>
1640
1641 * output.h (Output_data_got::add_constant): Tidy.
1642 (Output_data_got::add_constant_pair): New function.
1643 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1644 methods used so as to first call reserve_ent().
1645
679e4abf
RM
16462013-10-11 Roland McGrath <mcgrathr@google.com>
1647
44dcb735
RM
1648 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1649 add_got_entry and add_got_entry_pair.
1650
13323c49
RM
1651 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1652 (HAVE_PUBNAMES): Likewise.
1653 * configure: Regenerate.
1654
1496b446
RM
1655 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1656 * testsuite/Makefile.in: Regenerate.
1657
cc84c10b
RM
1658 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1659 Remove const from declaration.
1660 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1661 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1662 * output.h (Output_file_header): Remove const from member target_
1663 and corresponding constructor argument.
1664 * output.cc (Output_file_header::Output_file_header): Update prototype.
1665 (Output_file_header::do_sized_write): Use this->target_ in place
1666 of parameters()->target().
1667
52f66a2c
RM
1668 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1669
2b64b551
RM
1670 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1671 * configure: Regenerate.
1672 * Makefile.in: Regenerate.
1673 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1674 * testsuite/merge_string_literals_2.c: Likewise.
1675 * testsuite/Makefile.am
1676 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1677 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1678 literal -fmerge-constants.
1679 * testsuite/Makefile.in: Regenerate.
1680
43819297
RM
1681 * i386.cc (Target_i386): Remove unused member dynbss_.
1682 * arm.cc (Target_arm): Likewise.
1683 * powerpc.cc (Target_powerpc): Likewise.
1684 * sparc.cc (Target_sparc): Likewise.
1685 * tilegx.cc (Target_tilegx): Likewise.
1686 * x86_64.cc (Target_x86_64): Likewise.
1687 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1688 type_signature_, type_offset_.
1689 * plugin.h (Plugin_hook): Remove unused member layout_.
1690 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1691 mapfile_.
1692 (Read_member): Remove unused members input_objects_, symtab_,
1693 mapfile_, layout_.
1694 (Check_library): Remove unused member symtab_.
1695 * archive.h (Lib_group): Remove unused member lib_.
1696 * archive.cc (Lib_group::Lib_group): Update initializer.
1697 * incremental.h (Incremental_binary): Remove unused member target_.
1698 (Incremental_script_entry): Removed unused member script_.
1699 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1700 * icf.h (Icf): Remove unused member num_tracked_relocs.
1701
39d9ead7
RM
1702 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1703 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1704 its only use.
1705 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1706
679e4abf
RM
1707 * archive.h: Use struct rather than class for forward declaration
1708 of Read_symbols_data.
1709
54de2ea6
CC
17102013-10-07 Cary Coutant <ccoutant@google.com>
1711
1712 PR gold/16010
1713 * testsuite/Makefile.am (icf_test): Fix dependencies.
1714 (icf_safe_test): Likewise.
1715 (icf_safe_so_test): Likewise.
1716 (large_symbol_alignment): Add empty _LDADD rule.
1717 * testsuite/Makefile.in: Regenerate.
1718
b14016f0
L
17192013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1720
1721 PR gold/15927
1722 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1723 relocation for R_X86_64_32 on x32.
1724
eb426534
RM
17252013-08-27 Roland McGrath <mcgrathr@google.com>
1726
1727 * output.cc (Output_segment::set_section_addresses): Take new
1728 Target* argument. If target->isolate_execinstr() and the segment
1729 is executable and starts at a target->abi_pagesize() boundary,
1730 pad its end out to a target->abi_pagesize() boundary with code fill.
1731 * output.h (Output_segment::set_section_addresses): Update decl.
1732 * layout.h (Layout::check_output_data_for_reset_values): Take new
1733 argument RELAX_OUTPUTS.
1734 (Layout): New member relax_output_list_.
1735 (Layout::add_relax_output): New method.
1736 * layout.cc (Layout::Layout): Update constructor.
1737 (Layout::reset_relax_output): New method.
1738 (Layout::clean_up_after_relaxation): Call it.
1739 (Layout::prepare_for_relaxation): Update caller.
1740 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1741 Call reset_relax_output before re-processing segments for
1742 isolate_execinstr case.
1743 (Layout::write_data): Handle relax_output_list_.
1744 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1745 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1746
9aff4b7a
NC
17472013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1748
1749 PR binutils/15834
1750 * object.h: Fix typos.
1751
93f8221c
RM
17522013-08-16 Roland McGrath <mcgrathr@google.com>
1753
1754 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1755 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1756
e44c3715
CC
17572013-08-07 Cary Coutant <ccoutant@google.com>
1758
1759 Revert support for v2 DWP files:
1760
1761 2013-03-01 Cary Coutant <ccoutant@google.com>
1762
1763 Add dwp support for v2 DWARF package file format.
1764 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1765 tu_length parameter. Adjust all callers.
1766 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1767 * dwp.cc: Include dwarf.h.
1768 (Section_bounds): New struct type.
1769 (Unit_set): New struct type.
1770 (Dwo_file::Dwo_file): Initialize new data member.
1771 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1772 Combine and rename to...
1773 (Dwo_file::read_unit_index): ...this.
1774 (Dwo_file::sized_read_compunit_index)
1775 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1776 (Dwo_file::sized_read_unit_index): ...this.
1777 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1778 parameters; add section_id parameter.
1779 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1780 (Dwo_file::add_unit_set): ...this.
1781 (Dwo_file::shndx_map_): Remove.
1782 (Dwo_file::sect_offsets_): New data member.
1783 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1784 (Dwp_output_file::add_section): Rename to...
1785 (Dwp_output_file::add_contribution): ...this.
1786 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1787 (Dwp_output_file::add_tu_set): Likewise.
1788 (Dwp_output_file::Contribution): New type.
1789 (Dwp_output_file::Section::contributions): New data member.
1790 (Dwp_output_file::Cu_or_tu_set): Remove.
1791 (Dwp_output_file::Section::Section): New ctor.
1792 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1793 (Dwp_output_file::Dwp_index::Section_table): New type.
1794 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1795 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1796 parameter.
1797 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1798 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1799 (Dwp_output_file::Dwp_index::section_table): New member function.
1800 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1801 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1802 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1803 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1804 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1805 (Dwp_output_file::Dwp_index::section_table_): New data member.
1806 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1807 (Dwp_output_file::add_output_section): New member function.
1808 (Dwp_output_file::write_new_section): New member function.
1809 (Dwp_output_file::write_contributions): New member function.
1810 (Dwp_output_file::section_id_map_): New data member.
1811 (class Dwo_id_info_reader): Remove.
1812 (class Unit_reader): New class.
1813 (get_dwarf_section_name): New function.
1814 (Dwo_file::read_executable): Adjust initializations of class data.
1815 (Dwo_file::read): Add support for v2 package file format.
1816 (Dwo_file::read_unit_index): Likewise.
1817 (Dwo_file::sized_read_unit_index): Likewise.
1818 (Dwo_file::copy_section): Likewise.
1819 (Dwo_file::add_unit_set): Likewise.
1820 (Dwp_output_file::add_output_section): Likewise.
1821 (Dwp_output_file::add_contribution): Likewise.
1822 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1823 for empty slot.
1824 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1825 file format.
1826 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1827 slot.
1828 (Dwp_output_file::initialize): Remove unused function.
1829 (Dwp_output_file::finalize): Add support for v2 package file format.
1830 (Dwp_output_file::write_index): Likewise.
1831 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1832 function prototype.
1833
c6905c28
CC
18342013-07-31 Cary Coutant <ccoutant@google.com>
1835
1836 * object.cc (Sized_relobj::do_output_section_address): New function.
1837 (Sized_relobj): Instantiate explicitly.
1838 * object.h (Object::output_section_address): New function.
1839 (Object::do_output_section_address): New function.
1840 (Sized_relobj::do_output_section_address): New function.
1841 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1842
18432013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1844 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1845
1846 * parameters.cc (Parameters::entry): Return target-specific entry
1847 symbol name.
1848 * target.h (Target::entry_symbol_name): New function.
1849 (Target_info::entry_symbol_name): New data member.
1850
1851 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1852 * i386.cc (Target_i386::i386_info): Likewise.
1853 (Target_i386_nacl::i386_nacl_info): Likewise.
1854 * sparc.cc (Target_sparc::sparc_info): Likewise.
1855 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1856 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1857 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1858 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1859
234d4ab8
SA
18602013-07-22 Sterling Augustine <saugustine@google.com>
1861
1862 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1863 Convert parameter shndx to local variable. Add parameters symtab
1864 and symtab_size. Scan over section names. Find relocation
1865 section corresponding to current section. Create and initialize
1866 reloc_mapper_ and reloc_type_.
1867 (Dwarf_pubnames_table::read_header): Add assertion. Change
1868 unit_length to off_t. Initialize member unit_length_. Fill in field
1869 cu_offset_.
1870 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1871 Initialize new fields unit_length_ and cu_offset_.
1872 (Dwarf_pubnames_table::read_section): Update prototype.
1873 (Dwarf_pubnames_table::cu_offset): New member function.
1874 (Dwarf_pubnames_table::subsection_size): Likewise.
1875 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1876 New fields.
1877 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1878 member functions public.
1879 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1880 Update comment. Rework logic. Move repeated parts to...
1881 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1882 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1883 pubtypes_table_, and stmt_list_offset.
1884 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1885 Gdb_index::find_pubtype_offset,
1886 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1887 (Gdb_index::pubnames_read): Update prototype and rework logic.
1888 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1889 Forward declare.
1890 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1891 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1892 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1893 Gdb_index::map_pubtable_to_dies):
1894 Declare functions.
1895 (Gdb_index::pubnames_read): Update declaration.
1896 (Gdb_index::Pubname_offset_map): New type.
1897 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1898 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1899 Gdb_index::stmt_list_offset): Declare.
1900 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1901 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1902 Gdb_index::pubtypes_offset_): Remove.
1903
a3ed37d8
RM
19042013-07-19 Roland McGrath <mcgrathr@google.com>
1905
1906 * options.h (General_options): Add -Trodata-segment option.
1907 * parameters.cc (Parameters::check_rodata_segment): New function.
1908 (Parameters::set_target_once): Call it.
1909 * parameters.h (Parameters): Declare it (private member function).
1910 * layout.cc (load_seg_unusable_for_headers): New function, broken
1911 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1912 then validate rodata segment rather than text segment.
1913 (relaxation_loop_body): Call that.
1914 (is_text_segment): New function. Don't admit a non-executable
1915 segment if TARGET->isolate_execinstr().
1916 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1917
eb5b4ded
CC
19182013-07-15 Shawn Landden <shawnlandden@gmail.com>
1919
1920 PR gold/15070
1921 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1922 * nacl.h (Sniff_file::View::View): Request aligned view.
1923
4d5effb9
CC
19242013-07-11 Cary Coutant <ccoutant@google.com>
1925
1926 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1927 correct BRLT entry size.
1928
ba8ca3e7
AM
19292013-07-03 Alan Modra <amodra@gmail.com>
1930
1931 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1932 comment.
1933
267257d2
CC
19342013-07-01 Cary Coutant <ccoutant@google.com>
1935
1936 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1937 reloc_type_.
1938 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1939 (Dwarf_ranges_table::lookup_reloc): New function.
1940 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1941 reloc_type_.
1942 (Dwarf_ranges_table::lookup_reloc): New function.
1943 (Dwarf_ranges_table::reloc_type_): New data member.
1944
06f30c9d
CC
19452013-06-27 Jing Yu <jingyu@google.com>
1946
1947 PR gold/15662
1948 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1949 function.
1950 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1951 (Target_powerpc::do_relax): Call the above.
1952
a2d7bf59
AM
19532013-06-27 Cary Coutant <ccoutant@google.com>
1954
1955 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1956 on garbage collected .opd section.
1957
19582013-06-27 Alan Modra <amodra@gmail.com>
1959
1960 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1961 is non-zero.
1962 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1963 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1964
32364e50
CC
19652013-06-14 Cary Coutant <ccoutant@google.com>
1966
1967 * resolve.cc (Symbol::override_base): Don't override st_type
1968 from plugin placeholder symbols.
1969 (Symbol_table::resolve): Likewise.
1970 (Symbol_table::should_override): Don't complain about TLS mismatch
1971 if the TO symbol is a plugin placeholder.
1972 * testsuite/Makefile.am (plugin_test_tls): New test.
1973 * testsuite/Makefile.in: Regenerate.
1974 * testsuite/plugin_test_tls.sh: New test script.
1975 * testsuite/two_file_test_2_tls.cc: New test source.
1976 * testsuite/two_file_test_tls.cc: New test source.
1977
7fb47cc9
CC
19782013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1979
1980 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1981 the maximum segment alignment is larger than the page size.
1982 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1983 correctly aligns the symbols with large alignemnt.
1984 * testsuite/Makefile.in: Regenerate.
1985 * testsuite/large_symbol_alignment.cc: New file.
1986
6934001a
CC
19872013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1988 Sriraman Tallam <tmsriram@google.com>
1989
1990 * options.h (sort_section): New option.
1991 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1992 Rename from Input_section_sort_section_name_special_ordering_compare.
1993 (Input_section_sort_section_name_compare): New struct.
1994 * output.cc (Output_section::Input_section_sort_section_name_compare::
1995 operator()): New function.
1996 (Output_section::sort_attached_input_sections): Use new sort function
1997 for .text if --sort-section=name is specified.
1998 * layout.cc (Layout::make_output_section):
1999 Add sorting by name when --sort-section=name is specified.
2000 * testsuite/Makefile.am (text_section_grouping): Test option
2001 --sort-section=name.
2002 * testsuite/Makefile.in: Regenerate.
2003 * testsuite/section_sorting_name.cc: New file.
2004 * testsuite/section_sorting_name.sh: New file.
2005
93acabad
CC
20062013-05-21 Cary Coutant <ccoutant@google.com>
2007
2008 * symtab.h (Symbol::is_cxx_vtable): New function.
2009 * target-reloc.h (relocate_section): Check for vtable symbol.
2010 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2011 * testsuite/Makefile.in: Regenerate.
2012 * testsuite/missing_key_func.cc: New test source.
2013 * testsuite/missing_key_func.sh: New test script.
2014
60e8b3fc
CC
20152013-05-21 Cary Coutant <ccoutant@google.com>
2016
2b64b551
RM
2017 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2018 type of enclosing symbol.
2019 (Relocate_info::location): Check symbol type when describing symbol.
2020 * object.h (Symbol_location_info): Remove unused line_number;
2021 add enclosing_symbol_type.
2022 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2023
9df9de2c
CC
20242013-05-13 Cary Coutant <ccoutant@google.com>
2025
2b64b551
RM
2026 * configure.ac: Export DEFAULT_TARGET.
2027 * configure: Regenerate.
2028 * Makefile.in: Regenerate.
2029 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2030 * testsuite/Makefile.in: Regenerate.
2031 * testsuite/debug_msg.sh: Delete duplicate tests.
2032 Don't check undef_int error message match for powerpc where the
2033 source file and line number aren't available.
9df9de2c 2034
bbc5ae17
RM
20352013-05-10 Roland McGrath <mcgrathr@google.com>
2036
2037 * options.h (General_options): Add --rosegment-gap option.
2038 * options.cc (finalize): --rosegment-gap implies --rosegment.
2039 * layout.cc (set_segment_offsets): Let user option override
2040 target->rosegment_gap().
2041
0c6e6c39
RM
20422013-05-10 Roland McGrath <mcgrathr@google.com>
2043
2044 * options.h (General_options): Remove leading space from help
2045 messages for -nostdlib and --rosegment.
2046
cde7cb01
MR
20472013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2048
2049 PR ld/15365
2050 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2051
f31ae5b8
AM
20522013-05-03 Alan Modra <amodra@gmail.com>
2053
2054 * merge.cc (Output_merge_string::do_add_input_section): Correct
2055 scan for number of strings. Rename vars to avoid shadowing.
2056 Include missing terminator in input_size_.
2057
d3a7cd45
L
20582013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2059
2060 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2061 Restore empty string handling.
2062
6ad3daba
CC
20632013-05-01 Cary Coutant <ccoutant@google.com>
2064
2065 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2066 uninitialized warning.
2067
e31908b6
CC
20682013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2069
2070 * output.cc (Output_section::add_merge_input_section): Allow
2071 to merge sections if the alignment is more than character size.
2072 * merge.h (Output_merge_string::Output_merge_string): Remove
2073 assert.
2074 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2075 only not-null strings. Check the alignment of strings.
2076 * stringpool.h
2077 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2078 alignment as the argument.
2079 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2080 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2081 Align non-zero length strings according to the addralign_.
2082 (Stringpool_template<Stringpool_char>::set_string_offsets):
2083 Updating offsets according to the given alignment.
2084 * testsuite/Makefile.am (text_section_grouping): Test if string
2085 literals are getting merged.
2086 * testsuite/Makefile.in: Regenerate.
2087 * testsuite/merge_string_literals_1.c: New file.
2088 * testsuite/merge_string_literals_2.c: Ditto.
2089 * testsuite/merge_string_literals.sh: Ditto.
2090
0e804863
ILT
20912013-04-26 Ian Lance Taylor <iant@google.com>
2092
2093 * target-reloc.h (relocate_section): If the reloc offset is out of
2094 range, pass VIEW as NULL to relocate.relocate.
2095 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2096 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2097 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2098 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2099 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2100 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2101
e7c5ea40
CC
21022013-04-26 Geoff Pike <gpike@chromium.org>
2103
2104 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2105 * layout.cc (Hash_task): New class.
2106 (Layout::queue_build_id_tasks): New function.
2107 (Layout::write_build_id): Handle single-thread portion of build ID
2108 computation. (In some cases, all of it is single-threaded.) Replace
2109 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2110 functionality in fewer lines of code.
2111 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2112 * options.h (General_options): make "--build-id" default to tree
2113 rather than sha1. Add two new options related to --build-id=tree:
2114 --build-id-chunk-size-for-treehash and
2115 --build-id-min-file-size-for-treehash.
2116 * Makefile.am: add testing of --build-id=tree and related new options
2117 (these tests will be invoked by "make check").
2118 * Makefile.in: Regenerate.
2119
49926cd0
AM
21202013-04-25 Alan Modra <amodra@gmail.com>
2121
2122 * configure.tgt: Add powerpcle and powerpc64le.
2123
a4034750
AM
21242013-04-22 Alan Modra <amodra@gmail.com>
2125
2126 PR gold/15355
2127 * layout.cc (Layout::segment_precedes): Allow more than one
2128 segment with the same type and flags.
2129
e79c84aa
CC
21302013-04-15 Cary Coutant <ccoutant@google.com>
2131
2132 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2133 allocate space in file for BSS sections.
2134
2199fbe7
CC
21352013-04-15 Cary Coutant <ccoutant@google.com>
2136
2137 * script-sections.cc (Orphan_output_section): Reset address
2138 to zero after each orphaned section for relocatable links.
2139
502e8a84
CC
21402013-04-15 Cary Coutant <ccoutant@google.com>
2141
a4034750
AM
2142 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2143 section starting address for relocatable link.
2144 * testsuite/Makefile.am (script_test_11): New test.
2145 * testsuite/Makefile.in: Regenerate.
2146 * testsuite/script_test_11.c: New source file.
2147 * testsuite/script_test_11.t: New linker script.
502e8a84 2148
0cfdc767
AM
21492013-04-13 Alan Modra <amodra@gmail.com>
2150
2151 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2152 owner when sections are not adjacent and exceed group size.
2153 (Target_powerpc::group_sections): Handle corner case.
2154 (Target_powerpc::Branch_info::make_stub): Handle case where
2155 stub table doesn't exist due to branches in non-exec sections.
2156 (Target_powerpc::Relocate::relocate): Likewise.
2157
6830ee24
AM
21582013-04-11 Alan Modra <amodra@gmail.com>
2159
2160 PR gold/15354
2161 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2162 .branch_lt to match bfd ld. Adjust comments throughout file.
2163
54a3d865
ILT
21642013-04-04 Ian Lance Taylor <iant@google.com>
2165
2166 GCC PR c++/56840
2167 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2168 sections before checking whether they are included in the link.
2169
9993ba11
ST
21702013-03-29 Sriraman Tallam <tmsriram@google.com>
2171
2172 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2173 object before calling the plugin claim_file handler. Pass the elf
2174 object of the archive to the plugin. Delete the elf object if the
2175 plugin claims the file.
2176
ebacd51e
AM
21772013-03-21 Alan Modra <amodra@gmail.com>
2178
2179 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2180 segment when omagic.
2181
117be58f
AM
21822013-03-21 Alan Modra <amodra@gmail.com>
2183
2184 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2185 comparison warning.
2186 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2187 uninitialized" warning.
2188
32e2b61d
AM
21892013-03-20 Alan Modra <amodra@gmail.com>
2190
2191 * symtab.h (Symbol::clear_version): New function.
2192 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2193 is_needed by weak references. Clear version for symbols defined
2194 in as-needed objects that are not needed.
2195
b3ccdeb5
AM
21962013-03-15 Alan Modra <amodra@gmail.com>
2197
2198 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2199 static and public. Add report_err param. Return false for data refs.
2200 (Target_powerpc::rela_dyn_section): New overloaded function.
2201 (Target_powerpc::plt_, iplt_): Elucidate.
2202 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2203 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2204 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2205 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2206 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2207 push_branch and make_plt_entry for ifunc syms when
2208 reloc_needs_plt_for_ifunc.
2209 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2210 for ifunc unless reloc_needs_plt_for_ifunc.
2211
ad3d8a2f
AM
22122013-03-15 Alan Modra <amodra@gmail.com>
2213
2214 * gc.h (gc_process_relocs): Don't look through function descriptors.
2215 * icf.cc (get_section_contents): Do so here instead.
2216
4d9aa155
AM
22172013-03-13 Alan Modra <amodra@gmail.com>
2218
2219 * powerpc.cc (is_branch_reloc): Forward declare.
2220 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2221 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2222 false for 64-bit, true for 32-bit non-branch relocs.
2223 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2224 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2225 nm output.
2226 (icf_safe_test): Generate linker map file as well as nm output.
2227 (icf_safe_so_test): Likewise.
2228 * testsuite/Makefile.in: Regenerate.
2229 * testsuite/icf_test.sh: Parse linker map file to determine
2230 section folding.
2231 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2232 * testsuite/icf_safe_so_test.sh: Likewise.
2233 (X86_32_or_ARM_specific_safe_fold): Merge into..
2234 (arch_specific_safe_fold): ..this.
2235 (X86_64_specific_safe_fold): Delete unused function.
2236
57420c20
AM
22372013-03-12 Alan Modra <amodra@gmail.com>
2238
2239 * gc.h (gc_process_relocs): Look through function descriptors
2240 to determine shndx, symvalue and addend used by ICF. Tidy
2241 variable duplication.
2242
dc3714f3
AM
22432013-03-11 Alan Modra <amodra@gmail.com>
2244
2245 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2246 * layout.cc (Layout_task_runner::run): ..to here.
2247 * symtab.h (struct Symbol_location): Extract from..
2248 (class Symbol_table): ..here.
2249 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2250 * target.h (class Target): Add function_location and
2251 do_function_location functions.
2252 (class Sized_target): Add do_function_location.
2253 * object.h (class Sized_relobj_file): Move find_shdr..
2254 (class Object): ..to here.
2255 * object.cc: Likewise. Update to suit. Instantiate.
2256 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2257 * powerpc.cc (class Powerpc_dynobj): New.
2258 (Target_powerpc::do_function_location): New function.
2259 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2260 (Powerpc_dynobj::do_read_symbols): New function.
2261 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2262
956b03bb
ILT
22632013-03-08 Ian Lance Taylor <iant@google.com>
2264
2265 * options.cc (General_options::string_to_object_format): Accept
2266 "default".
2267
4bead2d5
AM
22682013-03-08 Alan Modra <amodra@gmail.com>
2269
2270 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2271 pointer to Post_fde.
2272 (struct Post_fde): Move definition to here..
2273 * ehframe.cc (struct Post_fde): ..from here.
2274 (Cie::write): Don't alloc Post_fde.
2275 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2276
02e60bf7
AM
22772013-03-07 Alan Modra <amodra@gmail.com>
2278
2279 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2280 relocation referencing .LC0.
2281 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2282
8343f03a
AM
22832013-03-07 Alan Modra <amodra@gmail.com>
2284
2285 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2286 always_inline. Add assembly for powerpc to avoid GOT.
2287
3366d57c
AM
22882013-03-07 Alan Modra <amodra@gmail.com>
2289
2290 * testsuite/script_test_10.sh: Don't test .bss section
2291 header number.
2292
6c77229c
AM
22932013-03-06 Alan Modra <amodra@gmail.com>
2294
2295 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2296 (Target_powerpc::symval_for_branch): Add symtab param. Update
2297 all callers. Handle folded sections.
2298 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2299 to Powerpc_relobj.
2300 (Global_symbol_visitor_opd::operator()): Likewise.
2301
a39e4af6
AM
23022013-03-04 Alan Modra <amodra@gmail.com>
2303
2304 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2305 * testsuite/Makefile.in: Regenerate.
2306
d5834edb
CC
23072013-03-01 Cary Coutant <ccoutant@google.com>
2308
2309 Add dwp support for v2 DWARF package file format.
2310 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2311 tu_length parameter. Adjust all callers.
2312 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2313 * dwp.cc: Include dwarf.h.
2314 (Section_bounds): New struct type.
2315 (Unit_set): New struct type.
2316 (Dwo_file::Dwo_file): Initialize new data member.
2317 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2318 Combine and rename to...
2319 (Dwo_file::read_unit_index): ...this.
2320 (Dwo_file::sized_read_compunit_index)
2321 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2322 (Dwo_file::sized_read_unit_index): ...this.
2323 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2324 parameters; add section_id parameter.
2325 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2326 (Dwo_file::add_unit_set): ...this.
2327 (Dwo_file::shndx_map_): Remove.
2328 (Dwo_file::sect_offsets_): New data member.
2329 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2330 (Dwp_output_file::add_section): Rename to...
2331 (Dwp_output_file::add_contribution): ...this.
2332 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2333 (Dwp_output_file::add_tu_set): Likewise.
2334 (Dwp_output_file::Contribution): New type.
2335 (Dwp_output_file::Section::contributions): New data member.
2336 (Dwp_output_file::Cu_or_tu_set): Remove.
2337 (Dwp_output_file::Section::Section): New ctor.
2338 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2339 (Dwp_output_file::Dwp_index::Section_table): New type.
2340 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2341 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2342 parameter.
2343 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2344 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2345 (Dwp_output_file::Dwp_index::section_table): New member function.
2346 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2347 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2348 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2349 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2350 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2351 (Dwp_output_file::Dwp_index::section_table_): New data member.
2352 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2353 (Dwp_output_file::add_output_section): New member function.
2354 (Dwp_output_file::write_new_section): New member function.
2355 (Dwp_output_file::write_contributions): New member function.
2356 (Dwp_output_file::section_id_map_): New data member.
2357 (class Dwo_id_info_reader): Remove.
2358 (class Unit_reader): New class.
2359 (get_dwarf_section_name): New function.
2360 (Dwo_file::read_executable): Adjust initializations of class data.
2361 (Dwo_file::read): Add support for v2 package file format.
2362 (Dwo_file::read_unit_index): Likewise.
2363 (Dwo_file::sized_read_unit_index): Likewise.
2364 (Dwo_file::copy_section): Likewise.
2365 (Dwo_file::add_unit_set): Likewise.
2366 (Dwp_output_file::add_output_section): Likewise.
2367 (Dwp_output_file::add_contribution): Likewise.
2368 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2369 for empty slot.
2370 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2371 file format.
2372 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2373 slot.
2374 (Dwp_output_file::initialize): Remove unused function.
2375 (Dwp_output_file::finalize): Add support for v2 package file format.
2376 (Dwp_output_file::write_index): Likewise.
2377 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2378 function prototype.
2379
a68a081d
CC
23802013-03-01 Cary Coutant <ccoutant@google.com>
2381
2382 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2383 function into class definition in header file.
2384 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2385 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2386 New function.
2387 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2388
9d5781f8
AM
23892013-02-28 Alan Modra <amodra@gmail.com>
2390
2391 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2392 * target.cc (Target::do_plt_fde_location): New function.
2393 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2394 accessor function, and constructor param.
2395 (struct Post_fde, Post_fdes): Declare.
2396 (Cie::write): Add post_fdes param.
2397 * ehframe.cc (Fde::write): Use plt_fde_location.
2398 (struct Post_fde): Define.
2399 (Cie::write): Stash FDEs added post merge mapping.
2400 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2401 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2402 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2403 other FDEs.
2404 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2405 (Target_powerpc::has_glink): New function.
2406 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2407 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2408 glink_eh_frame_fde_32, default_fde): New data.
2409 (Stub_table::eh_frame_added_): New var.
2410 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2411 Make const.
2412 (Stub_table::add_eh_frame): New function.
2413 (Output_data_glink::add_eh_frame): New function.
2414 (Target_powerpc::make_glink_section): Call add_eh_frame.
2415
214383dd
ILT
24162013-02-15 Ian Lance Taylor <iant@google.com>
2417
2418 * options.h (DEFINE_uint64_alias): Define.
2419 (class General_options): Add -Ttext-segment as an alias for
2420 -Ttext.
2421
91c2b899
AM
24222013-02-15 Alan Modra <amodra@gmail.com>
2423
2424 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2425 (Stub_table::do_write): ..here, two places.
2426 (Stub_table::plt_call_size): Use it here too.
2427
20e2a8aa
ILT
24282013-02-11 Ian Lance Taylor <iant@google.com>
2429
2430 * descriptors.cc (Descriptors::close_all): New function.
2431 * descriptors.h (class Descriptors): Declare close_all.
2432 (close_all_descriptors): New inline function.
2433 * plugin.cc: Include "descriptors.h".
2434 (Plugin_manager::cleanup): Call close_all_descriptors.
2435
8952bc69
AM
24362013-02-06 Alan Modra <amodra@gmail.com>
2437
2438 * README: Update coding style link.
2439
29bd8b6b
CC
24402013-01-28 Cary Coutant <ccoutant@google.com>
2441
a4034750
AM
2442 * dwp.cc (File_list): New typedef.
2443 (Dwo_name_info_reader): New class.
2444 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2445 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2446 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2447 (Dwo_file::read_executable): New function.
2448 (Dwo_file::read): Move common setup code to ...
2449 (Dwo_file::make_object): ... here.
2450 (dwp_options): Add --exec/-e.
2451 (usage): Likewise.
2452 (main): Likewise.
29bd8b6b 2453
c6ac678d
ST
24542013-01-24 Sriraman Tallam <tmsriram@google.com>
2455
2456 * layout.cc (Layout::layout): Check for option text_reorder.
2457 (Layout::make_output_section): Ditto.
2458 * options.h (text_reorder): New option.
2459 * output.cc (Input_section_sort_compare): Remove special ordering
2460 of section names.
2461 (Output_section::
2462 Input_section_sort_section_name_special_ordering_compare::
2463 operator()): New function.
2464 (Output_section::sort_attached_input_sections): Use new sort function
2465 for .text.
2466 * output.h (Input_section_sort_section_name_special_ordering_compare):
2467 New struct.
2468 * testsuite/Makefile.am (text_section_grouping): Test option
2469 --no-text-reorder
2470 * testsuite/Makefile.in: Regenerate.
2471 * testsuite/text_section_grouping.sh: Check order of functions without
2472 default text reordering.
2473
50701cc1
MF
24742013-01-18 Mike Frysinger <vapier@gentoo.org>
2475
2476 * options.h (General_options): Change default to true for new_dtags.
2477
b1b00fcc
MF
24782013-01-18 Mike Frysinger <vapier@gentoo.org>
2479
2480 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2481 when enable_new_dtags is false. Only add DT_RUNPATH when
2482 enable_new_dtags is true.
2483
ec5b8187
AM
24842013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2485
2486 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2487 used in declaration and definition consistent.
2488 (Target_powerpc::symval_for_branch): Ditto.
2489
a880d4c4
ST
24902013-01-16 Sriraman Tallam <tmsriram@google.com>
2491
2492 * testsuite/plugin_final_layout.cc: Fix comment.
2493
7c381248
ST
24942013-01-16 Sriraman Tallam <tmsriram@google.com>
2495
2496 * layout.cc (Layout::layout): Do not do default sorting for
2497 text sections when section ordering is specified.
2498 (make_output_section): Ditto.
2499 * testsuite/plugin_final_layout.cc: Name the function sections
2500 to catch reordering issues.
2501
e2458743
AM
25022013-01-15 Alan Modra <amodra@gmail.com>
2503
2504 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2505 plt-thread-safe.
2506
431ed302
AM
25072013-01-15 Alan Modra <amodra@gmail.com>
2508
2509 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2510 * testsuite/Makefile.in: Regenerate.
2511
0ec6429b
AM
25122013-01-14 Alan Modra <amodra@gmail.com>
2513
2514 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2515 * testsuite/Makefile.in: Regenerate.
2516
0bf402d5
ILT
25172013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2518
36af3926 2519 PR bfd/14430
0bf402d5
ILT
2520 Fix mingw gold build with plugins enabled
2521 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2522 * configure.ac: Export DLOPEN_LIBS and add headers check.
2523 * plugin.cc: Handle non-dlfcn case.
2524 * Makefile.in: Regenerate.
2525 * config.in: Regenerate.
2526 * configure: Regenerate.
2527 * testsuite/Makefile.in: Regenerate.
2528
9e9143bc
ST
25292013-01-09 Sriraman Tallam <tmsriram@google.com>
2530
2531 * output.h (sort_attached_input_sections): Change to be public.
2532 * script-sections.cc
2533 (Output_section_definition::set_section_addresses): Sort
2534 attached input sections according to section order before linker
2535 script assigns section addresses.
2536 (Orphan_output_section::set_section_addresses): Sort
2537 attached input sections according to section order before linker
2538 script assigns section addresses.
2539 * Makefile.am (final_layout.sh): Use a simple linker script to
2540 check if section ordering still works.
2541 * Makefile.in: Regenerate.
2542
679af368
ILT
25432013-01-09 Ben Cheng <bccheng@google.com>
2544
2545 * arm.cc (Target_arm::attributes_accept_div): New function.
2546 (Target_arm::attributes_forbid_div): New function.
2547 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2548 attribute using the same new functions as what bfd/elf32_arm.c
2549 does.
2550
3136a00e
CC
25512013-01-07 Cary Coutant <ccoutant@google.com>
2552
2553 PR gold/14993
2554 * output.cc (Output_section::add_input_section): For incremental
2555 updates, don't track input sections that are allocated from patch
2556 space.
2557
f2a6224b
L
25582013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2559 Ian Lance Taylor <iant@google.com>
2560
2561 PR gold/14897
2562 * configure.ac (--enable-ld): Removed.
2563 (install_as_default): Set to yes only for --enable-gold=default
2564 or --disable-ld.
2565 * configure: Regenerated.
2566
4f46f626
L
25672013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2568
2569 * options.h (General_options): Add -fuse-ld= for GCC linker
2570 option compatibility.
2571
26e4ef59
CC
25722013-01-04 Cary Coutant <ccoutant@google.com>
2573
2574 * configure.ac: Fix typo restoring CXXFLAGS.
2575 * configure: Regenerate.
2576
3d587466
CC
25772013-01-04 Cary Coutant <ccoutant@google.com>
2578
4f46f626
L
2579 * testsuite/Makefile.am (CXXLINK_S): New macro.
2580 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2581 * testsuite/Makefile.in: Regenerate.
3d587466 2582
44db6695
L
25832013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2584
2585 * version.cc (print_version): Update copyright year to 2013.
2586
edcac0c1
ILT
25872012-12-20 Ian Lance Taylor <iant@google.com>
2588
2589 * layout.cc (Layout::special_ordering_of_input_section): New
2590 function.
2591 (Layout::layout): If input section requires special ordering, must
2592 sort input sections.
2593 (Layout::make_output_section): May sort .text input sections.
2594 (Layout::is_section_name_prefix_grouped): Remove.
2595 * layout.h (class Layout): Declare
2596 special_ordering_of_input_section. Don't declare
2597 is_section_name_prefix_grouped.
2598 * output.cc (Output_section::add_input_section): Revert last
2599 change.
2600 (Output_section::Input_section_sort::match_file_name): Don't crash
2601 if called on output section data.
2602 (Output_section::Input_section_sort_compare): Sort based on
2603 special ordering.
2604 (Output_section::Input_section_sort_section_order_index_compare):
2605 Revert last patch.
2606 (Output_section::sort_attached_input_sections): Likewise.
2607
28f2a4ac
ST
26082012-12-18 Sriraman Tallam <tmsriram@google.com>
2609
edcac0c1 2610 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2611 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2612 * output.cc (Output_section::add_input_section): Check if section
2613 name contains special prefix. Keep input sections to sort such
2614 sections.
2615 (Output_section::Input_section_sort_section_order_index_compare
2616 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2617 (Output_section::sort_attached_input_sections): Add condition to
2618 Input_section_entry constructor call.
28f2a4ac
ST
2619 * testsuite/Makefile.am (text_section_grouping): New test.
2620 * testsuite/Makefile.in: Regenerate.
2621 * testsuite/text_section_grouping.cc: New file.
2622 * testsuite/text_section_grouping.sh: New file.
2623
5bf135a7
NC
26242012-12-17 Nick Clifton <nickc@redhat.com>
2625
2626 * Makefile.am: Add copyright notice.
2627 * NEWS: Likewise.
2628 * README: Likewise.
2629 * configure.ac: Likewise.
2630 * ftruncate.c: Likewise.
2631 * Makefile.in: Regenerate.
2632
59965708
CC
26332012-12-14 Cary Coutant <ccoutant@google.com>
2634
a4034750
AM
2635 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2636 --no-as-needed flag.
2637 (exception_separate_shared_12_test): Likewise.
2638 (incremental_copy_test): Likewise.
2639 * testsuite/Makefile.in: Regenerate.
59965708 2640
2a77e2ab
CC
26412012-12-14 Cary Coutant <ccoutant@google.com>
2642
2643 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2644 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2645
e3deeb9c
AM
26462012-12-12 Alan Modra <amodra@gmail.com>
2647
2648 * powerpc.cc (class Track_tls): New.
2649 (class Relocate, class Scan): Inherit Track_tls.
2650 (Target_powerpc::Scan::local, global): Track tls optimization
2651 and avoid creating plt entry for __tls_get_addr if all uses
2652 are optimized away.
2653 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2654
d8f5a274
AM
26552012-12-12 Alan Modra <amodra@gmail.com>
2656
2657 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2658 Replace no_toc_optimize with toc_optimize.
2659 * output.h (Output_section::input_sections): Provide non-const variant.
2660 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2661 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2662 accessors.
2663 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2664 (class Sort_toc_sections): New.
2665 (Target_powerpc::do_finalize_sections): Sort toc sections.
2666 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2667
4c8a1de1
RM
26682012-12-10 Roland McGrath <mcgrathr@google.com>
2669
2670 * testsuite/binary_unittest.cc (read_all): New function.
2671 (Sized_binary_test): Use it instead of ::read.
2672 * fileread.cc (do_read): Don't assume pread always reads the whole
2673 amount in a single call.
2674
edc27beb
AM
26752012-12-10 Alan Modra <amodra@gmail.com>
2676
2677 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2678 Set EM_PPC64 or EM_PPC here.
2679 (Target_selector_powerpc::do_recognize): Delete.
2680
906b9150
AM
26812012-12-10 Alan Modra <amodra@gmail.com>
2682
2683 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2684 stub_table_.
2685 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2686
418c15ae
RM
26872012-12-07 Roland McGrath <mcgrathr@google.com>
2688
2689 * testsuite/binary_unittest.cc (Sized_binary_test):
2690 Use open_descriptor rather than ::open.
2691
decdd3bc
AM
26922012-12-07 Alan Modra <amodra@gmail.com>
2693
2694 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2695 typedef and invalid_address constant.
2696 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2697 instantiate constants.
2698
db399005
ILT
26992012-12-06 Roland McGrath <mcgrathr@google.com>
2700
2701 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2702 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2703 * aclocal.m4: Regenerate.
2704 * configure: Regenerate.
2705 * Makefile.in: Regenerate.
2706 * testsuite/Makefile.in: Regenerate.
2707
aba6bc71
AM
27082012-12-07 Alan Modra <amodra@gmail.com>
2709
2710 * options.h (General_options): Add no_toc_optimize.
2711 * powerpc.cc (ok_lo_toc_insn): New function.
2712 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2713
9e69ed50
AM
27142012-12-06 Alan Modra <amodra@gmail.com>
2715
2716 * options.h (General_options): Add plt_align, plt_static_chain,
2717 plt_thread_safe. Update stub_group_size help text.
2718 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2719 for new plt_thread_safe_ var.
2720 (use_plt_offset): Correct comments.
2721 (Target_powerpc::do_relax): Look for thread creation symbols to
2722 determine default plt_thread_safe value. Clear plt call stubs
2723 as well as branch stubs each iteration.
2724 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2725 insn constants.
2726 (l, hi, ha, write_insn): Move earlier.
2727 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2728 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2729 plt stubs too.
2730 (Stub_table::update_size): Adjust.
2731 (Stub_table::prev_size, set_prev_size): Delete.
2732 (Stub_table::stub_align): Let --plt-align affect result.
2733 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2734 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2735 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2736 (Stub_table::do_write): Support more stub variants.
2737
f43ba157
AM
27382012-12-04 Alan Modra <amodra@gmail.com>
2739
2740 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2741 (Target_powerpc::do_define_standard_symbols): New function.
2742
34171bc5
AM
27432012-12-03 Alan Modra <amodra@gmail.com>
2744
2745 * output.h: Formatting, whitespace.
2746
dc9589e9 27472012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2748
2749 * layout.h (Layout::get_executable_sections): Declare.
2750 * layout.cc (Layout::get_executable_sections): New function.
2751 * arm.cc (Target_arm::group_sections): Use it.
2752 (Arm_output_section::group_sections): Delete now redundant test.
2753 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2754 param to handle relative relocs.
2755 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2756 (Output_data_reloc::add_absolute): Adjust.
2757 (Output_data_reloc::add_relative): New function.
2758 (Output_data::reset_data_size): New function.
2759 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2760 (Output_section::set_addralign): New function.
2761 (Output_section::checkpoint_set_addralign): New function.
2762 (Output_section::clear_section_offsets_need_adjustment): New function.
2763 (Output_section::input_sections): Make public.
2764 * powerpc.cc (class Output_data_brlt_powerpc): New.
2765 (class Stub_table, class Stub_control): New.
2766 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2767 stub_table_, set_stub_table, stub_table): New vectors and accessor
2768 functions.
2769 (Target_powerpc::do_may_relax, do_relax, push_branch,
2770 new_stub_table, stub_tables, brlt_section, group_sections,
2771 add_branch_lookup_table, find_branch_lookup_table,
2772 write_branch_lookup_table, make_brlt_section): New functions.
2773 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2774 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2775 branch_info_): New vars.
2776 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2777 make call stubs here.
2778 (Output_data_glink): Remove all call stub handling from this class.
2779 (Target_powerpc::Scan::local, global): Save interesting branch
2780 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2781 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2782 functions on final link.
2783 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2784 Handle long branch destinations too.
2785 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2786 do_plt_address_for_local): Adjust lookup of plt call stubs.
2787
627b30b7
AM
27882012-11-30 Alan Modra <amodra@gmail.com>
2789
2790 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2791 relocs against protected symbols when building 32-bit shared libs.
2792
40b469d7
AM
27932012-11-30 Alan Modra <amodra@gmail.com>
2794
2795 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2796 param. Call got_section() to make .got. Update all callers
2797 and their callers and so on.
2798
bb66a627
AM
27992012-11-30 Alan Modra <amodra@gmail.com>
2800
2801 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2802 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2803 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2804 value if it already exists.
2805
d2cf1c6c
L
28062012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2807
2808 PR gold/14858
2809 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2810
edccdf7c
RM
28112012-11-14 Roland McGrath <mcgrathr@google.com>
2812
2813 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2814 than bfc instruction for data sandboxing.
2815
6febeb74
AM
28162012-11-08 Alan Modra <amodra@gmail.com>
2817
2818 * po/POTFILES.in: Regenerate.
2819
0a6f1bf2
AM
28202012-11-05 Alan Modra <amodra@gmail.com>
2821
2822 * configure.ac: Apply 2012-09-10 change to config.in here.
2823 * configure: Regenerate.
2824
26a4e9cb
AM
28252012-11-05 Alan Modra <amodra@gmail.com>
2826
2827 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2828 (struct Opd_ent): Use "Address" rather than "Offset".
2829 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2830 (Target_powerpc::got_section): Make public.
2831 (Target_powerpc::scan_relocs): Move code setting symbols..
2832 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2833 Create _SDA_BASE_ only when referenced.
2834
cc928013
RM
28352012-11-02 Roland McGrath <mcgrathr@google.com>
2836
2837 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2838 from last change.
2839
50ed5eb1
RM
28402012-11-01 Roland McGrath <mcgrathr@google.com>
2841
62fe925a
RM
2842 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2843 for offset_in_output_section parameter.
2844 (Sized_target::relocate_special_relocatable): Likewise.
2845 * arm.cc (Target_arm::relocate_relocs): Likewise.
2846 (Target_arm::relocate_special_relocatable): Likewise.
2847 * i386.cc (Target_i386::relocate_relocs): Likewise.
2848 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2849 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2850 * target-reloc.h (relocate_relocs): Likewise.
2851 * testsuite/testfile.cc (Target_test): Likewise.
2852 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2853 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2854
2855 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2856 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2857
2858 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2859 parameter, which is unused in the [!F_SETFD] case.
2860
50ed5eb1
RM
2861 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2862 SYMNDX to off_t before comparing it to this->data_size().
2863 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2864 * incremental.cc (Output_section_incremental_inputs::do_write):
2865 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2866
2cadc0bf
RM
2867 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2868
3bfcb652
NC
28692012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2870
2871 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2872 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2873 in EABI_VER5.
2874
c1a8d56e
CC
28752012-10-29 Cary Coutant <ccoutant@google.com>
2876
2877 * dwp.cc (usage): Add file and exit status parameters;
2878 add --help and --version options.
2879 (print_version): New function.
2880 (main): Add --help and --version options.
2881
b2490a7b
L
28822012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2883
2884 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2885 final_layout_sequence.txt.
2886 * testsuite/Makefile.in: Regenerated.
2887
aa543512
L
28882012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2889
2890 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2891 COMPILE generated by automake.
2892 (LINK1): Likewise.
2893 (CXXCOMPILE1): Likewise.
2894 (CXXLINK1): Likewise.
2895 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2896 (LINK): Likewise.
2897 (CXXCOMPILE): Likewise.
2898 (CXXLINK): Likewise.
2899 * testsuite/Makefile.in: Regenerated.
2900
d361fafb
L
29012012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2902
2903 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2904 on bad fwrite return.
2905
598c7410
L
29062012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2907
2908 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2909 on val.
2910
35c813e2
CC
29112012-10-23 Cary Coutant <ccoutant@google.com>
2912
2913 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2914 * testsuite/Makefile.in: Regenerate.
2915 * testsuite/dwp_test.h: New source file.
2916 * testsuite/dwp_test_1.cc: New source file.
2917 * testsuite/dwp_test_1.s: New source file.
2918 * testsuite/dwp_test_1.sh: New source file.
2919 * testsuite/dwp_test_1b.cc: New source file.
2920 * testsuite/dwp_test_1b.s: New source file.
2921 * testsuite/dwp_test_2.cc: New source file.
2922 * testsuite/dwp_test_2.s: New source file.
2923 * testsuite/dwp_test_2.sh: New source file.
2924 * testsuite/dwp_test_main.cc: New source file.
2925 * testsuite/dwp_test_main.s: New source file.
2926
77429909
CC
29272012-10-23 Cary Coutant <ccoutant@google.com>
2928
2929 * dwp.h: New header file.
2930 * dwp.cc: New source file.
2931 * gold.h: Move shared declarations to system.h.
2932 * system.h: New header file.
2933 * Makefile.am: Add dwp.
2934 * Makefile.in: Regenerate.
2935
ed5d6712
CC
29362012-10-23 Cary Coutant <ccoutant@google.com>
2937
2938 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2939 Dwarf_info_reader::read_from_pointer.
2940 (Dwarf_pubnames_table::read_header): Likewise.
2941 (Dwarf_pubnames_table::next_name): Likewise.
2942 (Dwarf_die::read_attributes): Likewise.
2943 (Dwarf_die::skip_attributes): Likewise.
2944 (Dwarf_info_reader::read_from_pointer): New function template.
2945 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2946 (Dwarf_pubnames_table): Likewise.
2947 (Dwarf_info_reader::read_from_pointer): New function template.
2948 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2949 Dwarf_pubnames_table ctor.
2950
8787852d
CC
29512012-10-23 Cary Coutant <ccoutant@google.com>
2952
2953 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2954 abbrev_shndx.
2955 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2956 abbrev_shndx_.
2957 (Dwarf_info_reader::set_abbrev_shndx): New method.
2958 (Dwarf_info_reader::abbrev_shndx_): New data member.
2959
9fc236f3
CC
29602012-10-23 Cary Coutant <ccoutant@google.com>
2961
2962 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2963 from object, not parameters.
2964 (Dwarf_info_reader::parse): Likewise.
2965 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2966 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2967 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2968 methods.
2969
effe8365
CC
29702012-10-23 Cary Coutant <ccoutant@google.com>
2971
2972 * fileread.cc (Input_file::Input_file): New constructor.
2973 * fileread.h (class Input_file): Add new constructor.
2974
1698990d
AM
29752012-10-18 Alan Modra <amodra@gmail.com>
2976
2977 PR gold/14727
2978 * object.cc (Relobj::is_section_name_included): Also match
2979 .sdata personality section.
2980
168a4726
AM
29812012-10-18 Alan Modra <amodra@gmail.com>
2982
2983 * target-reloc.h (class Default_comdat_behavior): New, package up..
2984 (get_comdat_behaviour): ..this.
2985 (relocate_section): Add Relocate_comdat_behavior template arg,
2986 adjust code to suit.
2987 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2988 (Target_arm::scan_reloc_section): Likewise.
2989 * i386.cc (Target_i386::relocate_section): Likewise.
2990 * sparc.cc (Target_sparc::relocate_section): Likewise.
2991 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2992 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2993 * powerpc.cc (class Relocate_comdat_behavior): New.
2994 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2995 gold::relocate_section with new template arg.
2996
acc276d8
AM
29972012-10-18 Alan Modra <amodra@gmail.com>
2998
2999 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3000 dynamic relocs for GOT_TPREL got entries, without symbol if
3001 resolving locally.
3002 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3003 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3004 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3005
e10f9870
AM
30062012-10-17 Alan Modra <amodra@gmail.com>
3007
3008 PR gold/14726
3009 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3010
ae034989
ST
30112012-10-16 Sriraman Tallam <tmsriram@google.com>
3012
3013 * layout.cc (Layout::include_section): Keep sections marked
3014 SHF_EXCLUDE when doing relocatable links.
3015
f3a0ed29
AM
30162012-10-16 Alan Modra <amodra@gmail.com>
3017
3018 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3019 (Target_powerpc::do_finalize_sections): Call it.
3020 (Output_data_save_res): New class and supporting functions.
3021 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3022 normal symbols defined in object files.
3023
c6de8ed4
AM
30242012-10-12 Alan Modra <amodra@gmail.com>
3025
3026 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3027 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3028 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3029 section if scan_opd_relocs not yet called.
3030 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3031
03e25981
AM
30322012-10-12 Alan Modra <amodra@gmail.com>
3033
3034 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3035 add_local_ifunc_entry): Revert last change.
3036 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3037
c9824451
AM
30382012-10-05 Alan Modra <amodra@gmail.com>
3039
3040 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3041 do_plt_address_for_global): New functions.
3042 (Output_data_got_powerpc::do_write): Don't segfault when linking
3043 statically.
3044 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3045 add_local_ifunc_entry): Return true on adding entry..
3046 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3047 glink->add_entry call. Remove unused symtab param. Adjust calls.
3048 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3049 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3050 set up symbols here.
3051 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3052 syms here. Do so even when no .iplt. Don't segfault when linking
3053 statically.
3054 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3055 new variants without reloc param.
3056 (Glink_sym_ent::Glink_sym_ent): Likewise.
3057 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3058 reloc when refs will resolve to plt call stub.
3059 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3060 R_PPC_PLTREL24 to resolve locally.
3061 (Target_powerpc::Scan::global): Correct ifunc handling.
3062 (Target_powerpc::Relocate::relocate): Correct local sym glink
3063 lookup. Don't destroy "value" when we have a plt call stub,
3064 and when checking plt call validity.
3065 (Target_powerpc::do_dynsym_value): Simplify.
3066
19fec8c1
AM
30672012-10-05 Alan Modra <amodra@gmail.com>
3068
3069 * i386.cc (Output_data_plt_i386::address_for_global,
3070 address_for_local): Add plt offset to returned value. Adjust uses.
3071 * sparc.cc (Output_data_plt_sparc::address_for_global,
3072 address_for_local): Likewise.
3073 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3074 address_for_local): Likewise.
3075 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3076 address_for_local): Likewise.
3077 * target.h (Target::plt_address_for_global, plt_address_for_local):
3078 Update comment.
3079 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3080 (Output_data_got::Got_entry::write): Nor here.
3081 * output.h: Comment fix.
3082
e867b647
WL
30832012-10-02 Jiong Wang <jiwang@tilera.com>
3084
3085 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3086 global_offset_table_ value for larget got.
3087 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3088
e5d5f5ed
AM
30892012-09-29 Alan Modra <amodra@gmail.com>
3090
3091 * powerpc.cc (Target_powerpc::iplt_): New output section.
3092 (Target_powerpc::iplt_section, make_iplt_section,
3093 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3094 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3095 Target_powerpc::plt_entry_count): Count iplt entries too.
3096 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3097 reloc section in constructor. New params.
3098 (Target_powerpc::make_plt_section): Create reloc section here instead.
3099 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3100 functions.
3101 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3102 (Output_data_glink::add_entry, find_entry): New functions to
3103 deal with local syms.
3104 (Glink_sym_ent): Add support for local syms.
3105 (Output_data_glink::do_write): Handle ifunc plt entries.
3106 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3107 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3108 (Target_powerpc::Relocate::relocate): Likewise.
3109 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3110
ec4dbad3
AM
31112012-09-25 Alan Modra <amodra@gmail.com>
3112
3113 * object.h (Sized_relobj_file::adjust_local_symbol,
3114 do_adjust_local_symbol): New functions.
3115 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3116 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3117 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3118 and irregular opd entry spacing.
3119 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3120 (Global_symbol_visitor_opd): New functor.
3121 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3122 on deleted opd entries.
3123
5c0b3823
WL
31242012-09-15 Jiong Wang <jiwang@tilera.com>
3125
3126 * tilegx.cc: New file.
3127 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3128 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3129 * configure.tgt: Add entries for tilegx*.
3130 * configure.ac: Likewise.
3131 * Makefile.in: Rebuild.
3132 * configure: Likewise.
3133 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3134 tilegx.
3135
bfdfa4cd
AM
31362012-09-13 Alan Modra <amodra@gmail.com>
3137
3138 * target-reloc.h (scan_relocs): Call scan.local for relocs
3139 against symbols in discarded sections. Pass is_discarded
3140 param.
3141 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3142 Add is_discarded param.
3143 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3144 is_discarded to flag opd entry as discarded. Don't emit dyn
3145 relocs on such entries.
3146 (Target_powerpc::Scan::global): Similarly detect and handle
3147 such opd entries.
3148 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3149 opd_ent_. Update all uses.
3150 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3151 (Target_powerpc::relocate_section): Zero out discarded opd
3152 entry relocs.
3153
d77a0555
ILT
31542012-09-12 Ian Lance Taylor <iant@google.com>
3155
3156 PR gold/14570
3157 * output.cc: Rename Output_data_got template parameter from size
3158 to got_size for all functions. Compile all variants of
3159 Output_data_got.
3160 (Output_data_got::Got_entry::write): Correct use of size for
3161 symbol value. Use local_is_tls rather than casting to
3162 Sized_relobj_file.
3163 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3164 (class Sized_relobj_file): Add do_local_is_tls.
3165 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3166
815a1205
AM
31672012-09-11 Alan Modra <amodra@gmail.com>
3168
3169 PR gold/14566
3170 * layout.cc (Layout::set_segment_offsets): When using
3171 common-page-size alignment, ensure we are on a new max-page-size
3172 page.
3173 * output.cc (Output_segment::set_section_addresses): Use
3174 abi_pagesize, not common_pagesize for relro boundary.
3175 (Output_segment::set_offset): Likewise.
3176
bd73a62d
AM
31772012-09-11 Alan Modra <amodra@gmail.com>
3178
3179 * output.h (Output_data_got::add_global_tls, add_local_tls,
3180 add_local_tls_pair): New functions.
3181 (Output_data_got::add_local_pair_with_rel): Remove second
3182 reloc param. Expand comment.
3183 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3184 use_plt_or_tls_offset_, similarly for constructor param.
3185 (Output_data_got::Got_entry::write): Add got_index param.
3186 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3187 add_local_tls_pair): New functions.
3188 (Output_data_got::Got_entry::write): Handle tls symbols
3189 with use_plt_or_tls_offset_ set specially.
3190 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3191 (Output_data_got::do_write): Replace iterator with index, pass
3192 index to entry write function.
3193 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3194 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3195 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3196 call.
3197 * i386.cc (Target_i386::Scan::local): Likewise.
3198 * sparc.cc (Target_sparc::Scan::local): Likewise.
3199 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3200 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3201 do_tls_offset_for_global): New functions.
3202 (Target_powerpc::Scan::local): Correct TLS relocations and got
3203 entry values.
3204 (Target_powerpc::Scan::global): Don't emit unnecessary
3205 dynamic relocations on TLS GOT entries.
3206
00716ab1
AM
32072012-09-10 Matthias Klose <doko@ubuntu.com>
3208
3209 * config.in: Disable sanity check for kfreebsd.
3210
c891b3f9
SA
32112012-09-10 Sterling Augustine <saugustine@google.com>
3212
3213 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3214 (Gdb_index::pubtypes_read): New parameter.
3215 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3216 to calls.
3217 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3218 pubtypes_object_.
3219
e81fea4d
AM
32202012-09-09 Alan Modra <amodra@gmail.com>
3221
3222 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3223 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3224 * gc.h (gc_process_relocs): Call target gc_add_reference.
3225 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3226 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3227 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3228 unnecessary cast.
3229 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3230 to cater for when we don't need code offset. Update use.
3231 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3232 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3233 set_opd_valid): New functions.
3234 (Target_powerpc::do_gc_add_reference): New function.
3235 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3236 stashed refs.
3237 (Target_powerpc::do_gc_mark_symbol): New function.
3238
d2d60eef
CC
32392012-09-06 Cary Coutant <ccoutant@google.com>
3240
3241 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3242 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3243 (Dwarf_die::skip_attributes): Likewise.
3244 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3245 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3246 (main): Call it.
3247 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3248
32ed4573
L
32492012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3250
3251 * testsuite/script_test_3.t: Add .got.plt output section
3252 statement.
3253 * testsuite/script_test_4.t: Likewise.
3254
f4baf0d4
AM
32552012-09-05 Alan Modra <amodra@gmail.com>
3256
3257 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3258 update all uses and lose "enum" when using type.
3259
864a1b56
AM
32602012-09-05 Alan Modra <amodra@gmail.com>
3261
3262 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3263 * configure: Regenerate.
3264 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3265 (plugin_final_layout.stdout): Likewise.
3266 (memory_test): Set page sizes to 0x1000.
3267 * testsuite/Makefile.in: Regenerate.
3268 * testsuite/discard_locals_test.sh: Add FIXME comment.
3269 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3270 * testsuite/pr14265.t: Add .got output section statement.
3271 * testsuite/script_test_2.t: Likewise.
3272 * testsuite/script_test_3.t: Likewise.
3273 * testsuite/script_test_4.t: Likewise.
3274 * testsuite/script_test_5.t: Likewise.
3275 * testsuite/script_test_6.t: Likewise.
3276 * testsuite/script_test_7.t: Likewise.
3277 * testsuite/script_test_9.t: Likewise.
3278
3ea0a085
AM
32792012-09-05 Alan Modra <amodra@gmail.com>
3280
3281 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3282 (Powerpc_relocate_functions::Status): New typedef.
3283 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3284 (Target_powerpc::Scan::local): Handle REL64.
3285 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3286 for REL32 and REL64.
3287 (Target_powerpc::symval_for_branch): New function, extracted from..
3288 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3289 checks. Report overflow errors.
3290
7404fe1b
AM
32912012-09-05 Alan Modra <amodra@gmail.com>
3292
3293 * object.h (Sized_relobj_file::emit_relocs): Delete.
3294 (Sized_relobj_file::emit_relocs_reltype): Delete.
3295 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3296 relocate_relocs for --emit-relocs.
3297 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3298 * output.h: Update comment.
3299 (Output_segment::first_section): New function.
3300 (Output_segment::first_section_load_address): Use first_section.
3301 * output.cc (Output_segment::first_section): New function extracted..
3302 (Output_segment::first_section_load_address): ..from here. Delete.
3303 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3304 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3305 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3306 adjust call to target.h function.
3307 * i386.cc (Target_i386): Likewise.
3308 * sparc.cc (Target_sparc): Likewise.
3309 * x86_64.cc (Target_x86_64): Likewise.
3310 * powerpc.cc (Target_powerpc): Likewise.
3311 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3312 first tls section has section symbol for optimised local dynamic
3313 output relocs.
3314 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3315 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3316 optimised tls code.
3317 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3318 Rename to relocate_relocs. Update error message.
3319
957564c9
AS
33202012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3321
3322 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3323 --just-symbols.
3324
dd93cd0a
AM
33252012-08-31 Alan Modra <amodra@gmail.com>
3326
3327 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3328 (Powerpc_relobj::toc_base_offset): New stub function.
3329 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3330 got_mod_index_offset to tlsld_got_offset. Update all refs.
3331 (Target_powerpc::Relocate::enum skip_tls): New.
3332 (Target_powerpc::call_tls_get_addr_): New var.
3333 (Target_powerpc::is_branch_reloc): Move to file scope.
3334 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3335 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3336 New functions.
3337 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3338 (powerpc_info): Correct common_pagesize for ppc64.
3339 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3340 (Powerpc_relocate_functions): Add overflow check enums and functions.
3341 Add non-shift version of rela, rela_ua. Delete all rel public
3342 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3343 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3344 addr16_ha3, addr14 functions.
3345 (Output_data_got_powerpc::add_constant_pair): New function.
3346 (Output_data_got_powerpc::got_base_offset): Likewise.
3347 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3348 (instruction constants): Sort, add some more.
3349 (Output_data_glink::do_write): Add and use Address typedef. Use
3350 object->toc_base_offset() stub for 64-bit.
3351 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3352 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3353 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3354 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3355 Always treat .opd relocs as against locally defined symbol.
3356 Correct condition for RELATIVE relocs.
3357 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3358 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3359 for 32-bit syms with a plt entry. Correct ppc64 toc base
3360 calculations. Handle TLS relocs, and more. Add overflow
3361 checking and adjust for Powerpc_relocate_functions changes.
3362 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3363 Reinstate --emit-relocs code with FIXME.
3364
a1373b60
AM
33652012-08-30 Alan Modra <amodra@gmail.com>
3366
3367 * layout.cc (Layout::set_segment_offsets): Set p_align to
3368 abi_pagesize, not common_pagesize.
3369 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3370 to determine whether file header can go in segment.
3371
703d02da
AM
33722012-08-30 Alan Modra <amodra@gmail.com>
3373
3374 * output.h (Output_reloc::Output_reloc <output section>): Add
3375 is_relative param. Adjust calls.
3376 (Output_reloc::add_output_section_relative): New functions.
3377 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3378 is_relative.
3379 (Output_reloc::symbol_value): Handle SECTION_CODE.
3380
16164a6b
ST
33812012-08-24 Sriraman Tallam <tmsriram@google.com>
3382
3383 * gold.cc (queue_middle_tasks): Call layout again when unique
3384 segments for sections is desired.
3385 * layout.cc (Layout::Layout): Initialize new members.
3386 (Layout::get_output_section_flags): New function.
3387 (Layout::choose_output_section): Call get_output_section_flags.
3388 (Layout::layout): Make output section for mapping to a unique segment.
3389 (Layout::insert_section_segment_map): New function.
3390 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3391 output sections marked so.
16164a6b
ST
3392 (Layout::segment_precedes): Check for unique segments when sorting.
3393 * layout.h (Layout::Unique_segment_info): New struct.
3394 (Layout::Section_segment_map): New typedef.
3395 (Layout::insert_section_segment_map): New function.
3396 (Layout::get_output_section_flags): New function.
3397 (Layout::is_unique_segment_for_sections_specified): New function.
3398 (Layout::set_unique_segment_for_sections_specified): New function.
3399 (Layout::unique_segment_for_sections_specified_): New member.
3400 (Layout::section_segment_map_): New member.
3401 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3402 Rename is_gc_pass_one to is_pass_one.
3403 Rename is_gc_pass_two to is_pass_two.
3404 Rename is_gc_or_icf to is_two_pass.
3405 Check for which pass based on whether symbols data is present.
3406 Make it two pass when unique segments for sections is desired.
3407 * output.cc (Output_section::Output_section): Initialize new
3408 members.
3409 * output.h (Output_section::is_unique_segment): New function.
3410 (Output_section::set_is_unique_segment): New function.
3411 (Output_section::is_unique_segment_): New member.
3412 (Output_section::extra_segment_flags): New function.
3413 (Output_section::set_extra_segment_flags): New function.
3414 (Output_section::extra_segment_flags_): New member.
3415 (Output_section::segment_alignment): New function.
3416 (Output_section::set_segment_alignment): New function.
3417 (Output_section::segment_alignment_): New member.
3418 (Output_segment::Output_segment): Initialize is_unique_segment_.
3419 (Output_segment::is_unique_segment): New function.
3420 (Output_segment::set_is_unique_segment): New function.
3421 (Output_segment::is_unique_segment_): New member.
3422 * plugin.cc (allow_unique_segment_for_sections): New function.
3423 (unique_segment_for_sections): New function.
3424 (Plugin::load): Add new functions to transfer vector.
3425 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3426 * Makefile.in: Regenerate.
3427 * testsuite/plugin_final_layout.sh: Check if unique segment
3428 functionality works.
3429 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3430 are available.
3431 (allow_unique_segment_for_sections): New global.
3432 (unique_segment_for_sections): New global.
3433 (claim_file_hook): Call allow_unique_segment_for_sections.
3434 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3435
1e2bee4f
CC
34362012-08-22 Cary Coutant <ccoutant@google.com>
3437
3438 * layout.cc (Layout::include_section): Don't assert on GROUP
3439 sections with --emit-relocs.
3440
1d5dfe78
CC
34412012-08-21 Cary Coutant <ccoutant@google.com>
3442
3443 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3444 if --export-dynamic-symbol names an undef symbol.
3445
c9269dff
AM
34462012-08-18 Alan Modra <amodra@gmail.com>
3447
3448 * powerpc.cc: Formatting and white space.
3449 (Powerpc_relobj): Rename got2_section_ to special_.
3450 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3451 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3452 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3453 (Target_powerpc): Add Address typedef and invalid_address. Use
3454 throughout.
3455 (Target_powerpc::is_branch_reloc): New function.
3456 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3457 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3458 for dst_mask, value and addend.
3459 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3460 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3461 (Output_data_glink::do_write): Correct toc base. Don't try to use
3462 uint16_t for 24-bit offset. Use get_output_section_offset and
3463 check return.
3464 (Target_powerpc::Scan::local): Handle more relocs.
3465 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3466 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3467 Plug in toc restoring insn after plt calls. Translate branches
3468 to function descriptor symbols to corresponding entry point.
3469 (Target_powerpc::relocate_for_relocatable): Check return from
3470 get_output_section_offset.
3471 * symtab.h: Comment typo.
3472
b1759dce
ILT
34732012-08-14 Ian Lance Taylor <iant@google.com>
3474
3475 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3476 unsupported_relocal_local to call unsupported_reloc_global.
3477
b9b2ae8b
NC
34782012-08-14 Nick Clifton <nickc@redhat.com>
3479
3480 PR ld/14265
3481 * script-sections.cc (Sections_element::output_section_name): Add
3482 keep return parameter.
3483 (Output_section_element::match_name): Add keep return parameter.
3484 Return the value of the keep_ member.
3485 * script-sections.h (class Output_section): Update
3486 output_section_name prototype.
3487 * layout.cc (Layout::keep_input_section): New public member
3488 function.
3489 (Layout::choose_output_section): Pass keep parameter to
3490 output_section_name.
3491 * layout.h (class Layout): Add keep_input_section.
3492 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3493 sections.
3494 * testsuite/Makefile.am: Add a test.
3495 * testsuite/Makefile.in: Regenerate.
3496 * testsuite/pr14265.c: Source file for the test.
3497 * testsuite/pr14265.t: Linker script for the test.
3498 * testsuite/pr14265.sh: Shell script for the test.
3499
921b5322
AM
35002012-08-14 Alan Modra <amodra@gmail.com>
3501
3502 * target.h (Target::output_section_name): New function.
3503 (Target::do_output_section_name): New function.
3504 * layout.cc (Layout::choose_output_section): Call the above.
3505 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3506
6ce78956
AM
35072012-08-14 Alan Modra <amodra@gmail.com>
3508
3509 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3510 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3511 for replace_constant call.
3512 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3513 (Output_data_glink::do_print_to_mapfile): New function.
3514 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3515 (Target_powerpc::Relocate::relocate): Likewise.
3516
d1a8cabd
AM
35172012-08-14 Alan Modra <amodra@gmail.com>
3518
3519 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3520 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3521 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3522 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3523 all references to shndx_. Handle special case for R_PPC_PLTREL24
3524 here.
3525 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3526 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3527 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3528 here.
3529 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3530 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3531
d83ce4e3
AM
35322012-08-12 Alan Modra <amodra@gmail.com>
3533
3534 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3535 (glink insn constants): Use uint32_t.
3536 (Output_data_glink::add_entry): Use insert, not [] operator.
3537
cf43a2fe
AM
35382012-08-11 Alan Modra <amodra@gmail.com>
3539
3540 * object.h (Sized_relobj_file::find_shdr): New function.
3541 (Sized_relobj_file::find_special_sections): New function.
3542 * object.cc (Sized_relobj_file::find_shdr): New function.
3543 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3544 (Sized_relobj_file::find_special_sections): New function, split out..
3545 (Sized_relobj_file::do_read_symbols): ..from here.
3546 * output.h (Output_data_got::replace_constant): New function.
3547 (Output_data_got::num_entries): New function.
3548 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3549 (Output_data_got::got_offset): Protected rather than private.
3550 (Output_data_got::replace_got_entry): New function.
3551 * output.cc (Output_data_got::replace_got_entry): New function.
3552 * powerpc.cc (class Powerpc_relobj): New.
3553 (class Powerpc_relocate_functions): Delete all psymval variants or
3554 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3555 Implement _ha functions using corresponding _hi function.
3556 (Powerpc_relobj::find_special_sections): New function.
3557 (Target_powerpc::do_make_elf_object): New function.
3558 (class Output_data_got_powerpc): New.
3559 (class Output_data_glink): New.
3560 (class Powerpc_scan_relocatable_reloc): New.
3561 Many more changes througout file.
3562
3c892704
NC
35632012-08-09 Nick Clifton <nickc@redhat.com>
3564
3565 * po/vi.po: Updated Vietnamese translation.
3566
82435b3b
ILT
35672012-08-07 Ian Lance Taylor <iant@google.com>
3568
3569 * layout.cc (Layout::add_target_dynamic_tags): If
3570 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3571 plt_rel.
3572
a6dc81d2
NC
35732012-07-30 Nick Clifton <nickc@redhat.com>
3574
3575 * po/gold.pot: Updated template.
3576 * po/es.po: Updated Spanish translation.
3577
f1415016
CC
35782012-07-18 Cary Coutant <ccoutant@google.com>
3579
3580 PR gold/14344
3581 * configure.ac: Add check for -gpubnames support.
3582 * configure: Regenerate.
3583 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3584 support; force -gno-pubnames.
3585 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3586 support.
3587 (gdb_index_test_4): New test.
3588 * testsuite/Makefile.in: Regenerate.
3589 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3590 * testsuite/gdb_index_test_2.sh: Likewise.
3591 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3592 * testsuite/gdb_index_test_4.sh: New script.
3593 * testsuite/gdb_index_test_comm.sh: New script with common code;
3594 don't look for space after colon.
3595
b7fd7c37
ST
35962012-07-16 Sriraman Tallam <tmsriram@google.com>
3597
3598 * gold.cc (queue_middle_tasks): Update function order only after
3599 deferred objects due to plugins are processed.
3600
1f3212db
ILT
36012012-07-11 Ian Lance Taylor <iant@google.com>
3602
3603 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3604 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3605 (Target_arm::scan_reloc_for_stub): Likewise.
3606 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3607 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3608 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3609 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3610 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3611
81c82a68
ILT
36122012-07-10 Dodji Seketeli <dodji@redhat.com>
3613 Ian Lance Taylor <iant@google.com>
3614
3615 PR gold/14309
3616 * configure.ac: Test whether std::tr1::hash<off_t> works.
3617 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3618 needed.
3619 * output.h (class Output_fill): Add virtual destructor.
3620 * configure, config.in: Rebuild.
3621
eabc84f4
RM
36222012-06-22 Roland McGrath <mcgrathr@google.com>
3623
3624 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3625
370e30b6
RÁE
36262012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3627
3628 * plugin.cc (Plugin::load): Handle position independent executables.
3629
fb1b895d
CC
36302012-06-06 Cary Coutant <ccoutant@google.com>
3631
3632 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3633 add .debug_macro.
3634 (lines_only_debug_sections): Likewise.
3635 (gdb_fast_lookup_sections): New static array.
3636 (is_gdb_debug_section): Rename formal parameter.
3637 (is_lines_only_debug_section): Likewise.
3638 (is_gdb_fast_lookup_section): New function.
3639 (Layout::include_section): Check for ".zdebug_" prefix; pass
3640 section name suffix to is_gdb_debug_section, et al.; check for
3641 fast-lookup sections when building .gdb_index.
3642 * options.h (--strip-debug-gdb): Update GDB version number.
3643
7c0640fa
CC
36442012-06-06 Cary Coutant <ccoutant@google.com>
3645
3646 * configure.ac: Add check for fallocate.
3647 * configure: Regenerate.
3648 * config.in: Regenerate.
3649
3650 * options.h (class General_options): Add --mmap-output-file and
3651 --posix-fallocate options.
3652 * output.cc: (posix_fallocate): Remove; replace with...
3653 (gold_fallocate): New function.
3654 (Output_file::map_no_anonymous): Call gold_fallocate.
3655 (Output_file::map): Check --mmap-output-file option.
3656
2a49eb69
DK
36572012-06-05 Jing Yu <jingyu@google.com>
3658
3659 * gold.h (textdomain): Add do {} to empty while(0).
3660 (bindtextdomain): Likewise.
3661
fad072ac
CC
36622012-06-04 Cary Coutant <ccoutant@google.com>
3663
3664 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3665 has_dynsym_index.
3666
8cc69fb6
ST
36672012-05-25 Sriraman Tallam <tmsriram@google.com>
3668
3669 * symtab.cc (Symbol_table::define_special_symbol):
3670 Initialize *poldsym to prevent uninitialized variable errors.
3671
1be75daa
CC
36722012-05-23 Cary Coutant <ccoutant@google.com>
3673
3674 * layout.cc (Layout::section_name_mapping): Add rules to handle
3675 exact match on .data.rel.ro.local or .data.rel.ro.
3676 (Layout::output_section_name): Check for exact matches.
3677
9b689de0
CC
36782012-05-23 Cary Coutant <ccoutant@google.com>
3679
3680 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3681 more carefully.
3682
b24fdbf5
CC
36832012-05-22 Cary Coutant <ccoutant@google.com>
3684
3685 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3686 object before exporting symbol.
3687
e550e1a2
L
36882012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3689
3690 * testsuite/tls_test.cc: Include "config.h" first.
3691 * testsuite/tls_test_c.c: Likewise.
3692
df7b86aa
NC
36932012-05-17 Daniel Richard G. <skunk@iskunk.org>
3694 Nick Clifton <nickc@redhat.com>
3695
3696 PR 14072
3697 * configure.in: Add check that sysdep.h has been included before
3698 any system header files.
3699 * configure: Regenerate.
3700 * config.in: Regenerate.
3701
1007b503
CC
37022012-05-14 Cary Coutant <ccoutant@google.com>
3703
3704 * layout.cc (Layout::make_output_section): Mark .tdata section
3705 as RELRO.
3706 * testsuite/relro_test.cc: Add a TLS variable.
3707
fd885f3a
L
37082012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3709
3710 PR gold/14091
3711 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3712 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3713 R_X86_64_64.
3714
80f5885c
CC
37152012-05-08 Cary Coutant <ccoutant@google.com>
3716
3717 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3718 (lines_only_debug_sections): Likewise.
3719
2e702c99
RM
37202012-05-02 Roland McGrath <mcgrathr@google.com>
3721
3722 * nacl.cc: New file.
3723 * nacl.h: New file.
3724 * Makefile.am (CCFILES, HFILES): Add them.
3725 * Makefile.in: Regenerate.
3726 * i386.cc (Output_data_plt_i386_nacl): New class.
3727 (Output_data_plt_i386_nacl_exec): New class.
3728 (Output_data_plt_i386_nacl_dyn): New class.
3729 (Target_i386_nacl): New class.
3730 (Target_selector_i386_nacl): New class.
3731 (target_selector_i386): Use it instead of Target_selector_i386.
3732 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3733 (Target_x86_64_nacl): New class.
3734 (Target_selector_x86_64_nacl): New class.
3735 (target_selector_x86_64, target_selector_x32): Use it instead of
3736 Target_selector_x86_64.
3737 * arm.cc (Output_data_plt_arm_nacl): New class.
3738 (Target_arm_nacl): New class.
3739 (Target_selector_arm_nacl): New class.
3740 (target_selector_arm, target_selector_armbe): Use it instead of
3741 Target_selector_arm.
3742
3743 * target-select.cc (select_target): Take new Input_file* and off_t
3744 arguments, pass them on to recognize method of selector.
3745 * object.cc (make_elf_sized_object): Update caller.
3746 * parameters.cc (parameters_force_valid_target): Likewise.
3747 * incremental.cc (make_sized_incremental_binary): Likewise.
3748 * target-select.h: Update decl.
3749 (Target_selector::recognize): Take new Input_file* argument,
3750 pass it on to do_recognize.
3751 (Target_selector::do_recognize): Take new Input_file* argument.
3752 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3753 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3754 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3755 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3756
3757 * target.h (Target::Target_info): New members isolate_execinstr
3758 and rosegment_gap.
3759 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3760 * arm.cc (Target_arm::arm_info): Update initializer.
3761 * i386.cc (Target_i386::i386_info): Likewise.
3762 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3763 * sparc.cc (Target_sparc::sparc_info): Likewise.
3764 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3765 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3766 * layout.cc (Layout::attach_allocated_section_to_segment):
3767 Take new const Target* argument. If target->isolate_execinstr(), act
3768 like --rosegment.
3769 (Layout::find_first_load_seg): Take new const Target* argument;
3770 if target->isolate_execinstr(), reject PF_X segments.
3771 (Layout::relaxation_loop_body): Update caller.
3772 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3773 reset file offset to zero when we hit LOAD_SEG, and then do a second
3774 loop over the segments before LOAD_SEG to reassign offsets after
3775 addresses have been determined. Handle target->rosegment_gap().
3776 (Layout::attach_section_to_segment): Take new const Target* argument;
3777 pass it to attach_allocated_section_to_segment.
3778 (Layout::make_output_section): Update caller.
3779 (Layout::attach_sections_to_segments): Take new const Target* argument;
3780 pass it to attach_section_to_segment.
3781 * gold.cc (queue_middle_tasks): Update caller.
3782 * layout.h (Layout): Update method decls with new arguments.
3783
3784 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3785 Target_info pointer to use.
3786 (Target_arm::do_make_data_plt): New virtual method.
3787 (Target_arm::make_data_plt): New method that calls it.
3788 (Target_arm::make_plt_entry): Use it.
3789 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3790 for the section alignment.
3791 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3792 method.
3793 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3794 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3795 method.
3796 (Output_data_plt_arm::get_plt_entry_size): Call it.
3797 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3798 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3799 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3800 method.
3801 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3802 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3803 method instead of sizeof(plt_entry).
3804 (Output_data_plt_arm::add_entry): Likewise.
3805 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3806 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3807 than static method.
3808 (Target_arm::plt_entry_size): Likewise.
3809 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3810 Move to ...
3811 (Output_data_plt_arm_standard): ... here, new class.
3812 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3813 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3814 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3815
3816 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3817 Take additional argument for the PLT entry size.
3818 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3819 Use get_plt_entry_size method rather than plt_entry_size variable.
3820 (Output_data_plt_x86_64::reserve_slot): Likewise.
3821 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3822 (Output_data_plt_x86_64::add_entry): Likewise.
3823 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3824 (Output_data_plt_x86_64::address_for_global): Likewise.
3825 (Output_data_plt_x86_64::address_for_local): Likewise.
3826 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3827 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3828 Make method non-static.
3829 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3830 method.
3831 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3832 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3833 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3834 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3835 virtual method.
3836 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3837 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3838 virtual method.
3839 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3840 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3841 virtual method.
3842 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3843 (Output_data_plt_x86_64::plt_entry_size)
3844 (Output_data_plt_x86_64::first_plt_entry)
3845 (Output_data_plt_x86_64::plt_entry)
3846 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3847 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3848 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3849 (Output_data_plt_x86_64_standard): ... here, new class.
3850 (Target_x86_64::Target_x86_64): Take optional argument for the
3851 Target_info pointer to use.
3852 (Target_x86_64::do_make_data_plt): New virtual method.
3853 (Target_x86_64::make_data_plt): New method to call it.
3854 (Target_x86_64::init_got_plt_for_update): Use that.
3855 Call this->plt_->add_eh_frame method here.
3856 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3857 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3858 rather than static method.
3859 (Target_x86_64::plt_entry_size): Likewise.
3860 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3861 rather than plt_entry_size variable. Move guts of PLT filling to...
3862 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3863 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3864 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3865
3866 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3867 additional argument for the section alignment.
3868 Don't do add_eh_frame_for_plt here.
3869 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3870 non-static. Use get_plt_entry_size method rather than plt_entry_size
3871 variable.
3872 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3873 method.
3874 (Output_data_plt_i386::get_plt_entry_size): Call it.
3875 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3876 (Output_data_plt_i386::add_eh_frame): New method to call it.
3877 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3878 method.
3879 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3880 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3881 method.
3882 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3883 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3884 method instead of plt_entry_size.
3885 (Output_data_plt_i386::plt_entry_size)
3886 (Output_data_plt_i386::plt_eh_frame_fde_size)
3887 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3888 (Output_data_plt_i386_standard): ... here, new class.
3889 (Output_data_plt_i386_exec): New class.
3890 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3891 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3892 (Output_data_plt_i386::exec_plt_entry): Move to ...
3893 (Output_data_plt_i386_exec::plt_entry): ... here.
3894 (Output_data_plt_i386_dyn): New class.
3895 (Output_data_plt_i386::first_plt_entry): Move to ...
3896 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3897 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3898 (Output_data_plt_i386_dyn::plt_entry): ... here.
3899 (Target_i386::Target_i386): Take optional argument for the Target_info
3900 pointer to use.
3901 (Target_i386::do_make_data_plt): New virtual method.
3902 (Target_i386::make_data_plt): New method to call it.
3903 (Target_i386::make_plt_section): Use that.
3904 Call this->plt_->add_eh_frame method here.
3905 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3906 rather than plt_entry_size variable.
3907 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3908 (Output_data_plt_i386::address_for_local): Likewise.
3909 (Output_data_plt_i386::do_write): Likewise.
3910 Move guts of PLT filling to...
3911 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3912 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3913 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3914 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3915
b9b9f2ee
CC
39162012-05-01 Cary Coutant <ccoutant@google.com>
3917
3918 * dwarf_reader.cc (Dwarf_die::read_attributes)
3919 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3920 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3921 * reduced_debug_output.cc
3922 (Output_reduced_debug_info_section::get_die_end): Remove
3923 DW_FORM_GNU_ref_index. Add default case.
3924
57923f48
MW
39252012-04-26 Mark Wielaard <mjw@redhat.com>
3926
3927 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3928 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3929 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3930 DW_AT_high_pc as offset from DW_AT_low_pc.
3931
3932 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3933 * testsuite/Makefile.in: Regenerate.
3934 * testsuite/gdb_index_test_3.c: New test source file.
3935 * testsuite/gdb_index_test_3.sh: New test source file.
3936
2c54b4f4
ILT
39372012-04-25 Ian Lance Taylor <iant@google.com>
3938
3939 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3940 pointer.
3941 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3942 as a class, not a struct.
3943 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3944 (Target_arm::apply_cortex_a8_workaround): Likewise.
3945 * gc.h: Declare Reloc_types as a struct, not a class.
3946 * object.h: Declare Symbols_data as a struct.
3947 * reloc.h: Declare Read_relocs_data as a struct.
3948 * target.h: Declare Relocate_info as a struct.
3949
a5a5f7a3
DM
39502012-04-24 David S. Miller <davem@davemloft.net>
3951
3952 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3953 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3954 and R_SPARC_WPLT30.
3955
f038d496
CC
39562012-04-24 Cary Coutant <ccoutant@google.com>
3957
3958 * incremental-dump.cc (find_input_containing_global): Replace
3959 magic number with symbolic constant.
3960 (dump_incremental_inputs): Update version number.
3961 * incremental.cc (Output_section_incremental_inputs): Update version
3962 number; import symbolic constants from Incremental_inputs_reader.
3963 (Incremental_inputs::create_data_sections): Align relocations
3964 section correctly for 64-bit targets.
3965 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3966 constants; add padding.
3967 (Output_section_incremental_inputs::write_header): Add assert for
3968 header_size.
3969 (Output_section_incremental_inputs::write_input_files): Add assert
3970 for input_entry_size.
3971 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3972 add assert for object_info_size, input_section_entry_size,
3973 global_sym_entry_size.
3974 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3975 for data structure sizes; use them.
3976 (Incremental_input_entry_reader): Import symbolic constants from
3977 Incremental_inputs_reader; use them.
3978
a4d85145
DM
39792012-04-23 David S. Miller <davem@davemloft.net>
3980
3981 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3982 and elf_flags_set_.
3983 (Target_sparc::Target_sparc): Initialize new fields.
3984 (Target_sparc::do_make_elf_object): New function.
3985 (Target_sparc::do_adjust_elf_header): New function.
3986
1d509098
CC
39872012-04-23 Cary Coutant <ccoutant@google.com>
3988
3989 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3990 CU range table of gdb index.
3991
7ebeff7f
DM
39922012-04-20 David S. Miller <davem@davemloft.net>
3993
3994 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3995 instead of false.
3996
13cf9988
DM
39972012-04-16 David S. Miller <davem@davemloft.net>
3998
2a1079e8
DM
3999 * sparc.cc (Target_sparc::got_address): New function.
4000 (Sparc_relocate_functions::gdop_hix22): New function.
4001 (Sparc_relocate_functions::gdop_lox10): New function.
4002 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4003 relocs.
4004 (Target_sparc::Scan::local): Likewise if the global symbol is not
4005 preemptible and is not IFUNC.
4006 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4007 transformations for local and non-preemptible non-IFUNC global
4008 symbols.
4009
0bc964fc
DM
4010 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4011 writing out 64-bit part of ranges.
4012
661d7a80
DM
4013 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4014 -fpic and -fpie respectively.
4015 * Makefile.in: Regenerate.
4016
8c2bf391
DM
4017 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4018 (Target_sparc::Target_sparc): Initialize new field.
4019 (Target_sparc::do_plt_section_for_global): New function.
4020 (Target_sparc::do_plt_section_for_local): New function.
4021 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4022 (Target_sparc::make_plt_section): New function, broken out of
4023 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4024 (Target_sparc::make_plt_entry): Call make_plt_section.
4025 (Target_sparc::make_local_ifunc_plt_entry): New function.
4026 (Target_sparc::rela_ifunc_section): New function.
4027 (Target_sparc::plt_section): Remove const.
4028 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4029 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4030 and ifunc_count_ fields.
4031 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4032 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4033 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4034 (Output_data_plt_sparc::rela_ifunc): New function.
4035 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4036 (Output_data_plt_sparc::has_ifunc_section): New function.
4037 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4038 (Output_data_plt_sparc::address_for_global): New function.
4039 (Output_data_plt_sparc::address_for_local): New function.
4040 (Output_data_plt_sparc::plt_index_to_offset): New function.
4041 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4042 and entry_count.
4043 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4044 entry_count.
4045 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4046 R_SPARC_JMP_IREL to switch.
4047 (Target_sparc::Scan::check_non_pic): Likewise.
4048 (Target_sparc::Scan::local): Handle IFUNC symbols.
4049 (Target_sparc::Scan::local): Likewise.
4050 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4051 and plt_address_for_local.
4052 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4053 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4054
13cf9988
DM
4055 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4056 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4057 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4058 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4059 global relocs too.
4060 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4061 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4062 calls.
4063 * sparc.cc (Target_sparc::Scan::global): Likewise.
4064 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4065
31821be0
CC
40662012-04-16 Cary Coutant <ccoutant@google.com>
4067
4068 * archive.cc (Library_base::should_include_member): Check for
4069 --export-dynamic-symbol.
4070 * options.h (class General_options): Add --export-dynamic-symbol.
4071 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4072 --export-dynamic-symbol.
4073 (Symbol_table::gc_mark_undef_symbols): Likewise.
4074 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4075
2615994e
DM
40762012-04-12 David S. Miller <davem@davemloft.net>
4077
4078 * sparc.cc (Reloc::wdisp10): New relocation method.
4079 (Reloc::h34): Likewise.
4080 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4081 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4082 R_SPARC_WDISP10.
4083 (Target_sparc::Scan::local): Likewise.
4084 (Target_sparc::Scan::global): Likewise.
4085 (Target_sparc::Relocate::relocate): Likewise.
4086
6782735d
CC
40872012-04-09 Cary Coutant <ccoutant@google.com>
4088
4089 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4090 low_pc == 0.
4091
8c7a0b00
ILT
40922012-04-06 Ian Lance Taylor <iant@google.com>
4093
4094 * timer.cc: #include <unistd.h>.
4095
58797674
RM
40962012-04-06 Roland McGrath <mcgrathr@google.com>
4097
4098 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4099 * config.in: Regenerate.
4100 * configure: Regenerate.
4101
44350750
NC
41022012-04-05 Nick Clifton <nickc@redhat.com>
4103
4104 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4105 (AM_LC_MESSAGES): Add.
4106 * aclocal.m4: Regenerate.
4107 * config.in: Regenerate.
4108 * configure: Regenerate.
4109
c1027032
CC
41102012-03-21 Cary Coutant <ccoutant@google.com>
4111
4112 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4113 * Makefile.in: Regenerate.
4114 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4115 (Sized_elf_reloc_mapper::symbol_section): New function.
4116 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4117 (make_elf_reloc_mapper): New function.
4118 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4119 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4120 (Dwarf_abbrev_table::do_get_abbrev): New function.
4121 (Dwarf_ranges_table::read_ranges_table): New function.
4122 (Dwarf_ranges_table::read_range_list): New function.
4123 (Dwarf_pubnames_table::read_section): New function.
4124 (Dwarf_pubnames_table::read_header): New function.
4125 (Dwarf_pubnames_table::next_name): New function.
4126 (Dwarf_die::Dwarf_die): New function.
4127 (Dwarf_die::read_attributes): New function.
4128 (Dwarf_die::skip_attributes): New function.
4129 (Dwarf_die::set_name): New function.
4130 (Dwarf_die::set_linkage_name): New function.
4131 (Dwarf_die::attribute): New function.
4132 (Dwarf_die::string_attribute): New function.
4133 (Dwarf_die::int_attribute): New function.
4134 (Dwarf_die::uint_attribute): New function.
4135 (Dwarf_die::ref_attribute): New function.
4136 (Dwarf_die::child_offset): New function.
4137 (Dwarf_die::sibling_offset): New function.
4138 (Dwarf_info_reader::check_buffer): New function.
4139 (Dwarf_info_reader::parse): New function.
4140 (Dwarf_info_reader::do_parse): New function.
4141 (Dwarf_info_reader::do_read_string_table): New function.
4142 (Dwarf_info_reader::lookup_reloc): New function.
4143 (Dwarf_info_reader::get_string): New function.
4144 (Dwarf_info_reader::visit_compilation_unit): New function.
4145 (Dwarf_info_reader::visit_type_unit): New function.
4146 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4147 Sized_elf_reloc_mapper.
4148 (Sized_dwarf_line_info::symbol_section): Remove function.
4149 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4150 (Sized_dwarf_line_info::read_line_mappings): Remove object
4151 parameter, adjust callers.
4152 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4153 * dwarf_reader.h: Include <sys/types.h>.
4154 (class Track_relocs): Remove forward declaration.
4155 (class Elf_reloc_mapper): New class.
4156 (class Sized_elf_reloc_mapper): New class.
4157 (class Dwarf_abbrev_table): New class.
4158 (class Dwarf_range_list): New class.
4159 (class Dwarf_ranges_table): New class.
4160 (class Dwarf_pubnames_table): New class.
4161 (class Dwarf_die): New class.
4162 (class Dwarf_info_reader): New class.
4163 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4164 (Sized_dwarf_line_info::symbol_section): Remove member function.
4165 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4166 base class.
4167 * gdb-index.cc: New source file.
4168 * gdb-index.h: New source file.
4169 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4170 and .debug_types sections, call Layout::add_to_gdb_index.
4171 (Sized_relobj_incr::do_section_name): Implement.
4172 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4173 return type; Implement.
4174 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4175 return type.
4176 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4177 parameter list and return type.
4178 (Sized_incr_dynobj::do_section_contents): Likewise.
4179 * layout.cc: Include gdb-index.h.
4180 (Layout::Layout): Initialize gdb_index_data_.
4181 (Layout::init_fixed_output_section): Check for .gdb_index section.
4182 (Layout::add_to_gdb_index): New function. Instantiate.
4183 * layout.h: Add forward declaration for class Gdb_index.
4184 (Layout::add_to_gdb_index): New member function.
4185 (Layout::gdb_index_data_): New data member.
4186 * main.cc: Include gdb-index.h.
4187 (main): Print statistics for gdb index.
4188 * object.cc (Object::section_contents): Move code into
4189 do_section_contents.
4190 (need_decompressed_section): Check for sections needed when building
4191 gdb index.
4192 (build_compressed_section_map): Likewise.
4193 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4194 gdb index.
4195 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4196 sections; call Layout::add_to_gdb_index.
4197 (Sized_relobj_file::do_decompressed_section_contents): Call
4198 do_section_contents directly.
4199 * object.h (Object::do_section_contents): Adjust parameter list and
4200 return type.
4201 (Object::do_decompressed_section_contents): Call do_section_contents
4202 directly.
4203 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4204 return type.
4205 * options.h (class General_options): Add --gdb-index option.
4206 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4207 list and return type.
4208 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4209 * reloc.h (Track_relocs::checkpoint): New function.
4210 (Track_relocs::reset): New function.
4211
4212 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4213 New test cases.
4214 * testsuite/Makefile.in: Regenerate.
4215 * testsuite/gdb_index_test.cc: New test source file.
4216 * testsuite/gdb_index_test_1.sh: New test source file.
4217 * testsuite/gdb_index_test_2.sh: New test source file.
4218
647f1574
DK
42192012-03-19 Doug Kwan <dougkwan@google.com>
4220
4221 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4222 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4223 __exidx_start and __exidx_end. Make symbol table parameter
4224 anonymous as it is not used.
4225 * gold.cc (queue_middle_tasks): Call target hook to define any
4226 target-specific symbols.
4227 * target.h (Target::define_standard_symbols): New method.
4228 (Target::do_define_standard_symbols): Same.
4229 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4230 * testsuite/Makefile.in: Regenerate.
4231 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4232 and __exidx_end.
4233 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4234 relocations are generated for __exidx_start and __exidx_end.
4235
7c6109da
DK
42362012-03-16 Doug Kwan <dougkwan@google.com>
4237
4238 * testsuite/Makefile.am: Disable test initpri3b.
4239 * testsuite/Makefile.in: Regenerate.
4240
7b8957f8
DK
42412012-03-15 Doug Kwan <dougkwan@google.com>
4242
4243 * arm.cc (Target_arm::got_section): Make .got section read-only
4244 if -z now is given.
4245
14dc9ef7
ILT
42462012-03-15 Ian Lance Taylor <iant@google.com>
4247
4248 PR gold/13850
4249 * layout.cc (Layout::make_output_section): Correctly mark
4250 SHT_INIT_ARRAY, et. al., as relro.
4251
fa40b62a
DK
42522012-03-14 Doug Kwan <dougkwan@google.com>
4253
4254 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4255 dynamic relocations for protected symbols in shared objects.
4256
fd325007
ILT
42572012-03-13 Ian Lance Taylor <iant@google.com>
4258
4259 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4260 keep the larger alignment.
4261
e8dd54e1
CC
42622012-03-12 Cary Coutant <ccoutant@google.com>
4263
4264 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4265 handling of DW_LNE_define_file.
4266
feb5f3b0
CC
42672012-03-12 Cary Coutant <ccoutant@google.com>
4268
4269 * reduced_debug_output.cc
4270 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4271 codes to switch.
4272
a1fb4256
CC
42732012-02-29 Cary Coutant <ccoutant@google.com>
4274
4275 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4276
5dd8762a
CC
42772012-02-29 Cary Coutant <ccoutant@google.com>
4278
4279 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4280 Call Object::decompressed_section_contents.
4281 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4282 New dtor.
4283 (Sized_dwarf_line_info::buffer_start_): New data member.
4284 * merge.cc (Output_merge_data::do_add_input_section): Call
4285 Object::decompressed_section_contents.
4286 (Output_merge_string::do_add_input_section): Likewise.
4287 * object.cc (need_decompressed_section): New function.
4288 (build_compressed_section_map): Decompress sections needed later.
4289 (Sized_relobj_file::do_decompressed_section_contents): New function.
4290 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4291 * object.h (Object::decompressed_section_contents): New function.
4292 (Object::discard_decompressed_sections): New function.
4293 (Object::do_decompressed_section_contents): New function.
4294 (Object::do_discard_decompressed_sections): New function.
4295 (Compressed_section_info): New type.
4296 (Compressed_section_map): Include decompressed section contents.
4297 (Sized_relobj_file::do_decompressed_section_contents): New function.
4298 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4299
7b5de7ee
CC
43002012-02-16 Cary Coutant <ccoutant@google.com>
4301
4302 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4303 * testsuite/Makefile.in: Regenerate.
4304
f9fa4a63
CC
43052012-02-14 Cary Coutant <ccoutant@google.com>
4306
4307 * options.cc (General_options::finalize): Disallow -pie and -static.
4308
2c175ebc
DK
43092012-02-03 Doug Kwan <dougkwan@google.com>
4310
4311 * arm.cc (Arm_relocate_functions::abs8,
4312 Arm_relocate_functions::abs16): Use
4313 Bits::has_signed_unsigned_overflow32.
4314 (Arm_relocate_functions::thm_abs8): Correct range of
4315 overflow check.
4316 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4317 in assertions.
4318
90cff06f
DK
43192012-02-02 Doug Kwan <dougkwan@google.com>
4320
4321 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4322 position independent outputs, not just shared objects.
4323
63887f3d
L
43242012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4325
4326 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4327 * configure: Regenerated.
4328
bef2b434
ILT
43292012-01-27 Ian Lance Taylor <iant@google.com>
4330
4331 * reloc.h (Bits): New class with static functions, copied from
4332 namespace utils in arm.cc.
4333 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4334 instead.
4335
c335b55d
L
43362012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4337
4338 * incremental.cc (write_info_blocks): Correct relocation offset.
4339
41194d9f
L
43402012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4341
4342 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4343 (Relocate::tls_gd_to_le): Likewise.
4344
1bae613c
L
43452012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4346
4347 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4348
24482ca0
L
43492012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4350
4351 * configure.ac: Check if -mcmodel=medium works.
4352 * configure: Regenerated.
4353
c2c7840a
CC
43542012-01-24 Cary Coutant <ccoutant@google.com>
4355
4356 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4357 definition and ...
4358 (read_unsigned_LEB_128_x): ... this new function.
4359 (read_signed_LEB_128): Replaced with inline definition and ...
4360 (read_signed_LEB_128_x): ... this new function.
4361 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4362 (read_unsigned_LEB_128): Add inline definition.
4363 (read_signed_LEB_128_x): New function.
4364 (read_signed_LEB_128): Add inline definition.
4365 * testsuite/Makefile.am (leb128_unittest): New unit test.
4366 * testsuite/Makefile.in: Regenerate.
4367 * testsuite/leb128_unittest.cc: New unit test.
4368
833de760 43692012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4370
4371 PR gold/13617
4372 * i386.cc (Target_i386::do_code_fill): When using a jmp
4373 instruction, pad with nop instructions.
4374 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4375
618d6666
L
43762012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4377
4378 * x86_64.cc (gc_process_relocs): Add typename on types used in
4379 template.
4380 (scan_relocs): Likewise.
4381 (relocate_section): Likewise.
4382 (apply_relocation): Likewise.
4383
3660ff06
L
43842012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4385
4386 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4387 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4388 under x32.
4389
fc51264f
L
43902012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4391
4392 * x86_64.cc: Initial support for x32.
4393
dd74ae06
CC
43942012-01-03 Cary Coutant <ccoutant@google.com>
4395
4396 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4397 Use abstract base class for GOT.
4398 * gold/output.h (class Output_data_got_base): New abstract base class.
4399 (class Output_data_got): Derive from new base class, adjust ctors.
4400 (Output_data_got::reserve_slot): Make virtual; rename to
4401 do_reserve_slot; Adjust callers.
4402 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4403 pointer to abstract base class.
4404 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4405
83896202
ILT
44062011-12-18 Ian Lance Taylor <iant@google.com>
4407
4408 * object.h (Relobj::local_symbol_value): New function.
4409 (Relobj::local_plt_offset): New function.
4410 (Relobj::local_has_got_offset): New function.
4411 (Relobj::local_got_offset): New function.
4412 (Relobj::set_local_got_offset): New function.
4413 (Relobj::do_local_symbol_value): New pure virtual function.
4414 (Relobj::do_local_plt_offset): Likewise.
4415 (Relobj::do_local_has_got_offset): Likewise.
4416 (Relobj::do_local_got_offset): Likewise.
4417 (Relobj::do_set_local_got_offset): Likewise.
4418 (Sized_relobj::do_local_has_got_offset): Rename from
4419 local_has_got_offset.
4420 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4421 (Sized_relobj::do_set_local_got_offset): Rename from
4422 set_local_got_offset.
4423 (Sized_relobj_file::do_local_plt_offset): Rename from
4424 local_plt_offset.
4425 (Sized_relobj_file::do_local_symbol_value): New function.
4426 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4427 local_plt_offset.
4428 * output.cc (Output_data_got::Got_entry::write): Change object to
4429 Relobj. Use local_symbol_value.
4430 (Output_data_got::add_global_with_rel): Change rel_dyn to
4431 Output_data_reloc_generic*. Use add_global_generic.
4432 (Output_data_got::add_global_with_rela): Remove. Change all
4433 callers to use add_global_with_rel.
4434 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4435 Output_data_reloc_generic*. Use add_global_generic.
4436 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4437 callers to use add_global_pair_with_rel.
4438 (Output_data_got::add_local): Change object to Relobj*.
4439 (Output_data_got::add_local_plt): Likewise.
4440 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4441 change rel_dyn to Output_data_reloc_generic*. Use
4442 add_local_generic.
4443 (Output_data_got::add_local_with_rela): Remove. Change all
4444 callers to use all_local_with_rel.
4445 (Output_data_got::add_local_pair_with_rel): Change object to
4446 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4447 add_output_section_generic.
4448 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4449 callers to use add_local_pair_with_rel.
4450 (Output_data_got::reserve_local): Change object to Relobj*.
4451 * output.h: (class Output_data_reloc_generic): Add pure virtual
4452 declarations for add_global_generic, add_local_generic,
4453 add_output_section_generic.
4454 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4455 functions for Output_data_reloc_generic. Update declarations for
4456 changes listed in output.cc.
4457 (class Output_data_got): Change template parameter to got_size.
4458 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4459 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4460 function.
4461 (Sized_relobj_incr::do_local_plt_offset): New function.
4462 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4463 add_global_generic.
4464
76677ad0
CC
44652011-12-17 Cary Coutant <ccoutant@google.com>
4466
4467 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4468 * resolve.cc (Symbol_table::resolve): Likewise.
4469 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4470 arrays.
4471 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4472
8b8dd8d5
ILT
44732011-12-16 Ian Lance Taylor <iant@google.com>
4474
4475 * output.h (Output_data_reloc_generic::add): Only call
4476 add_dynamic_reloc if this is a dynamic reloc section.
4477
d55525b9
L
44782011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4479
4480 PR gold/13505
4481 * target-reloc.h (apply_relocation): Replace <64, false> with
4482 <size, big_endian>.
4483
ff81c7c1
NC
44842011-11-25 Nick Clifton <nickc@redhat.com>
4485
4486 * po/it.po: New Italian translation.
4487
628f39be
SA
44882011-11-17 Sterling Augustine <saugustine@google.com>
4489
4490 * script.cc (script_include_directive): Implement.
4491 (read_script_file): New local variables name and search_path. Update
4492 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4493 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4494 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4495
98ef3ea4
SA
44962011-11-11 Sterling Augustine <saugustine@google.com>
4497
4498 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4499 (file_or_sections_cmd): Likewise.
4500
f4a8b6d7
DK
45012011-11-11 Doug Kwan <dougkwan@google.com>
4502
4503 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4504 if --just-symbols is given.
4505
29ab395d
DK
45062011-11-10 Doug Kwan <dougkwan@google.com>
4507
4508 PR gold/13362
4509 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4510 when processing data relocs.
4511 * reloc.h (Relocate_functions::rel_unaligned): New method.
4512 (Relocate_functions::pcrel_unaligned): Ditto.
4513 (Relocate_functions::rel32_unaligned): Ditto.
4514 (Relocate_functions::pcrel32_unaligned): Ditto.
4515
2c339f71
DK
45162011-11-09 Doug Kwan <dougkwan@google.com>
4517
4518 PR gold/13362
4519 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4520 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4521 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4522 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4523 (Relocate_functions::rel_unaligned): New.
4524 (Relocate_functions::rel32_unaligned): New.
4525 * target-reloc.h (relocate_for_relocatable): Add code to handle
4526 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4527 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4528 arm_unaligned_reloc_r): New targets.
4529 * testsuite/Makefile.in: Regenerate.
4530 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4531 linking.
4532
3f3cddf1
ILT
45332011-11-02 Ian Lance Taylor <iant@google.com>
4534
4535 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4536 NATIVE_LINKER.
4537 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4538 * options.cc (General_options::finalize): Use library search path
4539 from configure script if specified. If not native and no sysroot,
4540 only search TOOLLIBDIR.
4541 * options.h (Search_directory::Search_directory): Change name to
4542 const std::string&.
4543 (General_options::add_to_library_path_with_sysroot): Change arg to
4544 const std::string&.
4545 * configure, Makefile.in, config.in: Rebuild.
4546
a8e2273b
ILT
45472011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4548
4549 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4550 we are working around the ARM1176 Erratum.
4551 * options.h (General_options::fix_arm1176): Add option.
4552 * testsuite/Makefile.am: Add testcases, and keep current ones
4553 working.
4554 * testsuite/Makefile.in: Regenerate.
4555 * testsuite/arm_fix_1176.s: New file.
4556 * testsuite/arm_fix_1176.sh: Likewise.
4557
cd6eab1c
ILT
45582011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4559
4560 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4561 may_use_blx_.
4562 (Target_arm::may_use_blx): Remove method.
4563 (Target_arm::set_may_use_blx): Likewise.
4564 (Target_arm::may_use_v4t_interworking): New method.
4565 (Target_arm::may_use_v5t_interworking): Likewise.
4566 (Target_arm::may_use_blx_): Remove member variable.
4567 (Arm_relocate_functions::arm_branch_common): Check for v5T
4568 interworking.
4569 (Arm_relocate_functions::thumb_branch_common): Likewise.
4570 (Reloc_stub::stub_type_for_reloc): Likewise.
4571 (Target_arm::do_finalize_sections): Correct interworking checks.
4572 * testsuite/Makefile.am: Add new tests.
4573 * testsuite/Makefile.in: Regenerate.
4574 * testsuite/arm_farcall_arm_arm.s: New test.
4575 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4576 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4577 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4578 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4579 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4580 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4581 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4582
286adcf4
CC
45832011-10-31 Cary Coutant <ccoutant@google.com>
4584
4585 PR gold/13023
4586 * expression.cc (Expression::eval_with_dot): Add
4587 is_section_dot_assignment parameter.
4588 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4589 absolute and assigning to dot within a section.
4590 * script-sections.cc
4591 (Output_section_element_assignment::set_section_addresses): Pass
4592 dot_section to set_if_absolute.
4593 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4594 as is_section_dot_assignment flag to eval_with_dot.
4595 (Output_section_element_dot_assignment::set_section_addresses):
4596 Likewise.
4597 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4598 parameter. Also set value if relative to dot_section; set the
4599 symbol's output_section.
4600 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4601 parameter. Adjust all callers.
4602 (Expression::eval_maybe_dot): Likewise.
4603 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4604 Adjust all callers.
4605 * testsuite/script_test_2.t: Test assignment of an absolute value
4606 to dot within an output section element.
4607
9634ed06
CC
46082011-10-31 Cary Coutant <ccoutant@google.com>
4609
4610 * options.h (class General_options): Add --[no-]gnu-unique options.
4611 * symtab.cc (Symbol_table::sized_write_globals): Convert
4612 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4613
de4101c7
CC
46142011-10-31 Cary Coutant <ccoutant@google.com>
4615
4616 PR gold/13359
4617 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4618 unnecessary assertion.
4619 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4620
7257cc92
ST
46212011-10-31 Sriraman Tallam <tmsriram@google.com>
4622
4623 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4624 gc_mark_symbol.
4625 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4626 gc_mark_symbol.
4627 Change to just keep the section associated with symbol.
4628 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4629 they are externally visible and --export-dynamic is turned on.
4630 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4631
bfc34b3f
ILT
46322011-10-19 Ian Lance Taylor <iant@google.com>
4633
4634 PR gold/13163
4635 * script-sections.cc
4636 (Output_section_element_dot_assignment::needs_output_section): New
4637 function.
4638
ea0d8c47
ILT
46392011-10-19 Ian Lance Taylor <iant@google.com>
4640
4641 PR gold/13204
4642 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4643 --section-start option was seen.
4644 * options.h (General_options::any_section_start): New function.
4645
abd242a9
DM
46462011-10-18 David S. Miller <davem@davemloft.net>
4647
4648 PR binutils/13301
4649 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4650 member to track relocation locations that have moved during TLS
4651 reloc optimizations.
4652 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4653 (Target_sparc::Relocate::relocate): Adjust view down by 4
4654 bytes if it matches reloc_adjust_addr_.
4655 (Target_sparc::Relocate::relocate_tls): Always move the
4656 __tls_get_addr call delay slot instruction forward 4 bytes when
4657 performing relaxation.
4658
bab9090f
CC
46592011-10-18 Cary Coutant <ccoutant@google.com>
4660
4661 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4662 (Output_file::map_no_anonymous): Check for non-zero
4663 return code from posix_fallocate.
4664
f7c5b166
CC
46652011-10-17 Cary Coutant <ccoutant@google.com>
4666
4667 PR gold/13245
4668 * plugin.cc (is_visible_from_outside): Check for symbols
4669 referenced from dynamic objects.
4670 * resolve.cc (Symbol_table::resolve): Don't count references
4671 from dynamic objects as references from real ELF files.
4672 * testsuite/plugin_test_2.sh: Adjust expected result.
4673
b490c0bb
CC
46742011-10-17 Cary Coutant <ccoutant@google.com>
4675
4676 * gold.cc: Include timer.h.
4677 (queue_middle_tasks): Stamp time.
4678 (queue_final_tasks): Likewise.
4679 * main.cc (main): Store timer in parameters. Print timers
4680 for each pass.
4681 * parameters.cc (Parameters::Parameters): Initialize timer_.
4682 (Parameters::set_timer): New function.
4683 (set_parameters_timer): New function.
4684 * parameters.h (Parameters::set_timer): New function.
4685 (Parameters::timer): New function.
4686 (Parameters::timer_): New data member.
4687 (set_parameters_timer): New function.
4688 * timer.cc (Timer::stamp): New function.
4689 (Timer::get_pass_time): New function.
4690 * timer.h (Timer::stamp): New function.
4691 (Timer::get_pass_time): New function.
4692 (Timer::pass_times_): New data member.
4693
f475cf7b
CC
46942011-10-17 Cary Coutant <ccoutant@google.com>
4695
4696 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4697 task for members of lib groups.
4698
cdd7e244
CC
46992011-10-17 Cary Coutant <ccoutant@google.com>
4700
4701 PR gold/13288
4f95c8b4 4702 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4703 (File_read::make_view): Move bounds check (replace with assert)...
4704 (File_read::find_or_make_view): ... to here.
4705
dfb45471
CC
47062011-10-12 Cary Coutant <ccoutant@google.com>
4707
4f95c8b4 4708 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4709 ::read returns less than requested size.
4710
53bbcc1b
CC
47112011-10-10 Cary Coutant <ccoutant@google.com>
4712
4f95c8b4 4713 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4714 Initialize defined_count_.
4715 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4716 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4717 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4718 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4719 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4720 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4721 member.
4722 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4723 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4724 Return zeroes instead of internal error.
4725
397b129b
CC
47262011-10-10 Cary Coutant <ccoutant@google.com>
4727
4728 PR gold/13249
4f95c8b4 4729 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4730 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4731 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4732 (Output_reloc::type_): Adjust size of bit field.
4733 (Output_reloc::use_plt_offset_): New bit field.
4734 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4735 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4736 flag. Adjust all callers.
4f95c8b4 4737 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4738 creating RELATIVE relocations.
4739
d5698657
NC
47402011-10-10 Nick Clifton <nickc@redhat.com>
4741
4742 * po/es.po: Updated Spanish translation.
4743 * po/fi.po: Updated Finnish translation.
4744
6a59a5c2
DN
47452011-10-03 Diego Novillo <dnovillo@google.com>
4746
4747 * options.cc (parse_uint): Fix dereference of RETVAL.
4748
f0558624
ST
47492011-09-29 Sriraman Tallam <tmsriram@google.com>
4750
4751 * layout.h (section_order_map_): New member.
4752 (get_section_order_map): New member function.
4753 * output.cc (Output_section::add_input_section): Check for patterns
4754 only when --section-ordering-file is specified.
4755 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4756 output_sections have been formed.
4757 * layout.cc (Layout_Layout): Initialize section_order_map_.
4758 * plugin.cc (update_section_order): Store order in order_map. Do not
4759 update the order.
4760 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4761 * testsuite/Makefile.in: Regenerate.
4762 * testsuite/plugin_section_order.c: New file.
4763 * testsuite/plugin_final_layout.cc: New file.
4764 * testsuite/plugin_final_layout.sh: New file.
4765
a7dac153
CC
47662011-09-29 Cary Coutant <ccoutant@google.com>
4767
4f95c8b4 4768 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4769 Check for NULL.
4f95c8b4 4770 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4771 symbols during incremental update.
4772 (Symbol_table::add_from_dynobj): Likewise.
4773
eebd87a5
ILT
47742011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4775 Ian Lance Taylor <iant@google.com>
4776
4777 * symtab.cc (Symbol_table::define_special_symbol): Always
4778 canonicalize version string.
4779
403a3331
CC
47802011-09-26 Cary Coutant <ccoutant@google.com>
4781
4f95c8b4
CC
4782 * gold.cc (queue_initial_tasks): Move option checks ...
4783 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4784 some options; make others fatal.
4785
235061c2
CC
47862011-09-26 Cary Coutant <ccoutant@google.com>
4787
4788 gcc PR lto/47247
4789 * plugin.cc (get_symbols_v2): New function.
4790 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4791 (is_referenced_from_outside): New function.
4792 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4793 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4794 (get_symbols): Pass version parameter.
4795 (get_symbols_v2): New function.
4796 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4797 parameter.
4798 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4799 (onload): Add LDPT_GET_SYMBOLS_V2.
4800 (all_symbols_read_hook): Use get_symbols_v2; check for
4801 LDPR_PREVAILING_DEF_IRONLY_EXP.
4802 * testsuite/plugin_test_3.sh: Update expected results.
4803
dc87f620
ILT
48042011-09-23 Simon Baldwin <simonb@google.com>
4805
4806 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4807 configuration options.
4808 * configure: Regenerate.
4809 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4810 * Makefile.in: Regenerate.
4811 * testsuite/Makefile.in: Regenerate.
4812
a8279f82
ST
48132011-09-19 Sriraman Tallam <tmsriram@google.com>
4814
4815 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4816
0c9350c8
CC
48172011-09-19 Cary Coutant <ccoutant@google.com>
4818
4819 * incremental.cc (can_incremental_update): Fix typo in comment.
4820 * incremental.h (can_incremental_update): Likewise.
4821
aa06ae28
CC
48222011-09-18 Cary Coutant <ccoutant@google.com>
4823
4824 * incremental.cc (can_incremental_update): New function.
4825 * incremental.h (can_incremental_update): New function.
4826 * layout.cc (Layout::init_fixed_output_section): Call it.
4827 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4828 * object.cc (Sized_relobj_file::do_layout): Call
4829 can_incremental_update.
4830
ebb300b2
CC
48312011-09-13 Cary Coutant <ccoutant@google.com>
4832
4833 * configure.ac: Check for glibc support for gnu_indirect_function
4834 support with static linking, setting automake conditional
4835 IFUNC_STATIC.
4836 * Makefile.in: Regenerate.
4837 * configure: Regenerate.
4838
4839 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4840 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4841 for IFUNC_STATIC.
4842 * testsuite/Makefile.in: Regenerate.
4843
1206d0d5
CC
48442011-09-13 Cary Coutant <ccoutant@google.com>
4845
4846 * incremental.cc (Sized_relobj_incr::do_layout): Call
4847 report_comdat_group for kept comdat sections.
4848 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4849 * testsuite/Makefile.in: Regenerate.
4850 * testsuite/incr_comdat_test_1.cc: New source file.
4851 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4852 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4853 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4854
40b29874
ILT
48552011-09-13 Ian Lance Taylor <iant@google.com>
4856
4857 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4858 variable external_symbols_offset.
4859
1b045aac
ILT
48602011-09-12 Ian Lance Taylor <iant@google.com>
4861
4862 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4863 triggered if object has no symbols.
4864
24c6c55a
DM
48652011-09-09 David S. Miller <davem@davemloft.net>
4866
4867 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4868 (Output_fill_debug_line::do_write): Likewise.
4869
66570254
CC
48702011-08-29 Cary Coutant <ccoutant@google.com>
4871
4872 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4873 casts to match formatting specs.
4874 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4875
8ea8cd50
CC
48762011-08-26 Cary Coutant <ccoutant@google.com>
4877
4878 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4879 remaining hole size when allocating.
4880 (Layout::make_output_section): Set fill methods for debug sections.
4881 * layout.h (Free_list::Free_list_node): Move from private to
4882 public.
4883 (Free_list::set_min_hole_size): New function.
4884 (Free_list::begin, Free_list::end): New functions.
4885 (Free_list::min_hole_): New data member.
4886 * output.cc: Include dwarf.h.
4887 (Output_fill_debug_info::do_minimum_hole_size): New function.
4888 (Output_fill_debug_info::do_write): New function.
4889 (Output_fill_debug_line::do_minimum_hole_size): New function.
4890 (Output_fill_debug_line::do_write): New function.
4891 (Output_section::Output_section): Initialize new data member.
4892 (Output_section::set_final_data_size): Ensure patch space is larger
4893 than minimum hole size.
4894 (Output_section::do_write): Fill holes in debug sections.
4895 * output.h (Output_fill): New class.
4896 (Output_fill_debug_info): New class.
4897 (Output_fill_debug_line): New class.
4898 (Output_section::set_free_space_fill): New function.
4899 (Output_section::free_space_fill_): New data member.
4900 * testsuite/Makefile.am (incremental_test_3): Add
4901 --incremental-patch option.
4902 (incremental_test_4): Likewise.
4903 (incremental_test_5): Likewise.
4904 (incremental_test_6): Likewise.
4905 (incremental_copy_test): Likewise.
4906 (incremental_common_test_1): Likewise.
4907 * testsuite/Makefile.in: Regenerate.
4908
7cf80422
NC
49092011-08-26 Nick Clifton <nickc@redhat.com>
4910
4911 * po/es.po: Updated Spanish translation.
4912
c3f7b0e5
CC
49132011-08-01 Cary Coutant <ccoutant@google.com>
4914
4915 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4916 * gold/testsuite/Makefile.in: Regenerate.
4917 * gold/testsuite/justsyms_exec.c: New source file.
4918 * gold/testsuite/justsyms_lib.c: New source file.
4919
9590bf25
CC
49202011-08-01 Cary Coutant <ccoutant@google.com>
4921
4922 * layout.cc (Layout::set_segment_offsets): Don't realign text
4923 segment if -Ttext was specified.
4924 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4925 file type.
4926 * object.h (Sized_relobj_file::e_type): New function.
4927 (Sized_relobj_file::e_type_): New data member.
4928 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4929 base address for ET_EXEC files.
4930 * target.cc (Target::do_make_elf_object_implementation): Allow
4931 ET_EXEC files with --just-symbols option.
4932
dcd8d12e
CC
49332011-07-28 Cary Coutant <ccoutant@google.com>
4934
4935 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4936 Add thread_number parameter.
4937 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4938 * workqueue-threads.cc
4939 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4940 current thread if its thread number is greater than desired thread
4941 count.
4942 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4943 Add thread_number parameter.
4944 (Workqueue::should_cancel_thread): Likewise.
4945 (Workqueue::find_runnable_or_wait): Pass thread_number to
4946 should_cancel_thread.
4947 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4948 parameter.
4949
804eb480
ST
49502011-07-22 Sriraman Tallam <tmsriram@google.com>
4951
4952 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4953 only after checking if it cannot be forced local.
4954 * symtab.h (is_externally_visible): Check if the symbol is not forced
4955 local.
4956
f1ddb600
ILT
49572011-07-15 Ian Lance Taylor <iant@google.com>
4958
4959 * options.h (class General_options): Add --print-output-format.
4960 Move -EL next to -EB, for better --help output.
4961 * target-select.cc: Include <cstdio>, "options.h", and
4962 "parameters.h".
4963 (Target_selector::do_target_bfd_name): New function.
4964 (print_output_format): New function.
4965 * target-select.h (class Target_selector): Update declarations.
4966 (Target_selector::target_bfd_name): New function.
4967 (print_output_format): Declare.
4968 * main.cc: Include "target-select.h".
4969 (main): Handle --print-output-format.
4970 * gold.cc: Include "target-select.h".
4971 (queue_initial_tasks): Handle --print-output-format when there are
4972 no input files.
4973 * parameters.cc (parameters_force_valid_target): Give a better
4974 error message if -EB/-EL does not match target.
4975 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4976 function.
4977
7d172687
ILT
49782011-07-15 Ian Lance Taylor <iant@google.com>
4979
4980 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4981 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4982 (Output_data_plt_i386::do_write): Write address of .dynamic
4983 section to first entry in .got.plt section.
4984 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4985 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4986 Initialize layout_.
4987 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4988 section to first entry in .got.plt section.
4989 * layout.h (Layout::dynamic_section): New function.
4990
e9552f7e
ST
49912011-07-13 Sriraman Tallam <tmsriram@google.com>
4992
4993 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4994 to claim_file call.
4995 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4996 input_section_position_, and input_section_glob_.
4997 (read_layout_from_file): Call function section_ordering_specified.
4998 * layout.h (is_section_ordering_specified): New function.
4999 (section_ordering_specified): New function.
5000 (section_ordering_specified_): New boolean member.
5001 * main.cc(main): Call load_plugins after layout object is defined.
5002 * output.cc (Output_section::add_input_section): Use
5003 function section_ordering_specified to check if section ordering is
5004 needed.
5005 * output.cc (Output_section::add_relaxed_input_section): Use
5006 function section_ordering_specified to check if section ordering is
5007 needed.
5008 (Output_section::update_section_layout): New function.
5009 (Output_section::sort_attached_input_sections): Check if input section
5010 must be reordered.
5011 * output.h (Output_section::update_section_layout): New function.
5012 * plugin.cc (get_section_count): New function.
5013 (get_section_type): New function.
5014 (get_section_name): New function.
5015 (get_section_contents): New function.
5016 (update_section_order): New function.
58797674 5017 (allow_section_ordering): New function.
e9552f7e
ST
5018 (Plugin::load): Add the new interfaces to the transfer vector.
5019 (Plugin_manager::load_plugins): New parameter.
5020 (Plugin_manager::all_symbols_read): New parameter.
5021 (Plugin_manager::claim_file): New parameter. Save the elf object for
5022 unclaimed objects.
5023 (Plugin_manager::get_elf_object): New function.
5024 (Plugin_manager::get_view): Change to directly use the bool to check
5025 if get_view is called from claim_file_hook.
5026 * plugin.h (input_objects): New function
5027 (Plugin__manager::load_plugins): New parameter.
5028 (Plugin_manager::claim_file): New parameter.
5029 (Plugin_manager::get_elf_object): New function.
5030 (Plugin_manager::in_claim_file_handler): New function.
5031 (Plugin_manager::in_claim_file_handler_): New member.
5032 (layout): New function.
5033 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5034 handler with an extra parameter. Make the elf object before calling
5035 claim_file handler.
5036 * testsuite/plugin_test.c (get_section_count): New function pointer.
5037 (get_section_type): New function pointer.
5038 (get_section_name): New function pointer.
5039 (get_section_contents): New function pointer.
5040 (update_section_order): New function pointer.
5041 (allow_section_ordering): New function pointer.
5042 (onload): Check if the new interfaces exist.
5043
9446efde
ILT
50442011-07-13 Ian Lance Taylor <iant@google.com>
5045
5046 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5047 relro section.
5048 * x86_64.cc (Target_x86_64::got_section): Likewise.
5049 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5050 (relro_now_test_SOURCES): New variable.
5051 (relro_now_test_DEPENDENCIES): New variable.
5052 (relro_now_test_LDFLAGS): New variable.
5053 (relro_now_test_LDADD): New variable.
5054 (relro_now_test.so): New target.
5055 * testsuite/Makefile.in: Rebuild.
5056
07aa62f2
ILT
50572011-07-12 Ian Lance Taylor <iant@google.com>
5058
5059 PR gold/12980
5060 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5061 GLOB_DAT relocation rather than a RELATIVE relocation for a
5062 protected symbol when creating a shared library.
5063 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5064 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5065 * testsuite/protected_main_1.cc (main): Test that protected
5066 function has same address.
5067
e2153196
ILT
50682011-07-11 Ian Lance Taylor <iant@google.com>
5069
5070 PR gold/12979
5071 * options.h (class General_options): Add -Bgroup.
5072 * options.cc (General_options::finalize): If -Bgroup is set,
5073 default to --unresolved-symbols=report-all.
5074 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5075 * target-reloc.h (issue_undefined_symbol_error): Handle
5076 --unresolved-symbols=report-all.
5077
6daf5215
ILT
50782011-07-08 Ian Lance Taylor <iant@google.com>
5079
5080 PR gold/11985
5081 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5082 if linker script discards key sections.
5083 (Layout::create_dynamic_symtab): Likewise.
5084 (Layout::assign_local_dynsym_offsets): Likewise.
5085 (Layout::sized_create_version_sections): Likewise.
5086 (Layout::create_interp): Likewise.
5087 (Layout::finish_dynamic_section): Likewise.
5088 (Layout::set_dynamic_symbol_size): Likewise.
5089
beabb2c6
ILT
50902011-07-08 Ian Lance Taylor <iant@google.com>
5091
5092 PR gold/12386
5093 * options.h (class General_options): Add --unresolved-symbols.
5094 * target-reloc.h (issue_undefined_symbol_error): Check
5095 --unresolved-symbols. Add comments.
5096
9c16daf1
ILT
50972011-07-08 Ian Lance Taylor <iant@google.com>
5098
5099 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5100 expression more complex.
5101
191f1a2d
ILT
51022011-07-08 Ian Lance Taylor <iant@google.com>
5103
5104 PR gold/11317
5105 * target-reloc.h (issue_undefined_symbol_error): New inline
5106 function, broken out of relocate_section.
5107 (relocate_section): Call issue_undefined_symbol_error.
5108 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5109 there is no TLS segment if we are about to issue an undefined
5110 symbol error.
5111 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5112
62855347
ILT
51132011-07-08 Ian Lance Taylor <iant@google.com>
5114
5115 PR gold/12279
5116 * resolve.cc (Symbol_table::should_override): Add fromtype
5117 parameter. Change all callers. Give error when linking together
5118 TLS and non-TLS symbol.
5119 (Symbol_table::should_override_with_special): Add fromtype
5120 parameter. Change all callers.
5121 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5122 there is no TLS segment if we have reported some errors.
5123 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5124
67181c72
ILT
51252011-07-08 Ian Lance Taylor <iant@google.com>
5126
5127 PR gold/12372
5128 * target.h (Target::plt_address_for_global): New function.
5129 (Target::plt_address_for_local): New function.
5130 (Target::plt_section_for_global): Remove.
5131 (Target::plt_section_for_local): Remove.
5132 (Target::do_plt_address_for_global): New virtual function.
5133 (Target::do_plt_address_for_local): New virtual function.
5134 (Target::do_plt_section_for_global): Remove.
5135 (Target::do_plt_section_for_local): Remove.
5136 (Target::register_global_plt_entry): Add Symbol_table and Layout
5137 parameters.
5138 * output.cc (Output_data_got::Got_entry::write): Use
5139 plt_address_for_global and plt_address_for_local.
5140 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5141 address of output section.
5142 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5143 got_irelative_, and irelative_count_ fields. Update
5144 declarations.
5145 (Output_data_plt_i386::has_irelative_section): New function.
5146 (Output_data_plt_i386::entry_count): Add irelative_count_.
5147 (Output_data_plt_i386::set_final_data_size): Likewise.
5148 (class Target_i386): Add got_irelative_ and rel_irelative_
5149 fields. Update declarations.
5150 (Target_i386::Target_i386): Initialize new fields.
5151 (Target_i386::do_plt_address_for_global): New function replacing
5152 do_plt_section_for_global.
5153 (Target_i386::do_plt_address_for_local): New function replacing
5154 do_plt_section_for_local.
5155 (Target_i386::got_section): Create got_irelative_.
5156 (Target_i386::rel_irelative_section): New function.
5157 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5158 fields. Don't define __rel_iplt_{start,end}.
5159 (Output_data_plt_i386::add_entry): Add symtab and layout
5160 parameters. Change all callers. Use different PLT and GOT for
5161 IFUNC symbols.
5162 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5163 layout parameters. Change all callers. Use different PLT and
5164 GOT.
5165 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5166 (Output_data_plt_i386::rel_irelative): New function.
5167 (Output_data_plt_i386::address_for_global): New function.
5168 (Output_data_plt_i386::address_for_local): New function.
5169 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5170 IRELATIVE GOT when changing IFUNC GOT entries.
5171 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5172 reloc.
5173 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5174 if we didn't create an IRELATIVE GOT.
5175 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5176 plt_address_for_local.
5177 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5178 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5179 got_irelative_, and irelative_count_ fields. Update
5180 declarations.
5181 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5182 Initialize new fields. Remove symtab parameter. Change all
5183 callers.
5184 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5185 irelative_count_.
5186 (Output_data_plt_x86_64::has_irelative_section): New function.
5187 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5188 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5189 fields. Update declarations.
5190 (Target_x86_64::Target_x86_64): Initialize new fields.
5191 (Target_x86_64::do_plt_address_for_global): New function replacing
5192 do_plt_section_for_global.
5193 (Target_x86_64::do_plt_address_for_local): New function replacing
5194 do_plt_section_for_local.
5195 (Target_x86_64::got_section): Create got_irelative_.
5196 (Target_x86_64::rela_irelative_section): New function.
5197 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5198 all callers. Don't create __rel_iplt_{start,end}.
5199 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5200 parameters. Change all callers. Use different PLT and GOT for
5201 IFUNC symbols.
5202 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5203 layout parameters. Change all callers. Use different PLT and
5204 GOT.
5205 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5206 parameters. Change all callers. Use different PLT and GOT for
5207 IFUNC symbols.
5208 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5209 (Output_data_plt_x86_64::rela_irelative): New function.
5210 (Output_data_plt_x86_64::address_for_global): New function.
5211 (Output_data_plt_x86_64::address_for_local): New function.
5212 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5213 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5214 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5215 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5216 parameters.
5217 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5218 reloc.
5219 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5220 symbols if we didn't create an IRELATIVE GOT.
5221 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5222 plt_address_for_local.
5223 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5224 * testsuite/ifuncvar1.c: New test file.
5225 * testsuite/ifuncvar2.c: New test file.
5226 * testsuite/ifuncvar3.c: New test file.
5227 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5228 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5229 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5230 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5231 * testsuite/Makefile.in: Rebuild.
5232
33c15b45
CC
52332011-07-07 Cary Coutant <ccoutant@google.com>
5234
5235 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5236 (two_file_test_1_ndebug.o): Likewise.
5237 (two_file_test_1b_ndebug.o): Likewise.
5238 (two_file_test_2_ndebug.o): Likewise.
5239 (two_file_test_main_ndebug.o): Likewise.
5240 (incremental_test_2): Link with no-debug versions.
5241
f48b5fb7
CC
52422011-07-06 Cary Coutant <ccoutant@google.com>
5243
5244 * gold/incremental.cc
5245 (Output_section_incremental_inputs::write_info_blocks): Check for
5246 hidden and internal symbols.
5247
221597a5
CC
52482011-07-06 Cary Coutant <ccoutant@google.com>
5249
5250 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5251 Check disposition for startup file.
5252 (Incremental_inputs::report_command_line): Ignore
5253 --incremental-startup-unchanged option.
5254 * options.cc (General_options::parse_incremental_startup_unchanged):
5255 New function.
5256 (General_options::General_options): Initialize new data member.
5257 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5258 (General_options): Add --incremental-startup-unchanged option.
5259 (General_options::incremental_startup_disposition): New function.
5260 (General_options::incremental_startup_disposition_): New data member.
5261
e24719f6
CC
52622011-07-06 Cary Coutant <ccoutant@google.com>
5263
5264 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5265 input file index to Script_info ctor.
5266 (Sized_incremental_binary::do_file_has_changed): Find the
5267 command-line argument for files named in scripts.
5268 * incremental.h (Script_info::Script_info): New ctor
5269 with input file index.
5270 (Script_info::input_file_index): New function.
5271 (Script_info::input_file_index_): New data member.
5272 (Incremental_binary::get_library): Add const.
5273 (Incremental_binary::get_script_info): Add const.
5274 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5275 * testsuite/Makefile.am (incremental_test_5): New test case.
5276 (incremental_test_6): New test case.
5277 * testsuite/Makefile.in: Regenerate.
5278
8f7c81e8
CC
52792011-07-06 Cary Coutant <ccoutant@google.com>
5280
5281 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5282 debug output when command lines differ.
5283
9fbd3822
CC
52842011-07-06 Cary Coutant <ccoutant@google.com>
5285
5286 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5287 --incremental-patch option.
5288 * layout.cc (Free_list::allocate): Extend allocation beyond original
5289 end if enabled.
5290 (Layout::make_output_section): Mark sections that should get
5291 patch space.
5292 * options.cc (parse_percent): New function.
5293 * options.h (parse_percent): New function.
5294 (DEFINE_percent): New macro.
5295 (General_options): Add --incremental-patch option.
5296 * output.cc (Output_section::Output_section): Initialize new data
5297 members.
5298 (Output_section::add_input_section): Print section name when out
5299 of patch space.
5300 (Output_section::add_output_section_data): Likewise.
5301 (Output_section::set_final_data_size): Add patch space when
5302 doing --incremental-full.
5303 (Output_section::do_reset_address_and_file_offset): Remove patch
5304 space.
5305 (Output_segment::set_section_list_addresses): Print debug output
5306 only if --incremental-update.
5307 * output.h (Output_section::set_is_patch_space_allowed): New function.
5308 (Output_section::is_patch_space_allowed_): New data member.
5309 (Output_section::patch_space_): New data member.
5310 * parameters.cc (Parameters::incremental_full): New function.
5311 * parameters.h (Parameters::incremental_full): New function
5312 * testsuite/Makefile.am (incremental_test_2): Add test for
5313 --incremental-patch option.
5314 * testsuite/Makefile.in: Regenerate.
5315 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5316 (t18): Remove function body.
5317
f6cccc2c
DK
53182011-07-05 Doug Kwan <dougkwan@google.com>
5319
5320 PR gold/12771
5321 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5322 Arm_Address type for relocation result.
5323 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5324 overflow check.
5325 (Arm_relocate_functions::abs32): Use unaligned access.
5326 (Arm_relocate_functions::rel32): Ditto.
5327 (Arm_relocate_functions::prel31): Ditto.
5328 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5329 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5330 static data relocations.
5331 * testsuite/Makefile.in: Regnerate.
5332 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5333
28a13fec
ILT
53342011-07-05 Ian Lance Taylor <iant@google.com>
5335
5336 PR gold/12392
5337 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5338 symbols if necessary.
5339 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5340
24d47b34
ILT
53412011-07-05 Ian Lance Taylor <iant@google.com>
5342
5343 PR gold/12952
5344 * resolve.cc (Symbol::override_base_with_special): Simply override
5345 version with special symbol version, ignoring previous version.
5346
41f9cbbe
ILT
53472011-07-05 Ian Lance Taylor <iant@google.com>
5348
5349 * object.cc (Sized_relobj_file::include_section_group): Add
5350 information to comment about signature location.
5351
886288f1
ILT
53522011-07-02 Ian Lance Taylor <iant@google.com>
5353
5354 PR gold/12957
5355 * options.h (class General_options): Add -f and -F.
5356 * options.cc (General_options::finalize): Fatal error if -f/-F
5357 are used without -shared.
5358 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5359
ae3a6d4f
ILT
53602011-07-02 Ian Lance Taylor <iant@google.com>
5361
5362 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5363
21131061
ILT
53642011-07-01 Ian Lance Taylor <iant@google.com>
5365
5366 PR gold/12525
5367 PR gold/12952
5368 * resolve.cc (Symbol::override_base_with_special): Don't override
5369 the version if the overriding symbol has a different name.
5370 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5371 all callers. If we give an error about an undefined version,
5372 define the base version if necessary.
5373 * dynobj.h (class Versions): Update declaration.
5374 * testsuite/weak_alias_test_5.cc: New file.
5375 * testsuite/weak_alias_test.script: New file.
5376 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5377 and versioned_alias have the right value, and call t2.
5378 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5379 weak_alias_test_5.so.
5380 (weak_alias_test_LDADD): Likewise.
5381 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5382 * testsuite/Makefile.in: Rebuild.
5383
611062c0
ILT
53842011-07-01 Ian Lance Taylor <iant@google.com>
5385
5386 PR gold/12525
5387 * options.h (class General_options): Support -z notext.
5388 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5389 -Wl,-z,notext.
5390 (two_file_shared_nonpic.so): Likewise.
5391 (two_file_shared_mixed.so): Likewise.
5392 (two_file_shared_mixed_1.so): Likewise.
5393 (weak_undef_lib_nonpic.so): Likewise.
5394 (alt/weak_undef_lib_nonpic.so): Likewise.
5395 (tls_test_shared_nonpic.so): Likewise.
5396 * testsuite/Makefile.in: Rebuild.
5397
328c7c2f
ILT
53982011-07-01 Ian Lance Taylor <iant@google.com>
5399
5400 PR gold/12525
5401 * configure.ac: Test whether static linking works, setting
5402 the automake conditional HAVE_STATIC.
5403 * testsuite/Makefile.am: Disable tests using -static if
5404 HAVE_STATIC is not true.
5405 * configure, testsuite/Makefile.in: Rebuild.
5406
02d7cd44
ILT
54072011-07-01 Ian Lance Taylor <iant@google.com>
5408
5409 PR gold/12525
5410 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5411 Assert if we see DW_EH_PE_indirect.
5412 * target.h (Target::ehframe_datarel_base): New function.
5413 (Target::do_ehframe_datarel_base): New target function.
5414 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5415 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5416 function.
5417
07a60597
ILT
54182011-07-01 Ian Lance Taylor <iant@google.com>
5419
5420 PR gold/12571
5421 * options.h (class General_options): Add
5422 --ld-generated-unwind-info.
5423 * ehframe.cc (Fde::write): Add address parameter. Change all
5424 callers. If associated with PLT, fill in address and size.
5425 (Cie::set_output_offset): Only add merge mapping if there is an
5426 object.
5427 (Cie::write): Add address parameter. Change all callers.
5428 (Eh_frame::add_ehframe_for_plt): New function.
5429 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5430 input_offset_ fields into union u_, with new plt field.
5431 (Fde::Fde): Adjust for new union field.
5432 (Fde::Fde) [Output_data version]: New constructor.
5433 (Fde::add_mapping): Only add merge mapping if there is an object.
5434 (class Cie): Update declarations.
5435 (class Eh_frame): Declare add_ehframe_for_plt.
5436 * layout.cc (Layout::layout_eh_frame): Break out code into
5437 make_eh_frame_section, and call it.
5438 (Layout::make_eh_frame_section): New function.
5439 (Layout::add_eh_frame_for_plt): New function.
5440 * layout.h (class Layout): Update declarations.
5441 * merge.cc (Merge_map::add_mapping): Add assertion.
5442 * i386.cc: Include "dwarf.h".
5443 (class Output_data_plt_i386): Make first_plt_entry,
5444 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5445 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5446 and plt_eh_frame_fde.
5447 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5448 boundary. Call add_eh_frame_for_plt if appropriate.
5449 * x86_64.cc: Include "dwarf.h".
5450 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5451 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5452 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5453 and plt_eh_frame_fde.
5454 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5455 appropriate.
5456
14788a3f
ILT
54572011-06-29 Ian Lance Taylor <iant@google.com>
5458
5459 PR gold/12629
5460 * object.cc (Sized_relobj_file::layout_section): Change shdr
5461 parameter to be const.
5462 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5463 out of do_layout.
5464 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5465 appropriate. Call layout_eh_frame_section.
5466 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5467 sections.
5468 * object.h (class Sized_relobj_file): Update declarations.
5469
6c21fce1
ILT
54702011-06-29 Ian Lance Taylor <iant@google.com>
5471
37e41b03 5472 PR gold/12652
6c21fce1
ILT
5473 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5474 modifier.
5475 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5476
4d5e4e62
ILT
54772011-06-29 Ian Lance Taylor <iant@google.com>
5478
5479 PR gold/12675
5480 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5481 SHT_X86_64_UNWIND.
5482 * layout.cc (Layout::layout_eh_frame): Likewise.
5483
886f533a
ILT
54842011-06-29 Ian Lance Taylor <iant@google.com>
5485
5486 PR gold/12695
5487 * layout.cc (Layout::symtab_section_shndx): New function.
5488 * layout.h (class Layout): Declare symtab_section_shndx.
5489 * output.cc (Output_section::write_header): Call it.
5490
f3ae1b28
ILT
54912011-06-29 Ian Lance Taylor <iant@google.com>
5492
5493 PR gold/12818
5494 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5495 symbols which are not used in a relocation.
5496
aecf301f
ILT
54972011-06-28 Ian Lance Taylor <iant@google.com>
5498
5499 PR gold/12898
5500 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5501 script create indistinguishable segments.
5502 (Layout::set_segment_offsets): Use stable_sort when sorting
5503 segments. Pass this to Compare_segments constructor.
5504 * layout.h (class Layout): Make segment_precedes non-static.
5505 (class Compare_segments): Change from struct to class. Add
5506 layout_ field. Add constructor.
5507 * script-sections.cc
5508 (Script_sections::attach_sections_using_phdrs_clause): Rename
5509 local orphan to is_orphan. Don't report failure to put empty
5510 section in segment. On attachment failure, report name of
5511 section, and attach to first PT_LOAD segment.
5512
03ef7571
ILT
55132011-06-28 Ian Lance Taylor <iant@google.com>
5514
5515 PR gold/12934
5516 * target-select.cc (Target_selector::Target_selector): Add
5517 emulation parameter. Change all callers.
5518 (select_target_by_bfd_name): Rename from select_target_by_name.
5519 Change all callers.
5520 (select_target_by_emulation): New function.
5521 (supported_emulation_names): New function.
5522 * target-select.h (class Target_selector): Add emulation_ field.
5523 Update declarations.
5524 (Target_selector::recognize_by_bfd_name): Rename from
5525 recognize_by_name. Change all callers.
5526 (Target_selector::supported_bfd_names): Rename from
5527 supported_names. Change all callers.
5528 (Target_selector::recognize_by_emulation): New function.
5529 (Target_selector::supported_emulations): New function.
5530 (Target_selector::emulation): New function.
5531 (Target_selector::do_recognize_by_bfd_name): Rename from
5532 do_recognize_by_name. Change all callers.
5533 (Target_selector::do_supported_bfd_names): Rename from
5534 do_supported_names. Change all callers.
5535 (Target_selector::do_recognize_by_emulation): New function.
5536 (Target_selector::do_supported_emulations): New function.
5537 (select_target_by_bfd_name): Change name in declaration.
5538 (select_target_by_emulation): Declare.
5539 (supported_emulation_names): Declare.
5540 * parameters.cc (parameters_force_valid_target): Try to find
5541 target based on emulation from -m option.
5542 * options.h (class General_options): Change doc string for -m.
5543 * options.cc (help): Print emulations.
5544 (General_options::parse_V): Likewise.
5545 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5546 Add emulation parameter. Change all callers.
5547
200b2bb9
ILT
55482011-06-28 Ian Lance Taylor <iant@google.com>
5549
5550 * target.h (class Target): Add osabi_ field.
5551 (Target::osabi): New function.
5552 (Target::set_osabi): New function.
5553 (Target::Target): Initialize osabi_.
5554 (Target::do_adjust_elf_header): Make pure virtual.
5555 (Sized_target::do_adjust_elf_header): Declare.
5556 * target.cc (Sized_target::do_adjust_elf_header): New function.
5557 (class Sized_target): Instantiate all versions.
5558 * freebsd.h (class Target_freebsd): Remove.
5559 (Target_selector_freebsd::do_recognize): Call set_osabi on
5560 Target.
5561 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5562 (Target_selector_freebsd::set_osabi): Remove.
5563 * i386.cc (class Target_i386): Inherit from Sized_target rather
5564 than Target_freebsd.
5565 * x86_64.cc (class Target_x86_64): Likewise.
5566
b3ce541e
ILT
55672011-06-28 Ian Lance Taylor <iant@google.com>
5568
5569 * target.h (Target::can_check_for_function_pointers): Rewrite.
5570 Make non-virtual.
5571 (Target::can_icf_inline_merge_sections): Likewise.
5572 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5573 (Target::Target_info): Add can_icf_inline_merge_sections field.
5574 (Target::do_can_check_for_function_pointers): New virtual
5575 function.
5576 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5577 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5578 from can_check_for_function_pointers, move in file.
5579 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5580 section_may_have_icf_unsafe_poineters, move in file.
5581 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5582 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5583 Rename from can_check_for_function_pointers, move in file.
5584 (Target_i386::can_icf_inline_merge_sections): Remove.
5585 (Target_i386::i386_info): Initialize
5586 can_icf_inline_merge_sections.
5587 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5588 Initialize can_icf_inline_merge_sections.
5589 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5590 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5591 Rename from can_check_for_function_pointers, move in file.
5592 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5593 (Target_x86_64::x86_64_info): Initialize
5594 can_icf_inline_merge_sections.
5595 * testsuite/testfile.cc (Target_test::test_target_info):
5596 Likewise.
5597 * icf.cc (get_section_contents): Correct formatting.
5598
6d1c4efb
ILT
55992011-06-27 Ian Lance Taylor <iant@google.com>
5600
5601 * symtab.cc (Symbol::versioned_name): New function.
5602 (Symbol_table::add_to_final_symtab): Use versioned_name when
5603 appropriate.
5604 (Symbol_table::sized_write_symbol): Likewise.
5605 * symtab.h (class Symbol): Declare versioned_name.
5606 * stringpool.h (class Stringpool_template): Add variant of add
5607 which takes a std::basic_string.
5608 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5609 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5610 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5611 (ver_test_12.o): New target.
5612 * testsuite/Makefile.in: Rebuild.
5613
57eb9b50
DK
56142011-06-27 Doug Kwan <dougkwan@google.com>
5615
5616 * arm.cc (Arm_relocate_functions::thm_jump8,
5617 Arm_relocate_functions::thm_jump11): Use a wider signed
5618 type to compute offset.
5619 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5620 arm_thm_jump8.
5621 * testsuite/Makefile.in: Regenerate.
5622 * testsuite/arm_branch_in_range.sh: Check test results of
5623 arm_thm_jump11 and arm_thm_jump8.
5624 * testsuite/arm_thm_jump11.s: New test source file.
5625 * testsuite/arm_thm_jump11.t: New linker script.
5626 * testsuite/arm_thm_jump8.s: New test source file.
5627 * testsuite/arm_thm_jump8.t: New linker script.
5628
487b39df
ILT
56292011-06-24 Ian Lance Taylor <iant@google.com>
5630
5631 * layout.cc: Include "object.h".
5632 (ctors_sections_in_init_array): New static variable.
5633 (Layout::is_ctors_in_init_array): New function.
5634 (Layout::layout): Add entry to ctors_sections_in_init_array if
5635 appropriate.
5636 * layout.h (class Layout): Declare is_ctors_in_init_array.
5637 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5638 is_ctors_reverse_view is set.
5639 (Sized_relobj_file::write_sections): Add layout parameter. Change
5640 all callers. Set is_ctors_reverse_view field of View_size.
5641 (Sized_relobj_file::reverse_words): New function.
5642 * object.h (Sized_relobj_file::View_size): Add
5643 is_ctors_reverse_view field.
5644 (class Sized_relobj_file): Update declarations.
5645 * testsuite/initpri3.c: New test.
5646 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5647 initpri3b.
5648 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5649 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5650 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5651 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5652 * testsuite/Makefile.in: Rebuild.
5653
472076e4
CC
56542011-06-24 Cary Coutant <ccoutant@google.com>
5655
5656 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5657 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5658 (debug_msg_cdebug.err): New targets.
5659 * testsuite/Makefile.in: Regenerate.
5660 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5661 Fix checks for link with shared library.
5662
a60af0db
DK
56632011-06-24 Doug Kwan <dougkwan@google.com>
5664
5665 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5666 skip empty text sections.
5667 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5668
5393d741
ILT
56692011-06-22 Ian Lance Taylor <iant@google.com>
5670
5671 PR gold/12910
5672 * options.h (class General_options): Add --ctors-in-init-array.
5673 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5674 friends as SHT_PROGBITS for merging sections.
5675 (Layout::layout): Remove special handling of .init_array and
5676 friends. Don't sort if doing relocatable link. Sort for .ctors
5677 and .dtors if ctors_in_init_array.
5678 (Layout::make_output_section): Force correct section types for
5679 .init_array and friends. Don't sort if doing relocatable link,
5680 Don't sort .ctors and .dtors if ctors_in_init_array.
5681 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5682 (Layout::output_section_name): Add relobj parameter. Change all
5683 callers. Handle .ctors. and .dtors. in code rather than table.
5684 Handle .ctors and .dtors if ctors_in_init_array.
5685 (Layout::match_file_name): New function, moved from output.cc.
5686 * layout.h (class Layout): Update declarations.
5687 * output.cc: Include "layout.h".
5688 (Input_section_sort_entry::get_priority): New function.
5689 (Input_section_sort_entry::match_file_name): Just call
5690 Layout::match_file_name.
5691 (Output_section::Input_section_sort_init_fini_compare::operator()):
5692 Handle .ctors and .dtors. Sort by explicit priority rather than
5693 by name.
5694 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5695 * testsuite/initpri2.c: New test.
5696 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5697 (check_PROGRAMS): Add initpri2.
5698 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5699 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5700 * configure, testsuite/Makefile.in: Rebuild.
5701
e1f74f98
ILT
57022011-06-19 Ian Lance Taylor <iant@google.com>
5703
5704 PR gold/12880
5705 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5706 .interp section to a PT_INTERP segment even if we have seen a
5707 --dynamic-linker option. Don't do it if we have seen a PHDRS
5708 clause in a linker script.
5709 (Layout::finalize): Don't create a .interp section if we've
5710 already create a PT_INTERP segment.
5711 (Layout::create_interp): Always call choose_output_section (revert
5712 patch of 2011-06-17). Don't create PT_INTERP segment.
5713 * script-sections.cc
5714 (Script_sections::create_note_and_tls_segments): Add a .interp
5715 section to a PT_INTERP segment even if we have seen a
5716 --dynamic-linker option.
5717
766f91bb
ILT
57182011-06-18 Ian Lance Taylor <iant@google.com>
5719
5720 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5721 merely because a non-PT_LOAD segment has a dynamic reloc.
5722
0d212c3a
ILT
57232011-06-18 Ian Lance Taylor <iant@google.com>
5724
5725 * layout.cc (Layout::finish_dynamic_section): Don't create
5726 DT_FLAGS entry if not needed.
5727
911a5072
ILT
57282011-06-18 Ian Lance Taylor <iant@google.com>
5729
5730 PR gold/12745
5731 * layout.cc (Layout::layout_eh_frame): Correct handling of
5732 writable .eh_frame section.
5733
534b4e5f
ILT
57342011-06-17 Ian Lance Taylor <iant@google.com>
5735
5736 PR gold/12893
5737 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5738 symbol is redefined with the exact same object and value.
5739
10b4f102
ILT
57402011-06-17 Ian Lance Taylor <iant@google.com>
5741
5742 PR gold/12880
5743 * layout.h (class Layout): Add interp_segment_ field.
5744 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5745 (Layout::attach_allocated_section_to_segment): If making shared
5746 library, put .interp section in PT_INTERP segment.
5747 (Layout::finalize): Also call create_interp if -dynamic-linker
5748 option was used.
5749 (Layout::create_interp): Assert that there is no PT_INTERP
5750 segment. If not using a SECTIONS clause, use make_output_section.
5751 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5752 * script-sections.cc
5753 (Script_sections::create_note_and_tls_segments): If making shared
5754 library, put .interp section in PT_INTERP segment.
5755
a29b0dad
ILT
57562011-06-17 Ian Lance Taylor <iant@google.com>
5757
e588ea8d
ILT
5758 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5759 when making a shared library.
5760
57612011-06-17 Ian Lance Taylor <iant@google.com>
5762
5763 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5764 parameter. Change all callers. Don't issue warning about PC32
5765 against locally defined symbol.
a29b0dad 5766
9d3b0698
ILT
57672011-06-16 Ian Lance Taylor <iant@google.com>
5768
5769 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5770 occurs in same object.
5771
85b0f90c
AM
57722011-06-14 Alan Modra <amodra@gmail.com>
5773
5774 * po/POTFILES.in: Regenerate.
5775
a94907d9
ILT
57762011-06-09 Ian Lance Taylor <iant@google.com>
5777
5778 * script-sections.cc
5779 (Orphan_output_section::set_section_addresses): For a relocatable
5780 link set address to 0.
5781
4fb3a1c3
CC
57822011-06-09 Cary Coutant <ccoutant@google.com>
5783
5784 PR gold/12804
5785 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5786 used with --compress-debug-sections.
5787 * gold/object.cc (Sized_relobj_file::do_layout): Report
5788 uncompressed size of compressed input sections.
5789
61220854
CC
57902011-06-08 Cary Coutant <ccoutant@google.com>
5791
5792 PR gold/12804
5793 * testsuite/two_file_test_2_v1.cc: Change initialization of
5794 v2 to keep it in .data.
5795
e6455dfb
CC
57962011-06-07 Cary Coutant <ccoutant@google.com>
5797
5798 * common.cc (Symbol_table::do_allocate_commons_list): Call
5799 gold_fallback.
5800 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5801 (Errors::fallback): New function.
5802 (gold_fallback): New function.
5803 * errors.h (Errors::fallback): New function.
5804 * gold.cc (gold_exit): Change status parameter to enum; adjust
5805 all callers.
5806 (queue_initial_tasks): Call gold_fallback.
5807 * gold.h: Include cstdlib.
5808 (Exit_status): New enum type.
5809 (gold_exit): Change status parameter to enum.
5810 (gold_fallback): New function.
5811 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5812 (Layout::create_symtab_sections): Likewise.
5813 (Layout::create_shdrs): Likewise.
5814 * main.cc (main): Adjust call to gold_exit.
5815 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5816 (Output_data_got::add_got_entry_pair): Likewise.
5817 (Output_section::add_input_section): Likewise.
5818 (Output_section::add_output_section_data): Likewise.
5819 (Output_segment::set_section_list_addresses): Likewise.
5820 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5821
fb0e076f
CC
58222011-06-07 Cary Coutant <ccoutant@google.com>
5823
5824 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5825 for incremental links.
5826 * output.cc (Output_segment::set_section_list_addresses): Remove
5827 FIXME and test for TLS or BSS.
5828
a5ee4d5d
CC
58292011-06-07 Cary Coutant <ccoutant@google.com>
5830
5831 * testsuite/Makefile.am: Add incremental_copy_test,
5832 incremental_common_test_1.
5833 * testsuite/Makefile.in: Regenerate.
5834 * testsuite/common_test_1_v1.c: New source file.
5835 * testsuite/common_test_1_v2.c: New source file.
5836 * testsuite/copy_test_v1.cc: New source file.
5837
5146f448
CC
58382011-06-07 Cary Coutant <ccoutant@google.com>
5839
5840 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5841 update, allocate common from bss section's free list.
5842 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5843 linker-defined symbols.
5844 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5845 Skip GOT and PLT entries that are no longer referenced.
5846 (Output_section_incremental_inputs::write_info_blocks): Mark
5847 linker-defined symbols.
5848 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5849 * output.cc (Output_section::allocate): New function.
5850 * output.h (Output_section::allocate): New function.
5851 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5852 linker-defined symbols.
5853 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5854 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5855 (Symbol::init_base_output_data): Likewise.
5856 (Symbol::init_base_output_segment): Likewise.
5857 (Symbol::init_base_constant): Likewise.
5858 (Sized_symbol::init_output_data): Likewise.
5859 (Sized_symbol::init_output_segment): Likewise.
5860 (Sized_symbol::init_constant): Likewise.
5861 (Symbol_table::do_define_in_output_data): Likewise.
5862 (Symbol_table::do_define_in_output_segment): Likewise.
5863 (Symbol_table::do_define_as_constant): Likewise.
5864 * symtab.h (Symbol::is_predefined): New function.
5865 (Symbol::init_base_output_data): Add is_predefined parameter.
5866 (Symbol::init_base_output_segment): Likewise.
5867 (Symbol::init_base_constant): Likewise.
5868 (Symbol::is_predefined_): New data member.
5869 (Sized_symbol::init_output_data): Add is_predefined parameter.
5870 (Sized_symbol::init_output_segment): Likewise.
5871 (Sized_symbol::init_constant): Likewise.
5872 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5873
26d3c67d
CC
58742011-06-07 Cary Coutant <ccoutant@google.com>
5875
5876 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5877 instead of emit_copy_reloc.
5878 (Copy_relocs::emit_copy_reloc): Refactor.
5879 (Copy_relocs::make_copy_reloc): New function.
5880 (Copy_relocs::add_copy_reloc): Remove.
5881 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5882 section.
5883 (Copy_relocs::make_copy_reloc): New function.
5884 (Copy_relocs::add_copy_reloc): Remove.
5885 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5886 unchanged input files.
5887 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5888 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5889 Reserve BSS space for COPY relocations.
5890 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5891 (Output_section_incremental_inputs::write_info_blocks): Record
5892 whether a symbol is copied from a shared object.
5893 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5894 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5895 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5896 (Incremental_input_entry_reader::get_output_symbol_index): Add
5897 is_copy parameter.
5898 (Incremental_binary::emit_copy_relocs): New function.
5899 (Incremental_binary::do_emit_copy_relocs): New function.
5900 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5901 new data member.
5902 (Sized_incremental_binary::add_copy_reloc): New function.
5903 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5904 (Sized_incremental_binary::Copy_reloc): New struct.
5905 (Sized_incremental_binary::Copy_relocs): New typedef.
5906 (Sized_incremental_binary::copy_relocs_): New data member.
5907 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5908 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5909 * target.h (Sized_target::emit_copy_reloc): New function.
5910 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5911
7cdb37d9
CC
59122011-06-02 Cary Coutant <ccoutant@google.com>
5913
5914 PR gold/12163
5915 * gold/archive.cc (Archive::Archive): Initialize new data member.
5916 (Archive::include_all_members): Return if archive has already been
5917 included.
5918 * gold/archive.h (Archive::include_all_members_): New data member.
5919
cc643b88
NC
59202011-06-02 Nick Clifton <nickc@redhat.com>
5921
5922 * dynobj.h: Fix spelling mistake in comment.
5923 * output.cc: Likewise.
5924
f62a3ca7 59252011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5926 Asier Llano
f62a3ca7
DK
5927
5928 PR gold/12826
cc643b88 5929 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5930 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5931 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5932 redundant arm_exidx_test.so.
5933 * testsuite/Makefile.in: Regenerate.
5934 (check_SCRIPTS): Add pr12826.sh
5935 (check_DATA): Add pr12826.stdout
5936 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5937 * testsuite/pr12826.sh: New file.
5938 * testsuite/pr12826_1.s: Ditto.
5939 * testsuite/pr12826_1.s: Ditto.
5940
8dbe1edc
ILT
59412011-05-30 Ian Lance Taylor <iant@google.com>
5942
5943 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5944 sections.
5945
c49875be
ILT
59462011-05-29 Ian Lance Taylor <iant@google.com>
5947
5948 PR gold/12804
5949 * testsuite/Makefile.am: Use different file name for two_file_test
5950 temporary file for each incremental test.
5951 * testsuite/Makefile.in: Rebuild.
5952
69d53f7a
ILT
59532011-05-29 Ian Lance Taylor <iant@google.com>
5954
5955 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5956 binary input file is empty.
5957
41d0ab5f
ILT
59582011-05-27 Ian Lance Taylor <iant@google.com>
5959
5960 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5961 (ver_test_9.so): Likewise.
5962 * testsuite/Makefile.in: Rebuild.
5963
89d8a36b
CC
59642011-05-26 Cary Coutant <ccoutant@google.com>
5965
5966 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5967 * incremental.cc (Incremental_inputs::report_input_section): Fix
5968 comment, indentation.
5969 (Incremental_inputs::report_comdat_group): New function.
5970 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5971 of data for incremental input file entry.
5972 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5973 group count, COMDAT group signatures.
5974 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5975 an unchanged input file.
5976 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5977 Initialize new data member.
5978 (Incremental_object_entry::add_comdat_group): New function.
5979 (Incremental_object_entry::get_comdat_group_count): New function.
5980 (Incremental_object_entry::get_comdat_signature_key): New function.
5981 (Incremental_object_entry::groups_): New data member.
5982 (Incremental_inputs::report_comdat_group): New function.
5983 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5984 data for incremental input file entry.
5985 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5986 (Incremental_input_entry_reader::get_input_section): Adjust size of
5987 data for incremental input file entry.
5988 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5989 (Incremental_input_entry_reader::get_comdat_group_signature): New
5990 function.
5991 * object.cc (Sized_relobj::include_section_group): Report kept
5992 COMDAT groups for incremental links.
5993
1706a06f
ILT
59942011-05-24 David Meyer <pdox@google.com>
5995
5996 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5997 with name parameter. Add found_name parameter.
5998 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5999 * dirsearch.h (class Dirsearch): Update declaration.
6000
a10ae760
ILT
60012011-05-24 Ian Lance Taylor <iant@google.com>
6002
6003 * archive.cc (Library_base::should_include_member): Pull in object
6004 from archive if it defines the entry symbol.
6005 * parameters.cc (Parameters::entry): New function.
6006 * parameters.h (class Parameters): Declare entry.
6007 * output.h (class Output_file_header): Remove entry_ field.
6008 * output.cc (Output_file_header::Output_file_header): Remove entry
6009 parameter. Change all callers.
6010 (Output_file_header::entry): Use parameters->entry.
6011 * gold.cc (queue_middle_tasks): Likewise.
6012 * plugin.cc (Plugin_hook::run): Likewise.
6013
aa92d6ed
CC
60142011-05-24 Cary Coutant <ccoutant@google.com>
6015
6016 * gold.cc (queue_initial_tasks): Pass incremental base filename
6017 to Output_file::open_base_file; don't print error message.
6018 * incremental-dump.cc (main): Adjust call to
6019 Output_file::open_for_modification.
6020 * incremental-dump.cc (main): Likewise.
6021 * incremental.cc (Incremental_inputs::report_command_line):
6022 Ignore --incremental-base option when comparing command lines.
6023 Ignore parameter when given as separate argument.
6024 * options.h (class General_options): Add --incremental-base.
6025 * output.cc (Output_file::Output_file):
6026 (Output_file::open_base_file): Add base_name and writable parameters;
6027 read base file into new file; print error message here.
6028 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6029 callers.
6030 * output.h (Output_file::open_for_modification): Rename to...
6031 (Output_file::open_base_file): ...this; add base_name and
6032 writable parameters; adjust all callers.
6033 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6034 callers.
6035 * testsuite/Makefile.am (incremental_test_4): Test
6036 --incremental-base.
6037 * testsuite/Makefile.in: Regenerate.
6038
2eedd706
CC
60392011-05-24 Cary Coutant <ccoutant@google.com>
6040
6041 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6042 incremental_test_4.
6043 * testsuite/Makefile.in: Regenerate.
6044 * testsuite/two_file_test_1_v1.cc: New test source file.
6045 * testsuite/two_file_test_1b_v1.cc: New test source file.
6046 * testsuite/two_file_test_2_v1.cc: New test source file.
6047
0f1c85a6
CC
60482011-05-24 Cary Coutant <ccoutant@google.com>
6049
6050 * dynobj.h (Dynobj::do_dynobj): New function.
6051 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6052 flag and soname for shared objects.
6053 * incremental.cc (Incremental_inputs::report_object): Make
6054 either Incremental_object_entry or Incremental_dynobj_entry; add
6055 soname to string table.
6056 (Incremental_inputs::report_input_section): Add assertion.
6057 (Output_section_incremental_inputs::set_final_data_size): Adjust
6058 type of input file entry for shared libraries; adjust size of
6059 shared library info entry.
6060 (Output_section_incremental_inputs::write_input_files): Write
6061 as_needed flag for shared libraries.
6062 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6063 of input file entry for shared libraries; write soname.
6064 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6065 soname from incremental info.
6066 * incremental.h (enum Incremental_input_flags): Add
6067 INCREMENTAL_INPUT_AS_NEEDED.
6068 (Incremental_input_entry::Incremental_input_entry): Initialize new
6069 data member.
6070 (Incremental_input_entry::set_as_needed): New function.
6071 (Incremental_input_entry::as_needed): New function.
6072 (Incremental_input_entry::do_dynobj_entry): New function.
6073 (Incremental_input_entry::as_needed_): New data member.
6074 (Incremental_object_entry::Incremental_object_entry): Don't check
6075 for shared library.
6076 (Incremental_object_entry::do_type): Likewise.
6077 (class Incremental_dynobj_entry): New class.
6078 (Incremental_input_entry_reader::as_needed): New function.
6079 (Incremental_input_entry_reader::get_soname): New function.
6080 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6081 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6082 size of shared library info entry.
58797674 6083 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6084 incremental link when adding DT_NEEDED entries.
6085 * object.h (Object::Object): Initialize new data member.
6086 (Object::dynobj): New function.
6087 (Object::set_as_needed): New function.
6088 (Object::as_needed): New function.
6089 (Object::do_dynobj): New function.
6090 (Object::as_needed_): New data member.
6091
6fa2a40b
CC
60922011-05-24 Cary Coutant <ccoutant@google.com>
6093
6094 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6095 info; adjust display of GOT entries.
6096 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6097 vector of input objects; remove file_status_.
6098 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6099 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6100 got_plt reader; call target hooks to reserve GOT entries.
6101 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6102 of input file info header and GOT info entry.
6103 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6104 relocation info.
6105 (Got_plt_view_info::got_descriptor): Remove.
6106 (Got_plt_view_info::sym_index): New data member.
6107 (Got_plt_view_info::input_index): New data member.
6108 (Local_got_offset_visitor::visit): Write input file index.
6109 (Global_got_offset_visitor::visit): Write 0 for input file index.
6110 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6111 with sym_index and input_index.
6112 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6113 incremental info GOT entry; replace got_descriptor with input_index.
6114 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6115 map from input file index to object.
6116 (Sized_relobj_incr::do_layout): Replace direct data member reference
6117 with accessor function.
6118 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6119 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6120 Adjust size of input file info header.
6121 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6122 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6123 (Incremental_input_entry_reader::get_input_section): Adjust size of
6124 input file info header.
6125 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6126 of incremental info GOT entry.
6127 (Incremental_got_plt_reader::get_got_desc): Remove.
6128 (Incremental_got_plt_reader::get_got_symndx): New function.
6129 (Incremental_got_plt_reader::get_got_input_index): New function.
6130 (Sized_incremental_binary::Sized_incremental_binary): Remove
6131 file_status_; add input_objects_.
6132 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6133 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6134 (Sized_incremental_binary::file_is_unchanged): Remove.
6135 (Sized_incremental_binary::set_input_object): New function.
6136 (Sized_incremental_binary::input_object): New function.
6137 (Sized_incremental_binary::file_status_): Remove.
6138 (Sized_incremental_binary::input_objects_): New data member.
6139 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6140 references.
6141 (Sized_relobj_incr::invalid_address): Move to base class.
6142 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6143 class.
6144 (Sized_relobj_incr::do_output_section_offset): Likewise.
6145 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6146 (Sized_relobj_incr::section_offsets_): Likewise.
6147 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6148 function.
6149 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6150 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6151 with accessor function.
6152 (Sized_relobj_file::do_layout): Likewise.
6153 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6154 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6155 (Sized_relobj_file::compute_final_local_value): Replace refs to
6156 section_offsets_ with accessor function.
6157 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6158 * object.h (Relobj::Relobj): Initialize new data members.
6159 (Relobj::add_dyn_reloc): New function.
6160 (Relobj::first_dyn_reloc): New function.
6161 (Relobj::dyn_reloc_count): New function.
6162 (Relobj::first_dyn_reloc_): New data member.
6163 (Relobj::dyn_reloc_count_): New data member.
6164 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6165 references.
6166 (Sized_relobj::Address): New typedef.
6167 (Sized_relobj::invalid_address): Move here from child class.
6168 (Sized_relobj::Sized_relobj): Initialize new data members.
6169 (Sized_relobj::sized_relobj): New function.
6170 (Sized_relobj::is_output_section_offset_invalid): Move here from
6171 child class.
6172 (Sized_relobj::get_output_section_offset): Likewise.
6173 (Sized_relobj::local_has_got_offset): Likewise.
6174 (Sized_relobj::local_got_offset): Likewise.
6175 (Sized_relobj::set_local_got_offset): Likewise.
6176 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6177 (Sized_relobj::clear_got_offsets): New function.
6178 (Sized_relobj::section_offsets): Move here from child class.
6179 (Sized_relobj::do_output_section_offset): Likewise.
6180 (Sized_relobj::do_set_section_offset): Likewise.
6181 (Sized_relobj::Local_got_offsets): Likewise.
6182 (Sized_relobj::local_got_offsets_): Likewise.
6183 (Sized_relobj::section_offsets_): Likewise.
6184 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6185 references.
6186 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6187 class.
6188 (Sized_relobj_file::sized_relobj): New function
6189 (Sized_relobj_file::local_has_got_offset): Move to base class.
6190 (Sized_relobj_file::local_got_offset): Likewise.
6191 (Sized_relobj_file::set_local_got_offset): Likewise.
6192 (Sized_relobj_file::get_output_section_offset): Likewise.
6193 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6194 (Sized_relobj_file::do_output_section_offset): Likewise.
6195 (Sized_relobj_file::do_set_section_offset): Likewise.
6196 (Sized_relobj_file::Local_got_offsets): Likewise.
6197 (Sized_relobj_file::local_got_offsets_): Likewise.
6198 (Sized_relobj_file::section_offsets_): Likewise.
6199 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6200 (all constructors).
6201 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6202 (Output_reloc::get_symbol_index): Likewise.
6203 (Output_reloc::local_section_offset): Likewise.
6204 (Output_reloc::get_address): Likewise.
6205 (Output_reloc::symbol_value): Likewise.
6206 (Output_data_got::reserve_slot): Move to class definition.
6207 (Output_data_got::reserve_local): New function.
6208 (Output_data_got::reserve_slot_for_global): Remove.
6209 (Output_data_got::reserve_global): New function.
6210 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6211 (all constructors, two instantiations).
6212 (Output_reloc::get_relobj): New function (two instantiations).
6213 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6214 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6215 (Output_data_reloc::add_global): Adjust type of relobj.
6216 (Output_data_reloc::add_global_relative): Likewise.
6217 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6218 (Output_data_reloc::add_local): Likewise.
6219 (Output_data_reloc::add_local_relative): Likewise.
6220 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6221 (Output_data_reloc::add_local_section): Likewise.
6222 (Output_data_reloc::add_output_section): Likewise.
6223 (Output_data_reloc::add_absolute): Likewise.
6224 (Output_data_reloc::add_target_specific): Likewise.
6225 (Output_data_got::reserve_slot): Move definition here.
6226 (Output_data_got::reserve_local): New function.
6227 (Output_data_got::reserve_global): New function.
6228 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6229 section_offsets_ with accessor function.
6230 (Sized_relobj_file::write_sections): Likewise.
6231 (Sized_relobj_file::do_relocate_sections): Likewise.
6232 * target.h (Sized_target::reserve_local_got_entry): New function.
6233 (Sized_target::reserve_global_got_entry): New function.
6234 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6235 (Target_x86_64::reserve_global_got_entry): New function.
6236 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6237
4829d394
CC
62382011-05-23 Cary Coutant <ccoutant@google.com>
6239
6240 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6241 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6242 bit when checking got_type.
6243 * incremental.cc (Sized_incremental_binary::setup_readers):
6244 Store symbol table and string table locations; initialize bit vector
6245 of file status flags.
6246 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6247 unchanged files.
6248 (Sized_incremental_binary::do_process_got_plt): New function.
6249 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6250 (Output_section_incremental_inputs::set_final_data_size): Record
6251 file index for each input file.
6252 (Output_section_incremental_inputs::write_got_plt): Store file index
6253 instead of input entry offset for each GOT entry.
6254 * incremental.h
6255 (Incremental_input_entry::Incremental_input_entry): Initialize new
6256 data member.
6257 (Incremental_input_entry::set_offset): Store file index.
6258 (Incremental_input_entry::get_file_index): New function.
6259 (Incremental_input_entry::file_index_): New data member.
6260 (Incremental_binary::process_got_plt): New function.
6261 (Incremental_binary::do_process_got_plt): New function.
6262 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6263 data members.
6264 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6265 (Sized_incremental_binary::set_file_is_unchanged): New function.
6266 (Sized_incremental_binary::file_is_unchanged): New function.
6267 (Sized_incremental_binary::do_process_got_plt): New function.
6268 (Sized_incremental_binary::file_status_): New data member.
6269 (Sized_incremental_binary::main_symtab_loc_): New data member.
6270 (Sized_incremental_binary::main_strtab_loc_): New data member.
6271 * output.cc (Output_data_got::Got_entry::write): Add case
6272 RESERVED_CODE.
6273 (Output_data_got::add_global): Call add_got_entry.
6274 (Output_data_got::add_global_plt): Likewise.
6275 (Output_data_got::add_global_with_rel): Likewise.
6276 (Output_data_got::add_global_with_rela): Likewise.
6277 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6278 (Output_data_got::add_global_pair_with_rela): Likewise.
6279 (Output_data_got::add_local): Call add_got_entry.
6280 (Output_data_got::add_local_plt): Likewise.
6281 (Output_data_got::add_local_with_rel): Likewise.
6282 (Output_data_got::add_local_with_rela): Likewise.
6283 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6284 (Output_data_got::add_local_pair_with_rela): Likewise.
6285 (Output_data_got::reserve_slot): New function.
6286 (Output_data_got::reserve_slot_for_global): New function.
6287 (Output_data_got::add_got_entry): New function.
6288 (Output_data_got::add_got_entry_pair): New function.
6289 (Output_section::add_output_section_data): Edit FIXME.
6290 * output.h
6291 (Output_section_data_build::Output_section_data_build): New
6292 constructor with size parameter.
6293 (Output_data_space::Output_data_space): Likewise.
6294 (Output_data_got::Output_data_got): Initialize new data member; new
6295 constructor with size parameter.
6296 (Output_data_got::add_constant): Call add_got_entry.
6297 (Output_data_got::reserve_slot): New function.
6298 (Output_data_got::reserve_slot_for_global): New function.
6299 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6300 (Output_data_got::add_got_entry): New function.
6301 (Output_data_got::add_got_entry_pair): New function.
6302 (Output_data_got::free_list_): New data member.
6303 * target.h (Sized_target::init_got_plt_for_update): New function.
6304 (Sized_target::register_global_plt_entry): New function.
6305 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6306 Initialize new data member; call init; add constructor with PLT count.
6307 (Output_data_plt_x86_64::init): New function.
6308 (Output_data_plt_x86_64::add_relocation): New function.
6309 (Output_data_plt_x86_64::reserve_slot): New function.
6310 (Output_data_plt_x86_64::free_list_): New data member.
6311 (Target_x86_64::init_got_plt_for_update): New function.
6312 (Target_x86_64::register_global_plt_entry): New function.
6313 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6314 incremental updates.
6315 (Output_data_plt_x86_64::add_relocation): New function.
6316 * testsuite/object_unittest.cc (Object_test): Set default options.
6317
ec69d6da
ILT
63182011-05-16 Ian Lance Taylor <iant@google.com>
6319
6320 * options.h (class General_options): Make -i a synonym for -r.
6321
732e31de
ILT
63222011-05-16 Ian Lance Taylor <iant@google.com>
6323
6324 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6325
403676b5
CC
63262011-05-10 Cary Coutant <ccoutant@google.com>
6327
6328 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6329 strip_all (-s).
6330
5b7b7d6e
ILT
63312011-05-06 Ian Lance Taylor <iant@google.com>
6332
6333 * layout.cc (Layout::layout): If the output section flags change,
6334 update the ordering.
6335
f0f9babf
CC
63362011-04-25 Cary Coutant <ccoutant@google.com>
6337
6338 * incremental-dump.cc (dump_incremental_inputs): Print local
6339 symbol info for each input file.
6340 * incremental.cc
6341 (Output_section_incremental_inputs::set_final_data_size): Add local
6342 symbol info to input file entries in incremental info.
6343 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6344 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6345 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6346 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6347 implementation.
6348 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6349 (Sized_incr_relobj::do_relocate): Write the local symbols.
6350 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6351 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6352 Adjust size of input file header.
6353 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6354 (Incremental_inputs_reader::get_local_symbol_count): New function.
6355 (Incremental_inputs_reader::get_input_section): Adjust size of input
6356 file header.
6357 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6358 (Sized_incr_relobj::This): New typedef.
6359 (Sized_incr_relobj::sym_size): New const data member.
6360 (Sized_incr_relobj::Local_symbol): New struct.
6361 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6362 (Sized_incr_relobj::do_local_symbol_offset): New function.
6363 (Sized_incr_relobj::local_symbol_count_): New data member.
6364 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6365 (Sized_incr_relobj::local_symbol_index_): New data member.
6366 (Sized_incr_relobj::local_symbol_offset_): New data member.
6367 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6368 (Sized_incr_relobj::local_symbols_): New data member.
6369 * object.h (Relobj::output_local_symbol_count): New function.
6370 (Relobj::local_symbol_offset): New function.
6371 (Relobj::do_output_local_symbol_count): New function.
6372 (Relobj::do_local_symbol_offset): New function.
6373 (Sized_relobj::do_output_local_symbol_count): New function.
6374 (Sized_relobj::do_local_symbol_offset): New function.
6375
d0a9ace3
ILT
63762011-04-22 Vladimir Simonov <sv@sw.ru>
6377
6378 * descriptors.cc (set_close_on_exec): New function.
6379 (Descriptors::open): Use set_close_on_exec.
6380 * output.cc (S_ISLNK): Define if not defined.
6381
94a3fc8b
CC
63822011-04-22 Cary Coutant <ccoutant@google.com>
6383
6384 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6385 global symbol map.
6386 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6387 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6388 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6389 relocations.
6390 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6391 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6392 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6393 * incremental.h
6394 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6395 function.
6396 (Incremental_binary::apply_incremental_relocs): New function.
6397 (Incremental_binary::do_apply_incremental_relocs): New function.
6398 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6399 data member.
6400 (Sized_incremental_binary::add_global_symbol): New function.
6401 (Sized_incremental_binary::global_symbol): New function.
6402 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6403 (Sized_incremental_binary::symbol_map_): New data member.
6404 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6405 * target.h (Sized_target::apply_relocation): New function.
6406 * target-reloc.h (apply_relocation): New function.
6407 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6408
c87e4302
DK
64092011-04-22 Doug Kwan <dougkwan@google.com>
6410
6411 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6412 flag of a SHT_ARM_EXIDX section.
2e702c99 6413 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6414 * testsuite/Makefile.in: Regenerate.
6415 * testsuite/arm_exidx_test.s: New file.
6416 * testsuite/arm_exidx_test.sh: Same.
6417
e7782cf6
CC
64182011-04-20 Cary Coutant <ccoutant@google.com>
6419
6420 PR gold/12689
6421 * archive.h (Incremental_archive_entry::Archive_member):
6422 Initialize arg_serial_ (second constructor).
6423
308ecdc7
ILT
64242011-04-17 Ian Lance Taylor <iant@google.com>
6425
6426 * object.cc (Relocate_info::location): Simplify location string.
6427 * errors.cc (Errors::error_at_location): Don't print program
6428 name.
6429 (Errors::warning_at_location): Likewise.
6430 (Errors::undefined_symbol): Likewise.
6431 * testsuite/debug_msg.sh: Update accordingly.
6432
bec5b579
CC
64332011-04-14 Cary Coutant <ccoutant@google.com>
6434
6435 * gold/layout.cc (Layout::symtab_section_offset): New function.
6436 * gold/layout.h (Layout::symtab_section_offset): New function.
6437 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6438
88597d34
ILT
64392011-04-12 Ian Lance Taylor <iant@google.com>
6440
6441 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6442 with MREMAP_MAYMOVE.
6443 * output.h (class Output_file): Add map_is_allocated_ field.
6444 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6445 not available, provide stubs. If mremap is not available, #define
6446 it to gold_mremap.
6447 (MREMAP_MAYMOVE): Define if not defined.
6448 (Output_file::Output_file): Initialize map_is_allocated_.
6449 (Output_file::resize): Check map_is_allocated_.
6450 (Output_file::map_anonymous): If mmap fails, use malloc.
6451 (Output_file::unmap): Don't do anything for an anonymous map.
6452 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6453 is not available, provide stubs.
6454 (File_read::View::~View): Use free rather than delete[].
6455 (File_read::make_view): Use malloc rather than new[]. If mmap
6456 fails, use malloc.
6457 (File_read::find_or_make_view): Use malloc rather than new[].
6458 * gold.h: Remove HAVE_REMAP code.
6459 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6460 exists. Rename mremap to gold_mremap. If mmap is not available
6461 don't do anything.
6462 * configure, config.in: Rebuild.
6463
11e361bc
ILT
64642011-04-11 Ian Lance Taylor <iant@google.com>
6465
6466 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6467 initialize local variable v.
6468
cdc29364
CC
64692011-04-11 Cary Coutant <ccoutant@google.com>
6470
6471 * archive.cc (Archive::include_member): Adjust call to
6472 report_object.
6473 (Add_archive_symbols::run): Track argument serial numbers.
6474 (Lib_group::include_member): Likewise.
6475 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6476 * archive.h (Incremental_archive_entry::Archive_member):
6477 Initialize arg_serial_.
6478 (Archive_member::arg_serial_): New data member.
6479 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6480 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6481 incremental link.
6482 (Sized_dynobj::do_for_all_local_got_entries): New function.
6483 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6484 function.
6485 * fileread.cc (get_mtime): New function.
6486 * fileread.h (get_mtime): New function.
6487 * gold.cc (queue_initial_tasks): Check for incremental update.
6488 (process_incremental_input): New function.
6489 (queue_middle_tasks): Don't force valid target for incremental
6490 update.
6491 * incremental-dump.cc (find_input_containing_global): Adjust
6492 size of symbol info entry.
6493 (dump_incremental_inputs): Dump argument serial number and
6494 in_system_directory flag; bias shndx by 1; print symbol names
6495 when dumping per-file symbol lists; use new symbol info readers.
6496 * incremental.cc
6497 (Output_section_incremental_inputs:update_data_size): New function.
6498 (Sized_incremental_binary::setup_readers): Setup input readers
6499 for each input file; build maps for files added from libraries
6500 and scripts.
6501 (Sized_incremental_binary::check_input_args): New function.
6502 (Sized_incremental_binary::do_check_inputs): Build map of argument
6503 serial numbers to input arguments.
6504 (Sized_incremental_binary::do_file_has_changed): Rename
6505 do_file_is_unchanged to this; compare file modification times.
6506 (Sized_incremental_binary::do_init_layout): New function.
6507 (Sized_incremental_binary::do_reserve_layout): New function.
6508 (Sized_incremental_binary::do_get_input_reader): Remove.
6509 (Sized_incremental_binary::get_symtab_view): New function.
6510 (Incremental_checker::can_incrementally_link_output_file): Remove.
6511 (Incremental_inputs::report_command_line): Exclude --debug options.
6512 (Incremental_inputs::report_archive_begin): Add parameter; track
6513 argument serial numbers; don't put input file entry for archive
6514 before archive members.
6515 (Incremental_inputs::report_archive_end): Put input file entry
6516 for archive after archive members.
6517 (Incremental_inputs::report_object): Add parameter; track argument
6518 serial numbers and in_system_directory flag.
6519 (Incremental_inputs::report_script): Add parameter; track argument
6520 serial numbers.
6521 (Output_section_incremental_inputs::set_final_data_size): Adjust
6522 size of symbol info entry; check for forwarding symbols.
6523 (Output_section_incremental_inputs::write_input_files): Write
6524 in_system_directory flag and argument serial number.
6525 (Output_section_incremental_inputs::write_info_blocks): Map section
6526 indices between incremental info and original input file; store
6527 input section index for each symbol.
6528 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6529 change operator() to visit().
6530 (class Global_got_offset_visitor): Likewise.
6531 (class Global_symbol_visitor_got_plt):
6532 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6533 classes.
6534 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6535 (Sized_incr_relobj::do_read_symbols): New function.
6536 (Sized_incr_relobj::do_layout): New function.
6537 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6538 (Sized_incr_relobj::do_add_symbols): New function.
6539 (Sized_incr_relobj::do_should_include_member): New function.
6540 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6541 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6542 (Sized_incr_relobj::do_section_size): New function.
6543 (Sized_incr_relobj::do_section_name): New function.
6544 (Sized_incr_relobj::do_section_contents): New function.
6545 (Sized_incr_relobj::do_section_flags): New function.
6546 (Sized_incr_relobj::do_section_entsize): New function.
6547 (Sized_incr_relobj::do_section_address): New function.
6548 (Sized_incr_relobj::do_section_type): New function.
6549 (Sized_incr_relobj::do_section_link): New function.
6550 (Sized_incr_relobj::do_section_info): New function.
6551 (Sized_incr_relobj::do_section_addralign): New function.
6552 (Sized_incr_relobj::do_initialize_xindex): New function.
6553 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6554 (Sized_incr_relobj::do_read_relocs): New function.
6555 (Sized_incr_relobj::do_gc_process_relocs): New function.
6556 (Sized_incr_relobj::do_scan_relocs): New function.
6557 (Sized_incr_relobj::do_count_local_symbols): New function.
6558 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6559 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6560 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6561 (Sized_incr_relobj::do_relocate): New function.
6562 (Sized_incr_relobj::do_set_section_offset): New function.
6563 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6564 (Sized_incr_dynobj::do_read_symbols): New function.
6565 (Sized_incr_dynobj::do_layout): New function.
6566 (Sized_incr_dynobj::do_add_symbols): New function.
6567 (Sized_incr_dynobj::do_should_include_member): New function.
6568 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6569 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6570 (Sized_incr_dynobj::do_section_size): New function.
6571 (Sized_incr_dynobj::do_section_name): New function.
6572 (Sized_incr_dynobj::do_section_contents): New function.
6573 (Sized_incr_dynobj::do_section_flags): New function.
6574 (Sized_incr_dynobj::do_section_entsize): New function.
6575 (Sized_incr_dynobj::do_section_address): New function.
6576 (Sized_incr_dynobj::do_section_type): New function.
6577 (Sized_incr_dynobj::do_section_link): New function.
6578 (Sized_incr_dynobj::do_section_info): New function.
6579 (Sized_incr_dynobj::do_section_addralign): New function.
6580 (Sized_incr_dynobj::do_initialize_xindex): New function.
6581 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6582 (make_sized_incremental_object): New function.
6583 (Incremental_library::copy_unused_symbols): New function.
6584 (Incremental_library::do_for_all_unused_symbols): New function.
6585 * incremental.h (enum Incremental_input_flags): New type.
6586 (class Incremental_checker): Remove.
6587 (Incremental_input_entry::Incremental_input_entry): Add argument
6588 serial number.
6589 (Incremental_input_entry::arg_serial): New function.
6590 (Incremental_input_entry::set_is_in_system_directory): New function.
6591 (Incremental_input_entry::is_in_system_directory): New function.
6592 (Incremental_input_entry::arg_serial_): New data member.
6593 (Incremental_input_entry::is_in_system_directory_): New data member.
6594 (class Script_info): Move here from script.h.
6595 (Script_info::Script_info): Add filename parameter.
6596 (Script_info::filename): New function.
6597 (Script_info::filename_): New data member.
6598 (Incremental_script_entry::Incremental_script_entry): Add argument
6599 serial number.
6600 (Incremental_object_entry::Incremental_object_entry): Likewise.
6601 (Incremental_object_entry::add_input_section): Build list of input
6602 sections with map to original shndx.
6603 (Incremental_object_entry::get_input_section_index): New function.
6604 (Incremental_object_entry::shndx_): New data member.
6605 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6606 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6607 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6608 serial number.
6609 (Incremental_inputs::report_archive_begin): Likewise.
6610 (Incremental_inputs::report_object): Likewise.
6611 (Incremental_inputs::report_script): Likewise.
6612 (class Incremental_global_symbol_reader): New class.
6613 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6614 and store flags and input file type.
6615 (Incremental_input_entry_reader::arg_serial): New function.
6616 (Incremental_input_entry_reader::type): Extract type from flags.
6617 (Incremental_input_entry_reader::is_in_system_directory): New function.
6618 (Incremental_input_entry_reader::get_input_section_count): Call
6619 accessor function for type.
6620 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6621 function for type; adjust size of global symbol entry.
6622 (Incremental_input_entry_reader::get_global_symbol_count): Call
6623 accessor function for type.
6624 (Incremental_input_entry_reader::get_object_count): Likewise.
6625 (Incremental_input_entry_reader::get_object_offset): Likewise.
6626 (Incremental_input_entry_reader::get_member_count): Likewise.
6627 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6628 (Incremental_input_entry_reader::get_member_offset): Likewise.
6629 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6630 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6631 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6632 (Incremental_input_entry_reader::get_global_symbol_reader): New
6633 function.
6634 (Incremental_input_entry_reader::get_output_symbol_index): New
6635 function.
6636 (Incremental_input_entry_reader::type_): Remove.
6637 (Incremental_input_entry_reader::flags_): New data member.
6638 (Incremental_inputs_reader::input_file_offset): New function.
6639 (Incremental_inputs_reader::input_file_index): New function.
6640 (Incremental_inputs_reader::input_file): Call input_file_offset.
6641 (Incremental_inputs_reader::input_file_at_offset): New function.
6642 (Incremental_relocs_reader::get_r_type): Reformat.
6643 (Incremental_relocs_reader::get_r_shndx): Reformat.
6644 (Incremental_relocs_reader::get_r_offset): Reformat.
6645 (Incremental_relocs_reader::data): New function.
6646 (Incremental_binary::Incremental_binary): Initialize new data members.
6647 (Incremental_binary::check_inputs): Add cmdline parameter.
6648 (Incremental_binary::file_is_unchanged): Remove.
6649 (Input_reader::arg_serial): New function.
6650 (Input_reader::get_unused_symbol_count): New function.
6651 (Input_reader::get_unused_symbol): New function.
6652 (Input_reader::do_arg_serial): New function.
6653 (Input_reader::do_get_unused_symbol_count): New function.
6654 (Input_reader::do_get_unused_symbol): New function.
6655 (Incremental_binary::input_file_count): New function.
6656 (Incremental_binary::get_input_reader): Change signature to use
6657 index instead of filename.
6658 (Incremental_binary::file_has_changed): New function.
6659 (Incremental_binary::get_input_argument): New function.
6660 (Incremental_binary::get_library): New function.
6661 (Incremental_binary::get_script_info): New function.
6662 (Incremental_binary::init_layout): New function.
6663 (Incremental_binary::reserve_layout): New function.
6664 (Incremental_binary::output_file): New function.
6665 (Incremental_binary::do_check_inputs): New function.
6666 (Incremental_binary::do_file_is_unchanged): Remove.
6667 (Incremental_binary::do_file_has_changed): New function.
6668 (Incremental_binary::do_init_layout): New function.
6669 (Incremental_binary::do_reserve_layout): New function.
6670 (Incremental_binary::do_input_file_count): New function.
6671 (Incremental_binary::do_get_input_reader): Change signature.
6672 (Incremental_binary::input_args_map_): New data member.
6673 (Incremental_binary::library_map_): New data member.
6674 (Incremental_binary::script_map_): New data member.
6675 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6676 new data members.
6677 (Sized_incremental_binary::output_section): New function.
6678 (Sized_incremental_binary::inputs_reader): Add const.
6679 (Sized_incremental_binary::symtab_reader): Add const.
6680 (Sized_incremental_binary::relocs_reader): Add const.
6681 (Sized_incremental_binary::got_plt_reader): Add const.
6682 (Sized_incremental_binary::get_symtab_view): New function.
6683 (Sized_incremental_binary::Inputs_reader): New typedef.
6684 (Sized_incremental_binary::Input_entry_reader): New typedef.
6685 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6686 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6687 (Sized_incremental_binary::do_file_has_changed): New function.
6688 (Sized_incremental_binary::do_init_layout): New function.
6689 (Sized_incremental_binary::do_reserve_layout): New function.
6690 (Sized_input_reader::Inputs_reader): Remove.
6691 (Sized_input_reader::Input_entry_reader): Remove.
6692 (Sized_input_reader::do_arg_serial): New function.
6693 (Sized_input_reader::do_get_unused_symbol_count): New function.
6694 (Sized_input_reader::do_get_unused_symbol): New function.
6695 (Sized_incremental_binary::do_input_file_count): New function.
6696 (Sized_incremental_binary::do_get_input_reader): Change signature;
6697 use index instead of filename.
6698 (Sized_incremental_binary::section_map_): New data member.
6699 (Sized_incremental_binary::input_entry_readers_): New data member.
6700 (class Sized_incr_relobj): New class.
6701 (class Sized_incr_dynobj): New class.
6702 (make_sized_incremental_object): New function.
6703 (class Incremental_library): New class.
6704 * layout.cc (Free_list::num_lists): New static data member.
6705 (Free_list::num_nodes): New static data member.
6706 (Free_list::num_removes): New static data member.
6707 (Free_list::num_remove_visits): New static data member.
6708 (Free_list::num_allocates): New static data member.
6709 (Free_list::num_allocate_visits): New static data member.
6710 (Free_list::init): New function.
6711 (Free_list::remove): New function.
6712 (Free_list::allocate): New function.
6713 (Free_list::dump): New function.
6714 (Free_list::print_stats): New function.
6715 (Layout_task_runner::run): Resize output file for incremental updates.
6716 (Layout::Layout): Initialize new data members.
6717 (Layout::set_incremental_base): New function.
6718 (Layout::init_fixed_output_section): New function.
6719 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6720 incremental updates.
6721 (Layout::create_gold_note): Do not create gold note section for
6722 incremental updates.
6723 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6724 for incremental updates.
6725 (Layout::set_section_offsets): For incremental updates, allocate space
6726 from free list.
6727 (Layout::create_symtab_sections): Layout with offsets relative to
6728 start of section; for incremental updates, allocate space from free
6729 list.
6730 (Layout::create_shdrs): For incremental updates, allocate space from
6731 free list.
6732 (Layout::finish_dynamic_section): For incremental updates, do not
6733 check --as-needed (fixed in subsequent patch).
6734 * layout.h (class Free_list): New class.
6735 (Layout::set_incremental_base): New function.
6736 (Layout::incremental_base): New function.
6737 (Layout::init_fixed_output_section): New function.
6738 (Layout::allocate): New function.
6739 (Layout::incremental_base_): New data member.
6740 (Layout::free_list_): New data member.
6741 * main.cc (main): Print Free_list statistics.
6742 * object.cc (Relobj::finalize_incremental_relocs): Add
6743 clear_counts parameter; clear counts only when clear_counts is set.
6744 (Sized_relobj::Sized_relobj): Initialize new base class.
6745 (Sized_relobj::do_layout): Don't report special sections.
6746 (Sized_relobj::do_for_all_local_got_entries): New function.
6747 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6748 symtab_off to all symbol table offsets.
6749 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6750 * object.h (class Got_offset_list): Move to top of file.
6751 (Object::Object): Allow case where input_file == NULL.
6752 (Object::~Object): Likewise.
6753 (Object::input_file): Assert that input_file != NULL.
6754 (Object::lock): Allow case where input_file == NULL.
6755 (Object::unlock): Likewise.
6756 (Object::is_locked): Likewise.
6757 (Object::token): Likewise.
6758 (Object::release): Likewise.
6759 (Object::is_incremental): New function.
6760 (Object::get_mtime): New function.
6761 (Object::for_all_local_got_entries): New function.
6762 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6763 (Object::set_is_in_system_directory): New function.
6764 (Object::is_in_system_directory): New function.
6765 (Object::do_is_incremental): New function.
6766 (Object::do_get_mtime): New function.
6767 (Object::do_for_all_local_got_entries): New function.
6768 (Object::is_in_system_directory_): New data member.
6769 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6770 (class Sized_relobj_base): New class.
6771 (class Sized_relobj): Derive from Sized_relobj_base.
6772 (class Sized_relobj::Symbols): Redeclare from base class.
6773 (class Sized_relobj::local_got_offset_list): Remove.
6774 (class Sized_relobj::Output_sections): Redeclare from base class.
6775 (class Sized_relobj::do_for_all_local_got_entries): New function.
6776 (class Sized_relobj::write_local_symbols): Add offset parameter.
6777 (class Sized_relobj::local_symbol_offset_): Update comment.
6778 (class Sized_relobj::local_dynsym_offset_): Update comment.
6779 * options.cc (Input_arguments::add_file): Remove const.
6780 * options.h (Input_file_argument::Input_file_argument):
6781 Initialize arg_serial_ (all constructors).
6782 (Input_file_argument::set_arg_serial): New function.
6783 (Input_file_argument::arg_serial): New function.
6784 (Input_file_argument::arg_serial_): New data member.
6785 (Input_arguments::Input_arguments): Initialize file_count_.
6786 (Input_arguments::add_file): Remove const.
6787 (Input_arguments::number_of_input_files): New function.
6788 (Input_arguments::file_count_): New data member.
6789 (Command_line::number_of_input_files): Call
6790 Input_arguments::number_of_input_files.
6791 * output.cc (Output_segment_headers::Output_segment_headers):
6792 Set current size.
6793 (Output_section::Input_section::current_data_size): New function.
6794 (Output_section::Output_section): Initialize new data members.
6795 (Output_section::add_input_section): Don't do merge sections for
6796 an incremental link; allocate space from free list for an
6797 incremental update.
6798 (Output_section::add_output_section_data): Allocate space from
6799 free list for an incremental update.
6800 (Output_section::update_data_size): New function.
6801 (Output_section::set_fixed_layout): New function.
6802 (Output_section::reserve): New function.
6803 (Output_segment::set_section_addresses): Remove const.
6804 (Output_segment::set_section_list_addresses): Remove const; allocate
6805 space from free list for an incremental update.
6806 (Output_segment::set_offset): Adjust size of RELRO segment for an
6807 incremental update.
6808 * output.h (Output_data::current_data_size): Move here from
6809 child classes.
6810 (Output_data::pre_finalize_data_size): New function.
6811 (Output_data::update_data_size): New function.
6812 (Output_section_headers::update_data_size): new function.
6813 (Output_section_data_build::current_data_size): Move to Output_data.
6814 (Output_data_strtab::update_data_size): New function.
6815 (Output_section::current_data_size): Move to Output_data.
6816 (Output_section::set_fixed_layout): New function.
6817 (Output_section::has_fixed_layout): New function.
6818 (Output_section::reserve): New function.
6819 (Output_section::update_data_size): New function.
6820 (Output_section::has_fixed_layout_): New data member.
6821 (Output_section::free_list_): New data member.
6822 (Output_segment::set_section_addresses): Remove const.
6823 (Output_segment::set_section_list_addresses): Remove const.
6824 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6825 New function.
6826 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6827 New function.
6828 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6829 parameter when calling Add_symbols constructor; store argument
6830 serial number for members of a lib group.
6831 (Add_symbols::locks): Allow case where token == NULL.
6832 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6833 (Read_member::~Read_member): New function.
6834 (Read_member::is_runnable): New function.
6835 (Read_member::locks): New function.
6836 (Read_member::run): New function.
6837 (Check_script::~Check_script): New function.
6838 (Check_script::is_runnable): New function.
6839 (Check_script::locks): New function.
6840 (Check_script::run): New function.
6841 (Check_library::~Check_library): New function.
6842 (Check_library::is_runnable): New function.
6843 (Check_library::locks): New function.
6844 (Check_library::run): New function.
6845 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6846 (Add_symbols::library_): New data member.
6847 (class Read_member): New class.
6848 (class Check_script): New class.
6849 (class Check_library): New class.
6850 * reloc.cc (Read_relocs::is_runnable): Allow case where
6851 token == NULL.
6852 (Read_relocs::locks): Likewise.
6853 (Scan_relocs::locks): Likewise.
6854 (Relocate_task::locks): Likewise.
6855 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6856 to clear counters.
6857 (Sized_relobj::incremental_relocs_scan): Fix comment.
6858 (Sized_relobj::do_relocate): Pass output file offset to
6859 write_local_symbols.
6860 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6861 from class declaration.
6862 * script.cc (read_input_script): Allocate Script_info; pass
6863 argument serial number to report_script.
6864 * script.h (class Script_info): Move to incremental.h.
6865 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6866 * symtab.h (Symbol_table::add_from_incrobj): New function.
6867 (Symbol_table::set_file_offset): New function.
6868
b961d0d7
CC
68692011-04-05 Cary Coutant <ccoutant@google.com>
6870
6871 * incremental-dump.cc (dump_incremental_inputs): Change signature
6872 to take a Sized_incremental_binary; change caller. Use readers
6873 in Sized_incremental_binary.
6874 * incremental.cc
6875 (Sized_incremental_binary::find_incremental_inputs_sections):
6876 Rename do_find_incremental_inputs_sections to this.
6877 (Sized_incremental_binary::setup_readers): New function.
6878 (Sized_incremental_binary::do_check_inputs): Check
6879 has_incremental_info_ flag; move setup code to setup_readers;
6880 use input readers.
6881 (Sized_incremental_binary::do_file_is_unchanged): New function.
6882 (Sized_incremental_binary::do_get_input_reader): New function.
6883 * incremental.h (class Incremental_binary): Move to end of file.
6884 (Incremental_binary::file_is_unchanged): New function.
6885 (Incremental_binary::do_file_is_unchanged): New function.
6886 (Incremental_binary::Input_reader): New class.
6887 (Incremental_binary::get_input_reader): New function.
6888 (class Sized_incremental_binary): Move to end of file.
6889 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6890 input section reader classes.
6891 (Sized_incremental_binary::has_incremental_info): New function.
6892 (Sized_incremental_binary::inputs_reader): New function.
6893 (Sized_incremental_binary::symtab_reader): New function.
6894 (Sized_incremental_binary::relocs_reader): New function.
6895 (Sized_incremental_binary::got_plt_reader): New function.
6896 (Sized_incremental_binary::do_file_is_unchanged): New function.
6897 (Sized_incremental_binary::Sized_input_reader): New class.
6898 (Sized_incremental_binary::get_input_reader): New function.
6899 (Sized_incremental_binary::find_incremental_inputs_sections):
6900 Rename do_find_incremental_inputs_sections to this.
6901 (Sized_incremental_binary::setup_readers): New function.
6902 (Sized_incremental_binary::has_incremental_info_): New data member.
6903 (Sized_incremental_binary::inputs_reader_): New data member.
6904 (Sized_incremental_binary::symtab_reader_): New data member.
6905 (Sized_incremental_binary::relocs_reader_): New data member.
6906 (Sized_incremental_binary::got_plt_reader_): New data member.
6907 (Sized_incremental_binary::current_input_file_): New data member.
6908
a869183f
PP
69092011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6910
6911 PR gold/12640
6912 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6913 violation.
6914
69152011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6916
6917 * archive.cc (Archive::include_member): Adjust call to report_object.
6918 (Add_archive_symbols::run): Add script_info to call to
6919 report_archive_begin.
6920 (Lib_group::include_member): Adjust call to report_object.
6921 (Add_lib_group_symbols::run): Adjust call to report_object.
6922 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6923 blocks. Add object count for script input files.
6924 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6925 script_info parameter; change all callers.
6926 (Incremental_inputs::report_object): Add script_info parameter;
6927 change all callers.
6928 (Incremental_inputs::report_script): Store backpointer to
6929 incremental info entry.
6930 (Output_section_incremental_inputs::set_final_data_size): Record
6931 additional information for scripts.
6932 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6933 * incremental.h (Incremental_script_entry::add_object): New function.
6934 (Incremental_script_entry::get_object_count): New function.
6935 (Incremental_script_entry::get_object): New function.
6936 (Incremental_script_entry::objects_): New data member; adjust
6937 constructor.
6938 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6939 (Incremental_inputs::report_object): Add script_info parameter.
6940 (Incremental_inputs_reader::get_object_count): New function.
6941 (Incremental_inputs_reader::get_object_offset): New function.
6942 * options.cc (Input_arguments::add_file): Return reference to
6943 new input argument.
6944 * options.h (Input_argument::set_script_info): New function.
6945 (Input_argument::script_info): New function.
6946 (Input_argument::script_info_): New data member; adjust all
6947 constructors.
6948 (Input_file_group::add_file): Return reference to new input argument.
6949 (Input_file_lib::add_file): Likewise.
6950 (Input_arguments::add_file): Likewise.
6951 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6952 * script.cc (Parser_closure::Parser_closure): Add script_info
6953 parameter; adjust all callers.
6954 (Parser_closure::script_info): New function.
6955 (Parser_closure::script_info_): New data member.
6956 (read_input_script): Report scripts earlier to incremental info.
6957 (script_add_file): Set script_info in Input_argument.
6958 (script_add_library): Likewise.
6959 * script.h (Script_options::Script_info): Rewrite class.
6960
a869183f 69612011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6962
6963 * archive.cc (Library_base::should_include_member): Move
6964 method here from class Archive.
6965 (Archive::Archive): Initialize base class.
6966 (Archive::should_include_member): Move to base class.
6967 (Archive::do_for_all_unused_symbols): New function.
6968 (Add_archive_symbols::run): Remove redundant access to
6969 incremental_inputs.
6970 (Lib_group::Lib_group): Initialize base class.
6971 (Lib_group::do_filename): New function.
6972 (Lib_group::include_member): Pass pointer to Lib_group to
6973 report_object.
6974 (Lib_group::do_for_all_unused_symbols): New function.
6975 (Add_lib_group_symbols::run): Report archive information for
6976 incremental links.
6977 * archive.h (class Library_base): New base class.
6978 (class Archive): Derive from Library_base.
6979 (Archive::filename): Move to base class.
6980 (Archive::set_incremental_info): Likewise.
6981 (Archive::incremental_info): Likewise.
6982 (Archive::Should_include): Likewise.
6983 (Archive::should_include_member): Likewise.
6984 (Archive::Armap_entry): Remove.
6985 (Archive::Unused_symbol_iterator): Remove.
6986 (Archive::unused_symbols_begin): Remove.
6987 (Archive::unused_symbols_end): Remove.
6988 (Archive::do_filename): New function.
6989 (Archive::do_get_mtime): New function.
6990 (Archive::do_for_all_unused_symbols): New function.
6991 (Archive::task_): Move to base class.
6992 (Archive::incremental_info_): Likewise.
6993 (class Lib_group): Derive from Library_base.
6994 (Lib_group::do_filename): New function.
6995 (Lib_group::do_get_mtime): New function.
6996 (Lib_group::do_for_all_unused_symbols): New function.
6997 (Lib_group::task_): Move to base class.
6998 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6999 function.
7000 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7001 function.
7002 * incremental.cc (Incremental_inputs::report_archive_begin):
7003 Use Library_base; call library's get_mtime; add incremental inputs
7004 entry before members.
7005 (class Unused_symbol_visitor): New class.
7006 (Incremental_inputs::report_archive_end): Use Library_base; use
7007 visitor class to record unused symbols; don't add incremental inputs
7008 entry after members.
7009 (Incremental_inputs::report_object): Use Library_base.
7010 * incremental.h
7011 (Incremental_archive_entry::Incremental_archive_entry): Remove
7012 unused Archive parameter.
7013 (Incremental_inputs::report_archive_begin): Use Library_base.
7014 (Incremental_inputs::report_archive_end): Likewise.
7015 (Incremental_inputs::report_object): Likewise.
7016 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7017 function.
7018 * object.h (Object::for_all_global_symbols): New function.
7019 (Object::do_for_all_global_symbols): New function.
7020 (Sized_relobj::do_for_all_global_symbols): New function.
7021 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7022 function.
7023 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7024 function.
7025
61ab3e40
ILT
70262011-03-27 Ian Lance Taylor <iant@google.com>
7027
7028 * archive.cc (Archive::interpret_header): Return -1 if something
7029 goes wrong. Change callers accordingly.
7030
30e1f9e6
CC
70312011-03-25 Cary Coutant <ccoutant@google.com>
7032
7033 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7034 * testsuite/Makefile.in: Regenerate.
7035
9370ce59 70362011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7037
7038 * plugin.cc (get_view): New.
7039 (Plugin::load): Pass get_view to the plugin.
7040 (Plugin_manager::get_view): New.
7041
9312bb0a
ILT
70422011-03-21 Ian Lance Taylor <iant@google.com>
7043
7044 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7045 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7046
7e12ba9e
ST
70472011-03-21 Sriraman Tallam <tmsriram@google.com>
7048
7049 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7050 Change == to -eq.
7051 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7052 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7053 Change == to -eq.
7054 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7055 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7056
fd7a005d
ILT
70572011-03-14 Ian Lance Taylor <iant@google.com>
7058
7059 * script-sections.cc (Sort_output_sections::script_compare):
7060 Rename from is_before, change return type.
7061 (Sort_output_sections::operator()): Adjust accordingly.
7062
ed16fd1b
ILT
70632011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7064
7065 PR gold/12572
7066 * testsuite/odr_violation2.cc: Add comment to make all error line
7067 numbers double digits.
7068 * testsuite/debug_msg.sh: Adjust expected errors.
7069
71ff8986
ILT
70702011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7071
7072 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7073 but mark earlier ones as non-canonical
7074 (offset_to_iterator): Update search target and example
7075 (do_addr2line): Return extra lines in a vector*
7076 (format_file_lineno): Extract from do_addr2line
7077 (one_addr2line): Add vector* out-param
7078 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7079 when a lineno entry appeared last for its instruction
7080 (Dwarf_line_info): Add vector* out-param
7081 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7082 * symtab.cc (Odr_violation_compare): Include the lineno in the
7083 comparison again.
7084 (linenos_from_loc): New. Combine the canonical line for an
7085 address with its other lines.
7086 (True_if_intersect): New. Helper functor to make
7087 std::set_intersection a query.
7088 (detect_odr_violations): Compare sets of lines instead of just
7089 one line for each function. This became less deterministic, but
7090 has fewer false positives.
7091 * symtab.h: Declarations.
7092 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7093 mix an optimized and non-optimized object in the same binary
7094 (odr_violation2.so): Same.
7095 * testsuite/Makefile.in: Regenerate from Makefile.am.
7096 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7097 * testsuite/debug_msg.sh: Update line numbers and add
7098 assertions.
7099 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7100 non-optimized context.
7101 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7102 isn't inlined, and use OdrDerived in an optimized context.
7103 * testsuite/odr_header1.h: Defines OdrDerived, where
7104 optimization will change the
7105 first-instruction-in-the-destructor's file and line number.
7106 * testsuite/odr_header2.h: Defines OdrBase.
7107
a19fefdc
ILT
71082011-03-09 Ian Lance Taylor <iant@google.com>
7109
7110 * fileread.cc (File_read::clear_views): Don't delete the whole
7111 file view.
7112
ecb351e9
ILT
71132011-03-08 Ian Lance Taylor <iant@google.com>
7114
7115 PR gold/12525
7116 * fileread.cc: #include <climits>.
7117 (GOLD_IOV_MAX): Define.
7118 (File_read::read_multiple): Limit number of entries by iov_max.
7119 * fileread.h (class File_read): Always set max_readv_entries to
7120 128.
7121
b821d13c
ILT
71222011-03-07 Ian Lance Taylor <iant@google.com>
7123
7124 PR gold/12525
7125 * options.h (class General_options): Add -dy and -dn.
7126
89243142
CC
71272011-03-02 Cary Coutant <ccoutant@google.com>
7128
7129 * testsuite/script_test_9.t: Add TLS segment.
7130
d0773f31
ILT
71312011-03-02 Simon Baldwin <simonb@google.com>
7132
7133 * configure.ac: Add check for gnu_indirect_function support in
7134 the toolchain building binutils.
7135 * configure: Rebuild.
7136
9370ce59 71372011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7138
7139 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7140 plugin only symbols.
7141 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7142 in plugin files as not needed in the symbol table.
7143
4cf7a849
ST
71442011-02-11 Sriraman Tallam <tmsriram@google.com>
7145
7146 * output.cc (Output_section::add_input_section): Delay fill
7147 generation for section ordering.
7148
b578bd7d
ILT
71492011-02-09 Ian Lance Taylor <iant@google.com>
7150
7151 PR gold/12316
7152 * object.h (class Sized_relobj): Remove clear_local_symbols.
7153 * reloc.cc (Sized_relobj::do_relocate): Don't call
7154 clear_local_symbols.
7155
9370ce59 71562011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7157
7158 * plugin.cc (is_visible_from_outside): Return true for symbols
7159 in the -u option.
7160
55382fb7
ILT
71612011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7162
7163 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7164 filename.
7165
4e271fff
ST
71662011-02-02 Sriraman Tallam <tmsriram@google.com>
7167
7168 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7169 to std::string.
4e271fff 7170 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7171 section_name to be std::string.
4e271fff
ST
7172 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7173
d433c3ac
ILT
71742011-01-25 Ian Lance Taylor <iant@google.com>
7175
7176 * script.cc (script_add_extern): Rewrite to use
7177 add_symbol_reference.
7178
880473a6
DK
71792011-01-25 Doug Kwan <dougkwan@google.com>
7180
d433c3ac 7181 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7182
f30f86fa
ILT
71832011-01-24 Ian Lance Taylor <iant@google.com>
7184
7185 * options.h (class General_options): Accept
7186 --no-detect-odr-violations.
7187
8e51a0b9
ILT
71882011-01-24 Ian Lance Taylor <iant@google.com>
7189
7190 * version.cc (version_string): Bump to 1.11.
7191
0f3b89d8
ILT
71922011-01-24 Ian Lance Taylor <iant@google.com>
7193
7194 * plugin.cc (class Plugin_rescan): Define new class.
7195 (Plugin_manager::claim_file): Set any_claimed_.
7196 (Plugin_manager::save_archive): New function.
7197 (Plugin_manager::save_input_group): New function.
7198 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7199 necessary.
7200 (Plugin_manager::new_undefined_symbol): New function.
7201 (Plugin_manager::rescan): New function.
7202 (Plugin_manager::rescannable_defines): New function.
7203 (Plugin_manager::add_input_file): Set any_added_.
7204 * plugin.h (class Plugin_manager): define new fields rescannable_,
7205 undefined_symbols_, any_claimed_, and any_added_. Declare
7206 Plugin_rescan as friend. Declare new functions.
7207 (Plugin_manager::Rescannable): Define type.
7208 (Plugin_manager::Rescannable_list): Define type.
7209 (Plugin_manager::Undefined_symbol_list): Define type.
7210 (Plugin_manager::Plugin_manager): Initialize new fields.
7211 * archive.cc (Archive::defines_symbol): New function.
7212 (Add_archive_symbols::run): Pass archive to plugins if any.
7213 * archive.h (class Archive): Declare defines_symbol.
7214 * readsyms.cc (Input_group::~Input_group): New function.
7215 (Finish_group::run): Pass input_group to plugins if any.
7216 * readsyms.h (class Input_group): Declare destructor.
7217 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7218 any.
7219
3bb951e5
ILT
72202011-01-10 Ian Lance Taylor <iant@google.com>
7221
7222 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7223 section as relro.
7224 (Layout::set_segment_offsets): Reset increase_relro before calling
7225 set_section_addresses a second time.
7226
0aa45fac
CC
72272011-01-04 Cary Coutant <ccoutant@google.com>
7228
7229 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7230 sections before NOBITS sections.
7231
0db46eb4
L
72322011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7233
7234 * version.cc (print_version): Update copyright to 2011.
7235
829c9745
CC
72362010-12-23 Cary Coutant <ccoutant@google.com>
7237
7238 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7239 of OS to this->add. Add OD parameter to second form of the function.
7240
7500420b
ILT
72412010-12-20 Ian Lance Taylor <iant@google.com>
7242
7243 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7244 second of two consecutive entries with same offset.
7245
f8e9a930
RW
72462010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7247
7248 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7249 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7250 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7251 to avoid unneeded links against $(LDADD).
7252 * testsuite/Makefile.in: Regenerate.
7253
2fbb4320
ILT
72542010-12-15 Ian Lance Taylor <iant@google.com>
7255
7256 PR gold/12324
7257 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7258 for R_X86_64_32 and R_X86_64_PC32.
7259 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7260 ver_matching_def_pic.o.
7261 (ver_matching_def_pic.o): New target.
7262
fedb228d
RW
72632010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7264
7265 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7266 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7267 Move definition before File_read::View member definitions.
7268 (File_read::View::~View): Initialize and hold lock before
7269 updating current_mapped_bytes.
7270
9b547ce6
RW
72712010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7272
7273 * dwarf_reader.cc: Remove outdated comment.
7274 * gold-threads.cc: Fix typo in error message.
7275 * archive.cc: Fix typos in comments.
7276 * archive.h: Likewise.
7277 * arm-reloc-property.cc: Likewise.
7278 * arm-reloc-property.h: Likewise.
7279 * arm-reloc.def: Likewise.
7280 * arm.cc: Likewise.
7281 * attributes.h: Likewise.
7282 * cref.cc: Likewise.
7283 * ehframe.cc: Likewise.
7284 * fileread.h: Likewise.
7285 * gold.h: Likewise.
7286 * i386.cc: Likewise.
7287 * icf.cc: Likewise.
7288 * incremental.h: Likewise.
7289 * int_encoding.cc: Likewise.
7290 * layout.h: Likewise.
7291 * main.cc: Likewise.
7292 * merge.h: Likewise.
7293 * object.cc: Likewise.
7294 * object.h: Likewise.
7295 * options.cc: Likewise.
7296 * readsyms.cc: Likewise.
7297 * reduced_debug_output.cc: Likewise.
7298 * reloc.cc: Likewise.
7299 * script-sections.cc: Likewise.
7300 * sparc.cc: Likewise.
7301 * symtab.h: Likewise.
7302 * target-reloc.h: Likewise.
7303 * target.cc: Likewise.
7304 * target.h: Likewise.
7305 * timer.cc: Likewise.
7306 * timer.h: Likewise.
7307 * x86_64.cc: Likewise.
7308
83e17bd5
CC
73092010-12-09 Cary Coutant <ccoutant@google.com>
7310
7311 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7312 stack.
7313 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7314 parameter; change all callers.
7315 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7316 * options.h (warn_execstack): New option.
7317
017257f8
DK
73182010-12-07 Doug Kwan <dougkwan@google.com>
7319
7320 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7321 like function call relocations.
7322
c20cbc06
ILT
73232010-12-07 Ian Lance Taylor <iant@google.com>
7324
7325 * archive.cc (Archive::get_elf_object_for_member): Permit
7326 punconfigured to be NULL.
7327 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7328 (Archive::include_member): Pass NULL to get_elf_object_for_member
7329 if we searched for the archive and this is the first included
7330 object.
7331
4dbfafcc
ILT
73322010-12-01 Ian Lance Taylor <iant@google.com>
7333
7334 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7335 track_relocs_type_ field.
7336 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7337 Set track_relocs_type_.
7338 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7339 contents when using RELA relocs.
7340 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7341 reloc_map_.
7342 * reloc.cc (Track_relocs::next_addend): New function.
7343 * reloc.h (class Track_relocs): Declare next_addend.
7344
e5e19edd
ILT
73452010-12-01 Ian Lance Taylor <iant@google.com>
7346
7347 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7348 virtual destructor.
7349
9a5ce24c
ILT
73502010-12-01 Ian Lance Taylor <iant@google.com>
7351
7352 * README: Update compilers known to work and fail.
7353
c7791212
NC
73542010-11-23 Matthias Klose <doko@ubuntu.com>
7355
7356 * configure.in: For --enable-gold, handle value `default' instead of
7357 `both*'. Always install ld as ld.bfd, install as ld if gold is
7358 not the default.
7359 * configure: Regenerate.
7360
0ad220c9
DK
73612010-11-18 Doug Kwan <dougkwan@google.com>
7362
7363 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7364 and right_alignment to be zero. Store result alignment only if it is
7365 greater than existing alignment.
7366
ab8056e0
CC
73672010-11-16 Cary Coutant <ccoutant@google.com>
7368
7369 PR gold/12220
7370 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7371 Check for ".zdebug_line".
7372
fd064a5b
CC
73732010-11-16 Doug Kwan <dougkwan@google.com>
7374 Cary Coutant <ccoutant@google.com>
7375
7376 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7377 by reference; adjust all callers.
7378 * output.cc (Output_segment::set_section_addresses): Adjust references
7379 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7380 list is empty.
7381 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7382 end at page boundary.
7383
6fc6ea19
CC
73842010-11-16 Cary Coutant <ccoutant@google.com>
7385
7386 PR gold/12220
7387 * layout.cc (Layout::choose_output_section): Transform names of
7388 compressed sections even when using a script with a SECTIONS clause.
7389 (Layout::output_section_name): Remove code to transform
7390 compressed debug section names.
7391 * output.cc (Output_section::add_input_section): Use uncompressed
7392 section size when tracking input sections.
7393
95a2c8d6
RS
73942010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7395
7396 * symtab.h (Symbol::NON_PIC_REF): Remove.
7397 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7398 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7399 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7400 (Symbol::use_plt_offset): Take a flags argument and pass it
7401 directly to needs_dynamic_reloc. Restrict check for undefined
7402 weak symbols to function calls.
7403 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7404 (Target_arm::Scan::global): Use it.
7405 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7406 (Target_arm::Relocate::relocate): Likewise.
7407 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7408 parameter with an r_type parameter. Use get_reference_flags
7409 to get the flags.
7410 (Target_arm::Relocate::relocate): Update accordingly.
7411 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7412 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7413 (Target_i386::Scan::global): Likewise.
7414 (Target_i386::Relocate::relocate): Likewise.
7415 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7416 parameter with an r_type parameter. Use get_reference_flags
7417 to get the flags.
7418 (Target_i386::Relocate::relocate): Update accordingly.
7419 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7420 (Target_powerpc::Scan::global): Use it.
7421 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7422 (Target_powerpc::Relocate::relocate): Likewise.
7423 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7424 (Target_sparc::Scan::global): Use it.
7425 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7426 (Target_sparc::Relocate::relocate): Likewise.
7427 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7428 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7429 (Target_x86_64::Scan::global): Likewise.
7430 (Target_x86_64::Relocate::relocate): Likewise.
7431
f625ae50
DK
74322010-11-08 Doug Kwan <dougkwan@google.com>
7433 Cary Coutant <ccoutant@google.com>
7434
7435 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7436 (Arm_exidx_merge_section::section_contents_): New data member.
7437 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7438 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7439 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7440 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7441 in parameters instead of calling Object::section_contents without
7442 locking.
7443 (Arm_output_section::group_section): New parameter TASK. Pass it
7444 to callees that need locking objects.
7445 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7446 to lock EXIDX input sections. Fix a formatting issue. Call
7447 Arm_exidx_merged_section::build_contents to create merged section
7448 contents.
7449 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7450 to lock object of stub table owner.
7451 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7452 TEXT_SIZE to initialize data member TEXT_SIZE_.
7453 (Arm_exidx_input_section::addralign): Fix typo in comment.
7454 (Arm_exidx_input_section::text_size): New method.
7455 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7456 that require locking objects. Lock objects before scanning for stubs
7457 and updating local symbols.
7458 (Arm_input_section<big_endian>::init): Copy contents of original
7459 input section.
2e702c99 7460 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7461 original input section instead of calling Object::section_contents
7462 without locking.
7463 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7464 size without calling Object::section_size().
7465 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7466 for size. Allocate a buffer for merged EXIDX entries.
7467 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7468 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7469 building code to Arm_exidx_merged_section::build_contetns. Write
7470 out contetns in buffer instead of building it on the fly.
7471 (Arm_relobj::make_exidx_input_section): Also pass text section size
7472 to Arm_exidx_input_section constructor.
7473 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7474 (Arm_dynobj::do_read_symbols): Fix memory leak.
7475 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7476 * target.h: (class Task): Add forward declaration.
7477 (Target::relax): Add new parameter TASK and pass it to
7478 Target::do_relax().
7479 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7480
5f9bcf58
CC
74812010-11-05 Cary Coutant <ccoutant@google.com>
7482
7483 PR gold/10708
7484 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7485 object when reading from the file.
7486 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7487 second layout pass.
7488 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7489 when reading section contents.
7490 (get_section_contents): Likewise.
7491 (icf::find_identical_sections): Likewise.
7492 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7493 object when reading from the file.
7494 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7495 the object when doing deferred section layout.
7496
e597fa08
NC
74972010-11-03 Nick Clifton <nickc@redhat.com>
7498
7499 PR gold/12001
7500 * script.h (class Symbol_assignment: name): New member. Returns
7501 the name of the symbol.
7502 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7503 Returns true if the given symbol name is on the list of
7504 assignments wating to be processed.
7505 * archive.cc (should_incldue_member): If the symbol is undefined,
7506 check to see if it is on the list of symbols pending assignment.
7507
3f9a3278
ILT
75082010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7509
7510 * script-sections.cc (Script_sections::find_memory_region): Check
7511 for a NULL output section pointer.
7512
d06fb4d1
DK
75132010-10-29 Doug Kwan <dougkwan@google.com>
7514
7515 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7516 Output_section::add_relaxed_input_section.
7517 * output.cc (Output_section::add_relaxed_input_section): Add new
7518 arguments LAYOUT and NAME. Set section order index.
7519 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7520 Copy section order index.
7521 * output.h (Output_section::add_relaxed_input_section): Add new
7522 arguments LAYOUT and NAME.
7523
90e24de5
ILT
75242010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7525
7526 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7527 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7528 * testsuite/Makefile.in: Regenerate.
7529
c9484ea5
DK
75302010-10-20 Doug Kwan <dougkwan@google.com>
7531
7532 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7533 without SHF_LINK_ORDER flags.
7534 * layout.cc (Layout::choose_output_section): Do not filter
7535 SHF_LINK_ORDER flag in a relocatable link.
7536
5bc2f5be
CC
75372010-10-17 Cary Coutant <ccoutant@google.com>
7538
7539 * output.h (Output_segment::set_section_addresses): Change function
7540 signature. Update all callers.
7541 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7542 sections.
7543 (Output_segment::set_section_addresses): Align after last TLS
7544 section. Add padding before last relro section instead of after.
7545
0c91cf04
DK
75462010-10-17 Doug Kwan <dougkwan@google.com>
7547
7548 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7549 GOT output section to be writable.
7550
8c21d9d3
CC
75512010-10-14 Cary Coutant <ccoutant@google.com>
7552
7553 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7554 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7555 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7556 mode.
7557 * incremental.cc (report_command_line): Ignore all forms of
7558 --incremental.
7559 * layout.cc (Layout::Layout): Check parameters for incremental link
7560 mode.
7561 * options.cc (General_options::parse_incremental): New function.
7562 (General_options::parse_no_incremental): New function.
7563 (General_options::parse_incremental_full): New function.
7564 (General_options::parse_incremental_update): New function.
7565 (General_options::incremental_mode_): New data member.
7566 (General_options::finalize): Check incremental_mode_.
7567 * options.h (General_options): Update help text for --incremental.
7568 Add --no-incremental, --incremental-full, --incremental-update.
7569 (General_options::Incremental_mode): New enum type.
7570 (General_options::incremental_mode): New function.
7571 (General_options::incremental_mode_): New data member.
7572 * parameters.cc (Parameters::incremental_mode_): New data member.
7573 (Parameters::set_options): Set incremental_mode_.
7574 (Parameters::set_incremental_full): New function.
7575 (Parameters::incremental): New function.
7576 (Parameters::incremental_update): New function.
7577 (set_parameters_incremental_full): New function.
7578 * parameters.h (Parameters::set_incremental_full): New function.
7579 (Parameters::incremental): New function.
7580 (Parameters::incremental_update): New function.
7581 (Parameters::incremental_mode_): New data member.
7582 (set_parameters_incremental_full): New function.
7583 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7584 incremental link mode.
7585 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7586 (Sized_relobj::do_relocate_sections): Likewise.
7587 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7588 option.
7589 * testsuite/Makefile.in: Regenerate.
7590 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7591
bb32aa18 75922010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7593
7594 * script-sections.h (class Script_sections): Make
7595 Sections_elements typedef public.
7596 * script-sections.cc (class Sort_output_sections): Add elements_
7597 field. Add constructor which sets it; change all callers.
7598 (Sort_output_sections::is_before): New function.
7599 (Sort_output_sections::operator()): Call is_before.
7600 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7601 conditional.
7602 * testsuite/script_test_10.sh: New test. Test script section
7603 order.
7604 * testsuite/script_test_10.t: Likewise.
7605 * testsuite/script_test_10.s: Likewise.
7606 * testsuite/Makefile.am: Wrap the cross linker tests and the
7607 common tests into NATIVE_OR_CROSS_LINKER.
7608 (check_SCRIPTS): Add script_test_10.sh.
7609 (check_DATA): Add script_test_10.stdout.
7610 (script_test_10.o, script_test_10): New targets.
7611 (script_test_10.stdout): New target.
7612 * configure, testsuite/Makefile.in: Regenerate.
7613
3cef7179
ILT
76142010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7615
7616 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7617 error for the deprecated relocations.
7618 (Target_arm::Scan::global): Likewise.
7619 (Target_arm::Relocate::relocate): Likewise.
7620
7411e9a8
RS
76212010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7622
7623 * fileread.cc (Input_file::find_file): Initialize *found_name
7624 and *namep when using the fallback search for case 4.
7625
6a9da32a
CC
76262010-10-11 Cary Coutant <ccoutant@google.com>
7627
7628 * options.h (class General_options): Redefine -z lazy as an alias for
7629 the negation of -z now.
7630
ac897c20
ILT
76312010-10-11 Ian Lance Taylor <iant@google.com>
7632
7633 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7634 binding.
7635
ea5cae92
NC
76362010-10-06 Nick Clifton <nickc@redhat.com>
7637
7638 * script-sections.cc(class Memory_region): Remove
7639 current_lma_offset_ field. Rename current_vma_offset_ to
7640 current_offset_. Add last_section_ field.
7641 (Memory_region::get_current_vma_address): Rename to
7642 get_current_address.
7643 (Memory_region::get_current_lma_address): Delete.
7644 (Memory_region::increment_vma_offset): Rename to
7645 increment_offset.
7646 (Memory_region::increment_lma_offset): Delete.
7647 (Memory_region::attributes_compatible): New method. Returns
7648 true if the provided section is compatible with the region.
7649 (Memory_region::get_last_section): New method. Returns the last
7650 section to use the region.
7651 (Memory_region::set_last_section): New method. Stores the last
7652 section to use the region.
7653 (Script_sections::block_in_region): New method. Returns true if
7654 a block of memory is contained within a region.
7655 (Script_sections::find_memory_region): New method. Locates a
7656 memory region to be used to set a VMA or LMA address.
7657 (Output_section_definition::set_section_addresses): Add code to
7658 check for addresses set by memory regions.
7659 (Output_segment::set_section_addresses): Remove memory region
7660 walking code.
7661 (Script_sections::create_segment): Add a warning if a header
7662 segment is created outside of any region.
7663 * script-sections.h (class Script_sections): Add prototypes for
7664 find_memory_region and block_in_region methods.
7665 * testsuite/memory_test.s: Use .long instead of .word.
7666 * testsuite/memory_test.t: Add some more output sections.
7667 * testsuite/memory_test.sh: Update expected output.
7668
a9bfd952
DK
76692010-10-02 Doug Kwan <dougkwan@google.com>
7670
7671 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7672 defintion to symtab.h
7673 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7674 declaration to defintion.
7675
bacff3ab
NC
76762010-10-01 Nick Clifton <nickc@redhat.com>
7677
7678 * expression.cc (eval): Replace dummy argument with NULL.
7679 (eval_maybe_dot): Check for a NULL result section pointer.
7680 (Symbol_expression::value): Likewise.
7681 (Dot_expression::value): Likewise.
7682 (BINARY_EXPRESSION): Likewise.
7683 (Max_expression::value): Likewise.
7684 (Min_expression::value): Likewise.
7685 (Absolute_expression::value): Likewise.
7686 (Addr_expression::value_from_output_section): Likewise.
7687 (Loaddddr_expression::value_from_output_section): Likewise.
7688 (Segment_start_expression::value): Likewise.
7689 * script-sections.cc
7690 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7691 argument with NULL.
7692 (Sections_elememt_dot_assignment::set_section_addresses):
7693 Likewise.
7694 (Output_data_expression::do_write_to_buffer): Likewise.
7695 (Output_section_definition::finalize_symbols): Likewise.
7696 (Output_section_definition::set_section_addresses): Likewise.
7697
f81bc8b5
DK
76982010-09-30 Doug Kwan <dougkwan@google.com>
7699
7700 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7701
c95e9f27
ST
77022010-09-28 Sriraman Tallam <tmsriram@google.com>
7703
7704 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7705 function.
c95e9f27
ST
7706 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7707 virtual function.
7708 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7709 virtual function.
7710 * icf.cc (get_section_contents): Inline merge sections only when
7711 target allows it.
7712
3cac54d2
RW
77132010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7714
7715 * configure: Regenerate.
7716
2904037a
ILT
77172010-09-17 Ian Lance Taylor <iant@google.com>
7718
7719 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7720 * testsuite/Makefile.am (memory_test.o): New target.
7721 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7722 memory_test.t.
7723 * testsuite/Makefile.in: Rebuild.
2904037a 7724
bca7fb63
DK
77252010-09-17 Doug Kwan <dougkwan@google.com>
7726
7727 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7728 defintion if relocation uses GOT entries of the symbol.
7729 * testsuite/icf_safe_test.sh: Fix test.
7730 * testsuite/icf_safe_so_test.sh: Fix test.
7731
4ef28648
CC
77322010-09-16 Cary Coutant <ccoutant@google.com>
7733
7734 * script_sections.cc (class Memory_region): Remove "NULL" from
7735 vector initializations.
7736
793990de
CC
77372010-09-15 Cary Coutant <ccoutant@google.com>
7738
7739 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7740 Resolve forwarding symbols.
7741
81e015e2
DK
77422010-09-15 Doug Kwan <dougkwan@google.com>
7743
7744 * gold/testsuite/script_test_3.t: Add ARM special sections.
7745 * gold/testsuite/script_test_4.t: Same.
7746 * gold/testsuite/script_test_5.t: Same.
7747 * gold/testsuite/script_test_6.t: Same.
7748 * gold/testsuite/script_test_7.t: Same.
7749 * gold/testsuite/script_test_7.t: Same.
7750 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7751
36171d64
CC
77522010-09-14 Cary Coutant <ccoutant@google.com>
7753
7754 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7755 (Target_x86_64::Relocate::relocate_tls): Replace check for
7756 saw_tls_block_reloc_ with test for executable section.
7757
d89051bd
CC
77582010-09-12 Cary Coutant <ccoutant@google.com>
7759
7760 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7761 position-independent executables to shared libraries need dynamic
7762 relocations.
7763 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7764 position-independent executables.
7765 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7766 * testsuite/Makefile.in: Regenerate.
7767
fca41f0f
NC
77682010-09-10 Nick Clifton <nickc@redhat.com>
7769
7770 PR gold/11997
7771 * testsuite/memory_test.t: Discard any sections that are not
7772 needed.
7773
6695e4b3
L
77742010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7775
7776 PR gold/11996
7777 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7778 "This::" to work around a bug in gcc 4.2.
7779
7780 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7781
0f72bf6f
RÁE
77822010-09-09 Rafael Espindola <espindola@google.com>
7783
7784 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7785 sections with different PF_X flags in the same segment.
7786 (Layout::find_first_load_seg): Search all segments to find the first
7787 one.
7788 * options.h (rosegment): New.
7789
77902010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7791
05a79166 7792 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7793
aa98ff75
DK
77942010-09-08 Doug Kwan <dougkwan@google.com>
7795
7796 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7797 (Arm_relobj::do_relocate_sections): Add new parameter for output
7798 file to match the parent.
7799 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7800 of local symbols instead of input values. Update code to track
7801 changes in gold::relocate_section.
7802 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7803 (Sized_relobj::compute_final_local_value_internal): New methods.
7804 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7805 body into private version of Sized_relobj::compute_final_local_value.
7806 Call the inline method.
7807 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7808 merged symbol value if there is one.
7809 (Symbol_value::has_output_value): New method defintiion.
7810 (Sized_relobj::Compute_final_local_value_status): New enum type.
7811 (Sized_relobj::compute_final_local_value): New methods.
7812 (Sized_relobj::compute_final_local_value_internal): New methods.
7813 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7814 and arm_cortex_a8.sh.
7815 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7816 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7817 New tests.
7818 * Makefile.in: Regenerate.
7819 * testsuite/arm_bl_out_of_range.s: Update test.
7820 * testsuite/thumb_bl_out_of_range.s: Ditto.
7821 * testsuite/thumb_blx_out_of_range.s: Ditto.
7822 * testsuite/arm_branch_out_of_range.sh: New file.
7823 * testsuite/arm_cortex_a8.sh: Ditto.
7824 * testsuite/arm_cortex_a8_b.s: Ditto.
7825 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7826 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7827 * testsuite/arm_cortex_a8_bl.s: Ditto.
7828 * testsuite/arm_cortex_a8_blx.s: Ditto.
7829 * testsuite/arm_cortex_a8_local.s: Ditto.
7830 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7831 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7832
05a79166
L
78332010-09-08 Rafael Espindola <espindola@google.com>
7834
7835 * Makefile.am (memory_test.stdout): Run readelf with -W.
7836 * Makefile.in: Regenerate.
7837 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7838 64 bit output.
7839
33dbc701
RÁE
78402010-09-08 Rafael Espindola <espindola@google.com>
7841
7842 * script-sections.cc (Script_sections::add_memory_region): Convert
7843 field precision to int.
7844 * script.cc (script_set_section_region, script_set_section_region):
7845 Convert field precision to int.
7846
731ca54a
RÁE
78472010-09-08 Rafael Espindola <espindola@google.com>
7848
7849 * arm.cc (do_finalize_sections): Create the __exidx_start and
7850 __exdix_end symbols even when the section is missing.
7851
7f8cd844
NC
78522010-09-08 Nick Clifton <nickc@redhat.com>
7853
7854 * README: Remove claim that MEMORY is not supported.
7855 * expression.cc (script_exp_function_origin)
7856 (script_exp_function_length): Move from here to ...
7857 * script.cc: ... here.
7858 (script_set_section_region, script_add_memory)
7859 (script_parse_memory_attr, script_include_directive): New
7860 functions.
7861 * script-sections.cc
7862 (class Memory_region): New class.
7863 (class Output_section_definition): Add set_memory_region,
7864 set_section_vma, set_section_lma and get_section_name methods.
7865 (class Script_Sections): Add add_memory_region,
7866 find_memory_region, find_memory_region_origin,
7867 find_memory_region_length and set_memory_region methods.
7868 Have set_section_addresses method walk the list of set memory
7869 regions.
7870 Extend the print methos to display memory regions.
7871 * script-sections.h: Add prototypes for new methods.
7872 Add enum for MEMORY region attributes.
7873 * yyscript.y: Add support for parsing MEMORY regions.
7874 * script-c.h: Add prototypes for new functions.
7875 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7876 * testsuite/Makefile.in: Regenerate.
7877 * testsuite/memory_test.sh: New script.
7878 * testsuite/memory_test.s: New assembler source file.
7879 * testsuite/memory_test.t: New linker script.
7880
a4649286
DK
78812010-08-27 Doug Kwan <dougkwan@google.com>
7882
7883 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7884 reference override an existing dynamic weak reference.
7885 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7886 * testsuite/Makefile.in: Regenerate.
7887 * testsuite/dyn_weak_ref.sh: New file.
7888 * testsuite/dyn_weak_ref_1.c: Ditto.
7889 * testsuite/dyn_weak_ref_2.c: Ditto.
7890
b56648ad
ILT
78912010-08-27 Ian Lance Taylor <iant@google.com>
7892
7893 * incremental.h (class Incremental_input_entry): Add virtual
7894 destructor.
7895
809313cb
ILT
78962010-08-27 Ian Lance Taylor <iant@google.com>
7897
7898 * testsuite/start_lib_test_3.c: Mark t3 as used.
7899
11e32464
NC
79002010-08-27 Nick Clifton <nickc@redhat.com>
7901
7902 * options.cc (version_script): Fix small typo in previous
7903 whitespace tidyup.
7904
ca09d69a
NC
79052010-08-25 Nick Clifton <nickc@redhat.com>
7906
7907 * archive.cc: Formatting fixes: Remove whitespace between
7908 typename and following asterisk. Remove whitespace between
7909 function name and opening parenthesis.
7910 * archive.h: Likewise.
7911 * arm.cc: Likewise.
7912 * attributes.cc: Likewise.
7913 * attributes.h: Likewise.
7914 * common.cc: Likewise.
7915 * copy-relocs.cc: Likewise.
7916 * dirsearch.h: Likewise.
7917 * dynobj.cc: Likewise.
7918 * ehframe.cc: Likewise.
7919 * ehframe.h: Likewise.
7920 * expression.cc: Likewise.
7921 * fileread.cc: Likewise.
7922 * fileread.h: Likewise.
7923 * gc.h: Likewise.
7924 * gold-threads.cc: Likewise.
7925 * gold.cc: Likewise.
7926 * i386.cc: Likewise.
7927 * icf.h: Likewise.
7928 * incremental-dump.cc: Likewise.
7929 * incremental.cc: Likewise.
7930 * layout.cc: Likewise.
7931 * layout.h: Likewise.
7932 * main.cc: Likewise.
7933 * merge.cc: Likewise.
7934 * merge.h: Likewise.
7935 * object.cc: Likewise.
7936 * object.h: Likewise.
7937 * options.cc: Likewise.
7938 * options.h: Likewise.
7939 * output.cc: Likewise.
7940 * output.h: Likewise.
7941 * plugin.cc: Likewise.
7942 * plugin.h: Likewise.
7943 * powerpc.cc: Likewise.
7944 * reloc.cc: Likewise.
7945 * script-c.h: Likewise.
7946 * script-sections.cc: Likewise.
7947 * script.cc: Likewise.
7948 * stringpool.cc: Likewise.
7949 * symtab.cc: Likewise.
7950 * symtab.h: Likewise.
7951 * target.cc: Likewise.
7952 * timer.cc: Likewise.
7953 * timer.h: Likewise.
7954 * version.cc: Likewise.
7955 * x86_64.cc: Likewise.
7956
b8fa8750
NC
79572010-08-24 Nick Clifton <nickc@redhat.com>
7958
7959 PR 11899
7960 * layout.cc (segment_precedes): Sort segments by their physical
7961 addresses, if they have been set.
7962
9919d93b
CC
79632010-08-23 Cary Coutant <ccoutant@google.com>
7964
7965 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7966 symbols data.
7967 (Lib_group::include_member): Unlock object after deleting its
7968 symbols data.
7969 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7970 the bug fixed here.
7971
97b4be1c
CC
79722010-08-19 Neil Vachharajani <nvachhar@google.com>
7973 Cary Coutant <ccoutant@google.com>
7974
7975 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7976 constructor, and set_blocker.
7977 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7978 readsyms_blocker_.
7979 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7980 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7981 * testsuite/Makefile.am (start_lib_test): New test case.
7982 * testsuite/Makefile.in: Regenerate.
7983 * testsuite/start_lib_test_main.c: New file.
7984 * testsuite/start_lib_test_1.c: New file.
7985 * testsuite/start_lib_test_2.c: New file.
7986 * testsuite/start_lib_test_3.c: New file.
7987
dd0b1884
ILT
79882010-08-19 Ian Lance Taylor <iant@google.com>
7989
7990 * Makefile.in: Rebuild with automake 1.11.1.
7991 * aclocal.m4: Likewise.
7992 * testsuite/Makefile.in: Likewise.
7993
7223e9ca
ILT
79942010-08-19 Ian Lance Taylor <iant@google.com>
7995
7996 PR 10893
7997 * i386.cc (class Output_data_plt_i386): Update declarations.
7998 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7999 local_ifuncs_ fields.
8000 (Target_i386::do_plt_section_for_global): New function.
8001 (Target_i386::do_plt_section_for_local): New function.
8002 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8003 parameter; change all callers. Initialize global_ifuncs_ and
8004 local_ifuncs_. If doing a static link define __rel_iplt_start and
8005 __rel_iplt_end.
8006 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8007 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8008 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8009 symbols.
8010 (Target_i386::make_plt_section): New function, broken out of
8011 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8012 (Target_i386::make_plt_entry): Call make_plt_section.
8013 (Target_i386::make_local_ifunc_plt_entry): New function.
8014 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8015 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8016 R_386_IRELATIVE to switch.
8017 (Target_i386::Scan::global): Likewise.
8018 (Target_i386::Relocate::relocate): Likewise.
8019 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8020 switch.
8021 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8022 (Target_x86_64::do_plt_section_for_global): New function.
8023 (Target_x86_64::do_plt_section_for_local): New function.
8024 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8025 parameter; change all callers. If doing a static link define
8026 __rela_iplt_start and __rela_iplt_end.
8027 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8028 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8029 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8030 to point to .plt.
8031 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8032 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8033 switch.
8034 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8035 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8036 R_X86_64_IRELATIVE to switch.
8037 (Target_x86_64::Scan::global): Likewise.
8038 (Target_x86_64::Relocate::relocate): Likewise.
8039 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8040 switch.
8041 * target.h (class Target): Add plt_section_for_global and
8042 plt_section_for_local functions. Add do_plt_section_for_global
8043 and do_plt_section_for_local virtual functions.
8044 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8045 clarifying comments.
8046 (Symbol::use_plt_offset): Handle IFUNC symbol.
8047 * object.cc (Sized_relobj::Sized_relobj): Initialize
8048 local_plt_offsets_.
8049 (Sized_relobj::local_has_plt_offset): New function.
8050 (Sized_relobj::local_plt_offset): New function.
8051 (Sized_relobj::set_local_plt_offset): New function.
8052 (Sized_relobj::do_count): Handle IFUNC symbol.
8053 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8054 a bit away from input_shndx_ field. Add set_is_func_symbol and
8055 is_ifunc_symbol functions.
8056 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8057 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8058 local_plt_offsets_ field.
8059 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8060 * output.h (class Output_section_data): Add non-const
8061 output_section function.
8062 (class Output_data_got): Update declarations.
8063 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8064 Add use_plt_offset parameter to global and local constructors.
8065 Change all callers. Change local_sym_index_ field to 31 bits.
8066 Change GSYM_CODE and CONSTANT_CODE accordingly.
8067 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8068 doing a static link don't set sh_link field.
8069 (Output_data_got::Got_entry::write): Use PLT offset if
8070 appropriate.
8071 (Output_data_got::add_global_plt): New function.
8072 (Output_data_got::add_local_plt): New function.
8073 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8074 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8075 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8076 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8077 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8078 IFUNC conditional.
8079 * testsuite/ifunc-sel.h: New file.
8080 * testsuite/ifuncmain1.c: New file.
8081 * testsuite/ifuncmain1vis.c: New file.
8082 * testsuite/ifuncmod1.c: New file.
8083 * testsuite/ifuncdep2.c: New file.
8084 * testsuite/ifuncmain2.c: New file.
8085 * testsuite/ifuncmain3.c: New file.
8086 * testsuite/ifuncmod3.c: New file.
8087 * testsuite/ifuncmain4.c: New file.
8088 * testsuite/ifuncmain5.c: New file.
8089 * testsuite/ifuncmod5.c: New file.
8090 * testsuite/ifuncmain6pie.c: New file.
8091 * testsuite/ifuncmod6.c: New file.
8092 * testsuite/ifuncmain7.c: New file.
8093 * configure, testsuite/Makefile.in: Rebuild.
8094
56f75c03
ILT
80952010-08-18 Ian Lance Taylor <iant@google.com>
8096
8097 * incremental.cc
8098 (Output_section_incremental_inputs::write_input_files): Add cast
8099 to avoid signed/unsigned comparison warning.
8100 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8101
55455f89
CC
81022010-08-12 Cary Coutant <ccoutant@google.com>
8103
8104 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8105
e2054bcb
ILT
81062010-08-13 Ian Lance Taylor <iant@google.com>
8107
8108 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8109
74f67560
DK
81102010-08-12 Cary Coutant <ccoutant@google.com>
8111 Doug Kwan <dougkwan@google.com>
8112
8113 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8114 defintion overrides non-weak undef, remember that the original undef
8115 is not weak.
8116 * symtab.cc (Symbol_table::sized_write_global): For undef without
8117 an original weak binding, set binding to global in output.
8118 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8119 * testsuite/Makefile.in: Regenerate.
8120 * testsuite/strong_ref_weak_def.sh: New file.
8121 * testsuite/strong_ref_weak_def_1.c: Ditto.
8122 * testsuite/strong_ref_weak_def_2.c: Ditto.
8123
d1238d12
CC
81242010-08-12 Cary Coutant <ccoutant@google.com>
8125
8126 * testsuite/incremental_test.sh: Rewrite.
8127 * testsuite/incremental_test_1.c: Rewrite.
8128 * testsuite/incremental_test_2.c: Rewrite.
8129
0e70b911
CC
81302010-08-12 Cary Coutant <ccoutant@google.com>
8131
8132 * arm.cc (Target_arm::got_size): Add const.
8133 (Target_arm::got_entry_count): New function.
8134 (Target_arm::plt_entry_count): New function.
8135 (Target_arm::first_plt_entry_offset): New function.
8136 (Target_arm::plt_entry_size): New function.
8137 (Output_data_plt_arm::entry_count): New function.
8138 (Output_data_plt_arm::first_plt_entry_offset): New function.
8139 (Output_data_plt_arm::get_plt_entry_size): New function.
8140 * i386.cc (Target_i386::got_size): Add const.
8141 (Target_i386::got_entry_count): New function.
8142 (Target_i386::plt_entry_count): New function.
8143 (Target_i386::first_plt_entry_offset): New function.
8144 (Target_i386::plt_entry_size): New function.
8145 (Output_data_plt_i386::entry_count): New function.
8146 (Output_data_plt_i386::first_plt_entry_offset): New function.
8147 (Output_data_plt_i386::get_plt_entry_size): New function.
8148 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8149 find_incremental_inputs_sections. Dump incremental_got_plt section.
8150 * incremental.cc: Include target.h.
8151 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8152 parameter. Adjust all callers. Find incremental_got_plt section.
8153 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8154 section.
8155 (Output_section_incremental_inputs::set_final_data_size): Calculate
8156 size of incremental_got_plt section.
8157 (Output_section_incremental_inputs::do_write): Write the
8158 incremental_got_plt section.
8159 (Got_plt_view_info): New struct.
8160 (Local_got_offset_visitor): New class.
8161 (Global_got_offset_visitor): New class.
8162 (Global_symbol_visitor_got_plt): New class.
8163 (Output_section_incremental_inputs::write_got_plt): New function.
8164 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8165 Add parameter. Adjust all callers.
8166 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8167 (Incremental_inputs::got_plt_section): New function.
8168 (Incremental_inputs::got_plt_section_): New data member.
8169 (Incremental_got_plt_reader): New class.
8170 * layout.cc (Layout::create_incremental_info_sections): Add the
8171 incremental_got_plt section.
8172 * object.h (Got_offset_list::get_list): New function.
8173 (Got offset_list::for_all_got_offsets): New function.
8174 (Sized_relobj::local_got_offset_list): New function.
8175 * powerpc.cc (Target_powerpc::got_size): Add const.
8176 (Target_powerpc::got_entry_count): New function.
8177 (Target_powerpc::plt_entry_count): New function.
8178 (Target_powerpc::first_plt_entry_offset): New function.
8179 (Target_powerpc::plt_entry_size): New function.
8180 (Output_data_plt_powerpc::entry_count): New function.
8181 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8182 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8183 * sparc.cc (Target_sparc::got_size): Add const.
8184 (Target_sparc::got_entry_count): New function.
8185 (Target_sparc::plt_entry_count): New function.
8186 (Target_sparc::first_plt_entry_offset): New function.
8187 (Target_sparc::plt_entry_size): New function.
8188 (Output_data_plt_sparc::entry_count): New function.
8189 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8190 (Output_data_plt_sparc::get_plt_entry_size): New function.
8191 * symtab.h (Symbol::got_offset_list): New function.
8192 (Symbol_table::for_all_symbols): New function.
8193 * target.h (Sized_target::got_entry_count): New function.
8194 (Sized_target::plt_entry_count): New function.
8195 (Sized_target::plt_entry_size): New function.
8196 * x86_64.cc (Target_x86_64::got_size): Add const.
8197 (Target_x86_64::got_entry_count): New function.
8198 (Target_x86_64::plt_entry_count): New function.
8199 (Target_x86_64::first_plt_entry_offset): New function.
8200 (Target_x86_64::plt_entry_size): New function.
8201 (Output_data_plt_x86_64::entry_count): New function.
8202 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8203 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8204
09ec0418
CC
82052010-08-12 Cary Coutant <ccoutant@google.com>
8206
8207 * archive.cc: Include incremental.h.
8208 (Archive::Archive): Initialize incremental_info_.
8209 (Archive::include_member): Record archive members in incremental info.
8210 (Add_archive_symbols::run): Record begin and end of an archive in
8211 incremental info.
8212 (Lib_group::include_member): Record objects in incremental info.
8213 * archive.h (Incremental_archive_entry): Forward declaration.
8214 (Archive::set_incremental_info): New member function.
8215 (Archive::incremental_info): New member function.
8216 (Archive::Unused_symbol_iterator): New class.
8217 (Archive::unused_symbols_begin): New member function.
8218 (Archive::unused_symbols_end): New member function.
8219 (Archive::incremental_info_): New data member.
8220 * incremental-dump.cc (find_input_containing_global): New function.
8221 (dump_incremental_inputs): Dump new incremental info sections.
8222 * incremental.cc: Include symtab.h.
8223 (Output_section_incremental_inputs): New class.
8224 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8225 new incremental info sections.
8226 (Sized_incremental_binary::do_check_inputs): Likewise.
8227 (Incremental_inputs::report_archive): Remove.
8228 (Incremental_inputs::report_archive_begin): New function.
8229 (Incremental_inputs::report_archive_end): New function.
8230 (Incremental_inputs::report_object): New function.
8231 (Incremental_inputs::finalize_inputs): Remove.
8232 (Incremental_inputs::report_input_section): New function.
8233 (Incremental_inputs::report_script): Rewrite.
8234 (Incremental_inputs::finalize): Do nothing but finalize string table.
8235 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8236 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8237 (Incremental_inputs::create_data_sections): New function.
8238 (Incremental_inputs::relocs_entsize): New function.
8239 (Output_section_incremental_inputs::set_final_data_size): New function.
8240 (Output_section_incremental_inputs::do_write): New function.
8241 (Output_section_incremental_inputs::write_header): New function.
8242 (Output_section_incremental_inputs::write_input_files): New function.
8243 (Output_section_incremental_inputs::write_info_blocks): New function.
8244 (Output_section_incremental_inputs::write_symtab): New function.
8245 * incremental.h (Incremental_script_entry): Forward declaration.
8246 (Incremental_object_entry): Forward declaration.
8247 (Incremental_archive_entry): Forward declaration.
8248 (Incremental_inputs): Forward declaration.
8249 (Incremental_inputs_header_data): Remove.
8250 (Incremental_inputs_header): Remove.
8251 (Incremental_inputs_header_write): Remove.
8252 (Incremental_inputs_entry_data): Remove.
8253 (Incremental_inputs_entry): Remove.
8254 (Incremental_inputs_entry_write): Remove.
8255 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8256 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8257 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8258 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8259 Likewise.
8260 (Incremental_input_entry): New class.
8261 (Incremental_script_entry): New class.
8262 (Incremental_object_entry): New class.
8263 (Incremental_archive_entry): New class.
8264 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8265 (Incremental_inputs::report_inputs): Remove.
8266 (Incremental_inputs::report_archive): Remove.
8267 (Incremental_inputs::report_archive_begin): New function.
8268 (Incremental_inputs::report_archive_end): New function.
8269 (Incremental_inputs::report_object): Change prototype.
8270 (Incremental_inputs::report_input_section): New function.
8271 (Incremental_inputs::report_script): Change prototype.
8272 (Incremental_inputs::get_reloc_count): New function.
8273 (Incremental_inputs::set_reloc_count): New function.
8274 (Incremental_inputs::create_data_sections): New function.
8275 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8276 (Incremental_inputs::inputs_section): New function.
8277 (Incremental_inputs::symtab_section): New function.
8278 (Incremental_inputs::relocs_section): New function.
8279 (Incremental_inputs::get_stringpool): Add const.
8280 (Incremental_inputs::command_line): Add const.
8281 (Incremental_inputs::inputs): Remove.
8282 (Incremental_inputs::command_line_key): New function.
8283 (Incremental_inputs::input_file_count): New function.
8284 (Incremental_inputs::input_files): New function.
8285 (Incremental_inputs::relocs_entsize): New function.
8286 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8287 (Incremental_inputs::finalize_inputs): Remove.
8288 (Incremental_inputs::Input_info): Remove.
8289 (Incremental_inputs::lock_): Remove.
8290 (Incremental_inputs::inputs_): Change type.
8291 (Incremental_inputs::inputs_map_): Remove.
8292 (Incremental_inputs::current_object_entry_): New data member.
8293 (Incremental_inputs::inputs_section_): New data member.
8294 (Incremental_inputs::symtab_section_): New data member.
8295 (Incremental_inputs::relocs_section_): New data member.
8296 (Incremental_inputs::reloc_count_): New data member.
8297 (Incremental_inputs_reader): New class.
8298 (Incremental_symtab_reader): New class.
8299 (Incremental_relocs_reader): New class.
8300 * layout.cc (Layout::finalize): Move finalization of incremental info
8301 and creation of incremental info sections to follow finalization of
8302 symbol table. Set offsets for postprocessing sections.
8303 (Layout::create_incremental_info_sections): Call
8304 Incremental_inputs::create_data_sections. Add incremental symtab
8305 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8306 sections to layout after input sections.
8307 * layout.h (struct Timespec): Forward declaration.
8308 (Layout::incremental_inputs): Add const.
8309 (Layout::create_incremental_info_sections): Add parameter.
8310 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8311 * object.cc: Include incremental.h.
8312 (Relobj::finalize_incremental_relocs): New function.
8313 (Sized_relobj::do_layout): Record input sections in incremental info.
8314 * object.h (Object::output_section): New function.
8315 (Object::output_section_offset): Moved from Relobj.
8316 (Object::get_incremental_reloc_base): New function.
8317 (Object::get_incremental_reloc_count): New function.
8318 (Object::do_output_section): New function.
8319 (Object::do_output_section_offset): Moved from Relobj.
8320 (Object::do_get_incremental_reloc_base): New function.
8321 (Object::do_get_incremental_reloc_count): New function.
8322 (Object::Object): Initialize new data members.
8323 (Relobj::output_section): Renamed do_output_section and moved to
8324 protected.
8325 (Relobj::output_section_offset): Moved to Object.
8326 (Relobj::do_get_incremental_reloc_base): New function.
8327 (Relobj::do_get_incremental_reloc_count): New function.
8328 (Relobj::allocate_incremental_reloc_counts): New function.
8329 (Relobj::count_incremental_reloc): New function.
8330 (Relobj::finalize_incremental_relocs): New function.
8331 (Relobj::next_incremental_reloc_index): New function.
8332 (Relobj::reloc_counts_): New data member.
8333 (Relobj::reloc_bases_): New data member.
8334 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8335 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8336 (Sized_relobj::incremental_relocs_scan): New function.
8337 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8338 (Sized_relobj::incremental_relocs_write): New function.
8339 (Sized_relobj::incremental_relocs_write_reltype): New function.
8340 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8341 incremental link.
8342 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8343 archives and object files elsewhere.
8344 (Add_symbols::run): Report object files here.
8345 (Finish_group::run): Report end of archive at end of group.
8346 * reloc.cc: Include layout.h, incremental.h.
8347 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8348 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8349 (Sized_relobj::incremental_relocs_scan): New function.
8350 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8351 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8352 (Sized_relobj::incremental_relocs_write): New function.
8353 (Sized_relobj::incremental_relocs_write_reltype): New function.
8354 * script.cc (read_input_script): Rewrite test for incremental link.
8355 Change call to Incremental_inputs::report_script.
8356 * symtab.h (Symbol_table::first_global_index): New function.
8357 (Symbol_table::output_count): New function.
8358
ce0d1972
DK
83592010-08-12 Doug Kwan <dougkwan@google.com>
8360
8361 * arm.cc (Target_arm::merge_object_attributes): Check command line
8362 options --no-wchar-size-warning and --no-enum-size-warning.
8363 * options.h (General_options): Add ld-compatible options
8364 --no-enum-size-warning and --no-wchar-size-warning.
8365
6e5710ce
ILT
83662010-08-04 Ian Lance Taylor <iant@google.com>
8367
8368 * x86_64.cc (Target_x86_64::Scan::local): Use
8369 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8370 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8371 (Target_x86_64::Scan::global): Likewise.
8372 (Target_x86_64::Relocate::relocate): Likewise.
8373 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8374 Likewise.
8375
fef830db
CC
83762010-08-03 Cary Coutant <ccoutant@google.com>
8377
8378 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8379 to reserve space in merged_strings vector. Keep total input size
8380 for stats.
8381 (Output_merge_string::do_print_merge_stats): Print total input size.
8382 * merge.h (Output_merge_string): Add input_size_ field.
8383 * stringpool.cc (Stringpool_template::string_length): Move
8384 implementations out of Stringpool_template class and place in
8385 stringpool.h.
8386 * stringpool.h (string_length): Move out of Stringpool_template.
8387
1e3811b0
ILT
83882010-08-03 Ian Lance Taylor <iant@google.com>
8389
8390 PR 11712
8391 * layout.cc (relaxation_loop_body): If address of load segment is
8392 set, adjust address to include headers if possible.
8393
7af0c620
ILT
83942010-08-03 Ian Lance Taylor <iant@google.com>
8395
8396 * version.cc (version_string): Bump to 1.10.
8397
22f0da72
ILT
83982010-08-03 Ian Lance Taylor <iant@google.com>
8399
8400 PR 11805
8401 * layout.h (enum Output_section_order): Define.
8402 (class Layout): Update declarations.
8403 * layout.cc (Layout::get_output_section): Add order parameter.
8404 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8405 is_first_non_relro parameters. Change all callers.
8406 (Layout::choose_output_section): Likewise.
8407 (Layout::add_output_section_data): Likewise.
8408 (Layout::make_output_section): Likewise. Set order.
8409 (Layout::default_section_order): New function.
8410 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8411 * output.cc (Output_section::Output_section): Initialize order_.
8412 Don't initialize deleted fields.
8413 (Output_segment::Output_segment): Don't initialize deleted
8414 fields.
8415 (Output_segment::add_output_section_to_load): New function
8416 replacing add_output_section. Change all callers to call this or
8417 add_output_section_to_nonload.
8418 (Output_segment::add_output_section_to_nonload): New function.
8419 (Output_segment::remove_output_section): Rewrite.
8420 (Output_segment::add_initial_output_data): Likewise.
8421 (Output_segment::has_any_data_sections): Likewise.
8422 (Output_segment::is_first_section_relro): Likewise.
8423 (Output_segment::maximum_alignment): Likewise.
8424 (Output_segment::has_dynamic_reloc): New function replacing
8425 dynamic_reloc_count. Change all callers.
8426 (Output_segment::has_dynamic_reloc_list): New function replacing
8427 dynamic_reloc_count_list. Change all callers.
8428 (Output_segment::set_section_addresses): Rewrite.
8429 (Output_segment::set_offset): Rewrite.
8430 (Output_segment::find_first_and_last_list): Remove.
8431 (Output_segment::set_tls_offsets): Rewrite.
8432 (Output_segment::first_section_load_address): Likewise.
8433 (Output_segment::output_section_count): Likewise.
8434 (Output_segment::section_with_lowest_load_address): Likewise.
8435 (Output_segment::write_section_headers): Likewise.
8436 (Output_segment::print_sections_to_map): Likewise.
8437 * output.h (class Output_data): Remove dynamic_reloc_count_
8438 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8439 (Output_data::add_dynamic_reloc): Rewrite.
8440 (Output_data::has_dynamic_reloc): New function.
8441 (Output_data::dynamic_reloc_count): Remove.
8442 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8443 is_last_relro_, is_first_non_relro_, is_interp_,
8444 is_dynamic_linker_section_ fields. Add order and set_order
8445 functions. Remove is_relro_local, set_is_relro_local,
8446 is_last_relro, set_is_last_relro, is_first_non_relro,
8447 set_is_first_non_relro functions, is_interp, set_is_interp,
8448 is_dynamic_linker_section, and set_is_dynamic_linker_section
8449 functions.
8450 (class Output_segment): Change Output_data_list from std::list to
8451 std:;vector. Add output_lists_ field. Remove output_data_ and
8452 output_bss_ fields. Update declarations.
8453
3ff2ccb0
ILT
84542010-08-02 Ian Lance Taylor <iant@google.com>
8455
8456 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8457 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8458 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8459
88a4108b
ILT
84602010-08-02 Ian Lance Taylor <iant@google.com>
8461
8462 PR 11855
8463 * script.cc (Script_options::Script_options): Initialize
8464 symbol_definitions_ and symbol_references_.
8465 (Script_options::add_symbol_assignment): Update
8466 symbol_definitions_ and symbol_references_.
8467 (Script_options::add_symbol_reference): New function.
8468 (script_symbol): New function.
8469 * script.h (class Script_options): Add symbol_definitions_ and
8470 symbol_references_ fields.
8471 (Script_options::referenced_const_iterator): New type.
8472 (Script_options::referenced_begin): New function.
8473 (Script_options::referenced_end): New function.
8474 (Script_options::is_referenced): New function.
8475 (Script_options::any_unreferenced): New function.
8476 * script-c.h (script_symbol): Declare.
8477 * yyscript.y (exp): Call script_symbol.
8478 * symtab.cc: Include "script.h".
8479 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8480 Change all callers. Check symbols referenced by scripts.
8481 (Symbol_table::add_undefined_symbols_from_command_line): Add
8482 layout parameter. Change all callers.
8483 (Symbol_table::do_add_undefined_symbols_from_command_line):
8484 Likewise. Break out loop body. Check symbols referenced by
8485 scripts.
8486 (Symbol_table::add_undefined_symbol_from_command_line): New
8487 function broken out of
8488 do_add_undefined_symbols_from_command_line.
8489 * symtab.h (class Symbol_table): Update declarations.
8490 * archive.cc: Include "layout.h".
8491 (Archive::should_include_member): Add layout parameter. Change
8492 all callers. Check for symbol mentioned in expression.
8493 * archive.h (class Archive): Update declaration.
8494 * object.cc (Sized_relobj::do_should_include_member): Add layout
8495 parameter.
8496 * object.h (Object::should_include_member): Add layout parameter.
8497 Change all callers.
8498 (Object::do_should_include_member): Add layout parameter.
8499 (class Sized_relobj): Update declaration.
8500 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8501 parameter.
8502 * dynobj.h (class Sized_dynobj): Update declaration.
8503 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8504 layout parameter.
8505 * plugin.h (class Sized_pluginobj): Update declaration.
8506
5f1ab67a
ILT
85072010-08-02 Ian Lance Taylor <iant@google.com>
8508
8509 PR 11866
8510 * output.cc (Output_segment::set_offset): Search for the first and
8511 last sections rather than assuming that the list is in order.
8512 (Output_segment::find_first_and_last_list): New function.
8513 * output.h (class Output_segment): Update declarations.
8514 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8515 (relro_strip_test_SOURCES): New variable.
8516 (relro_strip_test_DEPENDENCIES): New variable.
8517 (relro_strip_test_LDFLAGS): New variable.
8518 (relro_strip_test_LDADD): New variable.
8519 (relro_strip_test.so): New target.
8520
a8df5856
ILT
85212010-08-02 Ian Lance Taylor <iant@google.com>
8522
8523 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8524 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8525 (Target_i386::got_tlsdesc_section): New function.
8526 (Target_i386::got_section): Create space for GOT entries for
8527 TLSDESC relocations.
8528 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8529 R_386_TLS_GOTDESC.
8530 (Target_i386::Scan::global): Likewise.
8531 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8532 using TLSDESC GOT.
8533 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8534 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8535 (Target_x86_64::got_tlsdesc_section): New function.
8536 (Target_x86_64::got_section): Create space for GOT entries for
8537 TLSDESC relocations.
8538 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8539 R_386_TLS_GOTDESC.
8540 (Target_x86_64::Scan::global): Likewise.
8541 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8542 using TLSDESC GOT.
8543
0c10a0a6
ILT
85442010-08-02 Ian Lance Taylor <iant@google.com>
8545
8546 * testsuite/final_layout.sh: Use dc to convert from hex to
8547 decimal.
8548
41cbeecc
ST
85492010-07-29 Sriraman Tallam <tmsriram@google.com>
8550
8551 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8552 paramter to the call to gold::gc_process_relocs.
8553 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8554 paramter to the call to gold::gc_process_relocs.
8555 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8556 parameter to the call to gold::gc_process_relocs.
8557 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8558 template parameter to the call to gold::gc_process_relocs.
8559 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8560 paramter to the call to gold::gc_process_relocs.
8561 * gc.h (get_embedded_addend_size): New function.
8562 (gc_process_relocs): Save the size of the reloc for use by ICF.
8563 * icf.cc (get_section_contents): Get the addend from the text section
8564 for SHT_REL relocation sections.
8565 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8566 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8567 * int_encoding.h (read_from_pointer): New overloaded function.
8568 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8569 * testsuite/icf_sht_rel_addend_test.sh: New file.
8570 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8571 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8572
6ea55b82
RW
85732010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8574
8575 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8576 * Makefile.in: Regenerate.
8577 * testsuite/Makefile.in: Regenerate.
8578
9691462b
ILT
85792010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8580
8581 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8582 * gold/testsuite/debug_msg.cc: Likewise.
8583 * gold/testsuite/odr_violation1.cc
8584 * gold/testsuite/odr_violation2.cc
8585
76897331
CC
85862010-07-21 Cary Coutant <ccoutant@google.com>
8587
8588 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8589 string, and length fields.
8590 (Output_merge_string::Merged_strings_list): New type.
8591 (Output_merge_string::Merged_strings_lists): New typedef.
8592 (Output_merge_string): Replace merged_strings_ with
8593 merged_strings_lists_.
8594 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8595 Merged_strings_list per input object and section. Don't store pointer
8596 to the string. Don't store length with each merged string entry.
8597 (Output_merge_string::finalize_merged_data): Loop over list of merged
8598 strings lists. Recompute length of each merged string.
8599
78384e8f
CC
86002010-07-15 Cary Coutant <ccoutant@google.com>
8601
8602 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8603 here.
8604
783659f9
ILT
86052010-07-14 Ian Lance Taylor <iant@google.com>
8606
8607 * descriptors.cc (Descriptors::open): Report correct name in error
8608 message.
8609
131687b4
DK
86102010-07-13 Doug Kwan <dougkwan@google.com>
8611
8612 * arm.cc (Arm_input_section::Arm_input_section): For a
8613 SHT_ARM_EXIDX section, always keeps the input sections.
8614 (Arm_input_section::set_exidx_section_link): New method.
8615 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8616 has_errors_ to false.
8617 (Arm_exidx_input_section::has_errors,
8618 Arm_exidx_input_section::set_has_errors): New methods.
8619 (Arm_exidx_input_section::has_errors_): New data member.
8620 (Arm_relobj::get_exidx_shndx_list): New method.
8621 (Arm_output_section::append_text_sections_to_list): Do not skip
8622 section without SHF_EXECINSTR.
8623 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8624 errors.
2e702c99 8625 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8626 section header. Make error messages more verbose. Check for
8627 a non-executable section linked to an EXIDX section.
8628 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8629 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8630 check that there is no deferred EXIDX section if we exit early.
8631 Instead of not making an EXIDX section in case of an error, make one
8632 and set the has_errors flag of it.
8633 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8634 in a relocatable link.
8635 (Target_arm::do_relax): Look for the EXIDX output section instead of
8636 assuming that it is called .ARM.exidx.
2e702c99 8637 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8638 section list. Do not check for SHF_EXECINSTR section flags but
8639 skip any input section with errors.
8640 * output.cc (Output_section::Output_section): Initialize
8641 always_keeps_input_sections_ to false.
8642 (Output_section::add_input_section): Check for
8643 always_keeps_input_sections_.
8644 * output.h (Output_section::always_keeps_input_sections,
8645 Output_section::set_always_keeps_input_sections): New methods.
8646 (Output_section::always_keeps_input_sections): New data member.
8647
69517287
RÁE
86482010-07-13 Rafael Espindola <espindola@google.com>
8649
8650 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8651 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8652
82742395
ILT
86532010-07-13 Philip Herron <herron.philip@googlemail.com>
8654 Ian Lance Taylor <iant@google.com>
8655
8656 * output.h (Output_section_lookup_maps::add_merge_section):
8657 Correct check of whether value was inserted.
8658 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8659 (Output_section_lookup_maps::add_relaxed_input_section):
8660 Likewise.
8661 * arm.cc (Target_arm::got_section): Remove used local os.
8662 * i386.cc (Target_i386::got_section): Likewise.
8663 * x86_64.cc (Target_x86_64::got_section): Likewise.
8664 * sparc.cc (Target_sparc::got_section): Likewise.
8665 (Target_sparc::relocate): Remove unused local have_got_offset.
8666 * powerpc.cc (Target_powerpc::relocate): Likewise.
8667
f2d707b5
ILT
86682010-07-13 Ian Lance Taylor <iant@google.com>
8669
241531d6
ILT
8670 * compressed_output.cc (zlib_decompress): Fix signature in
8671 !HAVE_ZLIB_H case.
8672
f2d707b5
ILT
8673 * archive.cc (Archive::include_member): Unlock an external member
8674 of a thin archive. Don't bother to delete an object we know is
8675 NULL.
8676
a2e47362
CC
86772010-07-12 Cary Coutant <ccoutant@google.com>
8678
8679 * compressed_output.cc (zlib_decompress): New function.
8680 (get_uncompressed_size): New function.
8681 (decompress_input_section): New function.
8682 * compressed_output.h (get_uncompressed_size): New function.
8683 (decompress_input_section): New function.
8684 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8685 Handle compressed debug sections.
8686 * layout.cc (is_compressed_debug_section): New function.
8687 (Layout::output_section_name): Map compressed section names to
8688 canonical names.
8689 * layout.h (is_compressed_debug_section): New function.
8690 (is_debug_info_section): Recognize compressed debug sections.
8691 * merge.cc: Include compressed_output.h.
8692 (Output_merge_data::do_add_input_section): Handle compressed
8693 debug sections.
8694 (Output_merge_string::do_add_input_section): Handle compressed
8695 debug sections.
8696 * object.cc: Include compressed_output.h.
8697 (Sized_relobj::Sized_relobj): Initialize new data members.
8698 (build_compressed_section_map): New function.
8699 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8700 * object.h (Object::section_is_compressed): New method.
8701 (Object::do_section_is_compressed): New method.
8702 (Sized_relobj::Compressed_section_map): New type.
8703 (Sized_relobj::do_section_is_compressed): New method.
8704 (Sized_relobj::compressed_sections_): New data member.
8705 * output.cc (Output_section::add_input_section): Handle compressed
8706 debug sections.
8707 * reloc.cc: Include compressed_output.h.
8708 (Sized_relobj::write_sections): Handle compressed debug sections.
8709
ce279a62
CC
87102010-07-08 Cary Coutant <ccoutant@google.com>
8711
8712 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8713 weak when resolving to a dynamic def.
8714 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8715 for weak undef/dynamic def cases. Adjust callers.
8716 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8717 undef_binding_weak_.
8718 (Symbol_table::sized_write_globals): Adjust symbol binding.
8719 (Symbol_table::sized_write_symbol): Add binding parameter.
8720 * symtab.h (Symbol::set_undef_binding): New method.
8721 (Symbol::is_undef_binding_weak): New method.
8722 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8723 (Symbol_table::should_override): Add new parameter.
8724 (Symbol_table::sized_write_symbol): Add new parameter.
8725
8726 * testsuite/weak_undef_file1.cc: Add new test case.
8727 * testsuite/weak_undef_file2.cc: Fix header comment.
8728 * testsuite/weak_undef_test.cc: Add new test case.
8729
b2286c10
DK
87302010-06-29 Doug Kwan <dougkwan@google.com>
8731
8732 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8733 Initialize USE_SYMBOL_.
8734 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8735 definition.
8736 (Arm_reloc_property::uses_symbol_): New data member declaration.
8737 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8738 uses symbol value and symbol is undefined but not weakly undefined.
8739
4802450a
RÁE
87402010-06-28 Rafael Espindola <espindola@google.com>
8741
8742 * plugin.cc (Plugin::load): Use dlerror.
8743
e5ca47ba
ILT
87442010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8745
8746 * symtab.cc (detect_odr_violations): When reporting an ODR
8747 violation, report an object where the symbol is defined.
8748
8a75a161
DK
87492010-06-25 Doug Kwan <dougkwan@google.com>
8750
8751 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8752 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8753 definition.
8754 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8755 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8756 target hook to detect function points.
8757 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8758 * icf.h (Icf::check_section_for_function_pointers): Change type of
8759 parameter SECTION_NAME to const reference to std::string. Use
8760 target hook to determine if section may have unsafe pointers.
8761 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8762 method definition.
8763
42218b9f
RÁE
87642010-06-21 Rafael Espindola <espindola@google.com>
8765
8766 * fileread.cc (Input_file::find_fie): New
8767 (Input_file::open): Use Input_file::find_fie.
8768 * fileread.h (Input_file::find_fie): New
8769 * plugin.cc (set_extra_library_path): New.
8770 (Plugin::load): Add set_extra_library_path to the transfer vector.
8771 (Plugin_manager::set_extra_library_path): New.
8772 (Plugin_manager::add_input_file): Use the extra search path if set.
8773 (set_extra_library_path(): New.
8774 * plugin.h (Plugin_manager): Add set_extra_library_path and
8775 extra_search_path_.
8776
a0506cca
CC
87772010-06-19 Cary Coutant <ccoutant@google.com>
8778
8779 * layout.cc (gdb_sections): Add .debug_types.
8780 (lines_only_debug_sections): Likewise.
8781
6508b958
RÁE
87822010-06-18 Rafael Espindola <espindola@google.com>
8783
8784 * plugin.cc (add_input_file,add_input_library)
8785 (Plugin_manager::add_input_file): Make filename arguments const.
8786 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8787 const.
8788
3e235302
DK
87892010-06-16 Doug Kwan <dougkwan@google.com>
8790
8791 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8792 .ARM.attributes section if we have not merged any input
8793 attributes sections.
8794
106e8a6c
DK
87952010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8796
8797 * arm.cc: Allow combining objects with no EABI version
8798 information.
8799
91ff43fe
RÁE
88002010-06-15 Rafael Espindola <espindola@google.com>
8801
8802 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8803
68ed838c
ILT
88042010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8805
8806 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8807 (struct iovec): Correct !HAVE_READV definition.
8808
f3a2388f
CC
88092010-06-10 Cary Coutant <ccoutant@google.com>
8810
8811 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8812 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8813 reloc sections.
8814 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8815
8816 PR 11683
8817 * symtab.h (Symbol::is_placeholder): New member function.
8818 * target-reloc.h (relocate_section): Check for placeholder symbols.
8819
8820 * testsuite/Makefile.am (plugin_test_8): New test.
8821 (plugin_test_9): New test.
8822 * testsuite/Makefile.in: Regenerate.
8823
e1df38aa
NC
88242010-06-09 Nick Clifton <nickc@redhat.com>
8825
8826 * yyscript.y (input_list_element): Allow strings prefixed with
8827 the '-' character. Treat these as libraries.
8828 * script.cc (script_add_library): New function. Adds a library
8829 specified by "-l<name>" found in an input script.
8830 * script-c.h: Add prototype for script_add_library.
8831
25bbe950
DK
88322010-06-07 Doug Kwan <dougkwan@google.com>
8833
8834 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8835 Restrict stub-group size to be within long conditional branch
8836 range when working around cortex-A8 erratum.
8837
0f32ea4c
ILT
88382010-06-07 Damien Diederen <dd@crosstwine.com>
8839
8840 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8841 #ifdef typo.
8842
8fe2a369
ST
88432010-06-03 Sriraman Tallam <tmsriram@google.com>
8844
8845 PR gold/11658
8846 * output.cc
8847 (Output_section::Input_section_sort_entry::compare_section_ordering):
8848 Change to return non-zero correctly.
8849 (Output_section::Input_section_sort_section_order_index_compare
8850 ::operator()): Change to fix ambiguity in comparisons.
8851
6e9ba2ca
ST
88522010-06-01 Sriraman Tallam <tmsriram@google.com>
8853
8854 * gold.h (is_wildcard_string): New function.
8855 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8856 (Layout::layout_eh_frame): Ditto.
8857 (Layout::find_section_order_index): New method.
8858 (Layout::read_layout_from_file): New method.
8859 * layout.h (Layout::find_section_order_index): New method.
8860 (Layout::read_layout_from_file): New method.
8861 (Layout::input_section_position_): New private member.
8862 (Layout::input_section_glob_): New private member.
8863 * main.cc (main): Call read_layout_from_file here.
8864 * options.h (--section-ordering-file): New option.
8865 * output.cc (Output_section::input_section_order_specified_): New
8866 member.
8867 (Output_section::Output_section): Initialize new member.
8868 (Output_section::add_input_section): Add new parameter.
8869 Keep input sections when --section-ordering-file is used.
8870 (Output_section::set_final_data_size): Sort input sections when
8871 section ordering file is specified.
8872 (Output_section::Input_section_sort_entry): Add new parameter.
8873 Check sorting type.
8874 (Output_section::Input_section_sort_entry::compare_section_ordering):
8875 New method.
8876 (Output_section::Input_section_sort_compare::operator()): Change to
8877 consider section_order_index.
8878 (Output_section::Input_section_sort_init_fini_compare::operator()):
8879 Change to consider section_order_index.
8880 (Output_section::Input_section_sort_section_order_index_compare
8881 ::operator()): New method.
8882 (Output_section::sort_attached_input_sections): Change to sort
8883 according to section order when specified.
e1df38aa
NC
8884 (Output_section::add_input_section<32, true>): Add new parameter.
8885 (Output_section::add_input_section<64, true>): Add new parameter.
8886 (Output_section::add_input_section<32, false>): Add new parameter.
8887 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8888 * output.h (Output_section::add_input_section): Add new parameter.
8889 (Output_section::input_section_order_specified): New
8890 method.
8891 (Output_section::set_input_section_order_specified): New method.
8892 (Input_section::Input_section): Initialize section_order_index_.
8893 (Input_section::section_order_index): New method.
8894 (Input_section::set_section_order_index): New method.
8895 (Input_section::section_order_index_): New member.
8896 (Input_section::Input_section_sort_section_order_index_compare): New
8897 struct.
8898 (Output_section::input_section_order_specified_): New member.
8899 * script-sections.cc (is_wildcard_string): Delete and move modified
8900 method to gold.h.
8901 (Output_section_element_input::Output_section_element_input): Modify
8902 call to is_wildcard_string.
8903 (Output_section_element_input::Input_section_pattern
8904 ::Input_section_pattern): Ditto.
8905 (Output_section_element_input::Output_section_element_input): Ditto.
8906 * testsuite/Makefile.am (final_layout): New test case.
8907 * testsuite/Makefile.in: Regenerate.
8908 * testsuite/final_layout.cc: New file.
8909 * testsuite/final_layout.sh: New file.
8910
3537c84b
RÁE
89112010-06-01 Rafael Espindola <espindola@google.com>
8912
8913 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8914
105b6afd
RÁE
89152010-06-01 Rafael Espindola <espindola@google.com>
8916
8917 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8918 visibility of symbols.
8919
29e11421
DK
89202010-05-27 Doug Kwan <dougkwan@google.com>
8921
8922 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8923 from start of output section instead of address for a local symbol
8924 in a merged or relaxed section when doing a relocatable link.
8925
5e0f337e
RÁE
89262010-05-26 Rafael Espindola <espindola@google.com>
8927
703d02da 8928 PR 11604
5e0f337e
RÁE
8929 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8930 adding sections the garbage collector removed.
8931 * gold/testsuite/Makefile.am: Add test.
8932 * gold/testsuite/Makefile.in: Regenerate.
8933 * gold/testsuite/plugin_test_7.sh: New.
8934 * gold/testsuite/plugin_test_7_1.c: New.
8935 * gold/testsuite/plugin_test_7_2.c: New.
8936
f4187277
RÁE
89372010-05-26 Rafael Espindola <espindola@google.com>
8938
8939 * script-sections.cc (Output_section_definition::set_section_addresses):
8940 Check for --section-start.
8941
5c388529
DK
89422010-05-26 Doug Kwan <dougkwan@google.com>
8943
8944 * arm.cc (Arm_scan_relocatable_relocs): New class.
8945 (Target_arm::relocate_special_relocatable): New method.
8946 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8947 (Arm_relocate_functions::thumb_branch_common): Same.
8948 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8949 instead of Default_scan_relocatable_relocs.
8950 * target-reloc.h (relocate_for_relocatable): Let target handle
8951 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8952 * target.h (Sized_target::relocate_special_relocatable): New method.
8953
bca1c3ae
ILT
89542010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8955
8956 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8957
0439c796
DK
89582010-05-23 Doug Kwan <dougkwan@google.com>
8959
8960 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8961 instead of a cast.
8962 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8963 with a direct branch, not a conditional branch, to a stub.
8964 * merge.cc (Output_merge_base::record_input_section): New method
8965 defintion.
8966 (Output_merge_data::do_add_input_section): Record input section if
8967 keeps-input-sections flag is set.
8968 (Output_merge_string::do_add_input_section): Ditto.
8969 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8970 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8971 INPUT_SECTIONS_.
8972 (Output_merge_base::keeps_input_sections,
8973 Output_merge_base::set_keeps_input_sections,
8974 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8975 method definitions.
8976 (Output_merge_base::Input_sections): New type declaration.
8977 (Output_merge_base::input_sections_begin,
8978 Output_merge_base::input_sections_end,
8979 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8980 (Output_merge_base::bool keeps_input_sections_,
8981 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8982 Output_merge_base::input_sections_): New data members.
8983 (Output_merge_data::do_set_keeps_input_sections): New method
8984 defintion.
8985 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8986 * output.cc (Output_section::Input_section::relobj): Move method
8987 defintion from class declaration to here and handle merge sections.
8988 (Output_section::Input_section::shndx): Ditto.
8989 (Output_section::Output_section): Remove initializations of removed
8990 data members and initialize new data member LOOKUP_MAPS_.
8991 (Output_section::add_input_section): Set keeps-input-sections flag
8992 for a newly created merge output section as appropriate. Adjust code
8993 to use Output_section_lookup_maps class.
8994 (Output_section::add_relaxed_input_section): Adjst code for lookup
8995 maps code refactoring.
2e702c99 8996 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8997 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8998 class. If adding input section to a newly created merge output
8999 section fails, remove the new merge section.
9000 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9001 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9002 (Output_section::find_merge_section): Ditto.
0439c796 9003 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9004 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9005 Output_section_lookup_maps class.
9006 (Output_section::get_input_sections): Export merge sections. Adjust
9007 code to use Output_section_lookup_maps class.
9008 (Output_section:::add_script_input_section): Adjust code to use
9009 Output_section_lookup_maps class. Update lookup maps for merge
9010 sections also.
9011 (Output_section::discard_states): Use Output_section_lookup_maps.
9012 (Output_section::restore_states): Same.
9013 * output.h (Merge_section_properties): Move class defintion out of
9014 Output_section.
9015 (Output_section_lookup_maps): New class.
9016 (Output_section::Input_section::is_merge_section): New method
9017 defintion.
9018 (Output_section::Input_section::relobj): Move defintion out of class
9019 defintion. Declare method only.
9020 (Output_section::Input_section::shndx): Ditto.
9021 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9022 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9023 (Output_section::Merge_section_by_properties_map,
9024 Output_section::Output_section_data_by_input_section_map,
9025 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9026 Remove types.
2e702c99 9027 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9028 KEEPS_INPUT_SECTIONS.
9029 (Output_section::build_lookup_maps): New method declaration.
9030 (Output_section::merge_section_map_,
9031 Output_section::merge_section_by_properties_map_,
9032 Output_section::relaxed_input_section_map_,
9033 Output_section::is_relaxed_input_section_map_valid_): Remove data
9034 members.
9035 (Output_section::lookup_maps_): New data member.
9036
76295588
L
90372010-05-21 Doug Kwan <dougkwan@google.com>
9038
9039 PR gold/11619
9040 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9041 avoid a compilation error.
9042
d103a984
RÁE
90432010-05-19 Rafael Espindola <espindola@google.com>
9044
9045 * script-sections.cc (Output_section_definition::allocate_to_segment):
9046 Update the phdrs_list even when the output section is NULL.
9047 * testsuite/Makefile.am: Add test.
9048 * testsuite/Makefile.in: Regenerate.
9049 * testsuite/script_test_9.cc: New.
9050 * testsuite/script_test_9.sh: New.
9051 * testsuite/script_test_9.t: New.
9052
6625d24e
DK
90532010-05-19 Doug Kwan <dougkwan@google.com>
9054
9055 * arm.cc (Arm_input_section::original_size): New method.
9056 (Arm_input_section::do_addralign): Add a cast.
9057 (Arm_input_section::do_output_offset): Remove static cast.
9058 (Arm_input_section::original_addralign,
9059 Arm_input_section::original_size_): Change type to uint32_t.
9060 (Arm_input_section::init): Add safe casts for section alignment
9061 and size.
9062 (Arm_input_section::set_final_data_size): Do not set address and
9063 offset of stub table.
9064 (Arm_output_section::fix_exidx_coverage): Change use of of
9065 Output_section::Simple_input_section to that of
9066 Output_section::Input_section.
9067 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9068 except for the first pass.
9069 * output.cc (Output_section::get_input_sections): Change type of
9070 input_sections to std::list<Input_section>.
9071 (Output_section::add_script_input_section): Rename from
9072 Output_section::add_simple_input_section. Change type of SIS
9073 parameter from Simple_input_section to Input_section.
9074 * output.h (Output_section::Simple_input_section): Remove class.
9075 (Output_section::Input_section): Change class visibility to public.
9076 (Output_section::Input_section::addralign): Use stored alignments
9077 for special input sections if set.
9078 (Output_section::Input_section::set_addralign): New method.
9079 (Output_section::get_input_sections): Change parameter type from
9080 list of Simple_input_section to list of Input_section.
9081 (Output_section::add_script_input_section): Rename from
9082 Output_section::add_simple_input_section. Change first parameter's
9083 type from Simple_input_section to Input_section and remove the
9084 second and third parameters.
9085 * script-sections.cc (Input_section::Input_section_list): Change
9086 type to list of Output_section::Input_section/
9087 (Input_section_info::Input_section_info): Change parameter type of
9088 INPUT_SECTION to Output_section::Input_section.
9089 (Input_section_info::input_section): Change return type.
9090 (Input_section_info::input_section_): Change type to
9091 Output_section::Input_section.
9092 (Output_section_element_input::set_section_addresses): Adjust code
9093 to use Output_section::Input_section instead of
9094 Output_section::Simple_input_section. Adjust code for renaming
9095 of Output_section::add_simple_input_section.
9096 (Orphan_output_section::set_section_addresses): Ditto.
9097
e1e82ea4
RW
90982010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9099
9100 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9101 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9102
91e75c8a
RÁE
91032010-05-18 Rafael Espindola <espindola@google.com>
9104
9105 * options.cc (General_options::finalize): Handle -nostdlib.
9106 * options.h (nostdlib): New option.
9107 * script.cc (script_add_search_dir): Handle -nostdlib.
9108
da59ad79
DK
91092010-05-12 Doug Kwan <dougkwan@google.com>
9110
9111 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9112 attributes section only if there no attributes section after merging.
9113 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9114 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9115 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9116 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9117 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9118 and arm_attr_merge_7.stdout.
9119 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9120 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9121 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9122 arm_attr_merge_7b.o): New rules.
9123 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9124 arm_attr_merge_7
9125 * testsuite/Makefile.in: Regenerate.
9126 * testsuite/arm_attr_merge.sh: New file.
9127 * testsuite/arm_attr_merge_[67][ab].s: Same.
9128
3e01a7fd
NC
91292010-05-05 Nick Clifton <nickc@redhat.com>
9130
9131 * po/es.po: Updated Spanish translation.
9132
7ad2014a
L
91332010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9134
9135 * Makefile.am (install-exec-local): Properly install gold as
9136 default cross linker.
9137 * Makefile.in: Regenerated.
9138
4fda8867
NC
91392010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9140 Nick Clifton <nickc@redhat.com>
9141
9142 * configure.ac (install_as_default): Define and set to false
9143 unless --enable-gold or --enable-gold=both/gold has been
9144 specified.
9145 * configure: Regenerate.
9146
9147 * Makefile.am (install-exec-local): Install the executable as
9148 'ld.gold'. If install_as_default is true then also install it as
9149 'ld'.
9150 * Makefile.in: Regenerated.
9151
bd288ea2
ILT
91522010-04-24 Ian Lance Taylor <iant@google.com>
9153
9154 * layout.cc (Layout::layout_reloc): In relocatable link don't
9155 combine reloc sections for grouped sections.
9156
ef38fd8a
ST
91572010-04-23 Sriraman Tallam <tmsriram@google.com>
9158
9159 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9160 sections that are not ordinary to icf.
9161 * icf.cc (get_section_contents): Handle relocation pointing to section
9162 with no object or shndx information.
9163 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9164 * testsuite/Makefile.in: Regenerate.
9165 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9166 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9167
f6973bdc
ILT
91682010-04-22 Ian Lance Taylor <iant@google.com>
9169
9170 * expression.cc (Expression::Expression_eval_info): Add
9171 result_alignment_pointer field.
9172 (Expression::eval_with_dot): Add result_alignment_pointer
9173 parameter. Change all callers.
9174 (Expression::eval_maybe_dot): Likewise.
9175 (class Binary_expression): Add alignment_pointer parameter to
9176 left_value and right_value. Change all callers.
9177 (BINARY_EXPRESSION): Set result alignment.
9178 (class Trinary_expression): Add alignment_pointer parameter to
9179 arg2_value and arg3_value. Change all callers.
9180 (Trinary_cond::value): Set result alignment.
9181 (Max_expression::value, Min_expression::value): Likewise.
9182 (Align_expression::value): Likewise.
9183 * script-sections.cc (class Sections_element): Add dot_alignment
9184 parameter to set_section_addresses virtual function. Update
9185 instantiations.
9186 (class Output_section_element): Likewise.
9187 (Script_sections::create_segments): Add dot_alignment parameter.
9188 Change all callers.
9189 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9190 (Script_sections::set_phdrs_clause_addresses): Likewise.
9191 * script-sections.h: Update declarations.
9192 * script.h: Update declarations.
9193 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9194 min_p_align.
9195 * testsuite/script_test_3.t: Set large alignment.
9196 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9197 segment has expected alignment.
9198
9c9c98a5
NC
91992010-04-22 Nick Clifton <nickc@redhat.com>
9200
9201 * po/gold.pot: Updated by the Translation project.
9202 * po/vi.po: Updated Vietnamese translation.
9203
2253bfba
L
92042010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9205
9206 * testsuite/Makefile.am (check_PROGRAMS): Add
9207 icf_virtual_function_folding_test.
9208 * testsuite/Makefile.in: Regenerated.
9209
85fdf906
AH
92102010-04-15 Andrew Haley <aph@redhat.com>
9211
9212 * options.h (merge_exidx_entries): New option.
9213 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9214 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9215 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9216 (Target_arm::merge_exidx_entries): New function.
9217 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9218 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9219 to Arm_exidx_fixup constructor.
9220 Add new arg, merge_exidx_entries.
9221 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9222 Arm_output_section::fix_exidx_coverage.
9223
ce97fa81
ST
92242010-04-18 Sriraman Tallam <tmsriram@google.com>
9225
9226 * icf.cc (get_section_contents): Check for preemptible functions.
9227 Ignore addend when appropriate.
9228 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9229 section folded.
9230 (add_from_relobj): Check for section folded.
9231 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9232 * symtab.h (should_add_dynsym_entry): Add new parameter.
9233 * target-reloc.h (scan_relocs): Check for section folded.
9234 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9235 Check reloc types for function pointers in shared objects.
9236 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9237 case.
9238 (icf_preemptible_functions_test): New test case.
9239 (icf_string_merge_test): New test case.
9240 * testsuite.Makefile.in: Regenerate.
9241 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9242 bar_glob. Refactor code.
9243 * testsuite/icf_preemptible_functions_test.cc: New file.
9244 * testsuite/icf_preemptible_functions_test.sh: New file.
9245 * testsuite/icf_string_merge_test.cc: New file.
9246 * testsuite/icf_string_merge_test.sh: New file.
9247 * testsuite/icf_virtual_function_folding_test.cc: New file.
9248 * testsuite/icf_virtual_function_folding_test.sh: New file.
9249
04ceb17c
DK
92502010-04-14 Doug Kwan <dougkwan@google.com>
9251
9252 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9253 for local symbol recounting if we remove a section due to ICF.
9254 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9255 there are no regular objects in input.
9256
153e7da4
DK
92572010-04-13 Doug Kwan <dougkwan@google.com>
9258
9259 * arm.cc (Arm_input_section::set_final_data_size): Compute
9260 accurate final data size instead of using current data size.
9261
4dbd9faf
DK
92622010-04-09 Doug Kwan <dougkwan@google.com>
9263
9264 * layout.cc (Layout::choose_output_section): Handle script section
9265 types.
9266 (Layout::make_output_section_for_script): Add section type parameter.
9267 Handle script section types.
9268 * layout.h (Layout::make_output_section_for_script): Add section
9269 type parameter.
9270 * output.cc (Output_section::Output_section): Initialize data member
9271 is_noload_.
9272 (Output_section::do_reset_address_and_file_offset): Do not set address
9273 to 0 if section is a NOLOAD section.
9274 * output.h (Output_section::is_noload): New method.
9275 (Output_section::set_is_noload): Ditto.
9276 (Output_section::is_noload_): New data member.
9277 * script-c.h (Script_section_type): New enum type.
9278 (struct Parser_output_section_header): Add new file section_type.
9279 * script-sections.cc (Sections_element::output_section_name): Add
9280 parameter for returning script section type.
9281 (Output_section_definition::output_section_name): Ditto.
9282 (Output_section_definition::section_type)P; New method.
9283 (Output_section_definiton::script_section_type_name): Ditto.
9284 (Output_section_definition::script_section_type_): New data member.
9285 (Output_section_definition::Output_section_definition): Initialize
9286 data member Output_section_definition::script_section_type_.
9287 (Output_section_definition::create_sections): Pass script section type
9288 to Layout::make_output_section_for_script.
9289 (Output_section_definition::output_section_name): Return script
9290 section type to caller.
9291 (Output_section_definition::set_section_address): Do not advance
9292 dot value and load address if section type is NOLOAD. Set address
9293 of NOLOAD sections regardless of section flags.
9294 (Output_section_definition::print): Print section type if it is
9295 not SCRIPT_SECTION_TYPE_NONE.
9296 (Output_section_definition::section_type): New method.
9297 (Output_section_definition::script_section_type_name): Ditto.
9298 (Script_sections::output_section_name): Add new parameter
9299 PSECTION_TYPE for returning script section type. Pass it to
9300 section elements. Handle discard sections.
9301 (Sort_output_sections::operator()): Handle NOLOAD sections.
9302 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9303 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9304 returning script section type.
9305 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9306 INFO and NOLOAD.
9307 * yyscript.y (union): Add new field SECTION_TYPE.
9308 (COPY, DSECT, INFO, NOLOAD): New tokens.
9309 (opt_address_and_section_type): Change type to output_section_header.
9310 (section_type): New non-terminal
9311 (section_header): Handle section type.
2253bfba 9312 (opt_address_and_section_type): Return section type value.
4dbd9faf 9313
721ea635
L
93142010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9315
9316 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9317 * testsuite/plugin_common_test_2.c (foo): Likewise.
9318
6bf924b0
DK
93192010-04-08 Doug Kwan <dougkwan@google.com>
9320
9321 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9322 Output_merge_data.
9323 * output.cc (Output_section::add_merge_input_section): Simplify
9324 code and return status of Output_merge_base::add_input_section.
e1df38aa 9325 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9326 returns true.
9327
24af6f92
DK
93282010-04-07 Doug Kwan <dougkwan@google.com>
9329
9330 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9331 if section is marked as containing instructions but has no mapping
9332 symbols.
9333 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9334 correct section index.
9335 (Arm_relobj::find_linked_text_section): Ditto.
9336
00698fc5
CC
93372010-04-07 Cary Coutant <ccoutant@google.com>
9338
9339 * archive.cc (include_member): Destroy Read_symbols_data object before
9340 releasing file.
9341 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9342 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9343 (Read_symbols_data::~Read_symbols_data) New destructor.
9344 (Section_relocs::Section_relocs) New constructor.
9345 (Section_relocs::~Section_relocs) New destructor.
9346 (Read_relocs_data::Read_relocs_data) New constructor.
9347 (Read_relocs_data::~Read_relocs_data) New destructor.
9348 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9349 pointers to NULL after deleting.
9350
7296d933
DK
93512010-04-07 Doug Kwan <dougkwan@google.com>
9352
9353 * arm.cc: Replace "endianity" with "endianness" in comments.
9354 (Arm_exidx_cantunwind): Ditto.
9355 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9356 (Arm_relobj::merge_flags_and_attributes): New method.
9357 (Arm_relobj::merge_flags_and_attributes_): New data member.
9358 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9359 (Arm_relobj::scan_sections_for_stubs): Ditto.
9360 (Arm_relobj::do_read_symbols): Check to see if we really want to
9361 merge processor-specific flags and attributes. Exit early if
9362 an object is empty except for section names and the undefined symbol.
9363 (Target_arm::do_finalize_sections): Move check for ELF format to
9364 Arm_relobj::do_read_symbols. Merge processor specific flags and
9365 attributes from a regular object only when we have determined that
9366 it is aapropriate. Do not create an .ARM.attributes section in
9367 output if there is no regular input object.
9368 (Target_arm::merge_processor_specific_flags): Check
9369 --warn-mismatch before printing any error.
9370 (Target_arm::merge_object_attributes): Ditto.
9371 * gold.cc (queue_middle_tasks): Handle the case in which there is
9372 no regular object in input.
9373 * options.cc (General_options::parse_EB): New method.
9374 (General_options::parse_EL): Same.
9375 (General_options::General_options): Initialize endianness_.
9376 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9377 New options.
9378 (General_options::Endianness): New enum.
9379 (General_options::endianness): New method.
9380 (General_options::endianness_): New data member.
9381 * parameters.cc (Parameters::set_options): Check target endianness.
9382 (Parameters::set_target_once): Ditto.
9383 (Parameters::check_target_endianness): New method.
9384 (parameters_force_valid_target): If either -EL or -EB is specified,
9385 use it to define endianness of default target.
9386 * parameters.h (Parameters::check_target_endianness): New method
9387 declaration.
9388 * target.h (class Target): Change "endianity" to "endianness"
9389 in comments.
9390
efc8d4f2
RW
93912010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9392
9393 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9394 * configure: Regenerate.
9395 * Makefile.in: Regenerate.
9396 * testsuite/Makefile.in: Regenerate.
9397
be234d88
CC
93982010-04-06 Cary Coutant <ccoutant@google.com>
9399
9400 gcc PR lto/42757
9401 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9402 prevailing definitions of common symbols.
9403 * testsuite/plugin_test_6.sh: New test case.
9404 * testsuite/plugin_common_test_1.c: New test case.
9405 * testsuite/plugin_common_test_2.c: New test case.
9406 * testsuite/Makefile.am (plugin_test_6): New test case.
9407 * testsuite/Makefile.in: Regenerate.
9408
bd32c6bd
NC
94092010-04-06 Nick Clifton <nickc@redhat.com>
9410
9411 * po/vi.po: New Vietnamese translation.
9412
323c532f
DK
94132010-03-30 Doug Kwan <dougkwan@google.com>
9414
9415 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9416
4fcd97eb
DK
94172010-03-25 Doug Kwan <dougkwan@google.com>
9418
9419 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9420 to avoid a conversion warning on a 32-bit host.
9421
4ebf39db
ILT
94222010-03-24 Ian Lance Taylor <iant@google.com>
9423
9424 * testsuite/script_test_3.t: Add a TLS segment.
9425 * testsuite/Makefile.am (check_PROGRAMS): Add
9426 tls_phdrs_script_test.
9427 (tls_phdrs_script_test_SOURCES): Define.
9428 (tls_phdrs_script_test_DEPENDENCIES): Define.
9429 (tls_phdrs_script_test_LDFLAGS): Define.
9430 (tls_phdrs_script_test_LDADD): Define.
9431 * testsuite/Makefile.in: Rebuild.
9432
4a599bdd
CC
94332010-03-23 Cary Coutant <ccoutant@google.com>
9434
9435 * fileread.cc (find_or_make_view): Fix comment.
9436
6c93b22c
ILT
94372010-03-23 Ian Lance Taylor <iant@google.com>
9438
9439 * script-sections.cc (class Orphan_section_placement): Define
9440 PLACE_TLS and PLACE_TLS_BSS.
9441 (Orphan_section_placement::Orphan_section_placement): Initialize
9442 new places.
9443 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9444 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9445 (tls_script_test_SOURCES): Define.
9446 (tls_script_test_DEPENDENCIES): Define.
9447 (tls_script_test_LDFLAGS): Define.
9448 (tls_script_test_LDADD): Define.
9449 * testsuite/Makefile.in: Rebuild.
9450
a2c7281b
DK
94512010-03-22 Doug Kwan <dougkwan@google.com>
9452
9453 * arm.cc (Arm_relocate_functions::abs8,
9454 Arm_relocate_functions::abs16): Use correct check for overflow
9455 specified in the ARM ELF specs.
9456 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9457 target of a BLX instruction specially.
9458 (Reloc_stub::stub_type_for_reloc): Ditto.
9459 (Relocate::relocate): Use symbolic names instead of numeric relocation
9460 codes to report error.
9461 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9462 workaround.
9463 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9464 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9465 thumb2_blx_out_of_range.stdout
9466 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9467 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9468 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9469 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9470 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9471 thumb2_blx_in_range, thumb2_blx_in_range.o,
9472 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9473 thumb2_blx_out_of_range.o): New rules.
2e702c99 9474 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9475 thumb2_blx_in_range and thumb2_blx_out_of_range.
9476 * testsuite/Makefile.in: Regenerate.
9477 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9478 * testsuite/thumb_blx_in_range.s: New file.
9479 * testsuite/thumb_blx_out_of_range.s: New file.
9480
b0193076
RÁE
94812010-03-22 Rafael Espindola <espindola@google.com>
9482
9483 * archive.cc (Should_include): Move to archive.h.
9484 (should_include_member): Make it a member of Archive.
9485 (Lib_group): New.
9486 (Add_lib_group_symbols): New.
9487 * archive.h: Include options.h.
9488 (Archive_member): Moved from Archive.
9489 (Should_include): Moved from archive.cc.
9490 (Lib_group): New.
9491 (Add_lib_group_symbols): New.
9492 * dynobj.cc (do_should_include_member): New.
9493 * dynobj.h (do_should_include_member): New.
9494 * gold.cc (queue_initial_tasks): Update call to queue.
9495 * main.cc (main): Print lib group stats.
9496 * object.cc (do_should_include_member): New.
9497 * object.h: Include archive.h.
9498 (Object::should_include_member): New.
9499 (Object::do_should_include_member): New.
9500 (Sized_relobj::do_should_include_member): New.
9501 * options.cc (General_options::parse_start_lib): New.
9502 (General_options::parse_end_lib): New.
9503 (Input_arguments::add_file): Handle lib groups.
9504 (Input_arguments::start_group): Check we are not in a lib.
9505 (Input_arguments::start_lib): New.
9506 (Input_arguments::end_lib): New.
9507 * options.h (General_options): Add start_lib and end_lib.
9508 (Input_argument::lib_): New.
9509 (Input_argument::lib): New.
9510 (Input_argument::is_lib): New.
9511 (Input_file_lib): New.
9512 (Input_arguments::in_lib_): New.
9513 (Input_arguments::in_lib): New.
9514 (Input_arguments::start_lib): New.
9515 (Input_arguments::end_lib_): New.
9516 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9517 in unused members as preempted.
9518 (Sized_pluginobj::do_should_include_member): New.
9519 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9520 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9521 return the blocker.
9522 (Read_symbols::do_whole_lib_group): New.
9523 (Read_symbols::do_lib_group): New.
9524 (Read_symbols::do_read_symbols): Handle lib groups.
9525 (Read_symbols::get_name): Handle lib groups.
9526 * readsyms.h (Read_symbols): Add an archive member pointer.
9527 (Read_symbols::do_whole_lib_group): New.
9528 (Read_symbols::do_lib_group): New.
9529 (Read_symbols::member_): New.
9530 * script.cc (read_input_script): Update call to queue_soon.
9531
d099120c
DK
95322010-03-19 Doug Kwan <dougkwan@google.com>
9533
9534 * arm.cc (Stub_table::Stub_table): Initialize new data members
9535 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9536 (Stub_table::add_reloc_stub): Assign stub offset and update
9537 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9538 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9539 New data members.
2e702c99 9540 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9541 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9542 instead of going over all reloc stubs.
2e702c99 9543 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9544 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9545 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9546 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9547 Stringpool_template::offset_.
9548 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9549 Stringpool_template::offset_ to zero.
9550
1aa37384
DK
95512010-03-15 Doug Kwan <dougkwan@google.com>
9552
9553 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9554 offset_.
9555 (Stringpool_template::new_key_offset): New method.
9556 (Stringpool_template::add_string): Assign offsets when adding new
9557 strings.
9558 (Stringpool_template::set_string_offsets): Do not set string offsets
9559 when not optimizing.
9560 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9561 member size_.
2e702c99
RM
9562 (Chunked_vector::clear): Clear size_.
9563 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9564 (Chunked_vector::size): Return size_.
9565 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9566 (Chunked_vector::size_): New data member.
1aa37384
DK
9567 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9568 (Stringpool_template::new_key_offset): New method declaration.
9569 (Stringpool_template::offset_): New data member.
9570
b672b057
RÁE
95712010-03-15 Rafael Espindola <espindola@google.com>
9572
9573 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9574 Add_symbols' constructor.
9575 * readsyms.h (Add_symbols): Remove the input_group member.
9576
b6848d3c
ILT
95772010-03-10 Ian Lance Taylor <iant@google.com>
9578
9579 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9580 target to ask whether a reference to a symbol requires a stack
9581 split.
9582 * target.h (Target::is_call_to_non_split): New function.
9583 (Target::do_is_call_to_non_split): Declare virtual function.
9584 * target.cc: Include "symtab.h".
9585 (Target::do_is_call_to_non_split): New function.
9586 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9587
a2a5469e
CC
95882010-03-10 Cary Coutant <ccoutant@google.com>
9589
9590 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9591 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9592 (File_read::open[2]): Add whole_file_view_ to list of views.
9593 (File_read::make_view): Remove test of whole_file_view_.
9594 (File_read::find_or_make_view): Create whole_file_view_ if
9595 necessary.
9596 (File_read::clear_views): Replace bool parameter with enum;
9597 adjust all callers. Don't delete views with permanent data;
9598 do delete cached views and views from archives if
9599 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9600 if clearing the corresponding view.
9601 * fileread.h (File_read::Clear_views_mode): New enum.
9602 (File_read::View::is_permanent_view): New method.
9603 (File_read::clear_views): Replace bool parameter
9604 with enum; adjust all callers.
9605 * options.h (General_options): Change keep_files_mapped option;
9606 add map_whole_files.
9607 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9608 releasing the file.
9609 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9610 the file.
9611
8861f32b
DM
96122010-03-10 David S. Miller <davem@davemloft.net>
9613
9614 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9615
d62d0f5f
ST
96162010-03-09 Sriraman Tallam <tmsriram@google.com>
9617
9618 * icf.cc (get_section_contents): Add '@' marker after processing the
9619 merge reloc.
9620
9177756d
DK
96212010-03-08 Doug Kwan <dougkwan@google.com>
9622
9623 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9624 due to a conversion warning.
9625 (Arm_relobj::update_output_local_symbol_count): Check for local
9626 symbol with unset output index.
9627
9e9e071b
ILT
96282010-03-05 Ian Lance Taylor <iant@google.com>
9629
9630 * options.h (class General_options): Add --spare-dynamic-tags.
9631 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9632 --spare-dynamic-tags.
9633
a81ee015
ILT
96342010-03-05 Ian Lance Taylor <iant@google.com>
9635
9636 * incremental.cc: Include "libiberty.h".
9637
44ec90b9
RO
96382010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9639
9640 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9641 function, is_info_ member.
9642 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9643 (Versions::Versions): Update caller.
9644 (Versions::define_base_version): Likewise.
9645 (Versions::add_def): Likewise.
9646
0897ed3b
ST
96472010-03-03 Sriraman Tallam <tmsriram@google.com>
9648
9649 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9650 (Scan::possible_function_pointer_reloc): New function.
9651 (Scan::local_reloc_may_be_function_pointer): Change to call
9652 possible_function_pointer_reloc.
9653 (Scan::global_reloc_may_be_function_pointer): Ditto.
9654 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9655 relocations in ".data.rel.ro._ZTV" section.
9656 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9657 * testsuite/icf_safe_so_test.cc: Ditto.
9658 * testsuite/icf_safe_test.cc: Ditto.
9659 * testsuite/icf_safe_test.sh: Ditto.
9660
d3bbad62
ILT
96612010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9662 Ian Lance Taylor <iant@google.com>
9663
9664 * target-reloc.h (relocate_section): Check the symbol table index
9665 for -1U before setting the local symbol index.
9666 (scan_relocatable_relocs): If copying the relocation, record that
9667 the local symbol is required.
9668 * object.h (Symbol_value::is_output_symtab_index_set): New
9669 function.
9670 (Symbol_value::may_be_discarded_from_output_symtab): New
9671 function.
9672 (Symbol_value::has_output_symtab_entry): New function.
9673 (Symbol_value::needs_output_symtab_entry): Remove.
9674 (Symbol_value::output_symtab_index): Make sure the symbol index is
9675 set.
9676 (Symbol_value::set_output_symtab_index): Make sure the symbol
9677 index is not set. Make sure the new index is valid.
9678 (Symbol_value::set_must_have_output_symtab_entry): New function.
9679 (Symbol_value::has_output_dynsym_entry): New function.
9680 (Symbol_value::set_output_dynsym_index): Make sure the new index
9681 is valid.
9682 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9683 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9684 local symbol if permitted.
9685 (Sized_relobj::do_finalize_local_symbols): Call
9686 is_output_symtab_index_set rather than needs_output_symtab_entry.
9687 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9688 rather than needs_output_symtab_entry. Call
9689 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9690 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9691 is_output_symtab_index_set rather than needs_output_symtab_entry.
9692 * testsuite/discard_locals_relocatable_test.c: New file.
9693 * testsuite/discard_locals_test.sh: Test -r.
9694 * testsuite/Makefile.am (check_DATA): Add
9695 discard_locals_relocatable_test1.syms,
9696 discard_local_relocatable_test2.syms.
9697 (MOSTLYCLEANFILES): Likewise. Also add
9698 discard_locals_relocatable_test1.lout and
9699 discard_locals_relocatable_test2.out.
9700 (discard_locals_relocatable_test1.syms): New target.
9701 (discard_locals_relocatable_test.o): New target.
9702 (discard_locals_relocatable_test1.out): New target.
9703 (discard_locals_relocatable_test2.syms): New target.
9704 (discard_locals_relocatable_test2.out): New target.
9705 (various): Add missing ../ld-new dependencies.
9706 * testsuite/Makefile.in: Rebuild.
9707
7e8ccf26
NC
97082010-03-03 Nick Clifton <nickc@redhat.com>
9709
9710 * po/fi.po: New Finnish translation.
9711
2a0ff005
DK
97122010-03-01 Doug Kwan <dougkwan@google.com>
9713
9714 * layout.cc (Layout::Layout): Force section types of .init_array*,
9715 .preinit_array* and .fini_array* sections.
9716 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9717 Fix check of return value of std::string::find.().
9718 (Output_section::Input_section_sort_compare::operator()): Remove
9719 comment about .init_array.
9720 (Output_section::Input_section_sort_init_fini_compare::operator()):
9721 New method.
9722 (Output_section::sort_attached_input_sections): Handle .init_array
9723 and .fini_array specially.
9724 * output.h (Output_section::Inut_section_sort_compare): Update
9725 comment.
9726 (Output_section::Input_section_sort_init_fini_compare): New struct.
9727
c3e4ae29
DK
97282010-02-26 Doug Kwan <dougkwan@google.com>
9729
9730 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9731 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9732 * testsuite/debug_msg.sh: Avoid matching source line number for
9733 use of global variable undef_int.
9734
2fd9ae7a
DK
97352010-02-26 Doug Kwan <dougkwan@google.com>
9736
9737 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9738 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9739 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9740 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9741 * options.cc (General_options::General_options): Initialize member
9742 fix_v4bx_.
9743 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9744 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9745 and rm_no_fix_v4bx.stdout
9746 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9747 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9748 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9749 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9750 and arm_no_fix_v4bx.
9751 * Makefile.in: Regenerate.
9752 * testsuite/arm_fix_v4bx.s: New file.
9753 * testsuite/arm_fix_v4bx.sh: Ditto.
9754
67ec7d0b
DK
97552010-02-24 Doug Kwan <dougkwan@google.com>
9756
9757 * arm.cc (Target_arm::got_section): Make the .got section the first
9758 non RELRO section in the data segment.
9759 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9760 suffixes of section names.
9761
10165461
DK
97622010-02-24 Doug Kwan <dougkwan@google.com>
9763
9764 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9765 flags and attributes merging if an input file is a binary file.
9766 * fileread.cc (Input_file::open): Record format of original file.
9767 * fileread.h (Input_file::Format): New enum type.
2e702c99 9768 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9769 (Input_file::format): New method definition.
9770 (Input_file::format_):: New data member.
9771
4a54abbb
DK
97722010-02-24 Doug Kwan <dougkwan@google.com>
9773
9774 * arm.cc (Arm_output_data_got): New class.
9775 (ARM_TCB_SIZE): New constant
9776 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9777 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9778 If user uses a script with a SECTIONS clause, issue only a warning
9779 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9780 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9781 garbage collection.
9782 (Target_arm::got_mode_index_entry): Handle static linking.
9783 (Target_arm::Scan::local): Ditto.
9784 (Target_arm::Scan::global): Ditto.
9785 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9786 all incorrectly implemented relocations.
e1df38aa 9787 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9788 Arm_output_section::fix_exidx_coverage.
9789 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9790 from ".ARM.exidx." and ".ARM.extab.".
9791
ca419a6f
ILT
97922010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9793
9794 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9795 section if it does not already exist.
9796 * attributes.cc (Attributes_section_data::Attributes_section_data):
9797 Don't crash if size is zero.
9798
135b9c78
ILT
97992010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9800 Ian Lance Taylor <iant@google.com>
9801
9802 * gold.cc (queue_middle_tasks): If no input files were opened,
9803 exit.
9804 * workqueue.h (Task_function::Task_function): Assert that there is
9805 a blocker.
9806
bb0bfe4f
DK
98072010-02-22 Doug Kwan <dougkwan@google.com>
9808
9809 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9810 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9811 types to avoid warnings due to different uint64_t implementations
9812 on different hosts.
9813
2a2b6d42
DK
98142010-02-21 Doug Kwan <dougkwan@google.com>
9815
9816 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9817 handling of the maximum backward branch offset.
2e702c99 9818 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9819 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9820 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9821 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9822 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9823 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9824 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9825 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9826 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9827 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9828 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9829 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9830 thumb2_bl_out_of_range.o): New rules.
9831 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9832 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9833 thumb2_bl_out_of_range
9834 * testsuite/Makefile.in: Regenerate.
9835 * testsuite/arm_bl_in_range.s: New file.
9836 * testsuite/arm_bl_out_of_range.s: Ditto.
9837 * testsuite/arm_branch_in_range.sh: Ditto.
9838 * testsuite/arm_branch_range.t: Ditto.
9839 * testsuite/thumb2_branch_range.t: Ditto.
9840 * testsuite/thumb_bl_in_range.s: Ditto.
9841 * testsuite/thumb_bl_out_of_range.s: Ditto.
9842 * testsuite/thumb_branch_range.t: Ditto.
9843
b487ad64
ST
98442010-02-20 Sriraman Tallam <tmsriram@google.com>
9845
9846 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9847 Add reloc offset information.
9848 * icf.cc (get_section_contents): Change iterators to point to the new
9849 vectors. Add reloc offset information to the contents.
9850 * icf.h (Icf::Sections_reachable_info): New typedef.
9851 (Icf::Sections_reachable_list): New typedef.
9852 (Icf::Offset_info): New typedef.
9853 (Icf::Reloc_info): New struct typedef.
9854 (Icf::Reloc_info_list): New typedef.
9855 (Icf::symbol_reloc_list): Delete method.
9856 (Icf::addend_reloc_list): Delete method.
9857 (Icf::section_reloc_list): Delete method.
9858 (Icf::reloc_info_list): New method.
9859 (Icf::reloc_info_list_): New member.
9860
f96accdf
DK
98612010-02-19 Doug Kwan <dougkwan@google.com>
9862
9863 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9864 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9865 * arm.cc (Arm_relocation_functions): New forward declaration.
9866 (Target_arm::Target_arm): Initialize new data members
9867 got_mod_index_offset_ and tls_base_symbol_defined_.
9868 (Target_arm::Relocate::relocate_tls): New method.
9869 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9870 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9871 New methods.
2e702c99 9872 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9873 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9874 (Target_arm::got_mod_index_offset_,
9875 Target_arm::tls_base_symbol_defined_): New data members.
9876 (Target_arm::Scan::local, Target::Scan::global,
9877 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9878 relocations.
9879
c8761b9a
DK
98802010-02-18 Doug Kwan <dougkwan@google.com>
9881
9882 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9883 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9884 text section as a parameter becuase some broken tools may not set
9885 the link in section header.
9886 (Target_arm::has_got_section): New method.
9887 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9888 without any mapping symbol as data only. Remove warning.
9889 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9890 link in its section header, try to discover the link by inspecting the
9891 REL31 relocation at the beginning of the section.
9892 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9893 in error message.
9894 (Target_arm::Scan::global): Treat any reference to the symbol
9895 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9896
21bb3914
ST
98972010-02-12 Sriraman Tallam <tmsriram@google.com>
9898
9899 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9900 (Scan::global_reloc_may_be_function_pointer): New function.
9901 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9902 (Scan::global_reloc_may_be_function_pointer): New function.
9903 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9904 (Scan::global_reloc_may_be_function_pointer): New function.
9905 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9906 (Scan::global_reloc_may_be_function_pointer): New function.
9907 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9908 (Scan::global_reloc_may_be_function_pointer): New function.
9909 (Scan::possible_function_pointer_reloc): New function.
9910 (Target_x86_64::can_check_for_function_pointers): New function.
9911 * gc.h (gc_process_relocs): Scan relocation types to determine if
9912 function pointers were taken for targets that support it.
9913 * icf.cc (Icf::find_identical_sections): Include functions for
9914 folding in safe ICF whose pointer is not taken.
9915 * icf.h (Secn_fptr_taken_set): New typedef.
9916 (fptr_section_id_): New member.
9917 (section_has_function_pointers): New function.
9918 (set_section_has_function_pointers): New function.
9919 (check_section_for_function_pointers): New function.
9920 * options.h: Fix comment for safe ICF option.
9921 * target.h (can_check_for_function_pointers): New function.
9922 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9923 Modify icf_safe_test for X86-64.
9924 * testsuite/Makefile.in: Regenerate.
9925 * testsuite/icf_safe_so_test.cc: New file.
9926 * testsuite/icf_safe_so_test.sh: New file.
9927 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9928 (main): Change to take pointer to function kept_func_3.
9929 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9930 folding is done correctly for X86-64.
9931
0da6fa6c
DM
99322010-02-12 David S. Miller <davem@davemloft.net>
9933
9934 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9935 is_symbolless parameter.
9936 (Output_reloc<SHT_REL>::is_symbolless): New.
9937 (Output_reloc<SHT_REL>::is_symbolless_): New.
9938 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9939 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9940 (Output_reloc<SHT_RELA>::is_symbolless): New.
9941 (Output_data_reloc::add_global): Handle is_symbolless.
9942 (Output_data_reloc::add_global_relative): Likewise.
9943 (Output_data_reloc::add_local): Likewise.
9944 (Output_data_reloc::add_local_relative): Likewise.
9945 (Output_data_reloc::add_symbolless_global_addend): New.
9946 (Output_data_reloc::add_symbolless_local_addend): New.
9947 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9948 is_symbolless.
9949 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9950 instead of ->is_relative_
9951 (Output_reloc::write): Likewise.
9952 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9953 (Output_reloc::write_rel): Simplify.
9954
9955 * sparc.cc (Target_sparc::Scan::local): Use
9956 ->add_symbolless_local_addend as needed.
9957 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9958 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9959 based upon relocation offset.
9960
e4782e83
DK
99612010-02-11 Doug Kwan <dougkwan@google.com>
9962
9963 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9964 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9965 beginning of function.
9966 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9967 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9968 parameter is_32bit in calls to should_apply_static_reloc.
9969 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9970 (check_DATA): Add arm_abs_global.stdout.
9971 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9972 arm_abs_global.stdout): New rules.
9973 (MOSTLLYCLEANFILES): Add arm_abs_global
9974 * Makefile.in: Regenerate.
9975 * testsuite/arm_abs_global.s: New file.
9976 * testsuite/arm_abs_global.sh: Ditto.
9977 * testsuite/arm_abs_lib.s: Ditto.
9978
93ceb764
ILT
99792010-02-11 Ian Lance Taylor <iant@google.com>
9980
9981 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9982 Read_relocs task.
9983 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9984 Allocate_commons_task first.
9985 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9986 task, rather than symtab_lock_.
9987 (Gc_process_relocs::~Gc_process_relocs): New function.
9988 (Gc_process_relocs::is_runnable): Check this_blocker_.
9989 (Gc_process_relocs::locks): Use next_blocker_ rather than
9990 blocker_.
9991 (Scan_relocs::~Scan_relocs): New function.
9992 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9993 symtab_lock_.
9994 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9995 next_blocker_.
9996 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9997 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9998 constructor accordingly.
9999 (class Gc_process_relocs): Likewise.
10000 (class Scan_relocs): Likewise.
10001 * common.h (class Allocate_commons_task): Remove symtab_lock_
10002 field, and corresponding constructor parameter.
10003 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10004 symtab_lock_.
10005 (Allocate_commons_task::locks): Likewise.
10006
114dfbe1
ILT
100072010-02-11 Ian Lance Taylor <iant@google.com>
10008
10009 * gold-threads.h (class Once): Define.
10010 (class Initialize_lock): Rewrite as child of Once.
10011 * gold-threads.cc (class Once_initialize): Define.
10012 (once_pointer_control): New static variable.
10013 (once_pointer, once_arg): New static variables.
10014 (c_run_once): New static function.
10015 (Once::Once, Once::run_once, Once::internal_run): New functions.
10016 (class Initialize_lock_once): Remove.
10017 (initialize_lock_control): Remove.
10018 (initialize_lock_pointer): Remove.
10019 (initialize_lock_once): Remove.
10020 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10021 (Initialize_lock::initialize): Rewrite.
10022 (Initialize_lock::do_run_once): New function.
10023 * archive.cc (Archive::interpret_header): Only clear name if it is
10024 not already empty.
10025 * fileread.cc: Include "gold-threads.h"
10026 (file_counts_lock): New static variable.
10027 (file_counts_initialize_lock): Likewise.
10028 (File_read::release): Only increment counts when using --stats.
10029 Use a lock around the increment.
10030 * parameters.cc (class Set_parameters_target_once): Define.
10031 (set_parameters_target_once): New static variable.
10032 (Parameters::Parameters): Move here from parameters.h.
10033 (Parameters::set_target): Rewrite.
10034 (Parameters::set_target_once): New function.
10035 (Parameters::clear_target): Move here and rewrite.
10036 * parameters.h (class Parameters): Update declarations. Add
10037 set_parameters_target_once_ field.
10038 (Parameters::Parameters): Move to parameters.cc.
10039 (Parameters::clear_target): Likewise.
10040 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10041 task.
10042 (Start_group::~Start_group): New function.
10043 (Start_group::is_runnable): New function.
10044 (Start_group::locks, Start_group::run): New functions.
10045 (Finish_group::run): Change saw_undefined to size_t.
10046 * readsyms.h (class Start_group): Define.
10047 (class Finish_group): Change saw_undefined_ field to size_t.
10048 (Finish_group::Finish_group): Remove saw_undefined and
10049 this_blocker parameters. Change all callers.
10050 (Finish_group::set_saw_undefined): New function.
10051 (Finish_group::set_blocker): New function.
10052 * symtab.h (class Symbol_table): Change saw_undefined to return
10053 size_t. Change saw_undefined_ field to size_t.
10054 * target-select.cc (Set_target_once::do_run_once): New function.
10055 (Target_selector::Target_selector): Initialize set_target_once_
10056 field. Don't initialize lock_ and initialize_lock_ fields.
10057 (Target_selector::instantiate_target): Rewrite.
10058 (Target_selector::set_target): New function.
10059 * target-select.h (class Set_target_once): Define.
10060 (class Target_selector): Update declarations. Make
10061 Set_target_once a friend. Remove lock_ and initialize_lock_
10062 fields. Add set_target_once_ field.
10063
fa17a3f4
ILT
100642010-02-10 Ian Lance Taylor <iant@google.com>
10065
10066 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10067 queueing any tasks.
10068 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10069 (queue_middle_tasks): Add all blockers before queueing any tasks.
10070 (queue_final_tasks): Likewise.
10071 * token.h (Task_token::add_blockers): New function.
10072 * object.h (Input_objects::number_of_relobjs): New function.
10073
c7177d31
ILT
100742010-02-10 Ian Lance Taylor <iant@google.com>
10075
5de0e392
ILT
10076 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10077 shared, not if not position independent.
10078 * x86_64.cc (Relocate::relocate_tls): Likewise.
10079 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10080 (tls_pie_pic_test): New target.
10081 * testsuite/Makefile.in: Rebuild.
10082
c7177d31
ILT
10083 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10084 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10085 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10086 * testsuite/Makefile.in: Rebuild.
10087
684b268a
DM
100882010-02-09 David S. Miller <davem@davemloft.net>
10089
10090 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10091 R_SPARC_RELATIVE using ->add_local_relative().
10092 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10093
612a8d3d
DM
10094 * output.h (Output_data_dynamic::add_section_size): New method
10095 that takes two Output_data objects.
10096 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10097 entry param. Handle it in initializers.
10098 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10099 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10100 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10101 arg.
10102 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10103 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10104 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10105 for dynrel_includes_plt.
10106 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10107 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10108 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10109 before .rela.plt
10110 (Target_sparc::do_finalize_sections): Update to pass true for
10111 dynrel_includes_plt.
10112 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10113 output before .rela.plt
10114 (Target_powerpc::do_finalize_sections): Update to pass true for
10115 dynrel_includes_plt when 32-bit.
10116
cb1be87e
DK
101172010-02-08 Doug Kwan <dougkwan@google.com>
10118
10119 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10120 method.
10121 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10122 Arm_relobj::scan_section_for_cortex_a8_stubs,
10123 Arm_relobj::do_relocation_section): Instead of calling
10124 Output_section::output_address, use faster
10125 Arm_relobj::simple_input_section_output_address.
10126
705b5121
DM
101272010-02-08 David S. Miller <davem@davemloft.net>
10128
10129 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10130 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10131 relocation helper function.
10132
024c4466
DM
10133 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10134 just like R_SPARC_GOT{10,13,22}.
10135 (Target_sparc::Scan::local): Likewise.
10136 (Target_sparc::Relocate:relocate): Likewise.
10137
9109c078
ILT
101382010-02-06 Ian Lance Taylor <iant@google.com>
10139
10140 * configure.ac: Rewrite targetobjs duplicate removal code to use
10141 only shell constructs.
10142 * configure: Rebuild.
10143
cf846138
DK
101442010-02-05 Doug Kwan <dougkwan@google.com>
10145
10146 PR 11247
10147 * arm.cc (Arm_relobj::section_is_scannable): New method.
10148 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10149 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10150
6cfaf60b
DK
101512010-02-04 Doug Kwan <dougkwan@google.com>
10152
10153 PR 11247
10154 * arm-reloc-property.cc (cstdio): Include.
10155 * configure.ac (targetobjs): Remove duplicates.
10156 * configure: Regenerate.
10157 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10158 big and little endian version for a given address size.
10159
5c57f1be
DK
101602010-02-03 Doug Kwan <dougkwan@google.com>
10161
10162 * arm-reloc-property.cc
10163 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10164 definition.
10165 * arm-reloc-property.h
10166 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10167 New method definition.
10168 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10169 declaration.
10170 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10171 overflow to N.
10172 (GOT_PREL): Change implemented to Y.
10173 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10174 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10175 (Arm_relocate_functions::movw_abs_nc): Remove method.
10176 (Arm_relocate_functions::movt_abs): Ditto.
10177 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10178 (Arm_relocate_functions::thm_movt_abs): Ditto.
10179 (Arm_relocate_functions::movw_rel_nc): Ditto.
10180 (Arm_relocate_functions::movw_rel): Ditto.
10181 (Arm_relocate_functions::movt_rel): Ditto.
10182 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10183 (Arm_relocate_functions:thm_movw_rel): Ditto.
10184 (Arm_relocate_functions:thm_movt_rel): Ditto.
10185 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10186 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10187 New method definitions.
10188 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10189 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10190 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10191 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10192 (Target_arm::Relocate::relocate): Check for non-static or
10193 unimplemented relocation code and exit early. Change calls to
10194 Target_arm::reloc_uses_thumb_bit and
10195 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10196 instead. Refactor code to handle similar relocations to increase
10197 code sharing. Remove check for unsupported relocation code in switch
10198 statement.
10199 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10200 relocation property table to find out size. Change error message to
10201 print out the name of a relocation code instead of the numeric value.
10202 (Target_arm::scan_reloc_for_stub): Use relocation property table
10203 instead of calling Target_arm::reloc_uses_thumb_bit().
10204
218c5831
DK
102052010-02-02 Doug Kwan <dougkwan@google.com>
10206
10207 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10208 types of relaxed input section.
10209
0d31c79d
DK
102102010-02-02 Doug Kwan <dougkwan@google.com>
10211
10212 * Makefile.am (HFILES): Add arm-reloc-property.h.
10213 (DEFFILES): New.
2e702c99
RM
10214 (TARGETSOURCES): Add arm-reloc-property.cc
10215 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10216 (libgold_a_SOURCES): $(DEFFILES)
10217 * Makefile.in: Regenerate.
10218 * arm-reloc-property.cc: New file.
10219 * arm-reloc-property.h: New file.
10220 * arm-reloc.def: New file.
10221 * arm.cc: Update comments.
10222 (arm-reloc-property.h): New included header.
10223 (arm_reloc_property_table): New global variable.
10224 (Target_arm::do_select_as_default_target): New method definition.
10225 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10226 arm-reloc-property to targ_extra_obj.
10227 * parameters.cc (set_parameters_target): Call
10228 Target::select_as_default_target().
10229 * target.h (Target::select_as_default_target): New method definition.
10230 (Target::do_select_as_default_target): Same.
10231
546c7457
DK
102322010-02-01 Doug Kwan <dougkwan@google.com>
10233
10234 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10235 first_output_text_section_.
10236 (Arm_exidx_fixup::first_output_text_section): New method definition.
10237 (Arm_exidx_fixup::first_output_text_section_): New data member.
10238 (Arm_exidx_fixup::process_exidx_section): Record the first text
10239 output section seen.
10240 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10241 and entsize in output section header.
10242
11b861d5
DK
102432010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10244
10245 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10246 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10247 (Arm_relocate_functions::thm_alu11): New Method.
10248 (Arm_relocate_functions::thm_pc8): New Method.
10249 (Arm_relocate_functions::thm_pc12): New Method.
10250 (Target_arm::Scan::local): Handle the relocations.
10251 (Target_arm::Scan::global): Likewise.
10252 (Target_arm::Relocate::relocate): Likewise.
10253 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10254
c9a2c125
DK
102552010-01-29 Doug Kwan <dougkwan@google.com>
10256
10257 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10258 of relocation types as ld.
10259
1521477a
DK
102602010-01-29 Doug Kwan <dougkwan@google.com>
10261
10262 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10263 to public.
10264 (Arm_relocate_functions::thumb_branch_common): Ditto.
10265 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10266 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10267 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10268 Arm_relocate_functions::jump24): Remove.
10269 (Target_arm::Relocate::relocate): Adjust code to call
10270 Arm_relocation_functions::arm_branch_common and
10271 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10272 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10273
e7eca48c
DK
102742010-01-29 Doug Kwan <dougkwan@google.com>
10275
10276 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10277 output_local_symbol_count_needs_update_.
10278 (Arm_relobj::output_local_symbol_count_needs_update,
10279 Arm_relobj::set_output_local_symbol_count_needs_update,
10280 Arm_relobj::update_output_local_symbol_count): New methods.
10281 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10282 member.
10283 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10284 of pointed function as in a R_ARM_PREL31 relocation.
10285 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10286 for output local symbol count updating.
10287 (Target_arm::do_relax): Update output local symbol counts in objects
10288 if necessary.
10289 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10290
02961d7e
ILT
102912010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10292
10293 * arm.cc: Added support for the ARM relocations:
10294 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10295 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10296 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10297 movw_prel_nc).
10298 (Arm_relocate_functions::movw_rel): New method.
10299 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10300 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10301 thm_movw_prel_nc).
10302 (Arm_relocate_functions::thm_movw_rel): New method.
10303 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10304 thm_movt_prel).
10305 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10306 relocations.
10307 (Target_arm::Scan::global): Likewise.
10308 (Target_arm::Relocate::relocate): Likewise.
10309 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10310 Likewise.
10311
b10d2873
ILT
103122010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10313
10314 * arm.cc: Added support for ARM group relocations.
10315 (Target_arm::reloc_needs_sym_origin): New method.
10316 (Arm_relocate_functions::calc_grp_kn): New method.
10317 (Arm_relocate_functions::calc_grp_residual): New method.
10318 (Arm_relocate_functions::calc_grp_gn): New method.
10319 (Arm_relocate_functions::arm_grp_alu): New Method.
10320 (Arm_relocate_functions::arm_grp_ldr): New Method.
10321 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10322 (Arm_relocate_functions::arm_grp_ldc): New Method.
10323 (Target_arm::Scan::local): Handle the ARM group relocations.
10324 (Target_arm::Scan::global): Likewise.
10325 (Target_arm::Relocate::relocate): Likewise.
10326 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10327 Likewise.
10328
2b328d4e
DK
103292010-01-26 Doug Kwan <dougkwan@google.com>
10330
10331 * arm.cc (set): Include.
10332 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10333 pointer type.
2e702c99 10334 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10335 (Arm_output_section::append_text_sections_to_list): New method.
10336 (Arm_output_section::fix_exidx_coverage): Ditto.
10337 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10338 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10339 Relobj::set_section_offset() instead of
10340 Sized_relobj::invalidate_section_offset().
2e702c99 10341 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10342 parameter for section headers. Ignore relocation sections for
10343 unallocated sections and EXIDX sections.
10344 (Target_arm::fix_exidx_coverage): New method.
10345 (Target_arm::output_section_address_less_than): New type.
10346 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10347 linked text section instead of the EXIDX section.
10348 (Arm_output_section::create_stub_group): Add an assertion to check
10349 that this is not an EXIDX output section.
10350 (Arm_output_section::append_text_sections_to_list): New method.
10351 (Arm_output_section::fix_exidx_coverage): Ditto.
10352 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10353 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10354 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10355 first pass.
10356 (Target_arm::fix_exidx_coverage): New method.
10357 * object.h (Relobj::set_output_section): New method.
10358 (Sized_relobj::invalidate_section_offset): Remove method.
10359 (Sized_relobj::do_invalidate_section_offset): Remove method.
10360 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10361
c7f3c371
DK
103622010-01-25 Doug Kwan <dougkwan@google.com>
10363
10364 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10365 Fix warning due to signed and unsigned comparison on a 32-bit host.
10366
8923b24c
DK
103672010-01-22 Doug Kwan <dougkwan@google.com>
10368
10369 * arm.cc (Target_arm::do_relax): Record an output section for section
10370 offset adjustment it contains any stub table that has changed.
10371 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10372 offsets in an output section if necessary.
10373 * output.cc (Output_section::Output_section): Initialize
10374 section_offsets_need_adjustments_.
10375 (Output_section::add_input_section_for_script): Renamed to
10376 Output_section::add_simple_input_section.
10377 (Output_section::save_states): Add a comment.
10378 (Output_section::discard_states): New method defintion.
10379 (Output_section::adjust_section_offsets): Same.
10380 * output.h (Output_section::add_input_section_for_script): Renamed to
10381 Output_section::add_simple_input_section.
10382 (Output_section::discard_states): New method declaration.
10383 (Output_section::adjust_section_offsets): Same.
10384 (Output_section::section_offsets_need_adjustment,
10385 Output_section::set_section_offsets_need_adjustment): New method
10386 definitions.
10387 (Output_section::section_offsets_need_adjustment_): New data member.
10388 * script-sections.cc
10389 (Output_section_element_input::set_section_address): Adjust code for
10390 renaming of Output_section::add_input_section_for_script.
10391 (Orphan_output_section::set_section_address): Same.
10392
9b2fd367
DK
103932010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10394
10395 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10396 Fix_v4bx enum values .
10397 * gold/options.h (General_options): New option definitions.
10398 (General_options::fix_v4bx): New method.
10399 (General_options::Fix_v4bx): New enum.
10400 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10401 (General_options::parse_fix_v4bx_interworking): New method.
10402
80d0d023
DK
104032010-01-22 Doug Kwan <dougkwan@google.com>
10404
10405 * arm.cc (Arm_exidx_fixup): New class.
10406
af2cdeae
DK
104072010-01-21 Doug Kwan <dougkwan@google.com>
10408
10409 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10410 classes.
10411 (Arm_exidx_section_offset_map): New type.
10412
993d07c1
DK
104132010-01-21 Doug Kwan <dougkwan@google.com>
10414
10415 * arm.cc (Arm_exidx_input_section): New class.
10416 (Arm_relobj::exidx_input_section_by_link,
10417 Arm_relobj::exidx_input_section_by_shndx,
10418 Arm_relobj::make_exidx_input_section): New methods.
10419 (read_arm_attributes_section): Remove.
10420 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10421 information about them.
10422 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10423 to here.
10424
5ac169d4
DK
104252010-01-20 Doug Kwan <dougkwan@google.com>
10426
10427 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10428 Input_section_specifier to Section_id.
10429 (Target_arm::new_arm_input_section: Adjust code for change of key
10430 type.
10431 (Target_arm::find_arm_input_section): Ditto.
10432 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10433 (Section_id): Remove.
10434 (Garbage_collection::Section_id_hash): Remove.
10435 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10436 (Section_id): Remove.
10437 (Icf::Section_id_hash): Remove.
10438 * object.h (Section_id, Const_section_id, Section_id_hash,
10439 Const_section_id_hash): New type definitions.
10440 * output.cc (Output_section::add_relaxed_input_section): Change to
10441 use Const_section_id instead of Input_section_specifier as key type.
10442 (Output_section::add_merge_input_section): Ditto.
10443 (Output_section::build_relaxation_map): Change to use Section_id
10444 instead of Input_section_specifier as key type.
2e702c99 10445 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10446 Ditto.
10447 (Output_section::convert_input_sections_to_relaxed_sections): Change
10448 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10449 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10450 (Output_section::find_relaxed_input_section): Ditto.
10451 * output.h (Input_section_specifier): Remove class.
10452 (Output_section::Output_section_data_by_input_section_map): Change
10453 key type to Const_section_id.
10454 (Output_section::Output_relaxed_input_section_by_input_section_map):
10455 Ditto.
10456 (Output_section::Relaxation_map): Change key type to Section_id.
10457
a2162063
ILT
104582010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10459
10460 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10461 (class Arm_v4bx_stub): New class.
10462 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10463 (Stub_factory::make_arm_v4bx_stub): New method.
10464 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10465 (Stub_table::empty): Handle v4bx stubs.
10466 (Stub_table::add_arm_v4bx_stub): New method.
10467 (Stub_table::find_arm_v4bx_stub): New method.
10468 (Arm_relocate_functions::v4bx): New method.
10469 (Target_arm::fix_v4bx): New method.
10470 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10471 (Stub_table::relocate_stubs): Likewise.
10472 (Stub_table::do_write): Likewise.
10473 (Stub_table::update_data_size_and_addralign): Likewise.
10474 (Stub_table::finalize_stubs): Likewise.
10475 (Target_arm::Scan::local): Likewise.
10476 (Target_arm::Scan::global): Likewise.
10477 (Target_arm::do_finalize_sections): Likewise.
10478 (Target_arm::Relocate::relocate): Likewise.
10479 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10480 Likewise.
10481 (Target_arm::scan_reloc_for_stub): Likewise.
10482 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10483
5696ab0b
ILT
104842010-01-19 Ian Lance Taylor <iant@google.com>
10485
10486 * output.cc (Output_section_headers::do_sized_write): Write large
10487 segment count to sh_info field.
10488 (Output_file_header::do_sized_write): For large segment count,
10489 write PN_XNUM to e_phnum field.
10490
800d0f56
ILT
104912010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10492
10493 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10494 (Arm_relocate_functions::thm_jump8): New function.
10495 (Arm_relocate_functions::thm_jump11): New function.
10496 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10497 R_ARM_THM_JUMP11.
10498 (Target_arm::Scan::global): Likewise.
10499 (Target_arm::Relocate::relocate): Likewise.
10500 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10501 Likewise.
10502
41263c05
DK
105032010-01-14 Doug Kwan <dougkwan@google.com>
10504
10505 * arm.cc (map, utility): Include headers.
10506 (Target_arm::apply_cortex_a8_workaround): New method.
10507 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10508 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10509 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10510 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10511 the --[no-]fix-cortex-a8 command line options.
10512 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10513 (Target_arm::relocate_stub): Use addend in instruction template.
10514 * options.h (DEFINE_bool): Set the user-set flag.
10515 (General_options): Add --[no-]-fix-cortex options.
10516 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10517 : Update fast look-up map after conversion.
41263c05 10518
459e9b03
ST
105192010-01-14 Sriraman Tallam <tmsriram@google.com>
10520
10521 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10522 in the first pass of do_layout.
10523
b521dfe4
DK
105242010-01-13 Doug Kwan <dougkwan@google.com>
10525
10526 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10527 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10528 apparent compiler problem of not folding static constant integral
10529 data members of elfcpp::Elf_sizes<32>.
10530
44272192
DK
105312010-01-13 Doug Kwan <dougkwan@google.com>
10532
10533 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10534 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10535 Arm_relobj::scan_section_for_cortex_a8_erratum,
10536 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10537 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10538 sections to scan for relocation stubs into a new method
10539 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10540 relocation and Cortex-A8 stub scanning.
10541 (Target_arm::do_relax): Force stubs to be after stubbed sections
10542 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10543 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10544 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10545
44b71ece
ILT
105462010-01-12 Ian Lance Taylor <iant@google.com>
10547
10548 * target-reloc.h (visibility_error): New inline function.
10549 (relocate_section): Call visibility_error.
10550 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10551 (MOSTLYCLEANFILES): Likewise.
10552 (protected_4_pic.o, protected_3.err): New targets.
10553 * testsuite/protected_4.cc: New file.
10554
a120bc7f
DK
105552010-01-12 Doug Kwan <dougkwan@google.com>
10556
10557 * arm.cc (Cortex_a8_reloc): New class.
10558 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10559 and cortex_a8_relocs_info_.
10560 (Target_arm::fix_cortex_a8): New method definition.
10561 (Target_arm::Cortex_a8_relocs_info): New type.
10562 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10563 New data member declarations.
10564 (Target_arm::scan_reloc_for_stub): Record information about
10565 relocations for THUMB branches that might be exempted from the
10566 Cortex-A8 workaround.
10567 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10568 at the beginning of a relaxation pass.
10569
20138696
DK
105702010-01-12 Doug Kwan <dougkwan@google.com>
10571
10572 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10573 (Arm_relobj::Mapping_symbol_position,
10574 Arm_reloj::Mapping_symbol_position_less,
10575 Arm_relobj::Mapping_symbols_info): New types.
10576 (Target_arm::is_mapping_symbol_name): New method definition.
10577 (Arm_relobj::do_count_local_symbols): Save information about mapping
10578 symbols.
10579
089d69dc
DK
105802010-01-11 Doug Kwan <dougkwan@google.com>
10581
10582 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10583 Arm_relocate_functions::thumb32_branch_upper,
10584 Arm_relocate_functions::thumb32_branch_lower,
10585 Arm_relocate_functions::thumb32_cond_branch_offset,
10586 Arm_relocate_functions::thumb32_cond_branch_upper,
10587 Arm_relocate_functions::thumb32_cond_branch_lower,
10588 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10589 branch offset encoding.
10590 (Arm_relocate_functions::thumb_branch_common): Use new branch
10591 offset encoding methods to avoid code duplication.
10592 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10593 (Stub_addend_reader::operator()): Use new branch encoding method
10594 to avoid code duplication.
10595
99e5bff2
DK
105962010-01-11 Doug Kwan <dougkwan@google.com>
10597
10598 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10599 (Target_arm::do_finalize_sections): Define special EXIDX section
10600 symbols only if referenced.
10601 * gc.h (Garbage_collection::add_reference): New method.
10602 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10603 code duplication.
10604
98e090bd
ILT
106052010-01-11 Ian Lance Taylor <iant@google.com>
10606
d0a91bd8
ILT
10607 * script.cc (Version_script_info::build_expression_list_lookup):
10608 Change complaing about duplicate wildcard match from error to
10609 warning.
10610
98e090bd
ILT
10611 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10612 of 2009-12-30.
10613 (Version_script_info::Version_script_info): Initialize globs_,
10614 default_version_, default_is_global_, and exact_. Don't
10615 initialize globals_ or locals_.
10616 (Version_script_info::build_lookup_tables): Build local symbols
10617 first.
10618 (Version_script_info::unquote): New function.
10619 (Version_script_info::add_exact_match): New function.
10620 (Version_script_info::build_expression_list_lookup): Remove lookup
10621 parameter. Add is_global parameter. Change all callers. Handle
10622 wildcard pattern specially. Unquote pattern. Call
10623 add_exact_match.
10624 (Version_script_info::get_name_to_match): New function.
10625 (Version_script_info::get_symbol_version): New function.
10626 (Version_script_info::get_symbol_version_helper): Remove.
10627 (Version_script_info::check_unmatched_names): Call unquote.
10628 * script.h (class Version_script_info): Change get_symbol_version
10629 to be non-inline and add is_global parameter; change all callers.
10630 Rewrite symbol_is_local. Update declarations. Define struct
10631 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10632 Remove globals_ and locals_ members. Add exact_, globs_,
10633 default_version_, is_global_.
10634 (Version_script_info::Glob): Remove pattern, add expression and
10635 is_global. Update constructor. Change all callers.
10636 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10637 default version.
10638 (Versions::symbol_section_contents): If a symbol is undefined, or
10639 defined in a dynamic object, set the version index to
10640 VER_NDX_LOCAL.
10641 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10642 symbol_is_local.
10643 (Symbol_table::add_from_pluginobj): Likewise.
10644 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10645
d56962d3
DK
106462010-01-11 Doug Kwan <dougkwan@google.com>
10647
10648 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10649 (incremental_dump_LDADD): Add linking option for libintl.
10650 * Makefile.in: Regenerate.
10651
94e6ee91
L
106522010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10653
10654 PR gold/11144
10655 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10656 instead of -Ds.
10657 * testsuite/Makefile.in: Regenerated.
10658
e96c574b
DK
106592010-01-10 Doug Kwan <dougkwan@google.com>
10660
10661 * options.h (DEFINE_var): Use parentheses around argument varname__
10662 in macro body to avoid any unintended subsequent substitutions.
10663
7198066b
ILT
106642010-01-10 Ian Lance Taylor <iant@google.com>
10665
ba4d53bf
ILT
10666 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10667 candidates before doing symbol resolution.
10668
7198066b
ILT
10669 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10670 ODR candidates if only one is weak.
10671
a2beed37
ILT
106722010-01-08 Ian Lance Taylor <iant@google.com>
10673
10674 * script.cc (Version_script_info::build_expression_list_lookup):
10675 Don't warn about ambiguous version, just record the ambiguity.
10676 (Version_script_info::get_symbol_version_helper): Give error if
10677 version is ambiguous.
10678
2fb7225c
DK
106792010-01-08 Doug Kwan <dougkwan@google.com>
10680
10681 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10682 prev_data_size_ and prev_addralign_. Remove initializer for
10683 deleted data member has_been_changed_.
10684 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10685 to determine if the table is empty.
10686 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10687 Remove.
10688 (Stub_table::add_reloc_stub): Define method in class definition
10689 instead of just declaring it there.
10690 (Stub_table::add_cortex_a8_stub): New method definition.
10691 (Stub_table::update_data_size_and_addralign): Ditto.
10692 (Stub_table::finalize_stubs): Ditto.
10693 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10694 (Stub_table::do_addralign_): Return address alignment in the
10695 (Stub_table::do_reset_address_and_file_offset): Define method in
10696 class definition instead of declaring it there. Set current data
10697 size to be the data size of the previous pass.
10698 (Stub_table::set_final_data_size): Use current data size as the
10699 final data size.
10700 (Stub_table::relocate_stub): Change parameter type of stub from
10701 Reloc_stub pointer to Stub pointer.
10702 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10703 (Stub_table::Cortex_a8_stub_list): New typedef.
10704 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10705 Stub_table::prev_addralign_): New data member.
10706 (Arm_relobj::Arm_relobj): Initialize data member
10707 section_has_cortex_a8_workaround_.
10708 (Arm_relobj::section_has_cortex_a8_workaround,
10709 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10710 definitions.
10711 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10712 declarations.
10713 (Target_arm::relocate_stub): Change parameter type of stub from
10714 Reloc_stub pointer to Stub pointer.
10715 (Insn_template::size, Insn_template::alignment): Handle
10716 THUMB16_SPECIAL_TYPE.
10717 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10718 Stub_table::update_data_size_and_addralign,
10719 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10720 definitions.
10721 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10722 (Stub_table::do_write): Ditto.
10723 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10724
880cd20d
ILT
107252010-01-08 Ian Lance Taylor <iant@google.com>
10726
10727 PR 11108
10728 * symtab.h (class Symbol): Remove fields is_target_special_ and
10729 has_plt_offset_. Add field is_defined_in_discarded_section_.
10730 (Symbol::is_defined_in_discarded_section): New function.
10731 (Symbol::set_is_defined_in_discarded_section): New function.
10732 (Symbol::has_plt_offset): Rewrite.
10733 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10734 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10735 Don't initialize is_target_special_ or has_plt_offset_.
10736 Initialize is_defined_in_discarded_section_.
10737 (Symbol_table::add_from_relobj): If appropriate, set
10738 is_defined_in_discarded_section.
10739 * resolve.cc (Symbol::override_base_with_special): Don't test
10740 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10741 * target-reloc.h (relocate_section): Do special handling for
10742 symbols defined in discarded sections for global symbols as well
10743 as local symbols.
10744
2703e3eb
ILT
107452010-01-08 Ian Lance Taylor <iant@google.com>
10746
10747 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10748 the SHT_SYMTAB case.
10749
339d40a3
ILT
107502010-01-08 Ian Lance Taylor <iant@google.com>
10751
10752 * object.cc (Sized_relobj::do_layout): Don't get confused if
10753 layout_eh_frame returns NULL.
10754
abecea76
ILT
107552010-01-08 Ian Lance Taylor <iant@google.com>
10756
10757 PR 11084
10758 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10759 dynamic symbol table, use the normal symbol table.
10760 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10761 symbol table.
10762
6b7dd3f3
ILT
107632010-01-08 Ian Lance Taylor <iant@google.com>
10764
10765 PR 11072
10766 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10767 sections.
10768
36c50e63
L
107692010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10770
10771 * version.cc (print_version): Change to "Copyright 2010".
10772
e291e7b9
ILT
107732010-01-08 Ian Lance Taylor <iant@google.com>
10774
10775 PR 10287
10776 PR 11063
10777 * i386.cc (class Target_i386): Change return type of plt_section
10778 to be non-const.
10779 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10780 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10781 tls_desc_rel_ field.
10782 (Output_data_plt_i386::rel_tls_desc): New function.
10783 (Target_i386::rel_tls_desc_section): New function.
10784 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10785 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10786 R_386_TLS_DESC reloc in rel_tls_desc_section.
10787 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10788 Define struct Tlsdesc_info.
10789 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10790 (Target_x86_64::do_reloc_symbol_index): New function.
10791 (Target_x86_64::add_tlsdesc_info): New function.
10792 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10793 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10794 tlsdesc_rel_ field.
10795 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10796 all callers.
10797 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10798 (Target_x86_64::rela_tlsdesc_section): New function.
10799 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10800 handling.
10801 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10802 (Target_x86_64::do_reloc_addend): New function.
10803 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10804 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10805 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10806 (Output_reloc::type): New function.
10807 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10808 (Output_reloc::is_target_specific): New function.
10809 (Output_reloc::target_arg): New function.
10810 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10811 absolute relocs and target specific relocs.
10812 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10813 add_target_specific.
10814 (class Output_data_reloc) [SHT_RELA]: Likewise.
10815 * output.cc (Output_reloc::Output_reloc): Add four new versions
10816 for absolute relocs and target specific relocs.
10817 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10818 (Output_reloc::get_symbol_index): Likewise.
10819 (Output_reloc::local_section_offset): Check that local_sym_index_
10820 is not TARGET_CODE or 0.
10821 (Output_reloc::symbol_value): Likewise.
10822 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10823 reloc.
10824 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10825 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10826 functions.
10827 * layout.cc (add_target_dynamic_tags): Use output section for
10828 DT_PLTRELSZ and DT_JMPREL.
10829
3a44184e
ILT
108302010-01-07 Ian Lance Taylor <iant@google.com>
10831
10832 PR 11061
10833 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10834 function.
10835 (class Output_data_reloc_generic): Define.
10836 (class Output_data_reloc_base): Change base class to
10837 Output_data_reloc_generic. Change add() method to call
10838 bump_relative_reloc_count for a relative reloc. Remove
10839 sort_relocs_ field.
10840 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10841 to sort_relocs().
10842 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10843 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10844 appropriate.
10845 * layout.h (class Layout): Update declaration.
10846
ea715a34
ILT
108472010-01-07 Ian Lance Taylor <iant@google.com>
10848
10849 * output.h (class Output_data): Add const version of
10850 output_section and do_output_section.
10851 (class Output_section_data): Add const version of
10852 do_output_section.
10853 (class Output_section): Likewise.
10854 * layout.cc (Layout::add_target_dynamic_tags): New function.
10855 * layout.h (class Layout): Update declarations.
10856 * arm.cc (Target_arm::do_finalize_sections): Use
10857 add_target_dynamic_tags.
10858 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10859 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10860 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10861 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10862
659948a4
ILT
108632010-01-07 Ian Lance Taylor <iant@google.com>
10864
10865 PR 11042
10866 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10867 object as needed.
10868
9d3b86f6
ILT
108692010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10870 Ian Lance Taylor <iant@google.com>
10871
10872 PR 11019
10873 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10874 Xindex::read_symtab_xindex.
10875
bb0d3eb0
DK
108762010-01-07 Doug Kwan <dougkwan@google.com>
10877
10878 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10879 (Insn_template::thumb16_bcond_insn): New method declaration.
10880 (Insn_template): Fix spelling.
10881 (Stub::thumb16_special): New method declaration.
10882 (Stub::do_write): Define virtual method which was previously pure
10883 virtual.
10884 (Stub::do_thumb16_special): New method declaration.
10885 (Stub::do_fixed_endian_write): New template member.
10886 (Reloc_stub::do_write): Remove.
10887 (Reloc_stub::do_fixed_endian_write): Remove.
10888 (Cortex_a8_stub): New class definition.
10889 (Stub_factory::make_cortex_a8_stub): New method definition.
10890 (Stub_factory::Stub_factory): Add missing static storage class
10891 qualifier for elf32_arm_stub_a8_veneer_blx.
10892
ffeef7df
ILT
108932010-01-07 Ian Lance Taylor <iant@google.com>
10894
dc3f80fe
ILT
10895 PR 10980
10896 * options.h (class General_options): Add --warn-unresolved-symbols
10897 and --error-unresolved-symbols.
10898 * errors.cc (Errors::undefined_symbol): Implement
10899 --warn-unresolved-symbols.
10900
ffeef7df
ILT
10901 * options.h (class General_options): Add -z text and -z textoff.
10902 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10903
f1ec9ded
ST
109042010-01-06 Sriraman Tallam <tmsriram@google.com>
10905
10906 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10907 (Garbage_collection::cident_sections): New function.
10908 (Garbage_collection::add_cident_section): New function.
10909 (Garbage_collection::cident_sections_): New member.
10910 (gc_process_relocs): Add references to sections whose names are C
10911 identifiers.
10912 * gold.h (cident_section_start_prefix): New constant.
10913 (cident_section_stop_prefix): New constant.
10914 (is_cident): New function.
10915 * layout.cc (Layout::define_section_symbols): Replace string constants
10916 with the newly defined constants.
10917 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10918 C identifiers.
10919 * testsuite/Makefile.am: Add gc_orphan_section_test.
10920 * testsuite/Makefile.in: Regenerate.
10921 * testsuite/gc_orphan_section_test.cc: New file.
10922 * testsuite/gc_orphan_section_test.sh: New file.
10923
6eda8c29
ILT
109242010-01-06 Ian Lance Taylor <iant@google.com>
10925
b9674e17
ILT
10926 PR 10980
10927 * options.h (class General_options): Add --warn-shared-textrel.
10928 * layout.cc (Layout::finish_dynamic_section): Implement
10929 --warn-shared-textrel.
10930
6eda8c29
ILT
10931 PR 10980
10932 * options.h (class General_options): Add --warn-multiple-gp.
10933
32dcd44e
ILT
109342010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10935
10936 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10937 $(THREADSLIB) and $(LIBDL).
10938 * Makefile.in: Rebuild.
10939
a192ba05
ILT
109402010-01-06 Ian Lance Taylor <iant@google.com>
10941
10942 PR 10980
10943 * options.cc (General_options::parse_section_start): New function.
10944 (General_options::section_start): New function.
10945 (General_options::General_options): Initialize all members.
10946 * options.h: Include <map>
10947 (class General_options): Add --section-start. Add section_starts_
10948 member.
10949 * layout.cc (Layout::attach_allocated_section_to_segment): If
10950 --section-start was used, set the address of the segment. Remove
10951 local sort_sections.
10952 (Layout::relaxation_loop_body): If the address of the load segment
10953 has been set by --section-start, don't use it.
10954 * output.h (Output_segment::update_flags_for_output_section): New
10955 function.
10956 * output.cc (Output_segment::add_output_section): Call
10957 update_flags_for_output_section.
10958
dde3f402
ILT
109592010-01-05 Ian Lance Taylor <iant@google.com>
10960
62dfdd4d
ILT
10961 PR 10980
10962 * options.h (class General_options): Add --undefined-version.
10963 * script.cc (struct Version_expression): Add was_matched_by_symbol
10964 field.
10965 (Version_script_info::matched_symbol): New function.
10966 (Version_script_info::get_symbol_version_helper): Call
10967 matched_symbol.
10968 (Version_script_info::check_unmatched_names): New function.
10969 * script.h (class Version_script_info): Update declarations.
10970 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10971
9c4ae156
ILT
10972 * options.h (class General_options): Use DEFINE_bool_alias for
10973 allow_multiple_definition.
10974 * resolve.cc (Symbol_table::should_override): Don't test
10975 allow_multiple_definition.
10976
dde3f402
ILT
10977 PR 10980
10978 * options.h (class General_options): Add --cref.
10979 * main.cc (main): Print cref table if --cref. Don't close mapfile
10980 until after printing cref table.
10981 * cref.cc: Include "symtab.h".
10982 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10983 (Cref_table_compare::operator()): New function.
10984 (Cref_inputs::gather_cref): New function.
10985 (filecol): New static const.
10986 (Cref_inputs::print_cref): New function.
10987 (Cref::print_cref): New function.
10988 * cref.h: Include <cstdio>.
10989 (class Cref): Update declarations.
10990 * mapfile.h (Mapfile::file): New function.
10991 * object.h (class Object): Define Symbols. Declare virtual
10992 do_get_global_symbols.
10993 (Object::get_global_symbols): New function.
10994 * object.cc (Input_objects::add_object): Pass object to cref_ if
10995 --cref.
10996 (Input_objects::archive_start): Likewise.
10997 (Input_objects::archive_stop): Likewise.
10998 (Input_objects::print_cref): New function.
10999 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11000 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11001 --cref.
11002 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11003 function.
11004 * plugin.h (class Sized_pluginobj): Update declarations.
11005
8781f709
ILT
110062010-01-05 Ian Lance Taylor <iant@google.com>
11007
11008 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11009 to is_default_version. Rename insdef to insdefault.
11010 (Symbol_table::add_from_relobj): Rename def to is_default_version
11011 and local to is_forced_local.
11012 (Symbol_table::add_from_pluginobj): Likewise.
11013 (Symbol_table::add_from_dynobj): Likewise.
11014 (Symbol_table::define_special_symbol): Rename insdef to
11015 insdefault.
11016
fe35d28d
ILT
110172010-01-04 Ian Lance Taylor <iant@google.com>
11018
30bc8c46
ILT
11019 PR 10980
11020 * options.h (class General_options): Add
11021 --allow-multiple-definition and -z muldefs.
11022 * resolve.cc (Symbol_table::should_override): Don't warn about a
11023 multiple symbol definition if --allow-multiple-definition or -z
11024 muldefs.
11025
7eaea549
ILT
11026 PR 10980
11027 * options.h (class General_options): Add --add-needed and
11028 --copy-dt-needed-entries. Tweak --as-needed help entry.
11029 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11030 error if --copy-dt-needed-entries aka --add-needed is used and
11031 would cause a change in behaviour.
11032
fe35d28d
ILT
11033 PR 10980
11034 * options.h (class General_options): Add -G as a short version of
11035 --shared. Add no-op options -assert, -g, and -i.
11036
55a2bb35
ST
110372010-01-04 Sriraman Tallam <tmsriram@google.com>
11038
11039 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11040 check for .text or .gnu.linkonce.t sections.
11041 * icf.cc (Icf::find_identical_sections): Ditto.
11042 Change the detection for mangled function name within the section
11043 name.
11044 * icf.h (is_section_foldable_candidate): New function.
11045
719328e1
ILT
110462009-12-30 Ian Lance Taylor <iant@google.com>
11047
11048 PR 10980
11049 * options.h (class General_options): Permit two dashes with
11050 --retain-symbols-file.
11051
d7bb5745
ILT
110522009-12-30 Ian Lance Taylor <iant@google.com>
11053
403a15dd
ILT
11054 PR 10979
11055 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11056 don't put the file header and segment headers in the text
11057 segment.
11058
eda294df
ILT
11059 PR 10979
11060 * common.cc (Sort_commons::operator()): Stabilize sort when both
11061 entries are NULL.
11062 (Symbol_table::do_allocate_commons_list): When allocating common
11063 symbols, skip a symbol which is no longer common.
11064 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11065 an object before checking its type.
11066 * testsuite/common_test_2.c: New file.
11067 * testsuite/common_test_3.c: New file.
11068 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11069 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11070 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11071 (common_test_2_pic.o, common_test_2.so): New targets.
11072 (common_test_3_pic.o, common_test_3.so): New targets.
11073 * testsuite/Makefile.in: Rebuild.
11074
d7bb5745
ILT
11075 PR 10979
11076 * script.cc (read_input_script): If we see a new SECTIONS clause,
11077 and we have added an input section, give an error.
11078 * layout.h (class Layout): Add have_added_input_section function.
11079 Add have_added_input_section_ field.
11080 * layout.cc (Layout::Layout): Initialize
11081 have_added_input_section_.
11082 (Layout::layout): Set have_added_input_section_.
11083 (Layout::layout_eh_frame): Likewise.
11084
fc59c572
ILT
110852009-12-30 Ian Lance Taylor <iant@google.com>
11086
11087 PR 10931
11088 * options.h (class General_options): Add --sort-common option.
11089 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11090 * common.cc (Sort_common): Add sort_order parameter to
11091 constructor. Add sort_order_ field.
11092 (Sort_commons::operator): Check sort_order_.
11093 (Symbol_table::allocate_commons): Determine the sort order.
11094 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11095 Change all callers.
11096 (Symbol_table::do_allocate_commons_list): Likewise.
11097
1c74fab0
ILT
110982009-12-30 Ian Lance Taylor <iant@google.com>
11099
11100 PR 10916
11101 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11102 symbols from this object, don't change the visibility of an
11103 undefined symbol.
11104 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11105
6affe781
ILT
111062009-12-30 Ian Lance Taylor <iant@google.com>
11107
11108 PR 10861
11109 * script.h (class Version_script_info): Define Language enum.
11110 Update declarations. Define Glob, Exact, and Lookup types. Add
11111 new fields globals_, locals_, and is_finalized_.
11112 * script.cc: Various formatting fixes.
11113 (class Parser_closure): Change language_stack_ from a vector of
11114 std::string to one of Version_script_info::Language. Adjust all
11115 uses accordingly.
11116 (class Lazy_demangler): Remove.
11117 (struct Version_expression): Change language from std::string to
11118 Version_script_info::Language.
11119 (Version_script_info::Version_script_info): New function.
11120 (Version_script_info::~Version_script_info): Don't call clear.
11121 (Version_script_info::finalize): New function.
11122 (Version_script_info::build_lookup_tables): New function.
11123 (Version_script_info::build_expression_list_lookup): New
11124 function.
11125 (Version_script_info::get_symbol_version_helper): Rewrite to use
11126 lookup tables.
11127 (Version_script_info::print_expression_list): Adjust to use
11128 Version_script_info::Language.
11129 (script_push_lex_into_version_mode): Check that the version script
11130 has not been finalized.
11131 (version_script_push_lang): Change language string to
11132 Version_script_info::Language.
11133 * options.cc (Command_line::version_script): New function.
11134 * options.h (class General_options): Add finalize_dynamic_list
11135 function. Change version_script from declaration to definition.
11136 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11137 * testsuite/version_script.map: Remove duplicate def of foo.
11138 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11139 version_script.map.
11140 * testsuite/Makefile.in: Rebuild.
11141
818bf354
ILT
111422009-12-30 Ian Lance Taylor <iant@google.com>
11143
11144 PR 10843
11145 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11146 if the input symbol index is 0, make the output symbol index 0.
11147
ebcc8304
ILT
111482009-12-30 Ian Lance Taylor <iant@google.com>
11149
11150 PR 10670
11151 * options.h (class General_options): Add -x/--discard-all.
11152 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11153 --discard-all. If the local symbol needs a dynamic entry, check
11154 that before handling --discard-locals.
11155
176fe33f
ILT
111562009-12-30 Ian Lance Taylor <iant@google.com>
11157
bb321bb1
ILT
11158 PR 10450
11159 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11160 flags to PF_R.
11161 (Output_segment::add_output_section): Don't change the flags if
11162 the type is PT_TLS.
11163
176fe33f
ILT
11164 PR 10450
11165 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11166 GNU hash table if they need a dynamic value. Otherwise, don't add
11167 them if they are defined in a dynamic object or are forced local.
11168
e8cd95c7
ILT
111692009-12-29 Ian Lance Taylor <iant@google.com>
11170
1b81fb71
ILT
11171 PR 10450
11172 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11173 .gnu.hash table for a 32-bit target.
11174
8d6d383d
ILT
11175 PR 10450
11176 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11177 regular and a dynamic object only needs a dynamic symbol table
11178 entry if it is externally visible.
11179
e785ec03
ILT
11180 PR 10450
11181 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11182 constructor. Add global_offset_table_ field.
11183 (Target_i386::got_section): Set global_offset_table_.
11184 (Target_i386::do_finalize_sections): Set global_offset_table_
11185 size.
11186 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11187 in constructor. Add global_offset_table_ field.
11188 (Target_x86_64::got_section): Set global_offset_table_.
11189 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11190 size.
11191
1a2dff53
ILT
11192 * layout.cc (Layout::Layout): Initialize increase_relro_.
11193 (Layout::get_output_section): Add is_relro, is_last_relro, and
11194 is_first_non_relro parameters. Change all callers.
11195 (Layout::choose_output_section): Likewise.
11196 (Layout::add_output_section_data): Likewise.
11197 (Layout::make_output_section): Likewise.
11198 (Layout::set_segment_offsets): Clear increase_relro when using a
11199 linker script.
11200 * layout.h (class Layout): Add increase_relro method. Add
11201 increase_relro_ field. Update declarations.
11202 * output.cc (Output_section::Output_section): Initialize
11203 is_last_relro_ and is_first_non_relro_.
11204 (Output_segment::add_output_section): Group relro sections is
11205 do_sort is true. Handle is_last_relro and is_first_non_relro.
11206 (Output_segment::maximum_alignment): Remove relro handling.
11207 (Output_segment::set_section_addresses): Add increase_relro
11208 parameter. Change all callers. Add initial alignment to align
11209 relro sections on separate page. Remove old relro handling.
11210 (Output_segment::set_section_list_addresses): Remove in_relro
11211 parameter. Change all callers.
11212 (Output_segment::set_offset): Add increase parameter. Change all
11213 callers. Remove old relro handling.
11214 * output.h (class Output_section): Add new methods: is_last_relro,
11215 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11216 Add is_last_relro_ and is_first_non_relro_ fields.
11217 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11218 Create separate .got.plt section. Call increase_relro.
11219 * x86_64.cc (Target_x86_64::got_section): Likewise.
11220 * testsuite/relro_script_test.t: Add .got.plt.
11221
f0ba79e2
ILT
11222 PR 10450
11223 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11224 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11225 (Layout::finalize): Call set_dynamic_symbol_size.
11226 (Layout::set_dynamic_symbol_size): New function.
11227 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11228 set_dynamic_symbol_size.
11229
e8cd95c7
ILT
11230 PR 10450
11231 * output.h (class Output_section): Add is_entsize_zero_ field.
11232 * output.cc (Output_section::Output_section): Initialize
11233 is_entsize_zero_.
11234 (Output_section::set_entsize): If two different entsizes are
11235 requested, force it to zero.
11236 (Output_section::add_input_section): Set flags for .debug_str
11237 before updating section flags. Set entsize.
11238 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11239 and SHF_STRING if all input sections have those flags.
11240
3e1b9a8a
RÁE
112412009-12-29 Rafael Espindola <espindola@google.com>
11242
11243 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11244 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11245 reporting.
3e1b9a8a 11246
3dcad376
ST
112472009-12-29 Sriraman Tallam <tmsriram@google.com>
11248
11249 * options.cc (General_options::parse_version): Allow -v to exit
11250 without an error if there is nothing to link.
11251
084e2665
ILT
112522009-12-29 Ian Lance Taylor <iant@google.com>
11253
11254 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11255 using a version of gcc before 4.1.
11256 * configure: Rebuild.
11257
250acde3
CD
112582009-12-28 Chris Demetriou <cgd@google.com>
11259
11260 * attributes.cc (Output_attributes_section_data::do_write): Use
11261 std::vector::front rather than std::vector::data.
11262
99fff23b
ILT
112632009-12-28 Ian Lance Taylor <iant@google.com>
11264
11265 * symtab.h (class Symbol_table): Add enum Defined.
11266 * resolve.cc (Symbol_table::should_override): Add defined
11267 parameter. Change all callers. Test whether object is NULL
11268 before calling a method on it.
11269 (Symbol_table::report_resolve_problem): Add defined parameter.
11270 Change all callers.
11271 (Symbol_table::should_override_with_special): Likewise.
11272 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11273 parameter. Change all callers.
11274 (Symbol_table::do_define_in_output_data): Likewise.
11275 (Symbol_table::define_in_output_segment): Likewise.
11276 (Symbol_table::do_define_in_output_segment): Likewise.
11277 (Symbol_table::define_as_constant): Likewise.
11278 (Symbol_table::do_define_as_constant): Likewise.
11279 * script.h (class Symbol_assignment): Add is_defsym parameter to
11280 constructor; change all callers.
11281 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11282 parameter. Change all callers. Add is_defsym_ field.
11283 (class Parser_closure): Add parsing_defsym parameter to
11284 constructor; change all callers. Add parsing_defsym accessor
11285 function. Add parsing_defsym_ field.
11286
556bd683
ILT
112872009-12-28 Ian Lance Taylor <iant@google.com>
11288
11289 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11290 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11291
1782c879
ILT
112922009-12-23 Ian Lance Taylor <iant@google.com>
11293
11294 * i386.cc (Target_i386::do_calls_non_split): Recognize
11295 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11296 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11297 -fsplit-stack prologue when using %r11.
1782c879 11298
329ca2b1
ST
112992009-12-21 Sriraman Tallam <tmsriram@google.com>
11300
11301 * options.cc (General_options::parse_version): Make -v continue and do
11302 the link like GNU ld does.
11303
d675ff46
RÁE
113042009-12-17 Rafael Avila de Espindola <espindola@google.com>
11305
11306 * Makefile.am (CCFILES): Add timer.cc.
11307 (HFILES): Add timer.h.
11308 * configure.ac: Check for sysconf and times.
11309 * main.cc: include timer.h.
11310 (main): Use Timer instead of get_run_time.
11311 * timer.cc: New.
11312 * timer.h: New.
11313 * workqueue.cc: include timer.h.
11314 (Workqueue::find_and_run_task):
11315 Report user, sys and wall time.
11316 * Makefile.in: Regenerate.
11317 * config.in: Regenerate.
11318 * configure: Regenerate.
11319
d6344fb5
DK
113202009-12-16 Doug Kwan <dougkwan@google.com>
11321
11322 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11323 sections.
11324 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11325 relaxed input sections.
11326 * output.cc (Output_section::find_relaxed_input_section): Change
11327 return type to Output_relaxed_input_section pointer. Adjust code
11328 for new type of relaxed_input_section_map_.
11329 * output.h (Output_section::find_relaxed_input_section): Change
11330 return type to Output_relaxed_input_section pointer.
11331 (Output_section::Output_relaxed_input_section_by_input_section_map):
11332 New type.
11333 (Output_section::relaxed_input_section_map_): Change type to
11334 Output_section::Output_relaxed_input_section_by_input_section_map.
11335 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11336 input section.
11337
0e0d5469
ILT
113382009-12-15 Ian Lance Taylor <iant@google.com>
11339
11340 * layout.cc (Layout::create_shstrtab): Only write out after input
11341 sections if we are compressing debug sections.
11342
0649a889
ILT
113432009-12-15 Ian Lance Taylor <iant@google.com>
11344
11345 * archive.cc (Archive::add_symbols): Only look up a symbol without
11346 a version if there is, in fact, a version.
11347
2ea97941
ILT
113482009-12-14 Ian Lance Taylor <iant@google.com>
11349
11350 Revert -Wshadow changes, all changes from:
11351 2009-12-11 Doug Kwan <dougkwan@google.com>
11352 2009-12-11 Nick Clifton <nickc@redhat.com>
11353 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11354
b0eec2cc
DK
113552009-12-11 Doug Kwan <dougkwan@google.com>
11356
11357 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11358 due to -Wshadow.
11359 * attributes.cc (Object_attribute::size): Ditto.
11360 (Attributes_section_data::size): Ditto.
11361 (Attributes_section_data::Attributes_section_data): Ditto.
11362 (Output_attributes_section_data::do_write): Ditto.
11363 * attributes.h (Object_attribute::set_type): Ditto.
11364 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11365
91d6fa6a
NC
113662009-12-11 Nick Clifton <nickc@redhat.com>
11367
11368 * archive.cc: Fix shadowed variable warnings.
11369 * arm.cc: Likewise.
11370 * compressed_output.cc: Likewise.
11371 * compressed_output.h: Likewise.
11372 * configure: Likewise.
11373 * dwarf_reader.cc: Likewise.
11374 * dynobj.cc: Likewise.
11375 * dynobj.h: Likewise.
11376 * ehframe.cc: Likewise.
11377 * ehframe.h: Likewise.
11378 * errors.cc: Likewise.
11379 * expression.cc: Likewise.
11380 * fileread.cc: Likewise.
11381 * fileread.h: Likewise.
11382 * freebsd.h: Likewise.
11383 * i386.cc: Likewise.
11384 * icf.cc: Likewise.
11385 * incremental.h: Likewise.
11386 * layout.cc: Likewise.
11387 * layout.h: Likewise.
11388 * mapfile.cc: Likewise.
11389 * merge.cc: Likewise.
11390 * merge.h: Likewise.
11391 * object.cc: Likewise.
11392 * object.h: Likewise.
11393 * options.h: Likewise.
11394 * output.cc: Likewise.
11395 * output.h: Likewise.
11396 * parameters.cc: Likewise.
11397 * plugin.cc: Likewise.
11398 * powerpc.cc: Likewise.
11399 * reduced_debug_output.cc: Likewise.
11400 * reduced_debug_output.h: Likewise.
11401 * reloc.cc: Likewise.
11402 * reloc.h: Likewise.
11403 * resolve.cc: Likewise.
11404 * script-sections.cc: Likewise.
11405 * script.cc: Likewise.
11406 * script.h: Likewise.
11407 * sparc.cc: Likewise.
11408 * symtab.cc: Likewise.
11409 * symtab.h: Likewise.
11410 * target-select.cc: Likewise.
11411 * target-select.h: Likewise.
11412 * token.h: Likewise.
11413 * workqueue.cc: Likewise.
11414 * workqueue.h: Likewise.
11415 * x86_64.cc: Likewise.
11416
a0351a69
DK
114172009-12-10 Doug Kwan <dougkwan@google.com>
11418
11419 * arm.cc (attributes.h): New include.
11420 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11421 (Arm_relobj::~Arm_relobj): Delete object pointed by
11422 attributes_section_data_.
11423 (Arm_relobj::attributes_section_data): New method definition.
11424 (Arm_relobj::attributes_section_data_): New data member declaration.
11425 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11426 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11427 attributes_section_data_.
11428 (Arm_dynobj::attributes_section_data): New method definition.
11429 (Arm_dynobj::attributes_section_data_): New data member declaration.
11430 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11431 initialization value of may_use_blx_ to false.
2e702c99 11432 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11433 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11434 object attributes to compute results instead of hard-coding.
11435 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11436 Target_arm::get_secondary_compatible_arch,
11437 Target_arm::set_secondary_compatible_arch
11438 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11439 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11440 New method declarations.
11441 (Target_arm::get_aeabi_object_attribute): New method definition.
11442 (Target_arm::attributes_section_data_): New data member declaration.
11443 (read_arm_attributes_section): New template definition.
11444 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11445 (Arm_dynobj::do_read_symbols): Ditto.
11446 (Target_arm::do_finalize_sections): Merge attributes sections from
11447 input. Check for BLX use after attributes section merging.
11448 Fix __exidx_start and __exidx_end visibility. Create an
11449 .ARM.attributes section if necessary.
11450 (Target_arm::get_secondary_compatible_arch,
11451 Target_arm::set_secondary_compatible_arch,
11452 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11453 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11454 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11455 New method definitions.
11456
b59befec
ILT
114572009-12-09 Ian Lance Taylor <iant@google.com>
11458
11459 * plugin.cc (Plugin::load): Don't cast from void* to a function
11460 pointer.
11461
1276bc89
ILT
114622009-12-09 Ian Lance Taylor <iant@google.com>
11463
11464 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11465 information fields.
11466
2f2de248
L
114672009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11468
11469 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11470 Replace two_file_shared_1.so with two_file_shared_2.so.
11471 * testsuite/Makefile.in: Regenerated.
11472
4f787271
DK
114732009-12-08 Doug Kwan <dougkwan@google.com>
11474
11475 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11476 (HFILES): Add attributes.h and int_encoding.h.
11477 * Makefile.in: Regenerate.
11478 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11479 function definitions to int_encoding.cc
11480 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11481 prototypes to int_encoding.h
11482 * reduced_debug_output.cc (int_encoding.h): New include.
11483 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11484 function definitions to int_encoding.cc
11485 (insert_into_vector, read_from_pointer): Move template definitions to
11486 int_encoding.h
11487 * attributes.cc: New file.
11488 * attributes.h: New file.
11489 * int_encoding.cc: New file.
11490 * int_encoding.h: New file.
11491
20b52f1a
RÁE
114922009-12-07 Rafael Avila de Espindola <espindola@google.com>
11493
11494 PR gold/11055
11495 * incremental-dump.cc (dump_incremental_inputs): New.
11496 (main): Use dump_incremental_inputs.
11497
53d7974c
L
114982009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11499
11500 PR gold/10893
11501 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11502 checking elfcpp::STT_FUNC.
11503 (Target_i386::Relocate::relocate): Likewise.
11504 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11505
11506 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11507 symbols from shared libraries into normal FUNC symbols.
11508
11509 * symtab.h (Symbol): Add is_func and use it.
11510
05a352e6
DK
115112009-12-05 Doug Kwan <dougkwan@google.com>
11512
11513 * arm.cc (Target_arm::arm_info): Initialize new fields
11514 attributes_section and attributes_vendor.
11515 * i386.cc (Target_i386::i386_info): Same.
11516 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11517 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11518 fields attributes_section and attributes_vendor.
53d7974c 11519 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11520 * target.h (Target::attributes_section, Target::attributes_vendor,
11521 Target::is_attributes_section, Target::attribute_arg_type,
11522 Target::attributes_order): New method definitions.
11523 (Target::Target_info::attributes_section,
11524 Target::Target_info::attributes_vendor): New fields.
11525 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11526 virtual method definitions.
11527 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11528 attributes_section and attributes_vendor.
11529 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11530
f4e5969c
DK
115312009-12-05 Doug Kwan <dougkwan@google.com>
11532
11533 * arm.cc: Update comments about interworking and stub generation.
11534 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11535 considered as non-PIC.
11536 (Arm_relocate_functions::base_abs): Fix formatting.
11537 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11538 of function to use GOT entry address instead of offset.
11539 (Target_arm::Scan::global): Issue an error if a symbol would need a
11540 PLT does not get one because it is untyped. Remove code to create
11541 dynamic symbols for relative branches.
11542 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11543 takes unsigned integer instead of boolean.
11544
1abce4a6
L
115452009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11546
11547 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11548 (two_file_test_LDADD): Likewise.
11549 (common_test_1_LDADD): Likewise.
11550 (exception_test_LDADD) Likewise.
11551 (weak_test_LDADD): Likewise.
11552 (many_sections_test_LDADD): Likewise.
11553 (initpri1_LDADD): Likewise.
11554 (script_test_1_LDADD): Likewise.
11555 (script_test_2_LDADD): Likewise.
11556 (justsyms_LDADD): Likewise.
11557 (binary_test_LDADD): Likewise.
11558 (large_LDADD): Likewise.
11559 * testsuite/Makefile.in: Regenerated.
11560
adcf2816 115612009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11562
adcf2816
L
11563 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11564 (Symbol_table::override_with_special): Likewise.
11565 (Symbol_table::add_from_object): Likewise.
11566
28e67f5d
RÁE
115672009-12-04 Rafael Avila de Espindola <espindola@google.com>
11568
11569 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11570 Don't set the data_offset twice.
11571
ae10a101
RÁE
115722009-12-04 Rafael Avila de Espindola <espindola@google.com>
11573
11574 * testsuite/Makefile.in: Regenerate.
11575
f59f41f3
DK
115762009-12-03 Doug Kwan <dougkwan@google.com>
11577
11578 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11579 (Target_arm::do_finalize_sections): Add parameter for symbol table
11580 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11581 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11582 parameter for symbol table pointer.
11583 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11584 an additional parameter for a pointer to symbol table.
11585 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11586 parameter for a symbol table pointer.
11587 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11588 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11589 Ditto.
11590 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11591 parameter for a symbol table pointer.
11592
ca55d848
RÁE
115932009-12-03 Rafael Avila de Espindola <espindola@google.com>
11594
11595 * incremental.cc (Incremental_inputs_header)
11596 (Incremental_inputs_header_write, Incremental_inputs_entry)
11597 (Incremental_inputs_entry_write): Move ...
11598 * incremental.h (Incremental_inputs_header)
11599 (Incremental_inputs_header_write, Incremental_inputs_entry)
11600 (Incremental_inputs_entry_write): here.
11601
3aec4f9c
RÁE
116022009-12-02 Rafael Avila de Espindola <espindola@google.com>
11603
11604 * incremental.cc (make_sized_incremental_binary): Set the target.
11605 Error if it is incompatible.
11606 * output.h (Output_file): Add filename method.
11607
9c0ae74d
RÁE
116082009-12-02 Rafael Avila de Espindola <espindola@google.com>
11609
11610 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11611 from the get_* methods.
11612
a45500ae
RÁE
116132009-12-02 Rafael Avila de Espindola <espindola@google.com>
11614
11615 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11616 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11617 Write 0 for the data_offset of scripts.
11618
325e6408
RÁE
116192009-12-02 Rafael Avila de Espindola <espindola@google.com>
11620
11621 * testsuite/Makefile.am: Add the incremental_test.sh test.
11622 * testsuite/incremental_test.sh: New.
11623 * testsuite/incremental_test_1.c: New.
11624 * testsuite/incremental_test_2.c: New.
11625
954c3e2e
RÁE
116262009-12-01 Rafael Avila de Espindola <espindola@google.com>
11627
703d02da 11628 * incremental-dump.cc (main): Fix typos.
954c3e2e 11629
f8086623
RÁE
116302009-11-27 Rafael Avila de Espindola <espindola@google.com>
11631
11632 PR gold/11025
11633 * incremental-dump.cc (main): Use llu to print 64 bit values.
11634
3b0dd6ac
L
116352009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11636 H.J. Lu <hongjiu.lu@intel.com>
11637
11638 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11639 $(LIBDL).
11640 (incremental_dump_LDADD): Likewise.
11641 * Makefile.in: Regenerated.
11642
a6d1ef57 116432009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11644
a6d1ef57
DK
11645 Revert:
11646
11647 2009-11-25 Doug Kwan <dougkwan@google.com>
11648
11649 * arm.cc (Target_arm::Target_arm): Move method definition
11650 outside of class definition. Add code to handle
11651 --target1-rel, --target1-abs and --target2= options.
11652 (Target_arm::get_reloc_reloc_type): Change method to be
11653 non-static and const.
11654 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11655 New data member declaration.
11656 (Target_arm::Scan::local, Target_arm::Scan::global,
11657 Target_arm::Relocate::relocate,
11658 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11659 Adjust call to Target_arm::get_real_reloc_type.
11660 (Target_arm::get_real_reloc_type): Use command line options
11661 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11662 * options.h (--target1-rel, --target1-abs, --target2): New
11663 ARM-only options.
11664
50aeb7d4
DK
116652009-11-25 Doug Kwan <dougkwan@google.com>
11666
11667 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11668 class definition. Add code to handle --target1-rel, --target1-abs
11669 and --target2= options.
11670 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11671 and const.
11672 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11673 member declaration.
11674 (Target_arm::Scan::local, Target_arm::Scan::global,
11675 Target_arm::Relocate::relocate,
11676 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11677 call to Target_arm::get_real_reloc_type.
11678 (Target_arm::get_real_reloc_type): Use command line options to
11679 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11680 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11681 options.
11682
51938283
DK
116832009-11-25 Doug Kwan <dougkwan@google.com>
11684
11685 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11686 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11687 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11688 formatting.
11689 (Arm_relocate_functions::thm_call): Replace body with a call to
11690 Arm_relocate_functions::thumb_branch_common.
11691 (Arm_relocate_functions::thm_jump24,
11692 Arm_relocate_functions::thm_xpc22): New method definitions.
11693 (Arm_relocate_functions::thumb_branch_common): New method definition.
11694 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11695 operator.
11696 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11697 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11698
e2b8f3c4
RÁE
116992009-11-24 Rafael Avila de Espindola <espindola@google.com>
11700
11701 * Makefile.am: Build incremental-dump
11702 * Makefile.in: Regenerate.
11703 * incremental-dump.cc: New.
11704 * incremental.cc (Incremental_inputs_header_data,
11705 Incremental_inputs_entry_data): Move to incremental.h
11706 * incremental.h: (Incremental_inputs_header_data,
11707 Incremental_inputs_entry_data): Move from incremental.cc
11708
bcba9aec
RÁE
117092009-11-24 Rafael Avila de Espindola <espindola@google.com>
11710
11711 * incremental.cc (Incremental_inputs_header,
11712 Incremental_inputs_header_write, Incremental_inputs_entry,
11713 Incremental_inputs_entry_write): Add a typedef with the data type.
11714
7c3afe08
RÁE
117152009-11-24 Rafael Avila de Espindola <espindola@google.com>
11716
11717 * incremental.cc (Incremental_inputs_header,
11718 Incremental_inputs_header_write, Incremental_inputs_entry,
11719 Incremental_inputs_entry_write): Update comment about which
11720 type has the filed descriptions.
11721
d204b6e9
DK
117222009-11-15 Doug Kwan <dougkwan@google.com>
11723
11724 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11725 (Arm_relocate_functions::arm_branch_common): Change method defintion
11726 in class definition to a method declaration and update list of formal
11727 parameters.
11728 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11729 Arm_relocation_functions::jump24): Adjust call to
11730 Arm_relocate_functions::arm_branch_common. Update list of formal
11731 parameters.
11732 (Arm_relocate_functions::xpc25): New method definition.
11733 (Arm_relocate_functions::arm_branch_common): Move method defintion
11734 out from class definition. Use stubs for mode-switching and extending
11735 branch ranges.
11736 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11737 specially. Change code to enable use of stubs in ARM branches.
11738
43d12afe
DK
117392009-11-10 Doug Kwan <dougkwan@google.com>
11740
11741 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11742 in method declaration.
11743 (Target_arm::relocate_stub): New method declaration.
11744 (Target_arm::default_target): Change to return a pointer instead of
11745 a const reference.
11746 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11747 Target_arm::default_target.
11748 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11749 method definition.
11750 (Target_arm::relocate_section): Adjust view.
11751 (Target_arm::relocate_stub): New method definition.
11752
ac33a407
DK
117532009-11-10 Doug Kwan <dougkwan@google.com>
11754
11755 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11756 a format warning.
11757 * incremental.cc (open_incremental_binary): Initialized local
11758 variables to avoid warnings.
11759 * object.cc (make_elf_object): Ditto.
11760 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11761 a format warning.
e1df38aa 11762
88ee28e9
L
11763009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11764
11765 PR gold/10930
11766 * testsuite/plugin_test.c: Include "config.h".
11767
2daedcd6
DK
117682009-11-09 Doug Kwan <dougkwan@google.com>
11769
11770 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11771 (arm_symbol_value): Remove.
11772 (Arm_relocate_functions::arm_branch_common,
11773 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11774 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11775 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11776 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11777 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11778 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11779 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11780 Arm_relocate_functions::thm_mobw_abs_nc,
11781 Arm_relocate_functions::thm_mov_abs,
11782 Arm_relocate_functions::movw_prel_nc,
11783 Arm_relocate_functions::thm_movt_abs,
11784 Arm_relocate_functions::movt_prel,
11785 Arm_relocate_functions::thm_movw_prel_nc,
11786 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11787 (Target_arm::Relocate::relocate): Only decompose address into two
11788 parts if relocation type uses the thumb-bit and pass the actual
11789 bit instead of a flag indicating that the thumb-bit is used. Adjust
11790 calls to methods in Arm_relocate_functions for this change.
11791
1276bc89 117922009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11793
11794 PR 10925
11795 * reloc.cc: Instantiate
11796 Sized_relobj::initialize_input_to_output_maps and
11797 Sized_relobj:free_input_to_output_maps.
11798
e53ad1b5
ILT
117992009-11-06 Ian Lance Taylor <iant@google.com>
11800
11801 PR 10876
11802 * defstd.cc (in_segment): Set only_if_ref true for "end".
11803
eb44217c
DK
118042009-11-06 Doug Kwan <dougkwan@google.com>
11805
11806 * arm.cc (class Reloc_stub): Correct a comment.
11807 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11808 (Target_arm::scan_section_for_stubs): New method declaration.
11809 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11810 Change methods from private to protected.
11811 (Target_arm::do_may_relax): New method definition.
11812 (Target_arm::do_relax, Target_arm::group_sections,
11813 Target_arm::scan_reloc_for_stub,
11814 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11815 (Target_arm::arm_input_section_map_): New data member declaration.
11816 (Target_arm::scan_reloc_for_stub,
11817 Target_arm::scan_reloc_section_for_stubs,
11818 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11819 Target_arm::do_relax): New method definitions.
11820
5d329b7d
ILT
118212009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11822
11823 * configure.ac: Check for (struct stat)::st_mtim
11824 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11825 * config.in: Regenerate.
11826 * configure: Regenerate.
11827
96a0d71b
ILT
118282009-11-05 Ian Lance Taylor <iant@google.com>
11829
11830 PR 10910
11831 * output.cc (Output_segment::add_output_section): Add missing
11832 return statement.
11833
594c8e5e
ILT
118342009-11-04 Ian Lance Taylor <iant@google.com>
11835
11836 PR 10880
11837 * object.h (class Object): Add is_needed and set_is_needed
11838 methods. Add is_needed_ field. Make bool fields into bitfields.
11839 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11840 defined in a dynamic object and referenced by a regular object,
11841 set is_needed for the dynamic object.
11842 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11843 if the file is marked with as_needed and it is not needed.
11844
22b127cc
ILT
118452009-11-04 Ian Lance Taylor <iant@google.com>
11846
11847 PR 10887
11848 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11849 tags if data is discarded by linker script.
11850 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11851 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11852 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11853 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11854
f5c870d2
ILT
118552009-11-04 Ian Lance Taylor <iant@google.com>
11856
11857 * layout.cc (Layout::get_output_section): Add is_interp and
11858 is_dynamic_linker_section parameters. Change all callers.
11859 (Layout::choose_output_section): Likewise.
11860 (Layout::make_output_section): Likewise.
11861 (Layout::add_output_section_data): Add is_dynamic_linker_section
11862 parameter. Change all callers.
11863 * layout.h (class Layout): Update declarations.
11864 * output.h (class Output_section): Add is_interp, set_is_interp,
11865 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11866 Add is_interp_, is_dynamic_linker_section_ fields. Change
11867 generate_code_fills_at_write_ to a bitfield.
11868 * output.cc (Output_section::Output_sections): Initialize new
11869 fields.
11870 (Output_segment::add_output_section): Add do_sort parameter.
11871 Change all callers.
11872
1ae4d23b
ILT
118732009-11-03 Ian Lance Taylor <iant@google.com>
11874
11875 PR 10860
11876 * options.h (class General_options): Add --warn-common.
11877 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11878 merging two common symbols.
11879 (Symbol_table::should_override): Handle --warn-common when merging
11880 a common symbol with a defined symbol. Use report_resolve_problem
11881 for multiple definitions.
11882 (Symbol_table::report_resolve_problem): New function.
11883 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11884
55da9579
DK
118852009-11-03 Doug Kwan <dougkwan@google.com>
11886
11887 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11888 stub_factory_.
11889 (Target_arm::stub_factory): New method definition.
11890 (Target_arm::new_arm_input_section,
11891 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11892 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11893 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11894 New type definitions.
11895 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11896 member declarations.
11897 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11898 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11899 New method definitions.
11900
37a9ac43
ILT
119012009-11-03 Ian Lance Taylor <iant@google.com>
11902
11903 * options.h (class General_options): Add --warn_constructors.
11904
b3d6a3d4
ILT
119052009-11-03 Ian Lance Taylor <iant@google.com>
11906
11907 PR 10893
11908 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11909 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11910
934b01dd
ILT
119112009-11-03 Ian Lance Taylor <iant@google.com>
11912
11913 PR 10895
11914 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11915 --msgid-bugs-address.
11916 (install-pdf): New target.
11917 (install-data_yes): Look up one directory to find mkinstalldirs.
11918
03c1939b
L
119192009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11920
11921 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11922 tree.
11923
ebd95253
DK
119242009-10-30 Doug Kwan <dougkwan@google.com>
11925
11926 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11927
e9bbb538
DK
119282009-10-30 Doug Kwan <dougkwan@google.com>
11929
11930 * arm.cc (Stub_addend_reader): New struct template definition
11931 and partial specializations.
11932 (Stub_addend_reader::operator()): New method definition for a
11933 partially specialized template.
11934
d5b40221
DK
119352009-10-30 Doug Kwan <dougkwan@google.com>
11936
11937 * arm.cc (Arm_relobj::processor_specific_flags): New method
11938 definition.
11939 (Arm_relobj::do_read_symbols): New method declaration.
11940 (Arm_relobj::processor_specific_flags_): New data member declaration.
11941 (Arm_dynobj): New class definition.
11942 (Target_arm::do_finalize_sections): Add input_objects parameter.
11943 (Target_arm::do_adjust_elf_header): New method declaration.
11944 (Target_arm::are_eabi_versions_compatible,
11945 (Target_arm::merge_processor_specific_flags): New method declaration.
11946 (Target_arm::do_make_elf_object): New overloaded method definitions
11947 and declaration.
11948 (Arm_relobj::do_read_symbols): New method definition.
11949 (Arm_dynobj::do_read_symbols): Ditto.
11950 (Target_arm::do_finalize_sections): Add input_objects parameters.
11951 Merge processor-specific flags from all input objects.
11952 (Target_arm::are_eabi_versions_compatible,
11953 Target_arm::merge_processor_specific_flags,
11954 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11955 New method definitions.
11956 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11957 Input_objects pointer type parameter.
11958 * layout.cc (Layout::finalize): Pass input objects to target's.
11959 finalize_sections function.
11960 * output.cc (Output_file_header::do_sized_write): Set ELF file
11961 header's processor-specific flags.
11962 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11963 Input_objects pointer type parameter.
11964 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11965 * target.h (Input_objects): New forward class declaration.
11966 (Target::processor_specific_flags,
11967 Target::are_processor_specific_flags_sect): New method definitions.
11968 (Target::finalize_sections): Add input_objects parameter.
11969 (Target::Target): Initialize processor_specific_flags_ and
11970 are_processor_specific_flags_set_.
11971 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11972 parameter.
11973 (Target::set_processor_specific_flags): New method definition.
11974 (Target::processor_specific_flags_,
11975 Target::are_processor_specific_flags_set_): New data member
11976 declarations.
11977 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11978 Input_objects pointer type parameter.
11979
ebabffbd
DK
119802009-10-30 Doug Kwan <dougkwan@google.com>
11981
11982 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11983
ad0f2072
ILT
119842009-10-28 Ian Lance Taylor <iant@google.com>
11985
11986 * object.h (class Relobj): Drop options parameter from
11987 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11988 do_scan_relocs, do_relocate. Change all callers.
11989 (class Sized_relobj): Drop options parameters from
11990 do_gc_process_relocs, do_scan_relocs, do_relocate,
11991 do_relocate_sections, relocate_sections, emit_relocs_scan,
11992 emit_relocs_scan_reltype. Change all callers.
11993 (struct Relocate_info): Remove options field and all references to
11994 it.
11995 * reloc.h (class Read_relocs): Remove options constructor
11996 parameter and options_ field. Change all callers.
11997 (class Gc_process_relocs, class Scan_relocs): Likewise.
11998 (class Relocate_task): Likewise.
11999 * target-reloc.h (scan_relocs): Remove options parameter. Change
12000 all callers.
12001 (scan_relocatable_relocs): Likewise.
12002 * target.h (class Sized_target): Remove options parameter from
12003 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12004 all callers.
12005 * gc.h (gc_process_relocs): Remove options parameter. Change all
12006 callers.
12007 * arm.cc: Update functions to remove options parameters.
12008 * i386.cc: Likewise.
12009 * powerpc.cc: Likewise.
12010 * sparc.cc: Likewise.
12011 * x86_64.cc: Likewise.
12012 * testsuite/testfile.cc: Likewise.
12013
8ffa3667
DK
120142009-10-28 Doug Kwan <dougkwan@google.com>
12015
12016 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12017 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12018 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12019 New method definitions.
12020
40f36857
CC
120212009-10-28 Cary Coutant <ccoutant@google.com>
12022
12023 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12024 (Plugin::cleanup_done_): New member.
12025 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12026 (Plugin_manager::cleanup_done_): Remove.
12027 (Plugin_manager::add_input_file): Edit error message.
12028 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12029 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12030
2c849493
ILT
120312009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12032
12033 * fileread.cc: (File_read::View::~View): Use the new
12034 data_ownership_ filed.
12035 (File_read::~File_read): Dispose the new whole_file_view_.
12036 (File_read::open): Mmap the whole file if needed.
12037 (File_read::open): Use whole_file_view_ instead of contents_.
12038 (File_read::find_view): Use whole_file_view_ if applicable.
12039 (File_read::do_read): Use whole_file_view_ instead of contents_.
12040 (File_read::make_view): Use whole_file_view_ instead of contents_,
12041 update File_read::View::View call.
12042 (File_read::find_or_make_view): Update File_read::View::View
12043 call.
12044 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12045 remove contents_
12046 (File_read::View::Data_ownership): New enum.
12047 (File_read::View::View): Replace bool mapped_ with Data_ownership
12048 argument.
12049 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12050 (File_read::View::data_ownership_): New field.
12051 (File_read::contents_): Remove (replaced by whole_file_view_).
12052 (File_read::whole_file_view_): New field.
12053 * options.h (class General_options): Add --keep-files-mapped.
12054
24998053
CC
120552009-10-27 Cary Coutant <ccoutant@google.com>
12056
12057 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12058 * testsuite/Makefile.am (plugin_test_5): New test case.
12059 * testsuite/Makefile.in: Regenerate.
12060
72adc4fa
DK
120612009-10-25 Doug Kwan <dougkwan@google.com>
12062
12063 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12064 from private to protected to allow access by child class.
12065 (Sized_relobj::do_relocate_sections): New method declaration.
12066 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12067 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12068 Sized_relobj::relocate_sections. Instantiate template explicitly
12069 for different target sizes and endianity.
12070
07f508a2
DK
120712009-10-24 Doug Kwan <dougkwan@google.com>
12072
12073 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12074 (Arm_input_section::as_arm_input_section): New method.
12075 (Arm_output_section): New class definition.
12076 (Arm_output_section::create_stub_group,
12077 Arm_output_section::group_sections): New method definitions.
12078
10ad9fe5
DK
120792009-10-22 Doug Kwan <dougkwan@google.com>
12080
12081 * arm.cc (Arm_input_section): New class definition.
12082 (Arm_input_section::init, Arm_input_section:do_write,
12083 Arm_input_section::set_final_data_size,
12084 Arm_input_section::do_reset_address_and_file_offset): New method
12085 definitions.
12086
56ee5e00
DK
120872009-10-21 Doug Kwan <dougkwan@google.com>
12088
12089 * arm.cc (Stub_table, Arm_input_section): New forward class
12090 declarations.
12091 (Stub_table): New class defintion.
12092 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12093 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12094 New method definition.
12095
b569affa
DK
120962009-10-21 Doug Kwan <dougkwan@google.com>
12097
12098 * arm.cc: Update copyright comments.
12099 (Target_arm): New forward class template declaration.
12100 (Arm_address): New type.
12101 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12102 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12103 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12104 constants.
12105 (Insn_template): Same.
12106 (DEF_STUBS): New macro.
12107 (Stub_type): New enum type.
12108 (Stub_template): New class definition.
12109 (Stub): Same.
12110 (Reloc_stub): Same.
12111 (Stub_factory): Same.
12112 (Target_arm::Target_arm): Initialize may_use_blx_ and
12113 should_force_pic_veneer_.
12114 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12115 Target_arm::should_force_pic_veneer,
12116 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12117 Target_arm::using_thumb_only, Target_arm:;default_target): New
12118 method defintions.
12119 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12120 New data member declarations.
12121 (Insn_template::size, Insn_template::alignment): New method defintions.
12122 (Stub_template::Stub_template): New method definition.
12123 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12124 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12125 (Stub_factory::Stub_factory): New method definition.
12126 * gold.h (string_hash): New template.
12127 * output.h (Input_section_specifier::hash_value): Use
12128 gold::string_hash.
12129 (Input_section_specifier::string_hash): Remove.
12130 * stringpool.cc (Stringpool_template::string_hash): Use
12131 gold::string_hash.
12132
6c172549
DK
121332009-10-20 Doug Kwan <dougkwan@google.com>
12134
12135 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12136 symbols of relaxed input sections.
12137 * output.h (Output_section::find_relaxed_input_section): Make
12138 method public.
12139
c5617f2f
DK
121402009-10-16 Doug Kwan <dougkwan@google.com>
12141
12142 * dynobj.cc (Versions::Versions): Initialize version_script_.
12143 Only insert base version symbol definition for a shared object
12144 if version script defines any version versions.
12145 (Versions::define_base_version): New method definition.
12146 (Versions::add_def): Check that base version is not needed.
12147 (Versions::add_need): Define base version lazily.
12148 * dynobj.h (Versions::define_base_version): New method declaration.
12149 (Versions::needs_base_version_): New data member declaration.
12150 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12151 (check_DATA): Add no_version_test.stdout.
12152 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12153 New make rules.
12154 * testsuite/Makefile.in: Regenerate.
12155 * testsuite/no_version_test.c: New file.
12156 * testsuite/no_version_test.sh: Ditto.
12157
3c12dcdb
DK
121582009-10-16 Doug Kwan <dougkwan@google.com>
12159
12160 * expression.cc (class Segment_start_expression): New class definition.
12161 (Segment_start_expression::value): New method definition.
12162 (script_exp_function_segment_start): Return a new
12163 Segment_start_expression.
12164 * gold/script-c.h (script_saw_segment_start_expression): New function
12165 prototype.
12166 * script-sections.cc (Script_sections::Script_sections): Initialize
12167 SAW_SEGMENT_START_EXPRESSION_ to false.
12168 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12169 and -Tbbs options to specify section addresses if given in
12170 command line and no SEGMENT_START expression is seen in a script.
12171 * script-sections.h (Script_sections::saw_segment_start_expression,
12172 Script_sections::set_saw_segment_start_expression): New method
12173 definition.
12174 (Script_sections::saw_segment_start_expression_): New data member
12175 declaration.
12176 * script.cc (script_saw_segment_start_expression): New function.
12177 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12178 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12179 script_test_7.sh and script_test_8.sh.
12180 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12181 script_test_8.stdout.
12182 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12183 (script_test_6, script_test_6.stdout, script_test_7,
12184 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12185 * Makefile.in: Regenerate.
12186 * testsuite/script_test_6.sh: New file.
12187 * testsuite/script_test_6.t: Same.
12188 * testsuite/script_test_7.sh: Same.
12189 * testsuite/script_test_7.t: Same.
12190 * testsuite/script_test_8.sh: Same.
12191
64b1ae37
DK
121922009-10-16 Doug Kwan <dougkwan@google.com>
12193
12194 * output.cc (Output_segment::set_section_list_address): Cast
12195 expressions to unsigned long long type to avoid format warnings.
12196
661be1e2
ILT
121972009-10-15 Ian Lance Taylor <iant@google.com>
12198
12edd763 12199 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12200 dot assignment to script_sections_.
12edd763
ILT
12201 * script-sections.cc (Script_sections::add_dot_assignment):
12202 Initialize if necessary.
12203
68b6574b
ILT
12204 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12205 program headers with no load segment if there is a linker script.
12206
661be1e2
ILT
12207 * layout.cc (Layout::set_segment_offsets): Align the file offset
12208 to the segment aligment for -N or -n with no load segment.
12209 * output.cc (Output_segment::add_output_section): Don't crash if
12210 the first section is a TLS section.
12211 (Output_segment::set_section_list_addresses): Print an error
12212 message if the address moves backward in a linker script.
12213 * script-sections.cc
12214 (Output_section_element_input::set_section_addresses): Don't
12215 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12216 (Orphan_output_section::set_section_addresses): Likewise.
12217
f15f61a7
DK
122182009-10-15 Doug Kwan <dougkwan@google.com>
12219
12220 * layout.cc (Layout::finish_dynamic_section): Generate tags
12221 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12222 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12223 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12224
82bb573a
ILT
122252009-10-14 Ian Lance Taylor <iant@google.com>
12226
12227 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12228 fields.
12229 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12230 data_shdr fields of relinfo.
12231 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12232 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12233 R_386_TLS_LDO_32, adjust based on section flags.
12234 (Target_i386::Relocate::fix_up_ldo): Remove.
12235
374ad285
ILT
122362009-10-13 Ian Lance Taylor <iant@google.com>
12237
12238 Add support for -pie.
12239 * options.h (class General_options): Add -pie and
12240 --pic-executable.
12241 (General_options::output_is_position_independent): Test -pie.
12242 (General_options::output_is_executable): Return true if not shared
12243 and not relocatable.
12244 (General_options::output_is_pie): Remove.
12245 * options.cc (General_options::finalize): Reject incompatible uses
12246 of -pie.
12247 * gold.cc (queue_middle_tasks): A -pie link is not static.
12248 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12249 * symtab.cc (Symbol::final_value_is_known): Return false if
12250 output_is_position_independent.
12251 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12252 output_is_position_independent.
12253 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12254 output_is_position_independent.
12255 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12256 output_is_position_independent.
12257 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12258 two_file_pie_test.
12259 (basic_pie_test.o, basic_pie_test): New targets.
12260 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12261 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12262 (two_file_pie_test): New target.
12263 * testsuite/Makefile.in: Rebuild.
12264 * README: Remove note saying that -pie is not supported.
12265
c6585162
ILT
122662009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12267
12268 * options.h (class General_options): Add -init and -fini.
12269 * layout.cc (Layout::finish_dynamic_section): Emit
12270 given init and fini functions.
12271
032ce4e9
ST
122722009-10-13 Sriraman Tallam <tmsriram@google.com>
12273
12274 * gc.h (gc_process_relocs): Check if icf is enabled using new
12275 function.
12276 * gold.cc (queue_initial_tasks): Likewise.
12277 (queue_middle_tasks): Likewise.
12278 * object.cc (do_layout): Likewise.
12279 * symtab.cc (is_section_folded): Likewise.
12280 * main.cc (main): Likewise.
12281 * reloc.cc (Read_relocs::run): Likewise.
12282 (Sized_relobj::do_scan_relocs): Likewise.
12283 * icf.cc (is_function_ctor_or_dtor): New function.
12284 (Icf::find_identical_sections): Check if function is ctor or dtor when
12285 safe icf is chosen.
12286 * options.h (General_options::icf): Change option to be an enum.
12287 (Icf_status): New enum.
12288 (icf_enabled): New method.
12289 (icf_safe_folding): New method.
12290 (set_icf_status): New method.
12291 (icf_status_): New variable.
12292 * (options.cc) (General_options::finalize): Set icf_status_.
12293 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12294 icf_test and icf_keep_unique_test to use the --icf enum flag.
12295 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12296 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12297
f345227a
ST
122982009-10-12 Sriraman Tallam <tmsriram@google.com>
12299
12300 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12301 includes to gc.h and icf.h.
12302 * arm.cc: Include gc.h.
12303 * gold.cc: Likewise.
12304 * i386.cc: Likewise.
12305 * powerpc.cc: Likewise.
12306 * sparc.cc: Likewise.
12307 * x86_64.cc: Likewise.
12308 * gc.h: Include icf.h.
12309
1c7814ed
ILT
123102009-10-11 Ian Lance Taylor <iant@google.com>
12311
12312 * plugin.cc: Include "gold.h" before other header files.
12313
ae3b5189
CD
123142009-10-10 Chris Demetriou <cgd@google.com>
12315
12316 * options.h (Input_file_argument::Input_file_type): New enum.
12317 (Input_file_argument::is_lib_): Replace with...
12318 (Input_file_argument::type_): New member.
12319 (Input_file_argument::Input_file_argument): Take Input_file_type
12320 'type' rather than boolean 'is_lib' as second argument.
12321 (Input_file_argument::is_lib): Use type_.
12322 (Input_file_argument::is_searched_file): New function.
12323 (Input_file_argument::may_need_search): Handle is_searched_file.
12324 * options.cc (General_options::parse_library): Support -l:filename.
12325 (General_options::parse_just_symbols): Update for Input_file_argument
12326 changes.
12327 (Command_line::process): Likewise.
12328 * archive.cc (Archive::get_file_and_offset): Likewise.
12329 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12330 * script.cc (read_script_file, script_add_file): Likewise.
12331 * fileread.cc (Input_file::Input_file): Likewise.
12332 (Input_file::will_search_for): Handle is_searched_file.
12333 (Input_file::open): Likewise.
12334 * readsyms.cc (Read_symbols::get_name): Likewise.
12335 * testsuite/Makefile.am (searched_file_test): New test.
12336 * testsuite/Makefile.in: Regenerate.
12337 * testsuite/searched_file_test.cc: New file.
12338 * testsuite/searched_file_test_lib.cc: New file.
12339
f3048a1d
ILT
123402009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12341 Ian Lance Taylor <iant@google.com>
12342
12343 * descriptor.cc: Include <cstdio> and "binary-io.h".
12344 (Descriptors::open): Open the files in binary mode always.
12345 * script.cc (Lex::get_token): Treat \r as whitespace.
12346
d4780e57
ILT
123472009-10-09 Ian Lance Taylor <iant@google.com>
12348
12349 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12350
d9a893b8
ILT
123512009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12352 Ian Lance Taylor <iant@google.com>
12353
12354 * configure.ac: Check for readv function also.
12355 * fileread.cc (readv): Define if not HAVE_READV.
12356 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12357 does not exist.
12358 * config.in: Regenerate.
12359 * configure: Regenerate.
12360
c0a62865
DK
123612009-10-09 Doug Kwan <dougkwan@google.com>
12362
12363 * layout.cc (Layout::make_output_section): Call target hook to make
12364 ordinary output section.
12365 (Layout::finalize): Adjust parameter list of call the
12366 Target::may_relax().
12367 * layout.h (class Layout::section_list): New method.
12368 * merge.h (Output_merge_base::entsize): Change visibility to public.
12369 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12370 New methods.
12371 (Output_merge_string::do_is_string): New method.
12372 * object.cc (Sized_relobj::do_setup): renamed from
12373 Sized_relobj::set_up.
12374 * object.h (Sized_relobj::adjust_shndx,
12375 Sized_relobj::initializ_input_to_output_maps,
12376 Sized_relobj::free_input_to_output_maps): Change visibilities to
12377 protected.
12378 (Sized_relobj::setup): Virtualize.
12379 (Sized_relobj::do_setup): New method declaration.
12380 (Sized_relobj::invalidate_section_offset,
12381 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12382 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12383 * options.cc (parse_int): New function.
12384 * options.h (parse_int): New declaration.
12385 (DEFINE_int): New macro.
12386 (stub_group_size): New option.
12387 * output.cc (Output_section::Output_section): Initialize memebers
12388 merge_section_map_, merge_section_by_properties_map_,
12389 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12390 (Output_section::add_input_section): Handled deferred code-fill
12391 generation and remove an old comment.
12392 (Output_section::add_relaxed_input_section): New method definition.
12393 (Output_section::add_merge_input_section): Use merge section by
12394 properties map to speed to search. Update merge section maps
12395 as appropriate.
12396 (Output_section::build_relaxation_map): New method definition.
12397 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12398 Same.
12399 (Output_section::relax_input_section): Renamed to
12400 Output_section::convert_input_sections_to_relaxed_sections and change
12401 interface to take a vector of pointers to relaxed sections.
12402 (Output_section::find_merge_section,
12403 Output_section::find_relaxed_input_section): New method definitions.
12404 (Output_section::is_input_address_mapped,
12405 Output_section::output_offset, Output_section::output_address):
12406 Use output section data maps to speed up searching.
12407 (Output_section::find_starting_output_address): Add comments.
12408 (Output_section::do_write,
12409 Output_section::write_to_postprocessing_buffer): Do code-fill
12410 generation as appropriate.
12411 (Output_section::get_input_sections): Invalidate relaxed input section
12412 map.
12413 (Output_section::restore_states): Adjust type of checkpoint .
12414 Invalidate relaxed input section map.
12415 * output.h (Output_merge_base): New class declaration.
12416 (Input_section_specifier): New class defintion.
12417 (class Output_relaxed_input_section) Change base class to
12418 Output_section_data_build.
12419 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12420 base class initializer.
12421 (Output_section::add_relaxed_input_section): New method declaration.
12422 (Output_section::Input_section): Change visibility to protected.
2e702c99 12423 (Output_section::Input_section::relobj,
c0a62865
DK
12424 Output_section::Input_section::shndx): Handle relaxed input sections.
12425 Output_section::input_sections) Change visibility to protected. Also
12426 define overload to return a non-const pointer.
12427 (Output_section::Merge_section_properties): New class defintion.
12428 (Output_section::Merge_section_by_properties_map,
12429 Output_section::Output_section_data_by_input_section_map,
12430 Output_section::Relaxation_map): New types.
12431 (Output_section::relax_input_section): Rename method to
12432 Output_section::convert_input_sections_to_relaxed_sections and change
12433 interface to take a vector of relaxed section pointers.
12434 (Output_section::find_merge_section,
12435 Output_section::find_relaxed_input_section,
12436 Output_section::build_relaxation_map,
12437 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12438 New method declarations.
12439 (Output_section::merge_section_map_
12440 Output_section::merge_section_by_properties_map_,
12441 Output_section::relaxed_input_section_map_,
12442 Output_section::is_relaxed_input_section_map_valid_,
12443 Output_section::generate_code_fills_at_write_): New data members.
12444 * script-sections.cc
12445 (Output_section_element_input::set_section_addresses): Call
12446 current_data_size and addralign methods of relaxed input sections.
12447 (Orphan_output_section::set_section_addresses): Call current_data_size
12448 and addralign methods of relaxed input sections.
12449 * symtab.cc (Symbol_table::compute_final_value): Extract template
12450 from the body of Symbol_table::sized_finalize_symbol.
12451 (Symbol_table::sized_finalized_symbol): Call
12452 Symbol_table::compute_final_value.
12453 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12454 (Symbol_table::compute_final_value): New templated method declaration.
12455 * target.cc (Target::do_make_output_section): New method defintion.
12456 * target.h (Target::make_output_section): New method declaration.
12457 (Target::relax): Add more parameters for input objects, symbol table
12458 and layout. Adjust call to do_relax.
12459 (Target::do_make_output_section): New method declaration.
12460 (Target::do_relax): Add parameters for input objects, symbol table
12461 and layout.
12462
d446d6c4
ILT
124632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12464
12465 * pread.c: Include stdio.h.
12466
bc06c745
ILT
124672009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12468
12469 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12470 defined.
12471
75aea3d0
ILT
124722009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12473
12474 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12475 Change read_shndx type to unsigned int.
12476 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12477 int.
12478 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12479 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12480 Change read_shndx type to unsigned int.
12481 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12482 int.
12483 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12484 * layout.cc (Layout::create_symtab_sections): Cast the result of
12485 local_symcount * symsize to off_t in the gold_assert.
12486
be8fcb75
ILT
124872009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12488
12489 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12490 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12491 R_ARM_BASE_ABS.
12492 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12493 (Arm_relocate_functions::thm_abs5): New function.
12494 (Arm_relocate_functions::abs12): New function.
12495 (Arm_relocate_functions::abs16): New function.
12496 (Arm_relocate_functions::base_abs): New function.
12497 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12498 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12499 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12500 R_ARM_BASE_ABS.
12501 (Scan::global): Likewise.
12502 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12503 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12504 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12505 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12506 R_ARM_BASE_ABS.
12507
c2a122b6
ILT
125082009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12509
12510 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12511 (Arm_relocate_functions::movt_prel): New function.
12512 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12513 (Arm_relocate_functions::thm_movt_prel): New function.
12514 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12515 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12516 (Scan::global, Relocate::relocate): Likewise.
12517 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12518
c4aa1e2d
ILT
125192009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12520
12521 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12522 Incremental_checker.
12523 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12524 unsigned int.
12525 (class Incremental_inputs_header): New class.
12526 (Incremental_inputs_header_writer): Edit comment.
12527 (Incremental_inputs_entry): New class.
12528 (Incremental_inputs_entry_writer): Edit comment.
12529 (Sized_incremental_binary::do_find_incremental_inputs_section):
12530 Add *strtab_shndx parameter, fill it.
12531 (Sized_incremental_binary::do_check_inputs): New method.
12532 (Incremental_checker::can_incrementally_link_output_file): Use
12533 Sized_incremental_binary::check_inputs.
12534 (Incremental_inputs::report_command_line): Save command line in
12535 command_line_.
12536 * incremental.h:
12537 (Incremental_binary::find_incremental_inputs_section): New
12538 method.
12539 (Incremental_binary::do_find_incremental_inputs_section): Add
12540 strtab_shndx parameter.
12541 (Incremental_binary::do_check_inputs): New pure virtual method.
12542 (Sized_incremental_binary::do_check_inputs): Declare.
12543 (Incremental_checker::Incremental_checker): Add incremental_inputs
12544 parameter, use it to initialize incremental_inputs_.
12545 (Incremental_checker::incremental_inputs_): New field.
12546 (Incremental_checker::command_line): New method.
12547 (Incremental_checker::inputs): New method.
12548 (Incremental_checker::command_line_): New field.
12549
c549a694
ILT
125502009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12551
12552 * incremental.cc: Include <cstdarg> and "target-select.h".
12553 (vexplain_no_incremental): New function.
12554 (explain_no_incremental): New function.
12555 (Incremental_binary::error): New method.
12556 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12557 method.
12558 (make_sized_incremental_binary): New function.
12559 (open_incremental_binary): New function.
12560 (can_incrementally_link_file): Add checks if output is ELF and has
12561 inputs section.
12562 * incremental.h: Include "elfcpp_file.h" and "output.h".
12563 (Incremental_binary): New class.
12564 (Sized_incremental_binary): New class.
12565 (open_incremental_binary): Declare.
12566 * object.cc (is_elf_object): Use
12567 elfcpp::Elf_recognizer::is_elf_file.
12568 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12569 * output.h (Output_file::filesize): New method.
12570
fd3c5f0b
ILT
125712009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12572
12573 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12574 New function.
12575 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12576 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12577 function.
12578 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12579 function.
12580 (Arm_relocate_functions::movw_abs_nc): New function.
12581 (Arm_relocate_functions::movt_abs): New function.
12582 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12583 (Arm_relocate_functions::thm_movt_abs): New function.
12584 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12585 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12586 (Scan::global): Likewise.
12587 (Relocate::relocate): Likewise.
12588 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12589
7f5309a5
ILT
125902009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12591
12592 * arm.cc (Arm_relocate_functions::got_prel) New function.
12593 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12594 (Relocate::relocate): Likewise.
12595 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12596
364c7fa5
ILT
125972009-10-06 Ian Lance Taylor <iant@google.com>
12598
12599 * options.h (class General_options): Define
12600 split_stack_adjust_size parameter.
12601 * object.h (class Object): Add uses_split_stack_ and
12602 has_no_split_stack_ fields. Add uses_split_stack and
12603 has_no_split_stack accessor functions. Declare
12604 handle_split_stack_section.
12605 (class Reloc_symbol_changes): Define.
12606 (class Sized_relobj): Define Function_offsets. Declare
12607 split_stack_adjust, split_stack_adjust_reltype, and
12608 find_functions.
12609 * object.cc (Object::handle_split_stack_section): New function.
12610 (Sized_relobj::do_layout): Call handle_split_stack_section.
12611 * dynobj.cc (Sized_dynobj::do_layout): Call
12612 handle_split_stack_section.
12613 * reloc.cc (Sized_relobj::relocate_sections): Call
12614 split_stack_adjust for executable sections in split_stack
12615 objects. Pass reloc_map to relocate_section.
12616 (Sized_relobj::split_stack_adjust): New function.
12617 (Sized_relobj::split_stack_adjust_reltype): New function.
12618 (Sized_relobj::find_functions): New function.
12619 * target-reloc.h: Include "object.h".
12620 (relocate_section): Add reloc_symbol_changes parameter. Change
12621 all callers.
12622 * target.h (class Target): Add calls_non_split method. Declare
12623 do_calls_non_split virtual method. Declare match_view and
12624 set_view_to_nop.
12625 * target.cc: Include "elfcpp.h".
12626 (Target::do_calls_non_split): New function.
12627 (Target::match_view): New function.
12628 (Target::set_view_to_nop): New function.
12629 * gold.cc (queue_middle_tasks): Give an error if mixing
12630 split-stack and non-split-stack objects with -r.
12631 * i386.cc (Target_i386::relocate_section): Add
12632 reloc_symbol_changes parameter.
12633 (Target_i386::do_calls_non_split): New function.
12634 * x86_64.cc (Target_x86_64::relocate_section): Add
12635 reloc_symbol_changes parameter.
12636 (Target_x86_64::do_calls_non_split): New function.
12637 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12638 parameter.
12639 * powerpc.cc (Target_powerpc::relocate_section): Add
12640 reloc_symbol_changes parameter.
12641 * sparc.cc (Target_sparc::relocate_section): Add
12642 reloc_symbol_changes parameter.
12643 * configure.ac: Call AM_CONDITIONAL for the default target.
12644 * configure: Rebuild.
12645 * testsuite/Makefile.am (TEST_AS): New variable.
12646 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12647 (check_DATA): Add split_i386 and split_x86_64 files.
12648 (SPLIT_DEFSYMS): Define.
12649 (split_i386_[1234n].o): New targets.
12650 (split_i386_[124]): New targets.
12651 (split_i386_[1234r].stdout): New targets.
12652 (split_x86_64_[1234n].o): New targets.
12653 (split_x86_64_[124]): New targets.
12654 (split_x86_64_[1234r].stdout): New targets.
12655 (MOSTLYCLEANFILES): Add new executables.
12656 * testsuite/split_i386.sh: New file.
12657 * testsuite/split_x86_64.sh: New file.
12658 * testsuite/split_i386_1.s: New file.
12659 * testsuite/split_i386_2.s: New file.
12660 * testsuite/split_i386_3.s: New file.
12661 * testsuite/split_i386_4.s: New file.
12662 * testsuite/split_i386_n.s: New file.
12663 * testsuite/split_x86_64_1.s: New file.
12664 * testsuite/split_x86_64_2.s: New file.
12665 * testsuite/split_x86_64_3.s: New file.
12666 * testsuite/split_x86_64_4.s: New file.
12667 * testsuite/split_x86_64_n.s: New file.
12668 * testsuite/testfile.cc (Target_test): Update relocation_section
12669 function.
12670 * testsuite/Makefile.in: Rebuild.
12671
e8a9fcda
ILT
126722009-10-06 Ian Lance Taylor <iant@google.com>
12673
12674 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12675 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12676 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12677 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12678 the address on ldo_addrs_.
12679 (Target_i386::Relocate::fix_up_ldo): New function.
12680
e99daf92
ILT
126812009-10-06 Rafael Espindola <espindola@google.com>
12682
12683 * plugin.cc (add_input_library): New.
12684 (Plugin::load): Add add_input_library to tv.
12685 (Plugin_manager::add_input_file): Add the is_lib argument.
12686 (add_input_file): Update call to Plugin_manager::add_input_file.
12687 (add_input_library): New.
12688 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12689
966d4097
DK
126902009-09-30 Doug Kwan <dougkwan@google.com>
12691
12692 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12693 symbol and call Symbol::may_need_copy_reloc to determine if
12694 a copy reloc is needed.
12695 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12696 nocopyreloc is given in command line.
12697 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12698 given in command line.
12699 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12700 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12701 of the removed Target_i386::may_need_copy_reloc.
12702 * options.h (copyreloc): New option with default value false.
12703 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12704 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12705 instead of the removed Target_powerpc::may_need_copy_reloc.
12706 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12707 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12708 instead of the removed Target_sparc::may_need_copy_reloc.
12709 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12710 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12711 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12712 instead of the removed Target_x86_64::may_need_copy_reloc.
12713
029ba973
ILT
127142009-09-30 Ian Lance Taylor <iant@google.com>
12715
12716 * object.h (class Object): Remove target_ field, and target,
12717 sized_target, and set_target methods.
12718 (Object::sized_target): Remove.
12719 (class Sized_relobj): Update declarations. Remove sized_target.
12720 * object.cc (Sized_relobj::setup): Remove target parameter.
12721 Change all callers.
12722 (Input_objects::add_object): Don't do anything with the target.
12723 (make_elf_sized_object): Add punconfigured parameter. Change all
12724 callers. Set or test parameter target.
12725 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12726 Change all callers.
12727 * parameters.cc (Parameters::set_target): Change parameter type to
12728 be non-const.
12729 (Parameters::default_target): Remove.
12730 (set_parameters_target): Change parameter type to be non-const.
12731 (parameters_force_valid_target): New function.
12732 (parameters_clear_target): New function.
12733 * parameters.h (class Parameters): Update declarations. Remove
12734 default_target method. Add sized_target and clear_target
12735 methods. Change target_ to be non-const.
12736 (set_parameters_target): Update declaration.
12737 (parameters_force_valid_target): Declare.
12738 (parameters_clear_target): Declare.
12739 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12740 as NULL if we aren't searching.
12741 (Add_symbols::run): Don't check for compatible target.
12742 * fileread.cc (Input_file::open_binary): Call
12743 parameters_force_valid_target.
12744 * gold.cc (queue_middle_tasks): Likewise.
12745 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12746 set_target on object.
12747 * dynobj.h (class Sized_dynobj): Update declarations.
12748 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12749 make_elf_object returns NULL.
12750 (Archive::include_member): Don't check whether object target is
12751 compatible.
12752 * output.cc (Output_section::add_input_section): Get target from
12753 parameters.
12754 (Output_section::relax_input_section): Likewise.
12755 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12756 parameters.
12757 (Sized_relobj::do_scan_relocs): Likewise.
12758 (Sized_relobj::relocate_sections): Likewise.
12759 * resolve.cc (Symbol_table::resolve): Likewise.
12760 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12761 parameter. Change all callers.
12762 (Symbol_table::add_from_object): Get target from parameters.
12763 (Symbol_table::add_from_relobj): Don't check object target.
12764 (Symbol_table::add_from_dynobj): Likewise.
12765 (Symbol_table::define_special_symbol): Get target from
12766 parameters.
12767 * symtab.h (class Symbol_table): Update declaration.
12768 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12769 parameter. Change all callers. Clear parameter target.
12770 (Binary_test): Test target here.
12771 * testsuite/object_unittest.cc (gold_testsuite): Remove
12772 target_test_pointer parameter. Change all callers.
12773 (Object_test): Test target here.
12774
a6a22b83
ILT
127752009-09-26 Ian Lance Taylor <iant@google.com>
12776
12777 * testsuite/initpri1.c: Don't try to use constructor priorities if
12778 compiling with gcc before 4.3.
12779
6a8f49fe
ILT
127802009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12781
12782 * testsuite/retain_symbols_file_test.sh (check_present): Change
12783 output file name to retain_symbols_file_test.stdout.
12784 (check_absent): Likewise.
12785
8c604651
CS
127862009-09-18 Craig Silverstein <csilvers@google.com>
12787
12788 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12789 * options.cc: Include <cerrno> and <fstream>.
12790 (General_options::finalize): Parse -retain-symbols-file tag.
12791 * options.h: New flag.
12792 (General_options): New method should_retain_symbol, new
12793 variable symbols_to_retain.
12794 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12795 should_retain_symbol map.
12796 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12797 * testsuite/Makefile.in: Regenerate.
12798 * testsuite/retain_symbols_file_test.sh: New file.
12799
ca58b19f
NC
128002009-09-18 Nick Clifton <nickc@redhat.com>
12801
12802 * po/es.po: Updated Spanish translation.
12803
20e6d0d6
DK
128042009-09-17 Doug Kwan <dougkwan@google.com>
12805
12806 * debug.h (DEBUG_RELAXATION): New constant.
12807 (DEBUG_ALL): Add DEBUG_RELAXATION.
12808 (debug_string_to_enum): Add relaxation debug option.
12809 * layout.cc
12810 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12811 Layout::Relaxation_debug_check::read_sections,
12812 Layout::Relaxation_debug_check::read_sections): New method definitions.
12813 (Layout::Layout): Initialize data members
12814 record_output_section_data_from_scrips_,
12815 script_output_section_data_list_ and relaxation_debug_check_.
12816 (Layout::save_segments, Layout::restore_segments,
12817 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12818 Layout::relaxation_loop_body): New method definitions.
12819 (Layout::finalize): Support relaxation. Move section layout code to
12820 Layout::relaxation_loop_body.
12821 (Layout::set_asection_address_from_script): Move code for orphan
12822 section placement out.
12823 (Layout::place_orphan_sections_in_script): New method definition.
12824 * layout.h (Output_segment_headers, Output_file_header):
12825 New forward class declarations.
12826 (Layout::~Layout): Define.
12827 (Layout::new_output_section_data_from_script): New method definition.
12828 (Layout::place_orphan_sections_in_script): New method declaration.
12829 (Layout::Segment_states): New type declaration.
12830 (Layout::save_segments, Layout::restore_segments,
12831 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12832 Layout::relaxation_loop_body): New method declarations.
12833 (Layout::Output_section_data_list): New type declaration.
12834 (Layout::Relaxation_debug_check): New class definition.
12835 (Layout::record_output_section_data_from_script_,
12836 Layout::script_output_section_data_list_, Layout::segment_states_,
12837 Layout::relaxation_debug_check_): New data members.
12838 * output.cc: (Output_section_headers::do_size): New method definition.
12839 (Output_section_headers::Output_section_headers): Move size
12840 computation to Output_section_headers::do_size.
12841 (Output_segment_headers::do_size): New method definition.
e1df38aa 12842 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12843 Output_file_header::do_size and call it.
12844 (Output_file_header::do_size): New method definition.
12845 (Output_data_group::Output_data_group): Adjust call to
12846 Output_section_data.
12847 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12848 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12849 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12850 RELAXED_INPUT_SECTION_CODE.
12851 (Output_section::Output_section): Initialize data member checkpoint_.
12852 (Output_section::~Output_section): Delete checkpoint object pointed
12853 by checkpoint_.
12854 (Output_section::add_input_section): Always add an Input_section if
12855 relaxing.
12856 (Output_section::add_merge_input_section): Add assert.
12857 (Output_section::relax_input_section): New method definition.
12858 (Output_section::set_final_data_size): Set load address to zero for
12859 an unallocated section.
12860 (Output_section::do_address_and_file_offset_have_reset_values):
12861 New method definition.
12862 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12863 Handle relaxed input section.
12864 (Output_section::sort_attached_input_sections): Checkpoint input
12865 section list lazily.
12866 (Output_section::get_input_sections): Change type of input_sections to
12867 list of Simple_input_section pointers. Checkpoint input section list
12868 lazily. Also handle relaxed input sections.
12869 (Output_section::add_input_section_for_script): Take a reference to
12870 a Simple_input_section object instead of Relobj pointer and section
12871 index as parameter. Handle relaxed input sections.
12872 (Output_section::save_states, Output_section::restore_states): New
12873 method definitions.
12874 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12875 (Output_data::is_data_size_fixed): New method definition.
12876 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12877 if it is fixed.
12878 (Output_data::address_and_file_offset_have_reset_values): New method
12879 definition.
12880 (Output_data::do_address_and_file_offset_have_reset_values): New method
12881 definition.
12882 (Output_data::set_data_size): Check that data size is not fixed.
12883 (Output_data::fix_data_size): New method definition.
12884 (Output_data::is_data_size_fixed_): New data member.
12885 (Output_section_headers::set_final_data_size): New method definition.
12886 (Output_section_headers::do_size): New method declaration.
12887 (Output_segment_headers::set_final_data_size): New method definition.
12888 (Output_segment_headers::do_size): New method declaration.
12889 (Output_file_header::set_final_data_size)::New method definition.
12890 (Output_file_header::do_size)::New method declaration.
12891 (Output_section_data::Output_section_data): Add new parameter
12892 is_data_size_fixed and use it to fix data size.
12893 (Output_data_const::Output_data_const): Adjust call to base class
12894 constructor and fix data size.
12895 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12896 base class constructor and fix data size.
12897 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12898 base class constructor and fix data size.
12899 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12900 class constructor and fix data size.
12901 (Output_data_group::set_final_data_size): New method definition.
12902 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12903 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12904 class constructor and fix data size.
12905 (Output_relaxed_input_section): New class definition.
12906 (Output_section::Simple_input_section): New class definition.
12907 (Output_section::get_input_sections): Adjust parameter list.
12908 (Output_section::add_input_section_for_script): Same.
12909 (Output_section::save_states, Output_section::restore_states,
12910 Output_section::do_address_and_file_offset_have_reset_values,
12911 (Output_section::Input_section::Input_section): Handle
12912 RELAXED_INPUT_SECTION_CODE. Add new overload for
12913 Output_relaxed_input_section.
12914 (Output_section::Input_section::is_input_section,
12915 Output_section::Input_section::set_output_section): Handle relaxed
12916 input section.
12917 (Output_section::Input_section::is_relaxed_input_section,
12918 Output_section::Input_section::output_section_data,
12919 Output_section::Input_section::relaxed_input_section): New method
12920 definitions.
12921 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12922 value.
12923 (Output_section::Input_section::u1_): Update comments.
12924 (Output_section::Input_section::u2_): Add new union member poris.
12925 (Output_section::Checkpoint_output_section): New classs definition.
12926 (Output_section::relax_input_section): New method declaration.
12927 (Output_section::checkpoint_): New data member.
12928 (Output_segment): Update comments.
12929 (Output_segment::Output_segment): Un-privatize copy constructor.
12930 (Output_segment::operator=): Un-privatize.
12931 * script-sections.cc (Output_section_element::Input_section_list):
12932 Change element type to Output_section::Simple_input_section.
12933 (Output_section_element_dot_assignment::set_section_addresses):
12934 Register output section data for relaxation clean up.
12935 (Output_data_exression::Output_data_expression): Adjust call to base
12936 constructor to fix data size.
12937 (Output_section_element_data::set_section_addresses): Register
12938 Output_data_expression object for relaxation clean up.
12939 (struct Input_section_info): Replace Relobj pointer and section index
12940 pair with Output_section::Simple_input_section and Convert struct to a
12941 class.
12942 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12943 Input_section_info data member to use accessors.
20e6d0d6
DK
12944 (Output_section_element_input::set_section_addresses): Use layout
12945 parameter. Adjust code to use Output_section::Simple_input_section
12946 and Input_secction_info classes. Register filler for relaxation
12947 clean up.
12948 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12949 and section index pair with Output_section::Simple_input_section
12950 class. Adjust code accordingly.
12951 (Phdrs_element::release_segment): New method definition.
12952 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12953 segment list.
12954 (Script_sections::release_segments): New method definition.
12955 * gold/script-sections.h (Script_sections::release_segments): New
12956 method declaration.
12957 * gold/target.h (Target::may_relax, Target::relax,
12958 Target::do_may_relax, Target::do_relax): New method definitions.
12959
5e445df6
ILT
129602009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12961
12962 * arm.cc (has_signed_unsigned_overflow): New function.
12963 (Arm_relocate_functions::abs8): New function.
12964 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12965 (Target_arm::Scan::global): Likewise.
12966 (Target_arm::relocate::relocate): Likewise.
12967 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12968 Likewise.
12969
8c604651 129702009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12971
12972 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12973 * testsuite/Makefile.in: Regenerate.
12974
1e9cc1c2
NC
129752009-09-11 Nick Clifton <nickc@redhat.com>
12976
12977 * po/gold.pot: Updated by the Translation project.
12978
6a89f575
CC
129792009-09-08 Cary Coutant <ccoutant@google.com>
12980
12981 * output.cc (Output_file::open): Add execute permission to empty file.
12982 * testsuite/Makefile.am (permission_test): New test.
12983 * testsuite/Makefile.in: Regenerate.
12984
fdcac5af
ILT
129852009-09-02 Ian Lance Taylor <iant@google.com>
12986
12987 * output.cc (Output_file::resize): Call map_no_anonymous rather
12988 than map.
12989
44453f85
ILT
129902009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12991
12992 * gold.cc: Include "incremental.h".
12993 (queue_initial_tasks): Call Incremental_checker methods.
12994 * incremental.cc: Include "output.h".
12995 (Incremental_checker::can_incrementally_link_output_file): New
12996 method.
12997 * incremental.h (Incremental_checker): New class.
12998
12999 * output.cc (Output_file::open_for_modification): New method.
13000 (Output_file::map_anonymous): Changed return type to bool. Record
13001 map in base_ field.
13002 (Output_file::map_no_anonymous): New method, broken out of map.
13003 (Output_file::map): Use map_no_anonymous and map_anonymous.
13004 * output.h (class Output_file): Update declarations.
13005
293c1386
CC
130062009-08-24 Cary Coutant <ccoutant@google.com>
13007
13008 * options.h (Command_line::Pre_options): New class.
13009 (Command_line::pre_options): New member.
13010 * options.cc (gold::options::ready_to_register): New variable.
13011 (One_option::register_option): Do nothing if not registering options.
13012 Assert if same short option registered twice.
13013 (General_options::General_options): Turn off option registration when
13014 done constructing.
13015 (Command_line::Pre_options::Pre_options): New constructor.
13016
f773f3d2
CC
130172009-08-24 Cary Coutant <ccoutant@google.com>
13018
06a73cfe
CC
13019 * options.h (General_options::no_keep_memory): Remove incorrect
13020 short option.
f773f3d2 13021
a15af8e2
RW
130222009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13023
13024 * Makefile.am (am__skiplex, am__skipyacc): New.
13025 * Makefile.in: Regenerate.
13026
c462b41b
RW
130272009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13028
14ec8efd
RW
13029 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13030 (INCLUDES): ... this.
13031 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13032 (AM_CPPFLAGS): Renamed from ...
13033 (INCLUDE): ... this.
13034 * Makefile.in, testsuite/Makefile.in: Regenerate.
13035
81ecdfbb
RW
13036 * Makefile.in: Regenerate.
13037 * aclocal.m4: Likewise.
13038 * config.in: Likewise.
13039 * configure: Likewise.
13040 * testsuite/Makefile.in: Likewise.
13041
c462b41b
RW
13042 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13043 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13044 * Makefile.in: Regenerate.
13045 * testsuite/Makefile.in: Regenerate.
13046
2da73f13
CC
130472009-08-19 Cary Coutant <ccoutant@google.com>
13048
13049 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13050 symbols in shared libraries overridden by hidden or internal symbols
13051 in the main program.
13052
2db70501
CD
130532009-08-19 Chris Demetriou <cgd@google.com>
13054
13055 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13056 checking source file names in error messages.
13057
f733487b
DK
130582009-08-18 Doug Kwan <dougkwan@google.com>
13059
13060 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13061 an elcpp::Ehdr as parameter. Adjust call to set_target.
13062 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13063 an elfcpp::Ehdr as parameter.
13064 * object.cc (Object::set_target): Remove the version that looks up
13065 a target and sets it.
13066 (Sized_relobj::setup): Take a Target object instead of
13067 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13068 (make_elf_sized_object): Find target and ask target to
13069 make an ELF object.
13070 * object.h: (Object::set_target): Remove the version that looks up
13071 a target and sets it.
13072 (Sized_relobj::setup): Take a Target object instead of
13073 an elfcpp:Ehdr as parameter.
13074 * target.cc: Include dynobj.h.
13075 (Target::do_make_elf_object_implementation): New.
2e702c99 13076 (Target::do_make_elf_object): New.
f733487b
DK
13077 * target.h (Target::make_elf_object): New template declaration.
13078 (Target::do_make_elf_object): New method declarations.
13079 (Target::do_make_elf_object_implementation): New template declaration.
13080
cc70f101
ILT
130812009-08-14 Ian Lance Taylor <iant@google.com>
13082
13083 * gold.h (FUNCTION_NAME): Define.
13084 (gold_unreachable): Use FUNCTION_NAME.
13085
ef5e0cb1
ST
130862009-08-12 Sriraman Tallam <tmsriram@google.com>
13087
13088 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13089 symbol in the --keep-unique list is not found.
13090
48c187ce
ST
130912009-08-12 Sriraman Tallam <tmsriram@google.com>
13092
13093 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13094 been maked as --keep-unique.
13095 (Icf::unfold_section): New function.
13096 * icf.h (Icf::unfold_section): New function.
13097 * options.h (General_options::keep_unique): New option.
13098 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13099 * testsuite/Makefile.in: Regenerate.
13100 * testsuite/icf_keep_unique_test.sh: New file.
13101 * testsuite/icf_keep_unique_test.cc: New file.
13102
645afe0c
CC
131032009-08-12 Cary Coutant <ccoutant@google.com>
13104
13105 PR 10471
13106 * resolve.cc (Symbol_table::resolve): Check for references from
13107 dynamic objects to hidden and internal symbols.
13108 * testsuite/Makefile.am (hidden_test.sh): New test.
13109 * testsuite/Makefile.in: Regenerate.
13110 * testsuite/hidden_test.sh: New script.
13111 * testsuite/hidden_test_1.c: New test source.
13112 * testsuite/hidden_test_main.c: New test source.
13113
11af873f
DK
131142009-08-11 Doug Kwan <dougkwan@google.com>
13115
13116 * arm.cc: Update comments.
13117 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13118 segment to locate the .ARM.exidx section if present.
13119
b9f7d72d
DK
131202009-08-09 Doug Kwan <dougkwan@google.com>
13121
13122 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13123 patch.
13124
ddd3c53c
ST
131252009-08-07 Sriraman Tallam <tmsriram@google.com>
13126 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13127 compiler warnings.
13128
27721062
ST
131292009-08-06 Sriraman Tallam <tmsriram@google.com>
13130
13131 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13132 valid tls_segment only for non-debug-section relocations.
13133 * testsuite/Makefile.am: Add gc_tls_test.
13134 * testsuite/Makefile.in: Regenerate.
13135 * testsuite/gc_tls_test.cc: New file.
13136 * testsuite/gc_tls_test.sh: New file.
13137
ef15dade 131382009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13139
ef15dade
ST
13140 * icf.cc: New file.
13141 * icf.h: New file.
13142 * Makefile.am (CCFILES): Add icf.cc.
13143 (HFILES): Add icf.h
13144 * Makefile.in: Regenerate.
13145 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13146 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13147 section, symbol and addend information for the relocs.
13148 * gold.cc (queue_middle_tasks): Call identical code folding.
13149 * gold.h: Add defines for multimap.
13150 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13151 to the call of finalize_local_symbols.
13152 * main.cc (main): Create object of class Icf.
13153 * object.cc (Sized_relobj::do_layout): Allow this function to be
13154 called twice during icf.
13155 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13156 to sections marked as identical by icf.
13157 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13158 when available.
13159 (Sized_relobj::do_section_entsize): New function.
13160 * object.h (Object::section_entsize): New function.
13161 (Object::do_section_entsize): New pure virtual function.
13162 (Relobj::finalize_local_symbols): Add new parameter.
13163 (Relobj::do_section_entsize): New function.
13164 * options.h (General_options::icf): New option.
13165 (General_options::icf_iterations): New option.
13166 (General_options::print_icf_sections): New option.
13167 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13168 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13169 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13170 icf.
13171 * symtab.cc (Symbol_table::is_section_folded): New function.
13172 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13173 to sections marked as identical by icf.
13174 * symtab.h (Symbol_table::set_icf): New function.
13175 (Symbol_table::icf): New function.
13176 (Symbol_table::is_section_folded): New function.
13177 (Symbol_table::icf_): New data member.
13178 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13179 * testsuite/Makefile.am: Add commands to build icf_test.
13180 * testsuite/Makefile.in: Regenerate.
13181 * testsuite/icf_test.sh: New file.
13182 * testsuite/icf_test.cc: New file.
13183
c3b65ac4
CD
131842009-07-24 Chris Demetriou <cgd@google.com>
13185
13186 * layout.cc (is_compressible_debug_section): Fix incorrect
13187 comment about compressed section names.
13188
1caf2c51
ILT
131892009-07-20 Ian Lance Taylor <ian@airs.com>
13190
13191 PR 10419
13192 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13193
1ef4d87f
ILT
131942009-07-16 Ian Lance Taylor <iant@google.com>
13195
13196 PR 10400
13197 * layout.h: #include <map>.
13198 (class Kept_section): Change from struct to class. Add accessors
13199 and setters. Add section size to Comdat_group mapping. Change
13200 Comdat_group to std::map. Add is_comdat_ field. Add
13201 linkonce_size field in union.
13202 (class Layout): Update declaration of find_or_add_kept_section.
13203 Don't declare find_kept_object.
13204 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13205 parameter. Add object, shndx, is_comdat, and is_group_name
13206 parameters. Change all callers. Adjust for new Kept_section.
13207 (Layout::find_kept_object): Remove.
13208 * object.cc (Sized_relobj::include_section_group): Update use of
13209 Kept_section. Rename secnum to shndx. Only record
13210 Kept_comdat_section if sections are the same size.
13211 (Sized_relobj::include_linkonce_section): Update use of
13212 Kept_section. Only record Kept_comdat_section if sections are the
13213 same size. Set size of linkonce section.
13214 (Sized_relobj::map_to_kept_section): Update call to
13215 get_kept_comdat_section.
13216 * object.h (class Sized_relobj): Rename fields in
13217 Kept_comdat_section to drop trailing underscores; change object
13218 field to Relobj*. Change Kept_comdat_section_table to store
13219 struct rather than pointer.
13220 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13221 Add kept_object and kept_shndx parameters. Change all callers.
13222 (Sized_relobj::get_kept_comdat_section): Change return type to
13223 bool. Add kept_object and kept_shndx parameters. Change all
13224 callers.
13225 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13226 Layout::find_or_add_kept_section.
13227
37c3b7b0
ILT
132282009-07-09 Ian Lance Taylor <iant@google.com>
13229
13230 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13231 Reserve space in the hash table.
13232
98fa85cb
ILT
132332009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13234
13235 * fileread.cc (File_read::get_mtime): New method.
13236 * fileread.h (Timespec): New structure.
13237 (File_read::get_mtime): New method.
13238 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13239 Renamed from timestamp_nsec.
13240 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13241 Elf_Xword.
e1df38aa 13242 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13243 timestamp_nsec.
e1df38aa 13244 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13245 (Incremental_inputs::report_obejct): Save mtime; style fix.
13246 (Incremental_inputs::report_script): Save mtime; style fix.
13247 (Incremental_inputs::finalize_inputs): Style fix.
13248 (Incremental_inputs::finalize): Style fix.
13249 (Incremental_inputs::create_input_section_data): Store inputs
13250 mtime.
13251 * incremental.h (Incremental_inputs::report_script): Add mtime
13252 argument.
13253 (Incremental_inputs::Input_info::Input_info): Intialize only one
13254 union member.
13255 (Incremental_inputs::Input_info::archive): Move to nameless
13256 union.
13257 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13258 (Incremental_inputs::Input_info::script): Move to nameless union.
13259 (Incremental_inputs::mtime): New field.
13260 * script.cc (read_input_script): Pass file mtime to
13261 Incremental_input.
13262 * script.h (Script_info::inputs): Style fix.
13263
c9d70757
ILT
132642009-07-01 Ian Lance Taylor <ian@airs.com>
13265
13266 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13267 instead of 32.
13268
9c547ec3
ILT
132692009-06-24 Ian Lance Taylor <iant@google.com>
13270
13271 PR 10156
13272 * layout.cc (Layout::choose_output_section): If we find an
13273 existing section, update the flags.
13274 (Layout::create_notes): New function, broken out of
13275 Layout::finalize.
13276 (Layout::finalize): Don't create note sections.
13277 (Layout::create_note): Don't crash if linker script discards
13278 section.
13279 (Layout::create_gold_note): Likewise.
13280 (Layout::create_build_id): Likewise. Don't set
13281 after_input_sections on the section.
13282 (Layout::create_executable_stack_info): Remove target parameter.
13283 Change caller.
13284 * layout.h (class Layout): Declare create_notes. Update
13285 declaration of create_executable_stack_info.
13286 * gold.cc (queue_middle_tasks): Call create_notes.
13287 * output.cc (Output_section::update_flags_for_input_section): Move
13288 here from output.h. If SHF_ALLOC flag is newly set, mark address
13289 invalid.
13290 * output.h (Output_data::mark_address_invalid): New function.
13291 (class Output_section): Only declare, not define,
13292 update_flags_for_input_section. Remove set_flags.
13293
55458500
ILT
132942009-06-24 Ian Lance Taylor <iant@google.com>
13295
13296 * script-sections.cc (Output_section_definition::
13297 set_section_addresses): Rename shadowing local load_address to
13298 laddr.
13299
1307d6cd
ILT
133002009-06-24 Ian Lance Taylor <iant@google.com>
13301
13302 PR 10244
13303 * reloc.cc (relocate_sections): Skip empty relocation sections.
13304
ec3f783e
ILT
133052009-06-23 Ian Lance Taylor <iant@google.com>
13306
13307 PR 10156
13308 * layout.cc (Layout::create_note): Use choose_output_section
13309 rather than make_output_section.
13310
459c9f1c
ILT
133112009-06-23 Ian Lance Taylor <iant@google.com>
13312
13313 PR 10237
13314 * options.cc (General_options::parse_V): Set printed_version_.
13315 (General_options::General_options): Initialize printed_version_.
13316 * options.h (class General_options): Add printed_version_ field.
13317 * gold.cc (queue_initial_tasks): If there are no input files,
13318 don't give a fatal error if we printed the version information.
13319 (queue_middle_tasks): If using -r with a shared object, give a
13320 fatal error rather than an ordinary error.
13321
1518dc8f
ILT
133222009-06-23 Ian Lance Taylor <iant@google.com>
13323
13324 PR 10219
13325 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13326 (Layout::make_output_section): Set have_stabstr_section_ if we see
13327 a .stab*str section.
13328 (Layout::finalize): Call link_stabs_sections.
13329 (Layout::link_stabs_sections): New file.
13330 * layout.h (class Layout): Add have_stabstr_section_ field.
13331 Declare link_stabs_sections.
13332
3d857b98
DK
133332009-06-23 Doug Kwan <dougkwan@google.com>
13334
13335 * Makefile.am (libgold_a_LIBADD): New.
13336 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13337 * Makefile.in: Regenerate.
3d857b98
DK
13338 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13339 * configure: Regenerate.
13340 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13341 * fileread.cc: Include sys/state.h
13342 * gold.h: Declare memmem and strndup if found missing.
13343 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13344
0639a6f6
ILT
133452009-06-23 Ian Lance Taylor <iant@google.com>
13346
13347 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13348 * configure: Rebuild.
13349
8d63875c
ILT
133502009-06-23 Ian Lance Taylor <iant@google.com>
13351
13352 PR 10147
13353 * object.cc (Object::section_contents): Don't try to get a view if
13354 the section has length zero.
13355 (Object::handle_gnu_warning_section): If the section is empty, use
13356 the name of the section as the warning.
13357
f7c8a183
ILT
133582009-06-23 Ian Lance Taylor <iant@google.com>
13359
13360 PR 10133
13361 * stringpool.h (class Stringpool_template): Add optimize_ field.
13362 (Stringpool_template::set_optimize): New function.
13363 * stringpool.cc (Stringpool_template::Stringpool_template):
13364 Initialize optimize_ field.
13365 (Stringpool_template::set_string_offsets): Test local optimize
13366 fild rather than parameter.
13367 * layout.cc (Layout::Layout): Call set_optimize on the section
13368 name stringpool.
13369
e6a307ba
ILT
133702009-06-22 Ian Lance Taylor <iant@google.com>
13371
13372 PR 10030
13373 * yyscript.y: Parse TARGET.
13374 * script.cc (script_set_target): New function.
13375 * script-c.h (script_set_target): Declare.
13376 * options.cc (General_options::string_to_object_format): Rename
13377 from string_to_object_format in anonymous namespace. Change
13378 callers.
13379 * options.h (class General_options): Declare
13380 string_to_object_format.
13381
3ee173de
ILT
133822009-06-22 Ian Lance Taylor <iant@google.com>
13383
13384 * script-sections.cc (Script_sections::create_segments): Don't put
13385 program headers in a PT_LOAD segment if -n or -N.
13386
133872009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13388
13389 PR 10141
13390 * options.h (class General_options): Add -z lazy and -z now. Sort
13391 -z options into alphabetical order.
13392 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13393
cd6739a1 133942009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13395
13396 * layout.cc (Layout::make_output_section): Call
13397 Target::new_output_section.
13398 (Layout::attach_allocated_section_to_segment): Put large section
13399 sections in a separate load segment with the large segment flag
13400 set.
13401 (Layout::segment_precedes): Sort large data segments after other
13402 load segments.
13403 (align_file_offset): New static function.
13404 (Layout::set_segment_offsets): Use align_file_offset.
13405 * output.h (class Output_section): Add is_small_section_ and
13406 is_large_section_ fields.
13407 (Output_section::is_small_section): New function.
13408 (Output_section::set_is_small_section): New function.
13409 (Output_section::is_large_section): New function.
13410 (Output_section::set_is_large_section): New function.
13411 (Output_section::is_large_data_section): New function.
13412 (class Output_segment): Add is_large_data_segment_ field.
13413 (Output_segment::is_large_data_segment): New function.
13414 (Output_segment::set_is_large_data_segment): New function.
13415 * output.cc (Output_section::Output_section): Initialize new
13416 fields.
13417 (Output_segment::Output_segment): Likewise.
13418 (Output_segment::add_output_section): Add assertion that large
13419 data sections always go in large data segments. Force small data
13420 sections to the end of the list of data sections. Force small BSS
13421 sections to the start of the list of BSS sections. For large BSS
13422 sections to the end of the list of BSS sections.
13423 * symtab.h (class Symbol): Declare is_common_shndx.
13424 (Symbol::is_defined): Check Symbol::is_common_shndx.
13425 (Symbol::is_common): Likewise.
13426 (class Symbol_table): Define enum Commons_section_type. Update
13427 declarations. Add small_commons_ and large_commons_ fields.
13428 * symtab.cc (Symbol::is_common_shndx): New function.
13429 (Symbol_table::Symbol_table): Initialize new fields.
13430 (Symbol_table::add_from_object): Put small and large common
13431 symbols in the right list.
13432 (Symbol_table::sized_finalized_symbol): Check
13433 Symbol::is_common_shndx.
13434 (Symbol_table::sized_write_globals): Likewise.
13435 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13436 common symbol lists. Don't call do_allocate_commons_list if the
13437 list is empty.
13438 (Symbol_table::do_allocate_commons_list): Remove is_tls
13439 parameter. Add comons_section_type parameter. Change all
13440 callers. Handle small and large common symbols.
13441 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13442 Symbol::is_common_shndx.
13443 * resolve.cc (symbol_to_bits): Likewise.
13444 * target.h (Target::small_common_shndx): New function.
13445 (Target::small_common_section_flags): New function.
13446 (Target::large_common_shndx): New function.
13447 (Target::large_common_section_flags): New function.
13448 (Target::new_output_section): New function.
13449 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13450 small_common_section_flags, and large_common_section_flags
13451 fields.
13452 (Target::do_new_output_section): New virtual function.
13453 * arm.cc (Target_arm::arm_info): Initialize new fields.
13454 * i386.cc (Target_i386::i386_info): Likewise.
13455 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13456 Likewise.
13457 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13458 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13459 (Target_x86_64::do_new_output_section): New function.
13460 * configure.ac: Define conditional MCMODEL_MEDIUM.
13461 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13462 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13463 (large_LDFLAGS): Define.
13464 * testsuite/large.c: New file.
13465 * testsuite/testfile.cc (Target_test::test_target_info):
13466 Initialize new fields.
13467 * configure, testsuite/Makefile.in: Rebuild.
13468
bb04269c
DK
134692009-06-05 Doug Kwan <dougkwan@google.com>
13470
13471 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13472 * Makefile.in: Regenerate.
bb04269c
DK
13473 * i386.cc (class Target_i386): Define new virtual method to
13474 override do_is_local_label_name in parent.
13475 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13476 local symbols if --discard-locals or -X is given.
13477 * options.h (class General_options): Declare new options
13478 '--discard-locals' and '-X' for discarding locals.
13479 * target.h (class Target): Define new methods is_local_label_name.
13480 Declare new virtual method do_is_local_label_name.
13481 * target.cc: New file.
13482 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13483 (check_SCRIPTS): Add discard_locals_test.sh.
13484 (check_DATA): Add discard_local_tests.syms.
13485 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13486 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13487 * testsuite/Makefile.in: Regenerate.
13488 * testsuite/discard_locals_test.c: New file.
13489 * testsuite/discard_locals_test.sh: Same.
13490
805bb01c
DK
134912009-06-05 Doug Kwan <dougkwan@google.com>
13492
13493 * object.cc (Sized_relobj::Sized_relobj): Initialize
13494 discarded_eh_frame_shndx_ to -1U.
13495 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13496 section.
13497 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13498 a discarded .eh_frame section.
13499 (Sized_relobj::do_finalize_local_symbols): Ditto.
13500 * object.h (class Sized_relobj): Declare new member
13501 discarded_eh_frame_shndx_.
13502 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13503 (local_labels_test.o, local_labels_test): New rules.
13504 * testsuite/Makefile.in: Regenerate.
13505
1dcd334d
DK
135062009-06-04 Doug Kwan <dougkwan@google.com>
13507
13508 * layout.cc (Layout::section_name_mapping): Add mapping for
13509 special ARM sections.
13510
96d49306
DK
135112009-06-03 Doug Kwan <dougkwan@google.com>
13512
13513 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13514 (utils::has_overflow): Same.
13515
dff16297
ILT
135162009-06-03 Ian Lance Taylor <iant@google.com>
13517
13518 * layout.cc (Layout::section_name_mapping): New array, replacing
13519 Layout::linkonce_mapping.
13520 (Layout::section_name_mapping_count): New variable, replacing
13521 Layout::linkonce_mapping_count.
13522 (Layout::linkonce_output_name): Remove.
13523 (Layout::output_section_name): Rewrite.
13524 * layout.h (class Layout): Rename Linkonce_mapping to
13525 Section_name_mapping, linkonce_mapping to section_name_mapping,
13526 linkonce_mapping_count to section_name_mapping_count. Don't
13527 declare linkonce_output_name.
13528
c121c671
DK
135292009-06-03 Doug Kwan <dougkwan@google.com>
13530
13531 * gold/arm.cc (namespace utils): New.
13532 (Target_arm::reloc_is_non_pic): Define new method.
13533 (class Arm_relocate_functions): New.
13534 (Target_arm::Relocate::relocate): Handle relocation types used by
13535 Android.
13536
07800fab
ILT
135372009-06-03 Ian Lance Taylor <iant@google.com>
13538
13539 * arm.cc (Target_arm::scan::global): Use || instead of |.
13540
c121c671
DK
135412009-06-02 Doug Kwan <dougkwan@google.com>
13542
13543 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13544 issued_non_pic_error_.
13545 (class Target_arm::Scan): Declare new method check_non_pic.
13546 Define new method symbol_needs_plt_entry.
13547 Declare new data member issued_non_pic_error_.
13548 (class Target_arm::Relocate): Declare new method
13549 should_apply_static_reloc.
13550 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13551 (Target_arm::Scan::check_non_pic): Define new method.
13552 (Target_arm::Scan::local): Handle a small subset of reloc types used
13553 by Android.
13554 (Target_arm::Scan::local): Same.
13555 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13556
b19b0c6d
ILT
135572009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13558
13559 * incremental.cc (Incremental_inputs::report_command_line): Filter
13560 out --incremental-* options.
13561
94cdfcff
DK
135622009-05-29 Doug Kwan <dougkwan@google.com>
13563
13564 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13565 template class.
13566 (class Target_arm): Update comment.
13567 (Target_arm::Target_arm): Initialize new data members GOT_,
13568 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13569 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13570 and Target_arm::rel_dyn_section.
13571 Declare new_enum Target_arm::Got_type.
13572 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13573 and DYNBSS_.
13574 Update commments for member do_dynsym_value.
13575 (Target_arm::got_size, Target_arm::plt_section,
13576 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13577 new methods inside class defintion.
13578 (Target_arm::got_section): Define new method.
13579 (Target_arm::rel_dyn_section): Same.
13580 (Output_data_plt_arm): New template class.
13581 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13582 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13583 (Output_data_plt_arm::add_entry): Same.
13584 (Output_data_plt_arm::first_plt_entry): Define new
13585 static data member for PLT instruction template.
13586 (Output_data_plt_arm::plt_entry): Same.
13587 (Output_data_plt_arm::do_write): Define new method.
13588 (Target_arm::make_plt_entry): Same.
13589 (Target_arm::do_finalize_sections): Same.
13590 (Target_arm::do_dynsym_value): Same.
13591
4a657b0d
DK
135922009-05-28 Doug Kwan <dougkwan@google.com>
13593
13594 * Makefile.am (TARGETSOURCES): Add arm.cc.
13595 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13596 * Makefile.in: Regenerate.
13597 * arm.cc: New file.
13598 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13599
e7ae8c36
DK
136002009-05-26 Doug Kwan <dougkwan@google.com>
13601
13602 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13603 (General_options::check_excluded_libs): Strip off directories in
13604 archive name before matching like GNU ld does.
13605 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13606 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13607 (exclude_libs_test_LDFLAGS): Add linker option
13608 -Wl,--exclude-libs,libexclude_libs_test_3
13609 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13610 an explicit archive without using -l.
13611 (alt/libexclude_libs_test_3.a): New make rule.
13612 * testsuite/Makefile.in: Regenerate.
13613 * testsuite/exclude_libs_test.c : Declare lib3_default().
13614 (main): Call it.
13615 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13616 * exclude_libs_test_3.c: New file.
13617
f12e7348
NC
136182009-05-26 Nick Clifton <nickc@redhat.com>
13619
13620 * po/id.po: New Indonesian translation.
13621 * po/gold.pot: Updated template file.
13622
4daadc0d
ST
136232009-05-22 Sriraman Tallam <tmsriram@google.com>
13624
e1df38aa 13625 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13626 gc_comdat_test files. Add -Wl,--gc-sections to build
13627 gc_comdat_test.
13628 * testsuite/Makefile.in: Regenerate.
13629 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13630
531813ad
ST
136312009-05-21 Sriraman Tallam <tmsriram@google.com>
13632
13633 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13634 kept comdat section was garbage collected.
13635 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13636 * testsuite/Makefile.in: Regenerate.
13637 * testsuite/gc_comdat_test.sh: New file.
13638 * testsuite/gc_comdat_test_1.cc: New file.
13639 * testsuite/gc_comdat_test_2.cc: New file.
13640
65514900
CC
136412009-05-19 Doug Kwan <dougkwan@google.com>
13642
13643 * archive.cc (Archive::Archive): Move constructor from archive.h
13644 to here. Initialize no_export_.
13645 (Archive::get_elf_object_for_member): Set no_export flag of object.
13646 * archive.h (Archive::Archive): Move constructor body to
13647 archive.cc.
13648 (Archive::no_export): New method.
13649 (Archive::no_export_): New field.
13650 * object.h (Object::Object): Initialize no_export_ to false.
13651 (Object::no_export, Object::set_no_export): New methods.
13652 (Object::no_export_): New field.
13653 * options.cc (General_options::parse_exclude_libs): New method.
13654 (General_options::check_excluded_libs) Same.
13655 * options.h (exclude_libs): New option.
13656 (General_options::check_excluded_libs): New method declaration.
13657 (General_options::excluded_libs_): New field.
13658 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13659 default or protected visibility if an object has no-export flag set.
13660 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13661 (check_SCRIPTS): Add exclude_libs_test.sh.
13662 (check_DATA): Add exclude_libs_test.syms.
13663 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13664 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13665 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13666 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13667 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13668 libexclude_libs_test_2.a): New rules.
13669 * testsuite/Makefile.in: Regenerate.
13670 * testsuite/exclude_libs_test.c: New file.
13671 * testsuite/exclude_libs_test.sh: Ditto.
13672 * testsuite/exclude_libs_test_1.c: Ditto.
13673 * testsuite/exclude_libs_test_2.c: Ditto.
13674
1b77ea50
ILT
136752009-05-15 Ian Lance Taylor <iant@google.com>
13676
13677 * configure.ac: Check for declarations for cases where libiberty.h
13678 checks HAVE_DECL_xxx.
13679 * configure, config.in: Rebuild.
13680
072fe7ce
ILT
136812009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13682
13683 * gold.h (Incremental_argument_list): Remove (invalid) forward
13684 declaration.
13685 * incremental.cc (Incremental_inputs::report_achive): New method.
13686 (Incremental_inputs::report_object): New method.
13687 (Incremental_inputs::report_script): New method.
13688 (Incremental_inputs::finalize_inputs): New method.
13689 (Incremental_inputs::finalize): Call finalize_inputs().
13690 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13691 Create inputs entries.
13692 * incremental.h (Incremental_input_type): New enum.
13693 (Incremental_inputs::Incremental_input): Initialize new fields.
13694 (Incremental_inputs::report_inputs): New method.
13695 (Incremental_inputs::report_achive): New method.
13696 (Incremental_inputs::report_object): New method.
13697 (Incremental_inputs::report_script): New method.
13698 (Incremental_inputs::finalize_inputs): New method.
13699 (Incremental_inputs::Input_info): New struct.
13700 (Incremental_inputs::Input_info_map): New typedef.
13701 (Incremental_inputs::lock_): New field.
13702 (Incremental_inputs::Inputs_): New field.
13703 (Incremental_inputs::Inputs_map): New field.
13704 * main.cc (main): Call Incremental_input::report_inputs.
13705 * options.h (Input_argument_list): Typedef moved from
13706 Input_arguments.
13707 (Input_file_group::Files): Remove, use ::Input_argument_list.
13708 (Input_file_group::Input_argument_list): Remove, use
13709 ::Input_argument_list.
13710 * plugin.cc (Plugin_manager::add_input_file): Add error in
13711 incremental build.
13712 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13713 functions.
13714 * script.cc (read_input_script): Call
13715 Incremental_input::report_script.
13716 * script.h (Script_info): New class.
13717
b0481b0b
ILT
137182009-04-27 Ian Lance Taylor <iant@google.com>
13719
13720 * x86_64.cc (do_adjust_output_section): Set entsize to
13721 plt_entry_size.
13722
b22a5a41 137232009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13724
13725 * output.cc (Output_file::close): After short writes, continue
13726 writing from the correct offset in the buffer being written.
13727
40fde488
CD
137282009-04-23 Chris Demetriou <cgd@google.com>
13729
13730 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13731 * configure: Regenerate.
13732 * config.in: Regenerate.
13733 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13734 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13735
3ce2c28e
ILT
137362009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13737
13738 * incremental.cc (Incremental_inputs_header_data): Renamed from
13739 Incremental_input_header_data.
13740 (Incremental_inputs_header_data::data_size): New field.
13741 (Incremental_inputs_header_data::put_input_file_count): Renamed
13742 from input_file_count.
13743 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13744 from command_line_offset.
13745 (Incremental_inputs_header_data::put_reserved): Renamed from
13746 put_reserved.
13747 (Incremental_inputs_entry_data): Renamed from
13748 Incremental_input_entry_data.
13749 (Incremental_inputs_entry_data::data_size): New field.
13750 (Incremental_inputs::report_command_line): New method.
13751 (Incremental_inputs::finalize): New method.
13752 (Incremental_inputs::create_incremental_inputs_data): New method.
13753 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13754 * incremental.h: New file.
13755 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13756 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13757 incremental builds.
703d02da 13758 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13759 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13760 (Layout::create_incremental_info_sections): New method.
13761 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13762 * main.cc (main): Notify Incremental_input of the command line.
13763
e55bde5e
ILT
137642009-04-01 Ian Lance Taylor <iant@google.com>
13765 Mikolaj Zalewski <mikolajz@google.com>
13766
13767 * gold.h (reserve_unordered_map): Define, three versions, one for
13768 each version of Unordered_map.
13769 * layout.cc (Layout::Layout): Remove options parameter. Add
13770 number_of_input_files parameter. Don't initialize options_.
13771 Initialize number_of_input_files_ and resized_signatures_. Move
13772 sections_are_attached_.
13773 (Layout::layout_group): Reserve space for group_signatures_.
13774 (Layout::find_or_add_kept_section): Change name parameter to be a
13775 reference. Resize signatures_ map when it gets large enough.
13776 (Layout::layout_eh_frame): Use parameters->options() instead of
13777 this->options_.
13778 (Layout::make_output_section): Likewise.
13779 (Layout::attach_allocated_section_to_segment): Likewise.
13780 (Layout::finalize, Layout::create_executable_stack): Likewise.
13781 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13782 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13783 * layout.h (class Layout): Update declarations. Remove options_
13784 field. Add number_of_input_files_ and resized_signatures_
13785 fields. Move sections_are_attached_ field.
13786 * main.cc (main): Pass number of input files to Layout
13787 constructor. Don't pass options.
13788
154b857c
ILT
137892009-03-30 Ian Lance Taylor <iant@google.com>
13790
13791 * ffsll.c (ffsll): Correct implementation.
13792
2f35ab9b
ILT
137932009-03-27 Ian Lance Taylor <iant@google.com>
13794
fd03461a
ILT
13795 * ffsll.c: New file.
13796 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13797 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13798 * ftruncate.c (ftruncate): Declare before definition.
13799 * mremap.c (mremap): Likewise.
13800 * pread.c (pread): Likewise.
13801 * configure, Makefile.in, config.in: Rebuild.
13802
2f35ab9b
ILT
13803 * mremap.c: New file.
13804 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13805 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13806 (mremap): Declare if HAVE_MREMAP is not defined.
13807 * configure, Makefile.in, config.in: Rebuild.
13808
33aea2fd
CC
138092009-03-27 Cary Coutant <ccoutant@google.com>
13810
13811 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13812 position independent.
13813 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13814 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13815
6d479619
CC
138162009-03-24 Cary Coutant <ccoutant@google.com>
13817
13818 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13819 an executable.
13820 (needs_dynamic_reloc): Likewise.
13821
afc06bb8
ILT
138222009-03-24 Ian Lance Taylor <iant@google.com>
13823
13824 * yyscript.y (file_cmd): Recognize EXTERN.
13825 (extern_name_list, extern_name_list_body): New nonterminals.
13826 * script.cc (script_add_extern): Define.
13827 * script-c.h (script_add_extern): Declare.
13828
f6060a4d
ILT
138292009-03-24 Rafael Avila de Espindola <espindola@google.com>
13830
13831 * object.cc (is_elf_object): Define.
13832 * object.h (is_elf_object): Declare.
13833 * archive.cc (Archive::get_elf_object_for_member): Call
13834 is_elf_object.
33aea2fd 13835 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13836
26736d8e
ILT
138372009-03-24 Elliott Hughes <enh@google.com>
13838
13839 * output.cc (Output_file::map_anonymous): Define.
13840 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13841 try an anonymous one. Report the size if the mmap fails.
13842 * output.h (class Output_file): Declare map_anonymous.
13843
22fd9730
ILT
138442009-03-24 Ian Lance Taylor <iant@google.com>
13845
13846 * target-select.cc (instantiate_target): Don't acquire the lock if
13847 the instantiated_target_ field has already been set.
13848
cb010894
ILT
138492009-03-23 Ian Lance Taylor <iant@google.com>
13850
7f055c20
ILT
13851 * gold-threads.h (class Initialize_lock): Define.
13852 * gold-threads.cc (class Initialize_lock_once): Define.
13853 (initialize_lock_control): New static variable.
13854 (initialize_lock_pointer): New static variable.
13855 (initialize_lock_once): New static function.
13856 (Initialize_lock::Initialize_lock): Define.
13857 (Initialize_lock::initialize): Define.
13858 * target-select.h: Include "gold-threads.h".
13859 (class Target_selector): Add lock_ and initialize_lock_ fields.
13860 Don't define instantiate_target, just declare it.
13861 * target-select.cc (Target_selector::Target_selector): Initialize
13862 new fields.
13863 (Target_selector::instantiate_target): Define.
13864 * descriptors.h: Include "gold-threads.h".
13865 (class Descriptors): Add initialize_lock_ field.
13866 * descriptors.cc (Descriptors::Descriptors): Initialize new
13867 field.
13868 (Descriptors::open): Use initialize_lock_ field
13869 * errors.h (class Errors): Add initialize_lock_ field.
13870 * errors.cc (Errors::Errors): Initialize new field.
13871 (Errors::initialize_lock): Use initialize_lock_ field.
13872 * powerpc.cc (class Target_selector_powerpc): Remove
13873 instantiated_target_ field. In do_recognize call
13874 instantiate_target rather than do_instantiate_target. In
13875 do_instantiate_target just allocate a new target.
13876 * sparc.cc (class Target_selector_sparc): Likewise.
13877
36959681
ILT
13878 * freebsd.h: New file.
13879 * i386.cc: Include "freebsd.h".
13880 (Target_i386): Derive from Target_freebsd rather than
13881 Sized_target.
13882 (Target_selector_i386): Derive from Target_selector_freebsd rather
13883 than Target_selector.
13884 * x86_64.cc: Include "freebsd.h".
13885 (Target_x86_64): Derive from Target_freebsd rather than
13886 Sized_target.
13887 (Target_selector_x86_64): Derive from Target_selector_freebsd
13888 rather than Target_selector.
13889 * target.h (class Target): Add adjust_elf_header and
13890 do_adjust_elf_header.
13891 * output.cc (Output_file_header:: do_sized_write): Call target
13892 adjust_elf_header routine.
13893 * configure.tgt: Set targ_osabi.
13894 * configure.ac: Define GOLD_DEFAULT_OSABI.
13895 * parameters.cc (Parameters::default_target): Pass
13896 GOLD_DEFAULT_OSABI to select_target.
13897 * target-select.h (class Target_selector): Make instantiate_target
13898 protected rather than private.
13899 * Makefile.am (HFILES): Add freebsd.h.
13900 * configure, Makefile.in, config.in: Rebuild.
13901
cb010894
ILT
13902 * merge.cc (do_add_input_section): Correct pend value. Change
13903 message about last entry not being null terminated from error to
13904 warning.
13905
0e879927
ILT
139062009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13907
13908 * incremental.cc: New file.
13909 * Makefile.am (CCFILES): Add incremental.cc.
13910 * Makefile.in: Rebuild.
13911
41105937
PP
139122009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13913
13914 * layout.cc (Layout::output_section_name): Preserve names
13915 of '.note.' sections.
e1df38aa 13916
60439920
ILT
139172009-03-19 Ian Lance Taylor <iant@google.com>
13918
13919 * descriptors.cc (Descriptors::open): Check that the options are
13920 valid before using them.
13921
0d371ad3
ILT
139222009-03-18 Ian Lance Taylor <iant@google.com>
13923
13924 * script-sections.h: Include <list>.
13925 (class Script_sections): Change Sections_elements from std::vector
13926 to std::list. Typedef public Elements_iterator. Add
13927 orphan_section_placement_, data_segment_align_start_, and
13928 saw_data_segment_align_ fields. Remove data_segment_align_index_
13929 field.
13930 * script-sections.cc (class Orphan_section_placement): New class.
13931 (class Sections_element): Add virtual functions is_relro and
13932 orphan_section_init. Remove virtual function place_orphan_here.
13933 (class Output_section_definition): Add is_relro and
13934 orphan_section_init. Remove place_orphan_here.
13935 (class Orphan_output_section): Likewise.
13936 (Script_sections::Script_sections): Update for field changes.
13937 (Script_sections::data_segment_align): Set saw_data_segment_align_
13938 and data_segment_align_start_, not data_segment_align_index.
13939 (Script_sections::data_segment_relro_end): Check
13940 saw_data_segment_align_. Use data_segment_align_start_ rather
13941 than data_segment_align_index_.
13942 (Script_sections::place_orphan): Rewrite to use
13943 Orphan_section_placement.
13944
9201d894
ILT
139452009-03-17 Ian Lance Taylor <iant@google.com>
13946
9c5b8369
ILT
13947 * archive.cc (Archive::add_symbols): Check for a version attached
13948 to the symbol name in the archive map.
13949 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13950 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13951 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13952 (ver_test_11.a): New target.
13953 * testsuite/Makefile.in: Rebuild.
13954
9201d894
ILT
13955 * configure.ac: Check for chsize and posix_fallocate. Replace
13956 ftruncate.
13957 * ftruncate.c: New file, from gnulib.
13958 * output.cc (posix_fallocate): Define dummy version if not
13959 HAVE_POSIX_FALLOCATE.
13960 (Output_file::map): Call posix_fallocate rather than lseek and
13961 write.
13962 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13963 * configure, Makefile.in, config.in: Rebuild.
13964
ef4ab7a8 139652009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13966
ef4ab7a8
PP
13967 * layout.h (Layout::create_note): Add section_name parameter.
13968 * layout.cc (Layout::create_note): Likewise.
13969 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13970
8c500701
ILT
139712009-03-17 Ian Lance Taylor <iant@google.com>
13972
e85b18e1
ILT
13973 * descriptors.cc: Include "options.h".
13974 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13975 (Descriptors::open): Always use O_CLOEXEC when opening a new
13976 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13977 then set FD_CLOEXEC.
13978
9efe6174
ILT
13979 * sparc.cc (class Target_sparc): Add has_got_section.
13980 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13981 make sure we have a GOT section.
13982
13983 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13984 (Target_sparc::Scan::local): Likewise.
13985 (Target_sparc::Scan::global): Likewise.
13986 (Target_sparc::Relocate::relocate): Likewise.
13987 (Target_sparc::Relocate::relocate_tls): Likewise.
13988
8c500701
ILT
13989 * symtab.cc (Symbol_table::define_default_version): New function,
13990 broken out of add_from_object.
13991 (Symbol_table::add_from_object): Call define_default_version.
13992 (Symbol_table::define_special_symbol): Add resolve_oldsym
13993 parameter. Change all callers. If the version for a symbol comes
13994 from a version script, resolve it with the symbol with the same
13995 name with no version. Also add the symbol without a version if
13996 appropriate.
13997 (do_define_in_output_data): If resolving with oldsym, don't delete
13998 sym.
13999 (do_define_in_output_segment): Likewise.
14000 (do_define_as_constant): Likewise.
14001 * symtab.h (class Symbol_table): Update declarations.
14002
f1ed28fb
ILT
140032009-03-13 Ian Lance Taylor <iant@google.com>
14004
15f8229b
ILT
14005 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14006 (Read_symbols::requeue): New function.
14007 (Read_symbols::do_read_symbols): If make_elf_object fails because
14008 the target type is not configured, and the file was searched for,
14009 issue a warning and retry with the next directory.
14010 (Add_symbols::run): If the file has an incompatible format, and
14011 it was searched for, requeue the Read_symbols task. On error,
14012 release the object.
14013 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14014 dirindex parameter to constructor. Change all callers. Declare
14015 incompatible_warning and requeue.
14016 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14017 input_argument_ and input_group_ fields. Add them to
14018 constructor. Change all callers.
14019 (class Read_script): Add dirindex_ field. Add it to constructor.
14020 Change all callers.
14021 * archive.cc (Archive::setup): Remove input_objects parameter.
14022 Change all callers.
14023 (Archive::get_file_and_offset): Likewise.
14024 (Archive::read_all_symbols): Likewise.
14025 (Archive::read_symbols): Likewise.
14026 (Archive::get_elf_object_for_member): Remove input_objects
14027 parameter. Add punconfigured parameter. Change all callers.
14028 (Archive::add_symbols): Change return type to bool. Check return
14029 value of include_member.
14030 (Archive::include_all_members): Likewise.
14031 (Archive::include_member): Change return type to bool. Return
14032 false if first included object has incompatible target. Set
14033 included_member_ field.
14034 (Add_archive_symbols::run): If add_symbols returns false, requeue
14035 Read_symbols task.
14036 * archive.h (class Archive): Add included_member_ field.
14037 Initialize it in constructor. Add input_file and searched_for
14038 methods. Update declarations.
14039 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14040 input_argument_ fields. Add them to constructor. Change all
14041 callers.
14042 * script.cc: Include "target-select.h".
14043 (class Parser_closure): Add skip_on_incompatible_target_ and
14044 found_incompatible_target_ fields. Add
14045 skip_on_incompatible_target parameter to constructor. Change all
14046 callers. Add methods skip_on_incompatible_target,
14047 clear_skip_on_incompatible_target, found_incompatible_target, and
14048 set_found_incompatible_target.
14049 (read_input_script): Add dirindex parameter. Change all callers.
14050 If parser finds an incompatible target, requeue Read_symbols
14051 task.
14052 (script_set_symbol): Clear skip_on_incompatible_target in
14053 closure.
14054 (script_add_assertion, script_parse_option): Likewise.
14055 (script_start_sections, script_add_phdr): Likewise.
14056 (script_check_output_format): New function.
14057 * script.h (read_input_script): Update declaration.
14058 * script-c.h (script_check_output_format): Declare.
14059 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14060 (ignore_cmd): Remove OUTPUT_FORMAT.
14061 * fileread.cc (Input_file::Input_file): Add explicit this.
14062 (Input_file::will_search_for): New function.
14063 (Input_file::open): Add pindex parameter. Change all callers.
14064 * fileread.h (class Input_file): Add input_file_argument method.
14065 Declare will_search_for. Update declarations.
14066 * object.cc (make_elf_object): Add punconfigured parameter.
14067 Change all callers.
14068 * object.h (class Object): Make input_file public. Add
14069 searched_for method.
14070 (make_elf_object): Update declaration.
14071 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14072 restart search.
14073 * dirsearch.h (class Dirsearch): Update declaration.
14074 * options.h (class General_options): Add --warn-search-mismatch.
14075 * parameters.cc (Parameters::is_compatible_target): New function.
14076 * parameters.h (class Parameters): Declare is_compatible_target.
14077 * workqueue.cc (Workqueue::add_blocker): New function.
14078 * workqueue.h (class Workqueue): Declare add_blocker.
14079
f1ed28fb
ILT
14080 * fileread.cc (Input_file::open): Remove options parameter.
14081 Change all callers.
14082 (Input_file::open_binary): Likewise.
14083 * script.cc (read_input_script): Likewise.
14084 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14085 options parameter from constructor. Change all callers.
14086 (class Read_script): Likewise.
14087 * fileread.h (class Input_file): Update declarations.
14088 * script.h (read_input_script): Update declaration.
14089
34dd024a
NC
140902009-03-10 Nick Clifton <nickc@redhat.com>
14091
14092 * po/es.po: New Spanish translation.
14093
6d71b17c
CC
140942009-03-06 Cary Coutant <ccoutant@google.com>
14095
14096 * options.cc (parse_short_option): Keep dash_z from registering itself.
14097
031cdbed
ILT
140982009-03-03 Ian Lance Taylor <iant@google.com>
14099
14100 PR 9918
14101 * target-reloc.h (relocate_section): Pass output_section to
14102 relocate.
14103 * i386.cc (Target_i386::should_apply_static_reloc): Add
14104 output_section parameter. Change all callers.
14105 (Target_i386::Relocate::relocate): Add output_section parameter.
14106 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14107 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14108 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14109 * testsuite/two_file_shared.sh: New script.
14110 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14111 (check_DATA): Add two_file_shared.dbg.
14112 (two_file_shared.dbg): New target.
14113 * testsuite/Makefile.in: Rebuild.
14114
15d5fa16
ILT
141152009-03-01 Ian Lance Taylor <iant@google.com>
14116
14117 * configure.ac: Check for byteswap.h.
14118 * configure: Rebuild.
14119 * config.in: Rebuild.
14120
8a4c0b0d
ILT
141212009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14122
14123 * layout.cc (Layout::find_or_add_kept_section): New function.
14124 (Layout::add_comdat): Removed.
14125 * layout.h (struct Kept_section): Move out of class Layout.
14126 Remove trailing underscores from field names. Add group_sections
14127 field. Rename group_ field to is_group. Change all uses.
14128 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14129 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14130 comdat_groups_ field.
14131 (Sized_relobj::include_section_group): Use
14132 find_or_add_kept_section and Kept_section::group_sections.
14133 (Sized_relobj::include_linkonce_section): Likewise.
14134 * object.cc (class Sized_relobj): Don't define Comdat_group or
14135 Comdat_group_table. Remove find_comdat_group and
14136 add_comdat_group. Remove comdat_groups_ field.
14137 * plugin.cc (include_comdat_group): Use
14138 Layout::find_or_add_kept_section.
14139
b4ecf66b
ILT
141402009-02-28 Ian Lance Taylor <iant@google.com>
14141
14359ca0
ILT
14142 * README: --gc-sections and map files are now supported. Document
14143 some build requirements.
14144
b4ecf66b
ILT
14145 PR 6992
14146 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14147 relocatable link set the value of the section symbol to zero.
14148 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14149 relocatable link don't include the section address in the local
14150 symbol value.
14151
0602e05a
ILT
141522009-02-27 Ian Lance Taylor <iant@google.com>
14153
fd9d194f
ILT
14154 PR 6811
14155 * options.h (class Search_directory): Add is_system_directory.
14156 (class General_options): Declare is_in_system_directory.
14157 * options.cc (get_relative_sysroot): Make static.
14158 (get_default_sysroot): Make static.
14159 (General_optoins::is_in_system_directory): New function.
14160 * fileread.cc (Input_file::is_in_system_directory): New function.
14161 * fileread.h (class Input_file): Declare is_in_system_directory.
14162 * object.h (class Object): Add is_in_system_directory.
14163 (class Input_objects): Remove system_library_directory_ field.
14164 * object.cc (Input_objects::add_object): Don't set
14165 system_library_directory_.
14166 (input_objects::found_in_system_library_directory): Remove.
14167 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14168 parameter. Change all callers.
14169 (Symbol_table::sized_write_globals): Likewise.
14170 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14171 Call Object::is_in_system_directory.
14172 * symtab.h (class Symbol_table): Update declarations.
14173
61edd21f
ILT
14174 PR 5990
14175 * descriptors.h (Open_descriptor): Add is_on_stack field.
14176 * descriptors.cc (Descriptors::open): If the descriptor is on the
14177 top of the stack, remove it. Initialize is_on_stack field.
14178 (Descriptors::release): Only add pod to stack if it is not on the
14179 stack already.
14180 (Descriptors::close_some_descriptor): Clear stack_next and
14181 is_on_stack fields.
14182
e29e076a
ILT
14183 PR 7091
14184 * output.cc (Output_section::find_starting_output_address): Rename
14185 from starting_output_address; add PADDR parameter; change return
14186 type.
14187 * output.h (class Output_section): Declare
14188 find_starting_output_address instead of starting_output_address.
14189 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14190 section symbol for which we can't find a merge section.
14191
0602e05a
ILT
14192 PR 9836
14193 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14194 hidden or internal, force the symbol to be local.
14195 * resolve.cc (Symbol::override_visibility): Define.
14196 (Symbol::override_base): Use override_visibility.
14197 (Symbol_table::resolve): Likewise.
14198 (Symbol::override_base_with_special): Likewise.
14199 (Symbol_table::override_with_special): If the visibility is hidden
14200 or internal, force the symbol to be local.
14201 * symtab.h (class Symbol): Add set_visibility and
14202 override_visibility.
14203 * testsuite/ver_test_1.sh: New file.
14204 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14205 (check_DATA): Add ver_test_1.syms.
14206 (ver_test_1.syms): New target.
14207 * testsuite/Makefile.in: Rebuild.
14208
401a9a73
CC
142092009-02-25 Cary Coutant <ccoutant@google.com>
14210
14211 * layout.cc (Layout::choose_output_section): Don't rename sections
14212 when using a linker script that has a SECTIONS clause.
14213 * Makefile.in: Regenerate.
14214
14215 * testsuite/Makefile.am (script_test_5.sh): New test case.
14216 * testsuite/Makefile.in: Regenerate.
14217 * testsuite/script_test_5.cc: New file.
14218 * testsuite/script_test_5.sh: New file.
14219 * testsuite/script_test_5.t: New file.
14220
f488e4b0
CC
142212009-02-13 Rafael Avila de Espindola <espindola@google.com>
14222
14223 * archive.cc (Archive::include_member): Update calls to add_symbols.
14224 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14225 the Layout argument.
14226 * dynobj.h (do_add_symbols): Add the Layout argument.
14227 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14228 Layout argument.
14229 * object.h (Object::add_symbols): Add the Layout argument.
14230 (Object::do_add_symbols): Add the Layout argument.
14231 (Sized_relobj::do_add_symbols): Add the Layout argument.
14232 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14233 Unify the two versions.
14234 (Add_plugin_symbols): Remove.
14235 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14236 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14237 (Add_plugin_symbols): Remove.
14238 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14239 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14240 (Add_symbols::run): Make it work with Pulginobj.
14241
89dd1680
ILT
142422009-02-06 Ian Lance Taylor <iant@google.com>
14243
14244 * object.cc (Sized_relobj::do_layout): Make info message start
14245 with lower case letter.
14246
266d0a74
ILT
142472009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14248
602b464e
ILT
14249 * binary.cc: Fix file comment.
14250
266d0a74
ILT
14251 * options.h (enum Incremental_disposition): Define.
14252 (class General_options): Add new options: --incremental,
14253 --incremental_changed, --incremental_unchanged,
14254 --incremental_unknown. Add incremental_disposition_ and
14255 implicit_incremental_ fields.
14256 (General_options::incremental_disposition): New function.
14257 (class Position_dependent_options): Add incremental_disposition
14258 option.
14259 (Position_dependent_options::copy_from_options): Set incremental
14260 dispositions.
14261 * options.cc (General_options::parse_incremental_changed): New
14262 function.
2e702c99
RM
14263 (General_options::parse_incremental_unchanged): New function.
14264 (General_options::parse_incremental_unknown): New function.
14265 (General_options::General_options): Initialize new fields
266d0a74 14266 incremental_disposition_ and implicit_incremental_.
2e702c99 14267 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14268 without --incremental.
14269
f073bbf7
CD
142702009-02-06 Chris Demetriou <cgd@google.com>
14271
14272 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14273 pointer and to report location as the file name associated with
14274 the symbol.
14275 (gold_undefined_symbol_at_location): New function to replace the
14276 old gold_undefined_symbol functionality.
14277 * target-reloc.h (relocate_section): Update to use
14278 gold_undefined_symbol_at_location.
14279 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14280 Call gold_undefined_symbol function rather than gold_error.
14281 * errors.h (Errors::undefined_symbol): Take location as a
14282 string, rather than calculating it from a relocation.
14283 * errors.cc (Errors::fatal): Print "fatal error:" before the
14284 formatted message.
14285 (Errors::error, Errors::error_at_location): Print "error: "
14286 before the formatted message.
14287 (Errors::undefined_symbol): Take location as a string, rather
14288 than calculating it from a relocation.
14289 (gold_undefined_symbol_at_location): New function akin to
14290 old gold_undefined_symbol, calculates location from relocation.
14291 (gold_undefined_symbol): Change to take only a Symbol pointer
14292 and to report location as the file name associated with the symbol.
14293 * testsuite/debug_msg.sh: Update for changed error messages.
14294 * testsuite/undef_symbol.sh: Likewise.
14295
8e94a90c
ILT
142962009-02-04 Duncan Sands <baldrick@free.fr>
14297
14298 PR 9812
14299 * reduced_debug_output.h
14300 (Output_reduced_debug_abbrev_section::failed): Use format for
14301 gold_warning.
14302 (Output_reduced_debug_info_section::faild): Likewise.
14303
88a0e15b
ILT
143042009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14305
14306 * script.cc (Lazy_demangler): New class.
2e702c99 14307 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14308 symbol only once.
14309
5efc7cd2
CC
143102009-01-29 Cary Coutant <ccoutant@google.com>
14311
14312 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14313 to __tls_get_addr.
14314 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14315
e0ebcf42
ILT
143162009-01-28 Ian Lance Taylor <iant@google.com>
14317
5efc7cd2 14318 * version.cc (version_string): Bump to 1.9.
75fe7426 14319
e0ebcf42
ILT
14320 * gold.h: Include <cstring> and <stdint.h>.
14321 * version.cc: Include <cstdio>.
14322 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14323 warning.
14324 * reduced_debug_output.cc (insert_into_vector): Rename from
14325 Insert_into_vector; change all callers. Use Swap_unaligned to
14326 avoid aliasing issue; remove union since it is unnecessary.
14327
8e2813be 143282009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14329
14330 * Makefile.am (CCFILES): Add gc.cc.
14331 (HFILES): Add gc.h.
14332 * Makefile.in: Regenerate.
14333 * gold.cc (Gc_runner): New class.
14334 (queue_initial_tasks): Call garbage collection related tasks
14335 when corresponding options are invoked.
14336 (queue_middle_gc_tasks): New function.
14337 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14338 processed early before laying out sections during garbage collection.
14339 * gold.h (queue_middle_gc_tasks): New function.
14340 (is_prefix_of): Move from "layout.cc".
14341 * i386.cc (Target_i386::gc_process_relocs): New function.
14342 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14343 * main.cc (main): Create object of class "Garbage_collection".
14344 * object.cc (Relobj::copy_symbols_data): New function.
14345 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14346 (Sized_relobj::do_layout): Allow this function to be called twice
14347 during garbage collection and defer layout of section during the
6d03d481
ST
14348 first call.
14349 * object.h (Relobj::get_symbols_data): New function.
14350 (Relobj::is_section_name_included): New function.
14351 (Relobj::copy_symbols_data): New function.
14352 (Relobj::set_symbols_data): New function.
14353 (Relobj::get_relocs_data): New function.
14354 (Relobj::set_relocs_data): New function.
14355 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14356 (Relobj::gc_process_relocs): New function.
14357 (Relobj::do_gc_process_relocs): New pure virtual function.
14358 (Relobj::sd_): New data member.
14359 (Sized_relobj::is_output_section_offset_invalid): New function.
14360 (Sized_relobj::do_gc_process_relocs): New function.
14361 * options.h (General_options::gc_sections): Modify to not be a no-op.
14362 (General_options::print_gc_sections): New option.
14363 * plugin.cc (Plugin_finish::run): Remove function call to
14364 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14365 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14366 * reloc.cc (Read_relocs::run): Add task to process relocs and
14367 determine unreferenced sections when doing garbage collection.
14368 (Gc_process_relocs): New class.
14369 (Sized_relobj::do_gc_process_relocs): New function.
14370 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14371 sections that are garbage collected.
14372 * reloc.h (Gc_process_relocs): New class.
14373 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14374 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14375 symbols whose corresponding sections are garbage collected.
14376 (Symbol_table::Symbol_table): Add new parameter for the garbage
14377 collection object.
14378 (Symbol_table::gc_mark_undef_symbols): New function.
14379 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14380 (Symbol_table::gc_mark_dyn_syms): New function.
14381 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14382 as garbage.
14383 (Symbol_table::add_from_object): Likewise.
14384 (Symbol_table::add_from_relobj): When building shared objects, do not
14385 treat externally visible symbols as garbage.
14386 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14387 table information for static and relocatable links.
14388 * symtab.h (Symbol_table::set_gc): New function.
14389 (Symbol_table::gc): New function.
14390 (Symbol_table::gc_mark_undef_symbols): New function.
14391 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14392 (Symbol_table::gc_mark_dyn_syms): New function.
14393 (Symbol_table::gc_): New data member.
e1df38aa 14394 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14395 function.
14396 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14397 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14398
3b293544
CF
143992009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14400
14401 * options.h (General_options::gc_sections): Define as a no-op for now.
14402 (General_options::no_keep_memory): Ditto.
14403 (General_options::Bshareable): Define.
14404 * options.cc (General_options::finalize): Honor -Bshareable.
14405
83d22aa8
AS
144062009-01-20 Andreas Schwab <schwab@suse.de>
14407
14408 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14409 read the value in the contents, since we don't use it. Use the
14410 template endianness when writing.
14411 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14412
cd536b21
AS
144132009-01-19 Andreas Schwab <schwab@suse.de>
14414
14415 * configure.tgt (powerpc64-*): Fix targ_obj.
14416
99e9a495
ILT
144172009-01-15 Ian Lance Taylor <iant@google.com>
14418
14419 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14420 local symbols when stripping all symbols.
14421
bbbfea06
CC
144222009-01-14 Cary Coutant <ccoutant@google.com>
14423
99e9a495 14424 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14425
0f7c0701
CC
144262009-01-14 Cary Coutant <ccoutant@google.com>
14427
14428 * archive.cc (Archive::get_elf_object_for_member): Remove call
14429 to File_read::claim_for_plugin.
14430 * descriptors.cc (Descriptors::open): Remove reference to
14431 is_claimed.
14432 (Descriptors::claim_for_plugin): Remove.
14433 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14434 (Descriptors::is_claimed): Remove.
14435 (claim_descriptor_for_plugin): Remove.
14436 * fileread.cc (File_read::claim_for_plugin): Remove.
14437 * fileread.h (File_read::claim_for_plugin): Remove.
14438 (File_read::descriptor): Reopen descriptor if necessary.
14439 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14440 (Plugin_manager::all_symbols_read): Add task parameter. Change
14441 all callers.
14442 (Plugin_manager::get_input_file): New function.
14443 (Plugin_manager::release_input_file): New function.
14444 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14445 corresponding data member.
14446 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14447 and pass to base constructor. Change all callers.
14448 (get_input_file, release_input_file): New functions.
14449 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14450 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14451 (Plugin_manager::all_symbols_read): Add task parameter.
14452 (Plugin_manager::get_input_file): New function.
14453 (Plugin_manager::release_input_file): New function.
14454 (Plugin_manager::task_): New data member.
14455 (Pluginobj::Pluginobj): Add filesize parameter.
14456 (Pluginobj::filename): New function.
14457 (Pluginobj::descriptor): New function.
14458 (Pluginobj::filesize): New function.
14459 (Pluginobj::filesize_): New data member.
14460 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14461 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14462 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14463
14464 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14465 with archive libraries.
14466 * testsuite/Makefile.in: Regenerate.
14467 * testsuite/plugin_test.c (struct sym_info): New type.
14468 (get_input_file, release_input_file): New static variables.
14469 (onload): Capture new transfer vector entries.
14470 (claim_file_hook): Stop reading at end of file according to filesize.
14471 Factor out parsing of readelf output into separate function.
14472 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14473 APIs and get the source file name from the symbol table. Convert
14474 source file name to corresponding object file name. Print info
14475 message when adding new input files.
14476 (parse_readelf_line): New function.
14477 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14478 * testsuite/plugin_test_2.sh: Likewise.
14479 * testsuite/plugin_test_3.sh: Likewise.
14480 * testsuite/plugin_test_4.sh: New test case.
14481
62a6d109
ILT
144822009-01-07 Ian Lance Taylor <iant@google.com>
14483
14484 * version.cc (version_string): Bump to 1.8.
14485
483620e8
CC
144862008-12-23 Cary Coutant <ccoutant@google.com>
14487
14488 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14489 * plugin.cc (Plugin_manager::finish): Rename as
14490 layout_deferred_objects. Move cleanup to separate function.
14491 (Plugin_manager::cleanup): New function.
14492 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14493 separately.
14494 * plugin.h (Plugin_manager::finish): Rename as
14495 layout_deferred_objects.
14496 (Plugin_manager::cleanup): New function.
14497 (Plugin_manager::cleanup_done): New field.
14498
d66a9eb3
CC
144992008-12-23 Cary Coutant <ccoutant@google.com>
14500
14501 * plugin.cc (is_visible_from_outside): New function.
14502 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14503 so we don't return "IR only" status for exported symbols or -r links.
14504
14505 * testsuite/Makefile.am (plugin_test_3): New test case.
14506 * testsuite/Makefile.in: Regenerate.
14507 * testsuite/plugin_test_3.sh: New file.
14508
5995b570
CC
145092008-12-22 Cary Coutant <ccoutant@google.com>
14510
14511 * object.cc (Sized_relobj::layout_section): New function.
14512 (Sized_relobj::do_layout): Defer layout of input sections until after
14513 plugin has provided replacement files.
14514 (Sized_relobj::do_layout_deferred_sections): New function.
14515 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14516 (Relobj::layout_deferred_sections): New function.
14517 (Relobj::do_layout_deferred_sections): New function.
14518 (Sized_relobj::do_layout_deferred_sections): New function.
14519 (Sized_relobj::layout_section): New function.
14520 (Sized_relobj::Deferred_layout): New structure.
14521 (Sized_relobj::deferred_layout_): New field.
14522 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14523 Change all callers. Layout deferred sections.
14524 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14525 references.
14526 (Plugin_hook::run): Move code from do_plugin_hook inline.
14527 (Plugin_hook::do_plugin_hook): Remove.
14528 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14529 (Plugin_manager::finish): Renamed, was cleanup.
14530 (Plugin_manager::should_defer_layout): New function.
14531 (Plugin_manager::add_deferred_layout_object): New function.
14532 (Plugin_manager::Deferred_layout_list): New type.
14533 (Plugin_manager::deferred_layout_objects_): New field.
14534 (Plugin_hook::do_plugin_hook): Remove.
14535
ee769c88
ILT
145362008-12-17 Ian Lance Taylor <iant@google.com>
14537
14538 * options.h (class General_options): Add --no case for
14539 --export-dynamic.
14540
abc8dcba
CC
145412008-12-16 Cary Coutant <ccoutant@google.com>
14542
14543 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14544 vector.
14545 (Plugin_manager::claim_file): Create plugin object even if
14546 plugin did not call the add_symbols callback.
14547 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14548 asking for more symbols than were added.
14549 * testsuite/Makefile.am (plugin_test_1): Add test case with
14550 no global symbols.
14551 (empty.syms): New target.
14552 * testsuite/Makefile.in: Regenerate.
14553 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14554 message. Don't call add_symbols if no globals.
14555 (all_symbols_read_hook): Don't provide replacement for empty
14556 claimed file.
14557
b0074644
ILT
145582008-12-12 Ian Lance Taylor <iant@google.com>
14559
68943102
ILT
14560 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14561 r_type == 0 for a local symbol with r_sym == 0.
14562 (scan_relocatable_relocs): Pass r_sym to
14563 local_non_section_strategy.
14564 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14565 r_sym parameter.
14566
b0074644
ILT
14567 * configure.ac: Update test for TLS descriptors: they are
14568 supported as of glibc 2.9.
14569 * configure: Rebuild.
14570
c2508178
ILT
145712008-12-11 Ian Lance Taylor <iant@google.com>
14572
14573 PR 7091
14574 * target-reloc.h (Default_scan_relocatable_relocs): For each
14575 function, map r_type == 0 to RELOC_DISCARD.
14576
2756a258
CC
145772008-12-10 Cary Coutant <ccoutant@google.com>
14578
14579 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14580 object to override a kept COMDAT group from a plugin object.
14581
bb6f53d3
ILT
145822008-12-09 Ian Lance Taylor <iant@google.com>
14583
fbc558e1
ILT
14584 PR 7088
14585 * yyscript.y (file_cmd): Handle INPUT.
14586
bb6f53d3
ILT
14587 * testsuite/initpri1.c: Change all declarations to be full
14588 prototypes by adding void, to avoid compiler warnings.
14589
4674ecfc
CC
145902008-12-05 Rafael Avila de Espindola <espindola@google.com>
14591
14592 * options.cc (General_options::parse_plugin_opt): New.
14593 (General_options::add_plugin): The argument now is just the filename.
14594 (General_options::add_plugin_option): New.
14595 * options.h (plugin_opt): New.
14596 (add_plugin): Change argument name.
14597 (add_plugin_option): New.
14598 * plugin.cc (Plugin::load): Don't parse the plugin option.
14599 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14600 (Plugin::add_option): New.
14601 (Plugin::args_): Change type.
14602 (Plugin::filename_): New.
14603 (Plugin_manager::add_plugin_option): New.
14604 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14605 * testsuite/Makefile.in: Regenerate.
14606
fd06b4aa
CC
146072008-12-05 Cary Coutant <ccoutant@google.com>
14608
14609 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14610 Handle --strip-lto-sections option.
14611 * options.h (strip_lto_sections): New option.
14612
6c52134c
CC
146132008-12-01 Cary Coutant <ccoutant@google.com>
14614
14615 * plugin.cc (ld_plugin_message): Change format parameter to const.
14616 Fix mismatch between new[] and delete.
14617
a45248e0
CC
146182008-11-14 Cary Coutant <ccoutant@google.com>
14619
14620 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14621 instead of -1U.
14622
c82fbeee
CS
146232008-11-05 Craig Silverstein <csilvers@google.com>
14624
14625 * options.cc (General_options::parse_dynamic_list): New function.
14626 * options.h (General_options): New flags dynamic_list,
14627 dynamic_list_data, dynamic_list_cpp_new, and
14628 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14629 (General_options::in_dynamic_list): New function.
14630 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14631 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14632 (Lex::can_continue_name): Likewise.
14633 (yylex): Likewise.
14634 (read_script_file): New parameter script_options.
14635 (read_dynamic_list): New function.
14636 (Script_options::define_dynamic_list): New function.
14637 (dynamic_list_keyword_parsecodes): New variable.
14638 (dynamic_list_keywords): New variable.
14639 * script.h (Script_options::define_dynamic_list): New function
14640 prototype.
14641 (read_dynamic_list): New function prototype.
14642 * symtab.cc (strprefix): New macro.
14643 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14644 dynamic_list_data, dynamic_list_cpp_new, and
14645 dynamic_list_cpp_typeinfo.
14646 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14647 (dynamic_list_expr): New rule.
14648 (dynamic_list_nodes): Likewise.
14649 (dynamic_list_node): Likewise.
14650 * testsuite/Makefile.am (dynamic_list): New test.
14651 * testsuite/Makefile.in: Regenerated.
14652 * testsuite/dynamic_list.t: New file.
14653 * testsuite/dynamic_list.sh: New file.
14654
e0bb29a5
CS
146552008-11-05 Craig Silverstein <csilvers@google.com>
14656
14657 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14658 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14659 (t11_last): Likewise.
14660 * testsuite/ver_test_6.c (main): Likewise.
14661
4e1e25e0
CC
146622008-10-07 Cary Coutant <ccoutant@google.com>
14663
14664 * options.c (General_options::finalize): Add check for -static and
14665 -shared.
14666 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14667 is not empty.
14668
92f03fcb
CC
146692008-10-02 Cary Coutant <ccoutant@google.com>
14670
14671 * plugin.cc (make_sized_plugin_object): Fix conditional
14672 compilation to work when not all targets are enabled.
14673
fbd8a257
CC
146742008-09-29 Cary Coutant <ccoutant@google.com>
14675
14676 * archive.cc (Archive::get_file_and_offset): Use filename instead
14677 of name to get library path.
14678 (Archive::include_member): Unlock external member of a thin archive.
14679
14680 * testsuite/Makefile.am (TEST_AR): New variable.
14681 (thin_archive_test_1): New test.
14682 (thin_archive_test_2): New test.
81636b3f
CC
14683 * testsuite/Makefile.in: Regenerate.
14684 * testsuite/thin_archive_main.cc: New file.
14685 * testsuite/thin_archive_test_1.cc: New file.
14686 * testsuite/thin_archive_test_2.cc: New file.
14687 * testsuite/thin_archive_test_3.cc: New file.
14688 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14689
eff45813
CC
146902008-09-29 Cary Coutant <ccoutant@google.com>
14691
14692 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14693 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14694 instead of -1U.
14695 (Sized_relobj::do_finalize_local_symbols): Likewise.
14696 (Sized_relobj::map_to_kept_section): Likewise.
14697 * object.h (Sized_relobj::invalid_address): New constant.
14698 (Sized_relobj::do_output_section_offset): Check for invalid_address
14699 and return -1ULL.
14700 * output.cc (Output_reloc::local_section_offset): Use constant
14701 invalid_address instead of -1U.
14702 (Output_reloc::get_address): Likewise.
14703 (Output_section::output_address): Change -1U to -1ULL.
14704 * output.h (Output_reloc::invalid_address): New constant.
14705 * reloc.cc (Sized_relobj::write_sections): Use constant
14706 invalid_address instead of -1U.
14707 (Sized_relobj::relocate_sections): Likewise.
14708 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14709 values for merge sections.
14710 * target-reloc.h (relocate_for_relocatable): Use constant
14711 invalid_address instead of -1U.
14712
89fc3421
CC
147132008-09-19 Cary Coutant <ccoutant@google.com>
14714
14715 Add plugin functionality for link-time optimization (LTO).
14716 * configure.ac (plugins): Add --enable-plugins option.
14717 * configure: Regenerate.
14718 * config.in: Regenerate.
14719 * Makefile.am (LIBDL): New variable.
14720 (CCFILES): Add plugin.cc.
14721 (HFILES): Add plugin.h.
14722 (ldadd_var): Add LIBDL.
14723 * Makefile.in: Regenerate.
14724
14725 * archive.cc: Include "plugin.h".
14726 (Archive::setup): Don't preread archive symbols when using a plugin.
14727 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14728 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14729 files.
14730 (Archive::include_member): Add symbols from plugin objects.
14731 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14732 * descriptors.cc (Descriptors::open): Check for file descriptors
14733 abandoned by plugins.
14734 (Descriptors::claim_for_plugin): New function.
14735 * descriptors.h (Descriptors::claim_for_plugin): New function.
14736 (Open_descriptor::is_claimed): New field.
14737 (claim_descriptor_for_plugin): New function.
14738 * fileread.cc (File_read::claim_for_plugin): New function.
14739 * fileread.h (File_read::claim_for_plugin): New function.
14740 (File_read::descriptor): New function.
14741 * gold.cc: Include "plugin.h".
14742 (queue_initial_tasks): Add task to call plugin hooks for generating
14743 new object files.
14744 * main.cc: Include "plugin.h".
14745 (main): Load plugin libraries.
14746 * object.h (Pluginobj): Declare.
14747 (Object::pluginobj): New function.
14748 (Object::do_pluginobj): New function.
14749 (Object::set_target): New function.
14750 * options.cc: Include "plugin.h".
14751 (General_options::parse_plugin): New function.
14752 (General_options::General_options): Initialize plugins_ field.
14753 (General_options::add_plugin): New function.
14754 * options.h (Plugin_manager): Declare.
14755 (General_options): Add --plugin option.
14756 (General_options::has_plugins): New function.
14757 (General_options::plugins): New function.
14758 (General_options::add_plugin): New function.
14759 (General_options::plugins_): New field.
14760 * plugin.cc: New file.
14761 * plugin.h: New file.
14762 * readsyms.cc: Include "plugin.h".
14763 (Read_symbols::do_read_symbols): Check for archive before checking
14764 for ELF file. Call plugin hooks to claim files.
14765 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14766 from a real object file; force override when processing replacement
14767 files.
14768 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14769 (Symbol::init_base_object): Likewise.
14770 (Symbol::init_base_output_data): Likewise.
14771 (Symbol::init_base_output_segment): Likewise.
14772 (Symbol::init_base_constant): Likewise.
14773 (Symbol::init_base_undefined): Likewise.
14774 (Symbol::output_section): Assert that object is not a plugin.
14775 (Symbol_table::add_from_pluginobj): New function.
14776 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14777 undefined.
14778 (Symbol_table::sized_write_globals): Likewise.
14779 (Symbol_table::add_from_pluginobj): Instantiate template.
14780 * symtab.h (Sized_pluginobj): Declare.
14781 (Symbol::in_real_elf): New function.
14782 (Symbol::set_in_real_elf): New function.
14783 (Symbol::in_real_elf_): New field.
14784 (Symbol_table::add_from_pluginobj): New function.
14785
14786 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14787 (LIBDL): New variable.
14788 (LDADD): Add LIBDL.
14789 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14790 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14791 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14792 (MOSTLYCLEANFILES): Likewise.
14793 * testsuite/Makefile.in: Regenerate.
14794 * testsuite/plugin_test.c: New file.
14795 * testsuite/plugin_test_1.sh: New file.
14796 * testsuite/plugin_test_2.sh: New file.
14797
de31bda5
ILT
147982008-09-16 Ian Lance Taylor <iant@google.com>
14799
9c2d0ef9
ILT
14800 * target-reloc.h (relocate_section): Check whether a symbol is
14801 defined by the ABI before reporting an undefined symbol error.
14802 * target.h (Target::is_defined_by_abi): Make parameter const.
14803 (Target::do_is_defined_by_abi): Likewise.
14804 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14805 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14806 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14807 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14808 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14809 * testsuite/Makefile.in: Rebuild.
14810
de31bda5
ILT
14811 * fileread.cc (make_view): Add casts to avoid warning.
14812
9fa33bee
AO
148132008-09-16 Alexandre Oliva <aoliva@redhat.com>
14814
14815 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14816 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14817
183fd0e3
AO
148182008-09-16 Alexandre Oliva <aoliva@redhat.com>
14819
14820 * options.h (General_options::output_is_executable): New.
14821 (General_options::output_is_pie): New.
14822 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14823 for shared libraries.
14824 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14825
7be8330a
CD
148262008-09-11 Chris Demetriou <cgd@google.com>
14827
14828 * options.h (origin): New -z option.
14829 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14830 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14831 in DT_FLAGS_1.
14832
a9caad02
CC
148332008-09-05 Cary Coutant <ccoutant@google.com>
14834
14835 * fileread.cc (File_read::make_view): Add check for attempt to map
14836 beyond end of file.
14837
ae6dce4d
CC
148382008-09-05 Cary Coutant <ccoutant@google.com>
14839
14840 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14841 explicit instantiations.
14842
d7ab2a47
KVH
148432008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14844
14845 PR gold/6858
14846 * options.cc (General_options::finalize): Allow undefined symbols
14847 in shlibs if linking -shared.
14848
14849 PR gold/6859
14850 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14851 symbols as not needing a dynsym entry.
14852
1e52a9c1
CS
148532008-08-20 Craig Silverstein <csilvers@google.com>
14854
14855 * fileread.cc (File_read::open): Do not lock the file unless it
14856 was successfully opened.
14857
d85c80a3
CC
148582008-08-14 Cary Coutant <ccoutant@google.com>
14859
14860 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14861 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14862 * testsuite/tls_test.cc (struct int128): 128-bit struct
14863 for testing TLS relocs with non-zero addend.
14864 (v12): New TLS variable.
14865 (t12): New test.
14866 (t_last): Add check for v12.
14867 * testsuite/tls_test.h (t12): New function.
14868 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14869
2d924fd9
ILT
148702008-08-13 Ian Lance Taylor <iant@google.com>
14871
14872 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14873 set tls_segment_ or relro_segment_.
14874 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14875 when appropriate.
14876 * output.h (Output_section::clear_is_relro): New function.
14877 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14878 sections specially even when output_data_ is empty.
14879 (Output_segment::maximum_alignment): When first section is relro,
14880 only force alignment for PT_LOAD segments.
14881 * script.cc (script_data_segment_align): New function.
14882 (script_data_segment_relro_end): New function.
14883 * script-c.h (script_data_segment_align): Declare.
14884 (script_data_segment_relro_end): Declare.
14885 * script-sections.h (class Script_sections): Declare
14886 data_segment_align and data_segment_relro_end. Add fields
14887 segment_align_index_ and saw_relro_end_.
14888 * script-sections.cc (class Sections_element): Add set_is_relro
14889 virtual function. Add new bool* parameter to place_orphan_here.
14890 Add get_output_section virtual function.
14891 (class Output_section_definition): Add set_is_relro. Add new
14892 bool* parameter to place_orphan_here. Add get_output_section.
14893 Add is_relro_ field.
14894 (Output_section_definition::Output_section_definition): Initialize
14895 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14896 and is_relro_ fields.
14897 (Output_section_definition::place_orphan_here): Add is_relro
14898 parameter.
14899 (Output_section_definition::set_section_addresses): Set relro for
14900 output section.
14901 (Output_section_definition::alternate_constraint): Likewise.
14902 (class Orphan_output_section): Add new bool* parameter to
14903 place_orphan_here. Add get_output_section.
14904 (Orphan_output_section::place_orphan_here): Add is_relro
14905 parameter.
14906 (Script_sections::Script_sections): Initialize
14907 data_segment_align_index_ and saw_relro_end_.
14908 (Script_sections::data_segment_align): New function.
14909 (Script_sections::data_segment_relro_end): New function.
14910 (Script_sections::place_orphan): Set or clear is_relro.
14911 (Script_sections::set_section_addresses): Force alignment of first
14912 TLS section.
14913 * yyscript.y (exp): Call script_data_segment_align and
14914 script_data_segment_relro_end.
14915 * testsuite/relro_script_test.t: New file.
14916 * testsuite/relro_test.cc (using_script): Declare.
14917 (t1, t2): Test using_script.
14918 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14919 (relro_script_test_SOURCES): Define.
14920 (relro_script_test_DEPENDENCIES): Define.
14921 (relro_script_test_LDFLAGS): Define.
14922 (relro_script_test_LDADD): Define.
14923 (relro_script_test.so): New target.
14924 * testsuite/Makefile.in: Rebuild.
14925
f827c9a9
CC
149262008-08-06 Cary Coutant <ccoutant@google.com>
14927
14928 * archive.cc (Archive::total_archives, Archive::total_members)
14929 (Archive::total_members_loaded): New variables.
14930 (Archive::setup): Add parameter. Add option to preread
14931 archive symbols.
14932 (Archive::read_armap): Add counter.
14933 (Archive::get_file_and_offset): New function.
14934 (Archive::get_elf_object_for_member): New function.
14935 (Archive::read_all_symbols): New function.
14936 (Archive::read_symbols): New function.
14937 (Archive::add_symbols): Add counters.
14938 (Archive::include_all_members): Use armap to find members if it's
14939 already built.
14940 (Archive::include_member): Skip reading symbols if already read.
14941 Factored code into Archive::get_file_and_offset and
14942 Archive::get_elf_object_for_member. Changed call to
14943 Mapfile::report_include_archive_member.
14944 (Archive::print_stats): New function.
14945 * archive.h: Declare Object and Read_symbols_data classes.
14946 (Archive::Archive): Add initializers for new members.
14947 (Archive::setup): Add parameter.
14948 (Archive::print_stats): New function.
14949 (Archive::total_archives, Archive::total_members)
14950 (Archive::total_members_loaded): New variables.
14951 (Archive::get_file_and_offset): New function.
14952 (Archive::get_elf_object_for_member): New function.
14953 (Archive::read_all_symbols): New function.
14954 (Archive::read_symbols): New function.
14955 (Archive::Archive_member): New class.
14956 (Archive::members_): New member.
14957 (Archive::num_members_): New member.
14958 * main.cc: Include archive.h.
14959 (main): Call Archive::print_stats.
14960 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14961 archive parameter; member_name is now the fully-decorated name.
14962 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14963 * options.h: (General_options): Add --preread-archive-symbols option.
14964 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14965 Archive::setup.
14966
de4c45bd
ILT
149672008-08-04 Ian Lance Taylor <iant@google.com>
14968
14969 * symtab.h (Symbol::use_plt_offset): New function.
14970 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14971 * powerpc.cc (Relocate::relocate): Likewise.
14972 * sparc.cc (Relocate::relocate): Likewise.
14973 * x86_64.cc (Relocate::relocate): Likewise.
14974 * testsuite/weak_plt.sh: New test.
14975 * testsuite/weak_plt_main.cc: New test.
14976 * testsuite/weak_plt_shared.cc: New test.
14977 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14978 (check_PROGRAMS): Add weak_plt.
14979 (check_DATA): Add weak_plt_shared.so.
14980 (weak_plt_main_pic.o, weak_plt): New targets.
14981 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14982 * testsuite/Makefile.in: Rebuild.
14983
14984 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14985 gcctestdir/ld.
14986 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14987 * testsuite/Makefile.in: Rebuild.
14988
323ee3f4
AM
149892008-08-04 Alan Modra <amodra@bigpond.net.au>
14990
14991 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14992 * Makefile.in: Regenerate.
14993 * po/POTFILES.in: Regenerate.
14994
7c07ecec
ILT
149952008-07-29 Ian Lance Taylor <iant@google.com>
14996
14997 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14998 symbols before other symbols.
14999 * testsuite/script_test_2.cc (test_addr): Declare.
15000 (test_addr_alias): Declare.
15001 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15002 values.
7c07ecec
ILT
15003 * testsuite/script_test_2.t: Define test_addr_alias and
15004 test_addr.
15005
5778530e
ILT
150062008-07-24 Ian Lance Taylor <iant@google.com>
15007
2a00e4fb
ILT
15008 PR 5990
15009 * descriptors.cc: New file.
15010 * descriptors.h: New file.
15011 * gold-threads.h (class Hold_optional_lock): New class.
15012 * fileread.cc: Include "descriptors.h".
15013 (File_read::~File_read): Release descriptor rather than closing
15014 it.
15015 (File_read::open) [file]: Call open_descriptor rather than open.
15016 Set is_descriptor_opened_.
15017 (File_read::open) [memory]: Assert that descriptor is not open.
15018 (File_read::reopen_descriptor): New function.
15019 (File_read::release): Release descriptor.
15020 (File_read::do_read): Make non-const. Reopen descriptor.
15021 (File_read::read): Make non-const.
15022 (File_read::make_view): Reopen descriptor.
15023 (File_read::do_readv): Likewise.
15024 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15025 Update declarations.
15026 * layout.cc: Include "descriptors.h".
15027 (Layout::create_build_id): Use open_descriptor rather than open.
15028 * output.cc: Include "descriptors.h".
15029 (Output_file::open): Use open_descriptor rather than open.
15030 * archive.cc (Archive::const_iterator): Change Archive to be
15031 non-const.
15032 (Archive::begin, Archive::end): Make non-const.
15033 (Archive::count_members): Likewise.
15034 * archive.h (class Archive): Update declarations.
15035 * object.h (Object::read): Make non-const.
15036 * Makefile.am (CCFILES): Add descriptors.cc.
15037 (HFILES): Add descriptors.h.
15038 * Makefile.in: Rebuild.
15039
801647d1
ILT
15040 PR 6716
15041 * gold.h: Always include <clocale>. Add Solaris workarounds
15042 following code in binutils/sysdep.h.
15043
5edd166e
ILT
15044 PR 6048
15045 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15046 this->eh_frame_hdr_ is NULL before using it.
15047
c89ad728
ILT
15048 * dynobj.cc (Versions::Versions): Update comment.
15049
aa86f06b
ILT
15050 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15051 the base version name.
15052
5778530e
ILT
15053 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15054 array size plus one.
15055 (Stringpool_template::set_string_offsets): Subtract one from key
15056 before using it as an array index.
15057 (Stringpool_template::get_offset_with_length): Likewise.
15058 (Stringpool_template::write_to_buffer): Likewise.
15059 * stringpool.h (Stringpool_template::get_offset_from_key):
15060 Likewise.
15061
057ead22
ILT
150622008-07-23 Ian Lance Taylor <iant@google.com>
15063
7f649c59
ILT
15064 PR 6658
15065 * object.h (Merged_symbol_value::value): Do our best to handle a
15066 negative addend.
15067
057ead22
ILT
15068 PR 6647
15069 * script.cc (Version_script_info::get_versions): Don't add empty
15070 version tag to return value.
15071 (Version_script_info::get_symbol_version_helper): Change return
15072 type to bool. Add pversion parameter. Change all callers.
15073 (script_register_vers_node): Don't require a non-NULL tag.
15074 * script.h (class Version_script_info): Update declarations.
15075 (Version_script_info::get_symbol_version): Change return type to
15076 bool. Add version parameter. Change all callers.
15077 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15078 handling. Handle an empty version from a version script.
15079 (Symbol_table::define_special_symbol): Likewise.
15080 * testsuite/ver_test_10.script: New file.
15081 * testsuite/ver_test_10.sh: New file.
15082 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15083 (check_DATA): Add ver_test_10.syms.
15084 (ver_test_10.syms, ver_test_10.so): New target.
15085 * testsuite/Makefile.in: Rebuild.
15086
58e54ac2
CD
150872008-07-23 Simon Baldwin <simonb@google.com>
15088
15089 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15090 to zero for undefined symbols from dynamic libraries.
15091
95d14cd3
ILT
150922008-07-23 Ian Lance Taylor <iant@google.com>
15093
15094 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15095 Change all callers.
15096 * symtab.h (class Symbol_table): Update declaration.
15097 * testsuite/ver_test_9.cc: New file.
15098 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15099 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15100 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15101 (ver_test_9.so, ver_test_9.o): New targets.
15102 * testsuite/Makefile.in: Rebuild.
15103
92de84a6
ILT
151042008-07-22 Ian Lance Taylor <iant@google.com>
15105
34810851
ILT
15106 * options.h (class General_options): Define --check-sections.
15107 * layout.cc (Layout::set_segment_offsets): Handle
15108 --check-sections.
15109
af6156ef
ILT
15110 * options.h (class General_options): Define -n/--nmagic and
15111 -N/--omagic.
15112 * options.cc (General_options::finalize): For -n/--nmagic or
15113 -N/--omagic, set -static.
15114 * layout.cc (Layout::attach_allocated_section_to_segment): If
15115 -N/--omagic, don't put read-only and read-write sections in
15116 different segments.
15117 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15118 finding a read-only segment.
15119 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15120 don't set the minimum segment alignment to the common page size,
15121 and don't set the file offset to the address modulo the page size.
15122 * script-sections.cc (Script_sections::create_segments): If
15123 -n/--omagic, don't put read-only and read-write sections in
15124 different segments.
15125
92de84a6
ILT
15126 * cref.cc: New file.
15127 * cref.h: New file.
15128 * options.h (class General_options): Add --print-symbol-counts.
15129 * main.cc (main): Issue defined symbol report if requested.
15130 * archive.cc (Archive::interpret_header): Make into a const member
15131 function.
15132 (Archive::add_symbols): Call Input_objects::archive_start and
15133 archive_stop.
15134 (Archive::const_iterator): Define new class.
15135 (Archive::begin, Archive::end): New functions.
15136 (Archive::include_all_members): Rewrite to use iterator.
15137 (Archive::count_members): New function.
15138 * archive.h (class Archive): Update declarations.
15139 (Archive::filename): New function.
15140 * object.cc: Include "cref.h".
15141 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15142 (Sized_relobj::do_get_global_symbol_counts): New function.
15143 (Input_objects::add_object): Add object to cross-referencer.
15144 (Input_objects::archive_start): New function.
15145 (Input_objects::archive_stop): New function.
15146 (Input_objects::print_symbol_counts): New function.
15147 * object.h: Declare Cref and Archive.
15148 (Object::get_global_symbol_counts): New function.
15149 (Object::do_get_global_symbol_counts): New pure virtual function.
15150 (class Sized_relobj): Add defined_count_ field. Update
15151 declarations.
15152 (class Input_objects): Add cref_ field. Update constructor.
15153 Update declarations.
15154 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15155 defined_count_.
15156 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15157 symbol counts.
15158 (Sized_dynobj::do_get_global_symbol_counts): New function.
15159 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15160 defined_count_. Update declarations. Define Symbols typedef.
15161 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15162 parameter. Change all callers.
15163 (Symbol_table::add_from_dynobj): Add sympointers and defined
15164 parameters. Change all callers.
15165 * symtab.h (class Symbol_table): Update declarations.
15166 * Makefile.am (CCFILES): Add cref.cc.
15167 (HFILES): Add cref.h.
15168 * Makefile.in: Rebuild.
15169
3f7c5e1d
CD
151702008-07-22 Simon Baldwin <simonb@google.com>
15171
15172 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15173 to zero when writing undefined symbols.
15174
e0b64032
ILT
151752008-07-22 Ian Lance Taylor <iant@google.com>
15176
15177 * output.cc (Output_section::add_input_section): Don't try to
15178 merge empty merge sections.
15179
096b02cf
CS
151802008-07-21 Craig Silverstein <csilvers@google.com>
15181
15182 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15183 Include symbol version in error message.
cd536b21 15184
1d1f116d
CD
151852008-07-20 Chris Demetriou <cgd@google.com>
15186
cd536b21 15187 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15188 (RANDOM_SEED_CFLAGS): New substituted variable.
15189 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15190 * configure: Rebuild.
15191 * Makefile.in: Likewise.
15192 * testsuite/Makefile.in: Likewise.
15193
a18f591e
ILT
151942008-07-18 Ian Lance Taylor <iant@google.com>
15195
15196 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15197 where we see NAME/NULL and NAME/VERSION as separate symbols.
15198 * testsuite/ver_test_main.cc (main): Call t4.
15199 (t4, t4_2a): Define.
15200 * testsuite/ver_test_2.cc (t4_2): Define.
15201 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15202 * testsuite/ver_test_4.cc (t4_2a): Define.
15203 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15204 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15205
c6e3f6ed
ILT
152062008-07-17 Ian Lance Taylor <iant@google.com>
15207
15208 * dynobj.cc (Versions::add_def): If we give an error about a
15209 missing version, go ahead and create the version anyhow.
15210
ef9beddf
ILT
152112008-07-10 Ian Lance Taylor <iant@google.com>
15212
15213 Handle output sections with more than 0x7fffffff bytes.
15214 * object.h (class Relobj): Change map_to_output_ to
15215 output_sections_, and just keep a section pointer. Change all
15216 uses. Move comdat group support to Sized_relobj.
15217 (Relobj::is_section_specially_mapped): Remove.
15218 (Relobj::output_section): Remove poff parameter. Change all
15219 callers.
15220 (Relobj::output_section_offset): New function.
15221 (Relobj::set_section_offset): Rewrite.
15222 (Relobj::map_to_output): Remove.
15223 (Relobj::output_sections): New function.
15224 (Relobj::do_output_section_offset): New pure virtual function.
15225 (Relobj::do_set_section_offset): Likewise.
15226 (class Sized_relobj): Add section_offsets_ field. Add comdat
15227 group support from Relobj. Update declarations.
15228 (Sized_relobj::get_output_section_offset): New function.
15229 (Sized_relobj::do_output_section_offset): New function.
15230 (Sized_relobj::do_set_section_offset): New function.
15231 * object.cc (Relobj::output_section_address): Remove.
15232 (Sized_relobj::Sized_relobj): Initialize new fields.
15233 (Sized_relobj::include_section_group): Cast find_kept_object to
15234 Sized_relobj.
15235 (Sized_relobj::include_linkonce_section): Likewise.
15236 (Sized_relobj::do_layout): Use separate arrays for output section
15237 and output offset.
15238 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15239 output_sections.
15240 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15241 output_sections and section_offsets.
15242 (Sized_relobj::write_local_symbols): Likewise.
15243 (map_to_kept_section): Compute output address directly.
15244 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15245 output_sections and section_offsets.
15246 (Sized_relobj::write_sections): Likewise.
15247 (Sized_relobj::relocate_sections): Likewise.
15248 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15249 * output.h (class Output_reloc): Update declarations. Change
15250 u2_.relobj to Sized_relobj*.
15251 (class Output_data_reloc): Change add functions to use
15252 Sized_relobj*.
15253 * output.cc (Output_reloc::Output_reloc): Change relobj to
15254 Sized_relobj*.
15255 (Output_reloc::local_section_offset): Change return type to
15256 Elf_Addr. Use get_output_section_offset.
15257 (Output_reloc::get_address): Likewise.
15258 (Output_section::is_input_address_mapped): Don't call
15259 is_section_specially_mapped.
15260 (Output_section::output_offset): Likewise.
15261 (Output_section::output_address): Likewise.
15262 (Output_section::starting_output_address): Likewise.
15263 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15264 parameter to Sized_relobj*.
15265 (Copy_relocs::need_copy_reloc): Likewise.
15266 (Copy_relocs::save): Likewise.
15267 * copy-relocs.h (class Copy_relocs): Update declarations.
15268 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15269 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15270 * target-reloc.h (relocate_for_relocatable): Change
15271 offset_in_output_section type to Elf_Addr. Change code that uses
15272 it as well.
15273 * layout.cc (Layout::layout): Always set *off.
15274 * mapfile.cc (Mapfile::print_input_section): Use
15275 output_section_offset.
15276 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15277 Sized_relobj*.
15278 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15279 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15280 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15281
5cb66f97
ILT
152822008-07-03 Ian Lance Taylor <iant@google.com>
15283
15284 * layout.cc (Layout::include_section): Do not discard unrecognized
15285 SHT_STRTAB sections.
15286
afe47622
CS
152872008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15288
15289 * script.cc (Lex::can_continue_name): Make '?' allowable in
15290 version-script names.
15291 * testsuite/version_script.map: Change glob pattern to use '?'
15292
5adf9721
ILT
152932008-06-30 Manish Singh <yosh@gimp.org>
15294
15295 PR 6585
15296 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15297 Correct typo.
15298
e6fde208
ILT
152992008-06-30 Ian Lance Taylor <iant@google.com>
15300
15301 PR 6660
15302 PR 6682
15303 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15304 versions]: Don't try to read the value in the contents, since we
15305 don't use it. Use the template endianness when writing.
15306
3f2e6a2d
CC
153072008-06-25 Cary Coutant <ccoutant@google.com>
15308
15309 * fileread.cc (File_read::make_view): Assert on zero-length view.
15310 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15311 symbol table when there are no symbols to read.
15312
c43d3a48
CS
153132008-06-23 Craig Silverstein <csilvers@google.com>
15314
15315 * version.cc (version_string): Bump to 1.7
15316
5f494ea0
CS
153172008-06-18 Craig Silverstein <csilvers@google.com>
15318
15319 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15320 constant 0xFFFF to type Valtype.
15321 (Powerpc_relocate_functions::rel16_ha): Likewise.
15322
c42e122e
ILT
153232008-06-17 Ian Lance Taylor <iant@google.com>
15324
f34787f8
ILT
15325 * output.h (Output_section::Input_section): Initialize p2align_ to
15326 zero for Output_section_data constructors.
15327 (Output_section::Input_section::addralign): If not an input
15328 section, return the alignment of the Output_section_data.
15329 * testsuite/copy_test.cc: New file.
15330 * testsuite/copy_test_1.cc: New file.
15331 * testsuite/copy_test_2.cc: New file.
15332 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15333 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15334 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15335 (copy_test_1_pic.o, copy_test_1.so): New targets.
15336 (copy_test_2_pic.o, copy_test_2.so): New targets.
15337 * testsuite/Makefile.in: Rebuild.
15338
c42e122e
ILT
15339 * script-sections.cc (Script_sections::place_orphan): Initialize
15340 local variable exact.
15341
ce3ac18a
DE
153422008-06-13 David Edelsohn <edelsohn@gnu.org>
15343
15344 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15345
42cacb20
DE
153462008-06-12 David Edelsohn <edelsohn@gnu.org>
15347 David S. Miller <davem@davemloft.net>
15348
15349 * powerpc.cc: New file.
15350 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15351 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15352 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15353 * Makefile.in: Rebuild.
15354
7b308235
ILT
153552008-06-09 Ian Lance Taylor <iant@google.com>
15356
15357 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15358 <exception>.
15359 (throwing, orig_terminate): New static variables.
15360 (terminate_handler): New static function.
15361 (t2): Set terminate handler.
15362
f0b886e3
ILT
153632008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15364
15365 PR 6584
cd536b21 15366 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15367 alignment.
15368
3e90f135
CC
153692008-05-30 Cary Coutant <ccoutant@google.com>
15370
15371 * archive.cc (Archive::include_all_members) Correct to step
15372 over symbol table and extended name table in thin archives.
15373
e09ad04a
ILT
153742008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15375
15376 PR 6407
15377 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15378 calculation.
15379
62b01cb5
ILT
153802008-05-28 Caleb Howe <cshowe@google.com>
15381
15382 * reduced_debug_output.cc: New file.
15383 * reduced_debug_output.h: New file.
92de84a6 15384 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15385 * options.cc (General_options::finalize): Add strip_debug_non_line
15386 to the strip heirarchy.
15387 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15388 fields.
15389 * layout.cc: Include "reduced_debug_output.h".
15390 (Layout::Layout): Initialize new fields.
15391 (line_only_debug_sections): New static array.
15392 (is_lines_only_debug_sections): New static inline function.
15393 (Layout::include_section): Handle --strip-debug-non-line.
15394 (Layout::make_output_section): If --strip-debug-non-line, build
15395 new output sections for .debug_abbrev and .debug_info.
15396 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15397 gold. Warn about possible overflow.
15398 (read_signed_LEB_128): Likewise.
15399 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15400 (read_signed_LEB_128): Declare.
15401 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15402 (HFILES): Add reduced_debug_output.h.
15403 * Makefile.in: Rebuild.
15404
7d9e3d98
ILT
154052008-05-21 Ian Lance Taylor <iant@google.com>
15406
15407 * mapfile.cc: New file.
15408 * mapfile.h: New file.
15409 * options.h (class General_options): Add -M/--print-map and -Map.
15410 * options.cc (General_options::finalize): Make -M equivalent to
15411 -Map -.
15412 * main.cc: Include <cstdio> and "mapfile.h".
15413 (main): Open mapfile if requested.
15414 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15415 constructor. Change caller.
15416 (queue_initial_tasks): Add mapfile parameter. Change caller.
15417 (queue_middle_tasks): Likewise.
15418 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15419 declarations.
15420 * archive.cc: Include "mapfile.h".
15421 (Archive::add_symbols): Add mapfile parameter. Change all
15422 callers. Pass mapfile, symbol, and reason to include_member.
15423 (Archive::include_all_members): Add mapfile parameter. Change all
15424 callers.
15425 (Archive::include_member): Add mapfile, sym, and why parameters.
15426 Change all callers. Report inclusion to map file.
15427 * archive.h: Include "fileread.h".
15428 (class Archive): Update declarations.
15429 (Archive::file): New const method.
15430 (class Add_archive_symbols): Add mapfile_ field. Update
15431 constructor. Change all callers.
15432 * readsyms.h (class Read_symbols): Likewise.
15433 (class Finish_group): Likewise.
15434 (class Read_script): Likewise.
15435 * common.cc: Include "mapfile.h".
15436 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15437 all callers.
15438 (Symbol_table::do_allocate_commons): Likewise.
15439 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15440 symbol allocation to mapfile.
15441 * common.h (class Allocate_commons_task): Add mapfile_ field.
15442 Update constructor. Change all callers.
15443 * symtab.h (class Symbol_table): Update declarations.
15444 * layout.cc: Include "mapfile.h".
15445 (Layout_task_runner::run): Print information to mapfile.
15446 (Layout::create_gold_note): Change Output_data_fixed_space to
15447 Output_data_zero_fill.
15448 (Layout::create_build_id): Likewise.
15449 (Layout::print_to_mapfile): New function.
15450 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15451 constructor. Change caller.
15452 (class Layout): Declare print_to_mapfile.
15453 * output.cc (Output_section::Input_section::print_to_mapfile): New
15454 function.
15455 (Output_section::add_input_section): If producing a map, always
15456 add to input_sections_ list.
15457 (Output_section::do_print_to_mapfile): New function.
15458 (Output_segment::print_sections_to_mapfile): New function.
15459 (Output_segment::print_section_list_to_mapfile): New function.
15460 * output.h: Include "mapfile.h".
15461 (Output_data::print_to_mapfile): New function.
15462 (Output_data::do_print_to_mapfile): New virtual function.
15463 (Output_segment_headers::do_print_to_mapfile): New function.
15464 (Output_file_header::do_print_to_mapfile): New function.
15465 (Output_data_const::do_print_to_mapfile): New function.
15466 (class Output_data_const_buffer): Add map_name_ field. Update
15467 constructor. Change all callers. Add do_print_to_mapfile
15468 function.
15469 (class Output_data_fixed_space): Likewise.
15470 (class Output_data_space): Likewise.
15471 (class Output_data_zero_fill): New class.
15472 (Output_data_strtab::do_print_to_mapfile): New function.
15473 (Output_data_reloc_base::do_print_to_mapfile): New function.
15474 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15475 (Output_data_group::do_print_to_mapfile): New function.
15476 (Output_data_got::do_print_to_mapfile): New function.
15477 (Output_data_dynamic::do_print_to_mapfile): New function.
15478 (Output_symtab_xindex::do_print_to_mapfile): New function.
15479 (class Output_section): Declare do_print_to_mapflie. Declare
15480 print_to_mapfile in Input_section.
15481 (class Output_segment): Declare new functions.
15482 * object.h (Sized_relobj::symbol_count): New function.
15483 * script-sections.cc
15484 (Output_section_element_dot_assignment::set_section_addresses):
15485 Change Output_data_fixed_space to Output_data_zero_fill.
15486 (Output_data_expression::do_print_to_mapfile): New function.
15487 * script.cc (read_input_script): Add mapfile parameter. Change
15488 all callers.
15489 * script.h (read_input_script): Update declaration.
15490 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15491 (Eh_frame::do_print_to_mapfile): New function.
15492 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15493 (Output_merge_string::do_print_to_mapfile): New function.
15494 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15495 function.
15496 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15497 function.
15498 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15499 function.
15500 * Makefile.am (CCFILES): Add mapfile.cc.
15501 (HFILES): Add mapfile.h.
15502 * Makefile.in: Rebuild.
15503
9f1d377b
ILT
155042008-05-19 Ian Lance Taylor <iant@google.com>
15505
15506 * options.h (class General_options): Add -z relro.
15507 * layout.cc (Layout::Layout): Initialize relro_segment_.
15508 (Layout::add_output_section_data): Return the output section.
15509 (Layout::make_output_section): Rcognize relro sections and mark
15510 them appropriately.
15511 (Layout::attach_allocated_section_to_segment): Put relro sections
15512 in a PT_GNU_RELRO segment.
15513 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15514 section as relro.
15515 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15516 PT_TLS segments.
15517 (Layout::linkonce_mapping): Map d.rel.ro.local to
15518 .data.rel.ro.local.
15519 (Layout::output_section_name): Us .data.rel.ro.local for any
15520 section which begins with that.
15521 * layout.h (class Layout): Update add_output_section_data
15522 declaration. Add relro_segment_ field.
15523 * output.cc (Output_section::Output_section): Initialize is_relro_
15524 and is_relro_local_ fields.
15525 (Output_segment::add_output_section): Group relro sections.
15526 (Output_segment::is_first_section_relro): New function.
15527 (Output_segment::maximum_alignment): If there is a relro section,
15528 align the segment to the common page size.
15529 (Output_segment::set_section_addresses): Track whether we are
15530 looking at relro sections. If the last section is a relro
15531 section, align to the common page size.
15532 (Output_segment::set_section_list_addresses): Add in_relro
15533 parameter. Change all callers. Align to the page size when
15534 moving from relro to non-relro section.
15535 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15536 segment.
15537 * output.h (class Output_section): Add is_relro_ and
15538 is_relro_local_ fields.
15539 (Output_section::is_relro): New function.
15540 (Output_section::set_is_relro): New function.
15541 (Output_section::is_relro_local): New function.
15542 (Output_section::set_is_relro_local): New function.
15543 (class Output_segment): Update declarations.
15544 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15545 * sparc.cc (Target_sparc::got_section): Likewise.
15546 * x86_64.cc (Target_x86_64::got_section): Likewise.
15547 * testsuite/relro_test_main.cc: New file.
15548 * testsuite/relro_test.cc: New file.
15549 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15550 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15551 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15552 (relro_test.so, relro_test_pic.o): New targets.
15553 * testsuite/Makefile.in: Rebuild.
15554
a984ee1d
ILT
155552008-05-16 Ian Lance Taylor <iant@google.com>
15556
01676dcd
ILT
15557 * output.cc (Output_segment::add_output_section): Remove front
15558 parameter.
15559 * output.h (class Output_segment): Remove
15560 add_initial_output_section and overloaded add_output_section.
15561 Update declaration of remaining add_output_section.
15562 * layout.cc (Layout::create_interp): Call add_output_section
15563 rather than add_initial_output_section.
15564 (Layout::finish_dynamic_section): Likewise.
15565
497897f9
ILT
15566 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15567 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15568 know the dynamic type.
15569 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15570 field. Initialize it in constructor.
15571 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15572 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15573 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15574 reloc.
15575
a984ee1d
ILT
15576 * output.cc (Output_reloc::get_address): Change return type to
15577 Elf_Addr.
15578 * output.h (class Output_reloc): Update get_address declaration.
15579 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15580 for section addresses.
15581
55ba0940
ILT
155822008-05-09 Ian Lance Taylor <iant@google.com>
15583
15584 PR 6493
15585 * gold.cc (gold_nomem): Use return value of write.
15586
75517b77
ILT
155872008-05-08 Ian Lance Taylor <iant@google.com>
15588
15589 * symtab.c (Symbol::init_base_output_data): Add version
15590 parameter. Change all callers.
15591 (Symbol::init_base_output_segment): Likewise.
15592 (Symbol::init_base_constant): Likewise.
15593 (Symbol::init_base_undefined): Likewise.
15594 (Sized_symbol::init_output_data): Likewise.
15595 (Sized_symbol::init_output_segment): Likewise.
15596 (Sized_symbol::init_constant): Likewise.
15597 (Sized_symbol::init_undefined): Likewise.
15598 (Symbol_table::do_define_in_output_data): If the new symbol has a
15599 version, mark it as the default.
15600 (Symbol_table::do_define_in_output_segment): Likewise.
15601 (Symbol_table::do_define_as_constant): Likewise.
15602 * symtab.h (class Symbol): Update declarations.
15603 (class Sized_symbol): Likewise.
15604 * resolve.cc (Symbol::override_version): New function.
c42e122e 15605 (Symbol::override_base): Call override_version.
75517b77
ILT
15606 (Symbol::override_base_with_special): Likewise.
15607 * testsuite/ver_script_8.script: New file.
15608 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15609 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15610 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15611 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15612
f1f70eae
ILT
156132008-05-06 Ian Lance Taylor <iant@google.com>
15614
f3e9c5c5
ILT
15615 PR 6049
15616 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15617 functions.
15618 (class General_options): Remove existing --undefined, and add
15619 --no-undefined instead. Add new --undefined as synonym for -u.
15620 * archive.cc (Archive::add_symbols): Check whether symbol was
15621 named with -u.
15622 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15623 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15624 all uses. Add IS_UNDEFINED. Update declarations to split
15625 different versions of init_base. Declare init_base_undefined.
15626 (Symbol::is_defined): Handle IS_UNDEFINED.
15627 (Symbol::is_undefined): Likewise.
15628 (Symbol::is_weak_undefined): Call is_undefined.
15629 (Symbol::is_absolute): Handle IS_CONSTANT.
15630 (class Sized_symbol): Update declarations to split different
15631 versions of init. Declare init_undefined.
15632 (class Symbol_table): Declare new functions.
15633 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15634 Change all callers.
15635 (Symbol::init_base_output_data): Likewise.
15636 (Symbol::init_base_output_segment): Likewise.
15637 (Symbol::init_base_constant): Likewise.
15638 (Symbol::init_base_undefined): New function.
15639 (Sized_symbol::init_object): Rename from init. Change all
15640 callers.
15641 (Sized_symbol::init_output_data): Likewise.
15642 (Sized_symbol::init_output_segment): Likewise.
15643 (Sized_symbol::init_constant): Likewise.
15644 (Sized_symbol::init_undefined): New function.
15645 (Symbol_table::add_undefined_symbols_from_command_line): New
15646 function.
15647 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15648 function.
15649 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15650 (Symbol::output_section): Likewise.
15651 (Symbol::set_output_section): Likewise.
15652 (Symbol_table::sized_finalize_symbol): Likewise.
15653 (Symbol_table::sized_write_globals): Likewise.
15654 * resolve.cc (Symbol_table::should_override): Likewise.
15655 (Symbol::override_base_with_special): Likewise.
15656
8bdcdf2c
ILT
15657 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15658 symbol, change it to have default visibility.
15659 * testsuite/protected_1.cc: New file.
15660 * testsuite/protected_2.cc: New file.
15661 * testsuite/protected_3.cc: New file.
15662 * testsuite/protected_main_1.cc: New file.
15663 * testsuite/protected_main_2.cc: New file.
15664 * testsuite/protected_main_3.cc: New file.
15665 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15666 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15667 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15668 (protected_1.so): New target.
15669 (protected_1_pic.o, protected_2_pic.o): New targets.
15670 (protected_3_pic.o): New target.
15671 (check_PROGRAMS): Add protected_2.
15672 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15673 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15674 * testsuite/Makefile.in: Rebuild.
15675
2b706932
ILT
15676 * options.h (DEFINE_var): Add set_user_set_##varname__.
15677 (DEFINE_bool_alias): New macro.
15678 (class General_options): Define -Bstatic using DEFINE_bool_alias
15679 rather than DEFINE_special. Add --undefined as an alias for -z
15680 defs.
15681 * options.cc (General_options::parse_Bstatic): Remove.
15682
d82a5bcc
ILT
15683 * options.h (class General_options): Add --fatal-warnings.
15684 * main.cc (main): Implement --fatal-warnings.
15685 * errors.h (Errors::warning_count): New function.
15686
f1f70eae
ILT
15687 * options.h (class General_options): Add -Bsymbolic-functions.
15688 * symtab.h (Symbol::is_preemptible): Check for
15689 -Bsymbolic-functions.
15690
8825ac63
ILT
156912008-05-05 Ian Lance Taylor <iant@google.com>
15692
d98bc257
ILT
15693 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15694 as noVARNAME rather than no-VARNAME.
15695 (class General_options): Add option -z combreloc.
15696 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15697 get_address.
15698 (Output_reloc::sort_before) [SHT_REL]: New function.
15699 (Output_reloc::sort_before) [SHT_RELA]: New function.
15700 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15701 Sort_relocs_comparison.
15702 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15703 parameter. Change all callers.
15704 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15705 sort_relocs parameter. Change all callers.
15706 * output.cc (Output_reloc::get_address): New function, broken out
15707 of write_rel.
15708 (Output_reloc::write_rel): Call it.
15709 (Output_reloc::compare): New function.
15710 (Output_data_reloc_base::do_write): Optionally sort relocs.
15711
60b2b4e7
ILT
15712 * configure.ac: If targ_extra_obj is set, link it in.
15713 * configure.tgt: Initialize all variables.
15714 (x86_64*): Set targ_extra_obj and targ_extra_size.
15715 * configure: Rebuild.
15716
8825ac63
ILT
15717 * object.cc (Sized_relobj::include_section_group): Adjust section
15718 indexes read from group data. Build vector to pass to
15719 layout_group.
15720 * layout.cc (Layout::layout_group): Add flags and shndxes
15721 parameters. Remove contents parameter. Change caller. Update
15722 explicit instantiations.
15723 * layout.h (class Layout): Update layout_group declaration.
15724 * output.cc (Output_data_group::Output_data_group): Add flags and
15725 input_shndxes parameters. Remove contents parameter. Change
15726 caller.
15727 (Output_data_group::do_write): Change input_sections_ to
15728 input_shndxes_.
15729 * output.h (class Output_data_group): Update constructor
15730 declaration. Rename input_sections_ to input_shndxes_.
15731 * testsuite/many_sections_test.cc: Add template.
15732
e94cf127
CC
157332008-04-30 Cary Coutant <ccoutant@google.com>
15734
4418b2d5
CC
15735 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15736
e94cf127
CC
15737 * layout.cc (Layout::include_section): Refactored check for debug
15738 info section.
15739 (Layout::add_comdat): Add new parameters. Change type
15740 of signature parameter. Add object and shndx to signatures table.
15741 (Layout::find_kept_object): New function.
15742 * layout.h: Include <cstring>.
15743 (Layout::is_debug_info_section): New function.
15744 (Layout::add_comdat): Add new parameters.
15745 (Layout::find_kept_object): New function.
15746 (Layout::Kept_section): New struct.
15747 (Layout::Signatures): Change type of map range.
15748 * object.cc (Relobj::output_section_address): New function.
15749 (Sized_relobj::include_section_group): Add new parameters. Change
15750 calls to Layout::add_comdat. Change to build table of kept comdat
15751 groups and table mapping discarded sections to kept sections.
15752 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15753 (Sized_relobj::do_layout): Change calls to include_section_group and
15754 include_linkonce_section.
15755 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15756 value to zero when section is discarded.
15757 (Sized_relobj::map_to_kept_section): New function.
15758 * object.h (Relobj::output_section_address): New function.
15759 (Relobj::Comdat_group): New type.
15760 (Relobj::find_comdat_group): New function.
15761 (Relobj::Comdat_group_table): New type.
15762 (Relobj::Kept_comdat_section): New type.
15763 (Relobj::Kept_comdat_section_table): New type.
15764 (Relobj::add_comdat_group): New function.
15765 (Relobj::set_kept_comdat_section): New function.
15766 (Relobj::get_kept_comdat_section): New function.
15767 (Relobj::comdat_groups_): New field.
15768 (Relobj::kept_comdat_sections_): New field.
15769 (Symbol_value::input_value): Update comment.
15770 (Sized_relobj::map_to_kept_section) New function.
15771 (Sized_relobj::include_linkonce_section): Add new parameter.
15772 * target-reloc.h (Comdat_behavior): New type.
15773 (get_comdat_behavior): New function.
15774 (relocate_section): Add code to map a discarded section to the
15775 corresponding kept section when applying a relocation.
15776
e4e5049b
CS
157772008-04-30 Craig Silverstein <csilvers@google.com>
15778
15779 * dwarf_reader.cc (next_generation_count): New static var.
15780 (Addr2line_cache_entry): New struct.
15781 (addr2line_cache): New static var.
15782 (Dwarf_line_info::one_addr2line): Added caching.
15783 (Dwarf_line_info::clear_addr2line_cache): New function.
15784 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15785 cache-size parameter.
15786 (Dwarf_line_info::one_addr2line_cache): New function.
15787 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15788 new cache-size argument to one_addr2line(), and clear cache.
15789
d09e9154
CC
157902008-04-28 Cary Coutant <ccoutant@google.com>
15791
15792 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15793 R_386_PC8 relocations.
15794
7ef73768
ILT
157952008-04-23 Ian Lance Taylor <iant@google.com>
15796
55438702
ILT
15797 * object.cc (Sized_relobj::include_section_group): Check for
15798 invalid section group.
15799
c165fb93
ILT
15800 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15801 header size.
15802
7ef73768
ILT
15803 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15804 than read for file header.
15805 * archive.cc (Archive::include_member): Likewise.
15806
6194aaab
L
158072008-04-23 Paolo Bonzini <bonzini@gnu.org>
15808
15809 * aclocal.m4: Regenerate.
15810 * configure: Regenerate.
15811
d491d34e
ILT
158122008-04-19 Ian Lance Taylor <iant@google.com>
15813
5ea2bac6
ILT
15814 * version.cc (version_string): Bump to 1.6.
15815
7bc3e21a
ILT
15816 * testsuite/Makefile.am (many_sections_r_test): New target.
15817 (many_sections_r_test_SOURCES): Remove.
15818 (many_sections_r_test_DEPENDENCIES): Remove.
15819 (many_sections_r_test_LDFLAGS): Remove.
15820 (many_sections_r_test_LDADD): Remove.
15821
7fcd3aa9
ILT
15822 * object.cc (Sized_relobj::do_add_symbols): Always pass
15823 local_symbol_count_ to add_from_relobj.
15824
4c94d6ae
ILT
15825 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15826 every thousand variables.
15827 * testsuite/Makefile.in: Rebuild.
15828
d491d34e
ILT
15829 * object.cc (Xindex::initialize_symtab_xindex): New function.
15830 (Xindex::read_symtab_xindex): New function.
15831 (Xindex::sym_xindex_to_shndx): New function.
15832 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15833 available.
15834 (Sized_relobj::do_initialize_xindex): New function.
15835 (Sized_relobj::do_read_symbols): Adjust section links.
15836 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15837 parameter. Change all callers.
15838 (Sized_relobj::include_section_group): Adjust section links and
15839 symbol section indexes.
15840 (Sized_relobj::do_layout): Adjust section links.
15841 (Sized_relobj::do_count_local_symbols): Adjust section links and
15842 symbol section indexes.
15843 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15844 ordinary and special symbols.
15845 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15846 dynsym_xindex parameters. Change all callers. Adjust section
15847 links. Use SHN_XINDEX when needed.
15848 (Sized_relobj::get_symbol_location_info): Adjust section links.
15849 Don't get fooled by special symbols.
15850 * object.h (class Xindex): Define.
15851 (class Object): Add xindex_ parameter. Declare virtual functoin
15852 do_initialize_xindex.
15853 (Object::adjust_sym_shndx): New function.
15854 (Object::set_xindex): New protected function.
15855 (class Symbol_value): Add is_ordinary_shndx_ field.
15856 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15857 (Symbol_value::value): Assert ordinary section.
15858 (Symbol_value::initialize_input_to_output_map): Likewise.
15859 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15860 Change all callers.
15861 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15862 all callers.
15863 (class Sized_relobj): Update declarations.
15864 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15865 parameter. Change all callers.
15866 (Sized_relobj::adjust_shndx): New function.
15867 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15868 field.
15869 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15870 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15871 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15872 (Sized_dynobj::read_dynsym_section): Adjust section links.
15873 (Sized_dynobj::read_dynamic): Likewise.
15874 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15875 section links.
15876 (Sized_dynobj::do_initialize_xindex): New function.
15877 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15878 do_initialize_xindex.
15879 (Sized_dynobj::adjust_shndx): New function.
15880 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15881 dynsym_xindex_ fields.
15882 (Layout::finalize): Add a call to set_section_indexes before
15883 creating the symtab sections.
15884 (Layout::set_section_indexes): Don't do anything if the section
15885 already has a section index.
15886 (Layout::create_symtab_sections): Add shnum parameter. Change
15887 caller. Create .symtab_shndx section if needed.
15888 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15889 caller.
15890 (Layout::allocated_output_section_count): New function.
15891 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15892 needed.
15893 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15894 fields. Update declarations.
15895 (Layout::symtab_xindex): New function.
15896 (Layout::dynsym_xindex): New function.
15897 (class Write_symbols_task): Add layout_ field.
15898 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15899 Change caller.
15900 * output.cc (Output_section_headers::Output_section_headers): Add
15901 shstrtab_section parameter. Change all callers.
15902 (Output_section_headers::do_sized_write): Store overflow values
15903 for section count and section string table section index in
15904 section header zero.
15905 (Output_file_header::do_sized_write): Check for overflow of
15906 section count and section string table section index.
15907 (Output_symtab_xindex::do_write): New function.
15908 (Output_symtab_xindex::endian_do_write): New function.
15909 * output.h (class Output_section_headers): Add shstrtab_section_.
15910 Update declarations.
15911 (class Output_symtab_xindex): Define.
15912 (Output_section::has_out_shndx): New function.
15913 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15914 field.
15915 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15916 Change all callers.
15917 (Sized_symbol::init): Likewise.
15918 (Symbol::output_section): Check for ordinary symbol.
15919 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15920 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15921 callers.
15922 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15923 Change all callers. Simplify handling of symbols from sections
15924 not included in the link.
15925 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15926 distinction.
15927 (Weak_alias_sorter::operator()): Assert that symbols are
15928 ordinary.
15929 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15930 distinction.
15931 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15932 parameters. Change all callers.
15933 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15934 symbol distinction. Use SHN_XINDEX when needed.
15935 (Symbol_table::write_section_symbol): Add symtab_xindex
15936 parameter. Change all callers.
15937 (Symbol_table::sized_write_section_symbol): Likewise. Use
15938 SHN_XINDEX when needed.
15939 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15940 declarations.
15941 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15942 (Symbol::is_defined): Check is_ordinary.
15943 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15944 (Symbol::is_absolute, Symbol::is_common): Likewise.
15945 (class Sized_symbol): Update declarations.
15946 (class Symbol_table): Update declarations.
15947 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15948 parameters. Change all callers.
15949 (Sized_symbol::override): Likewise.
15950 (Symbol_table::override): Likewise.
15951 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15952 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15953 is_ordinary, and orig_st_shndx parameters. Change all callers.
15954 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15955 to be in an ordinary section.
15956 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15957 object and is_ordinary parameters. Change all callers.
15958 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15959 Change all callers. Don't add undefined or non-ordinary symbols
15960 to reloc_map_.
15961 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15962 Change all callers.
15963 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15964 declarations.
15965 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15966 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15967 (Sized_relobj::relocate_sections): Likewise.
15968 * target-reloc.h (scan_relocs): Adjust section symbol index.
15969 (scan_relocatable_relocs): Likewise.
15970 * i386.cc (Scan::local): Check for ordinary symbols.
15971 * sparc.cc (Scan::local): Likewise.
15972 * x86_64.cc (Scan::local): Likewise.
15973 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15974 to symbol_section_and_value.
15975 * testsuite/many_sections_test.cc: New file.
15976 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15977 (check_PROGRAMS): Add many_sections_test.
15978 (many_sections_test_SOURCES): Define.
15979 (many_sections_test_DEPENDENCIES): Define.
15980 (many_sections_test_LDFLAGS): Define.
15981 (BUILT_SOURCES): Add many_sections_define.h.
15982 (many_sections_define.h): New target.
15983 (BUILT_SOURCES): Add many_sections_check.h.
15984 (many_sections_check.h): New target.
15985 (check_PROGRAMS): Add many_sections_r_test.
15986 (many_sections_r_test_SOURCES): Define.
15987 (many_sections_r_test_DEPENDENCIES): Define.
15988 (many_sections_r_test_LDFLAGS): Define.
15989 (many_sections_r_test_LDADD): Define.
15990 (many_sections_r_test.o): New target.
15991 * testsuite/Makefile.in: Rebuild.
15992
c5818ff1
CC
159932008-04-17 Cary Coutant <ccoutant@google.com>
15994
15995 * errors.cc (Errors::info): New function.
15996 (gold_info): New function.
15997 * errors.h (Errors::info): New function.
15998 * gold.h (gold_info): New function.
15999 * object.cc (Input_objects::add_object): Print trace output.
16000 * options.cc (options::parse_set): New function.
16001 (General_options::parse_wrap): Deleted.
16002 (General_options::General_options): Deleted initializer.
16003 * options.h (options::String_set): New typedef.
16004 (options::parse_set): New function.
16005 (DEFINE_set): New macro.
16006 (General_options::wrap): Changed to use DEFINE_set. Changed
16007 callers of any_wrap_symbols and is_wrap_symbol.
16008 (General_options::trace, General_options::trace_symbol):
16009 New options.
16010 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16011 (General_options::wrap_symbols_): Deleted.
16012 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16013
b5be4a7c
DM
160142008-04-17 David S. Miller <davem@davemloft.net>
16015
16016 * options.cc (General_options::parse_V): New function.
16017 * options.h: Add entries for -V and -Qy.
16018
155a0dd7
ILT
160192008-04-17 Ian Lance Taylor <iant@google.com>
16020
16021 * common.cc (Symbol_table::allocate_commons): Remove options
16022 parameter. Change caller.
16023 (Symbol_table::do_allocate_commons): Remove options parameter.
16024 Change caller. Just call do_allocate_commons_list twice.
16025 (Symbol_table::do_allocate_commons_list): New function, broken out
16026 of do_allocate_commons.
16027 * common.h (class Allocate_commons_task): Remove options_ field.
16028 Update constructor.
16029 * symtab.cc (Symbol_table::Symbol_table): Initialize
16030 tls_commons_.
16031 (Symbol_table::add_from_object): Put TLS common symbols on
16032 tls_commons_ list.
16033 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16034 which are IN_OUTPUT_DATA.
16035 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16036 allocate_commons and do_allocate_commons declarations. Declare
16037 do_allocate_commons_list.
16038 * gold.cc (queue_middle_tasks): Update creation of
16039 Allocate_commons_task to not pass options.
16040 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16041 (TLS_TEST_C_FLAGS): New variable.
16042 (tls_test_c_pic.o): New target.
16043 (tls_test_shared.so): Link in tls_test_c_pic.o.
16044 (tls_test_c_pic_ie.o): New target.
16045 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16046 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16047 (tls_test_c.o): New target.
16048 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16049 (tls_pic_test_LDADD): Likewise.
16050 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16051 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16052 (tls_test_c_gnu2.o): New target.
16053 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16054 tls_test_c_gnu2.o.
16055 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16056 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16057 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16058 * testsuite/tls_test.cc: Include "config.h".
16059 (t_last): Call t11_last.
16060 * testsuite/tls_test.h (t11, t11_last): Declare.
16061 * testsuite/tls_test_c.c: New file.
16062 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16063 * configure.ac: Check for OpenMP support.
16064 * configure, config.in, Makefile.in: Rebuild.
16065 * testsuite/Makefile.in: Rebuild.
16066
edfbb029
CC
160672008-04-16 Cary Coutant <ccoutant@google.com>
16068
16069 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16070 (Target_i386::tls_base_symbol_defined_): New field.
16071 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16072 (Target_i386::Scan::global): Likewise.
16073 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16074 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16075 (Target_x86_64::tls_base_symbol_defined_): New field.
16076 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16077 (Target_x86_64::Scan::global): Likewise.
16078
f3c69fca
CC
160792008-04-16 Cary Coutant <ccoutant@google.com>
16080
16081 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16082 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16083 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16084 building shared libraries.
16085 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16086 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16087 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16088 * testsuite/Makefile.in: Rebuild.
16089 * testsuite/weak_undef.h: New file.
16090 * testsuite/weak_undef_file1.cc: Add extra test cases.
16091 * testsuite/weak_undef_file2.cc: Likewise.
16092 * testsuite/weak_undef_test.cc: Likewise.
16093
7c414435
DM
160942008-04-16 David S. Miller <davem@davemloft.net>
16095
32b769e1
DM
16096 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16097 Add issued_non_pic_error_ field. Declare check_non_pic.
16098 (Target_sparc::Scan::check_non_pic): New function.
16099 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16100 (Target_sparc::Scan::global): Likewise.
16101
11936fb1
DM
16102 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16103 * configure: Rebuild.
16104
7c414435
DM
16105 * options.h (DEFINE_enable): New macro.
16106 (new_dtags): New enable option.
16107 (initfirst, interpose, loadfltr, nodefaultlib,
16108 nodelete, nodlopen, nodump): New -z options.
16109 * layout.cc (Layout:finish_dynamic_section): If new
16110 dtags enabled, emit DT_RUNPATH. Also, emit a
16111 DT_FLAGS_1 containing any specified -z flags.
16112
85c7bf8b
ILT
161132008-04-16 Ian Lance Taylor <iant@google.com>
16114
12c0daef
ILT
16115 * copy-relocs.cc: New file.
16116 * copy-relocs.h: New file.
16117 * reloc.cc: Remove Copy_relocs code.
16118 * reloc.h: Likewise.
16119 * reloc-types.h (struct Reloc_types) [both versions]: Add
16120 get_reloc_addend_noerror.
16121 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16122 variants of add_global which take an addend which must be zero.
16123 * i386.cc: Include "copy-relocs.h".
16124 (class Target_i386): Change type of copy_relocs_ to variable,
16125 update initializer.
16126 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16127 Change all callers.
16128 (Target_i386::do_finalize_sections): Change handling of
16129 copy_relocs_.
16130 * sparc.cc: Include "copy-relocs.h".
16131 (class Target_sparc): Change type of copy_relocs_ to variable,
16132 update initializer.
16133 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16134 Change all callers.
16135 (Target_sparc::do_finalize_sections): Change handling of
16136 copy_relocs_.
16137 * x86_64.cc: Include "copy-relocs.h".
16138 (class Target_x86_64): Change type of copy_relocs_ to variable,
16139 update initializer.
16140 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16141 class. Change all callers.
16142 (Target_x86_64::do_finalize_sections): Change handling of
16143 copy_relocs_.
16144 * Makefile.am (CCFILES): Add copy-relocs.cc.
16145 (HFILES): Add copy-relocs.h.
16146
4f4995b6
ILT
16147 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16148
85c7bf8b
ILT
16149 * testsuite/script_test_4.sh: Permit leading zeroes.
16150
4f2a9edd
ILT
161512008-04-15 Ian Lance Taylor <iant@google.com>
16152
e6188289
ILT
16153 * script-sections.cc (Script_sections::create_segments): Use
16154 header_size_adjustment even when there is enough room for the
16155 headers.
16156 * testsuite/script_test_4.sh: New file.
16157 * testsuite/script_test_4.t: New file.
16158 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16159 (check_DATA): Add script_test_4.stdout.
16160 (MOSTLYCLEANFILES): Likewise.
16161 (script_test_4): New target.
16162 (script_test_4.stdout): New target.
16163 * testsuite/Makefile.in: Rebuild.
16164
4f2a9edd
ILT
16165 * sparc.cc: Add definitions for Output_data_plt_sparc class
16166 constants.
16167
f5314dd5
DM
161682008-04-14 David S. Miller <davem@davemloft.net>
16169
16170 * sparc.cc: New file.
16171 * Makefile.am (TARGETSOURCES): Add sparc.cc
16172 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16173 * configure.tgt: Document targ_extra_size and
16174 targ_extra_big_endian. Add entries for sparc-* and
16175 sparc64-*.
16176 * configure.ac: Handle targ_extra_size and
16177 targ_extra_big_endian.
16178 * Makefile.in: Rebuild.
16179 * configure: Likewise.
16180 * po/POTFILES.in: Likewise.
16181 * po/gold.pot: Likewise.
16182
154e0e9a
ILT
161832008-04-14 Ian Lance Taylor <iant@google.com>
16184
16185 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16186 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16187 in the name/type/flags to section mapping. Don't call
16188 allocate_output_section.
16189 (Layout::choose_output_section): Change parameter from adjust_name
16190 to is_input_section. Don't permit input sections after sections
16191 are attached to segments. Don't call allocate_output_section.
16192 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16193 not write_enable_output_section.
16194 (Layout::make_output_section): Don't push to
16195 unattached_section_list_ nor call attach_to_segment. Call
16196 attach_section_to_segment if sections are attached.
16197 (Layout::attach_sections_to_segments): New function.
16198 (Layout::attach_section_to_segment): New function.
16199 (Layout::attach_allocated_section_to_segment): Rename from
16200 attach_to_segment. Remove flags parameter.
16201 (Layout::allocate_output_section): Remove function.
16202 (Layout::write_enable_output_section): Remove function.
16203 * layout.h (class Layout): Update for above changes. Add new
16204 field sections_are_attached_.
16205 * output.h (Output_section::update_flags_for_input_section): New
16206 function.
16207 * output.cc (Output_section::add_input_section): Call
16208 update_flags_for_input_section.
16209 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16210
009a67a2
CC
162112008-04-11 Cary Coutant <ccoutant@google.com>
16212
16213 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16214 thought unnecessary.
16215 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16216
759b1a24
ILT
162172008-04-11 Ian Lance Taylor <iant@google.com>
16218
16219 * output.h (class Output_section_data): Remove inline definition
16220 of set_addralign.
16221 * output.cc (Output_section_data::set_addralign): New function.
16222
c2b45e22
CC
162232008-04-11 Cary Coutant <ccoutant@google.com>
16224
16225 Add support for TLS descriptors for i386 and x86_64.
16226 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16227 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16228 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16229 GOT_TYPE_TLS_DESC.
16230 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16231 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16232 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16233 relocations.
16234 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16235 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16236 Fix problem with initial-exec relocations.
16237 (Target_i386::Relocate::relocate_tls): Likewise.
16238 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16239 relaxation.
16240 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16241 support for section-plus-offset dynamic table entries.
16242 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16243 (Output_data_dynamic::Dynamic_entry): Add support for
16244 section-plus-offset dynamic table entries.
16245 (Output_data_dynamic::Classification): Likewise.
16246 (Output_data_dynamic::classification_): Renamed offset_.
16247 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16248 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16249 (Target_x86_64::make_plt_section): New function.
16250 (Target_x86_64::reserve_tlsdesc_entries): New function.
16251 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16252 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16253 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16254 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16255 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16256 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16257 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16258 add extra PLT entry for TLS descriptors.
16259 (Output_data_plt_x86_64::got_): New field.
16260 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16261 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16262 fields.
16263 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16264 descriptors.
16265 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16266 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16267 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16268 R_386_TLS_DESC_CALL relocations.
16269 (Target_x86_64::Scan::global): Likewise.
16270 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16271 for TLS descriptors.
16272 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16273 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16274 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16275 GD-to-IE relaxation.
16276 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16277 and TLS_DESCRIPTORS.
16278 * Makefile.in: Rebuild.
16279 * configure: Rebuild.
16280 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16281 (tls_test_shared2.so): New target.
16282 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16283 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16284 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16285 (tls_shared_gd_to_ie_test_LDADD): New variable.
16286 (tls_shared_gnu2_gd_to_ie_test): New target.
16287 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16288 New targets.
16289 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16290 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16291 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16292 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16293 (tls_shared_gnu2_test): New target.
16294 (tls_test_gnu2_shared.so): New target.
16295 (tls_shared_gnu2_test_SOURCES): New variable.
16296 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16297 (tls_shared_gnu2_test_LDFLAGS): New variable.
16298 (tls_shared_gnu2_test_LDADD): New variable.
16299 * testsuite/Makefile.in: Rebuild.
16300 * testsuite/Makefile.
16301
83bfb6b7
ILT
163022008-04-11 Ian Lance Taylor <iant@google.com>
16303
16304 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16305 justsyms.t.
16306 * testsuite/Makefile.in: Rebuild.
16307
16308 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16309 long.
16310 * testsuite/script_test_2.cc (main): Adjust test.
16311
706e1f5e
ILT
163122008-04-11 David S. Miller <davem@davemloft.net>
16313 Ian Lance Taylor <iant@google.com>
16314
16315 * options.h (General_options): Add entries for '-Y' and
16316 '-relax'.
16317 * options.cc (General_options:finalize): If -Y was used, add those
16318 entries to the library path instead of the default "/lib" and
16319 "/usr/lib".
16320
7c98e6bb
DM
163212008-04-11 David S. Miller <davem@davemloft.net>
16322
16323 * testsuite/justsyms.t: Start at 0x100.
16324 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16325 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16326 long.
16327 * testsuite/script_test_2.cc: Adjust string and section length
16328 checks.
7c98e6bb 16329
99a37bfd
ILT
163302008-04-09 Ian Lance Taylor <iant@google.com>
16331
2cefc357
ILT
16332 PR gold/5996
16333 * script-sections.cc (Sections_element::allocate_to_segment): Add
16334 orphan parameter.
16335 (Output_section_definition::allocate_to_segment): Likewise.
16336 (Orphan_output_section::allocate_to_segment): Likewise.
16337 (Script_sections::attach_sections_using_phdrs_clause): Don't
16338 propagate non-PT_LOAD segments to orphan sections.
16339 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16340 readelf rather than objdump.
16341 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16342 .interp section and PT_INTERP segment are the same size.
16343 * testsuite/Makefile.in: Rebuild.
16344
99a37bfd
ILT
16345 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16346 aliases for symbols defined in the same object.
16347 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16348 (weak_alias_test_SOURCES): New variable.
16349 (weak_alias_test_DEPENDENCIES): New variable.
16350 (weak_alias_test_LDFLAGS): New variable.
16351 (weak_alias_test_LDADD): New variable.
16352 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16353 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16354 (weak_alias_test_3.o): New target.
16355 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16356 * testsuite/weak_alias_test_main.cc: New file.
16357 * testsuite/weak_alias_test_1.cc: New file.
16358 * testsuite/weak_alias_test_2.cc: New file.
16359 * testsuite/weak_alias_test_3.cc: New file.
16360
780e49c5
ILT
163612008-04-08 Ian Lance Taylor <iant@google.com>
16362
cdb0b8f5
ILT
16363 * options.h (class General_options): Add --noinhibit-exec option.
16364 * main.cc (main): Check --noinhibit-exec.
16365
0864d551
ILT
16366 * options.h (class General_options): Define --wrap as a special
16367 option. Add wrap_symbols_ field.
16368 (General_options::any_wrap_symbols): New function.
16369 (General_options::is_wrap_symbol): New function.
16370 * options.cc (General_options::parse_wrap): New function.
16371 (General_options::General_options): Initialize wrap_symbols_.
16372 * symtab.cc (Symbol_table::wrap_symbol): New function.
16373 (Symbol_table::add_from_object): Handle --wrap.
16374 * symtab.h (class Symbol_table): Declare wrap_symbol.
16375 * target.h (Target::wrap_char): New function.
16376 (Target::Target_info): Add wrap_char field.
16377 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16378 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16379 * testsuite/testfile.cc (Target_test::test_target_info):
16380 Likewise.
16381
789aa6de
ILT
16382 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16383 there is one.
16384
2c38906f
ILT
16385 * layout.h (class Layout): Add added_eh_frame_data_ field.
16386 * layout.cc (Layout::Layout): Initialize new field.
16387 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16388 output section until we find a section we merged successfully.
16389 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16390 that the size be non-zero.
16391
780e49c5
ILT
16392 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16393 qualifier.
16394
7fcd0256
ILT
163952008-04-08 Craig Silverstein <csilvers@google.com>
16396
16397 * configure.ac: Export new conditional variable HAVE_ZLIB.
16398 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16399 on HAVE_ZLIB.
16400 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16401 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16402
6835af53
ILT
164032008-04-07 Ian Lance Taylor <iant@google.com>
16404
e24f324c
ILT
16405 * version.cc (version_string): Set to "1.5".
16406
a036edd8
ILT
16407 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16408 Add issued_non_pic_error_ field. Declare check_non_pic.
16409 (Target_x86_64::Scan::check_non_pic): New function.
16410 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16411 (Target_x86_64::Scan::global): Likewise.
16412
624f8810
ILT
16413 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16414 addend parameter. Change caller. Handle merge sections.
16415 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16416 Address to Addend. Don't add in the result of
16417 local_section_offset, pass down the addend and use the returned
16418 value.
16419 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16420 Update declarations of local_section_offset and symbol_value.
16421 * testsuite/two_file_test_1.cc (t18): New function.
16422 * testsuite/two_file_test_2.cc (f18): New function.
16423 * testsuite/two_file_test_main.cc (main): Call t18.
16424 * testsuite/two_file_test.h (t18, f18): Declare.
16425
6835af53
ILT
16426 * configure.ac: Don't test for objdump, c++filt, or readelf.
16427 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16428 conditionals.
16429 (TEST_READELF): New variable.
16430 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16431 (check_PROGRAMS): Add two_file_strip_test.
16432 (two_file_strip_test): New target.
16433 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16434 (two_file_same_shared_strip_test_SOURCES): New variable.
16435 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16436 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16437 (two_file_same_shared_strip_test_LDADD): New variable.
16438 (two_file_shared_strip.so): New target.
16439 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16440 (ver_test_5.syms, ver_test_7.syms): Likewise.
16441 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16442 (strip_test_3.stdout): Use TEST_OBJDUMP.
16443 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16444
86925eef
CC
164452008-04-04 Cary Coutant <ccoutant@google.com>
16446
16447 * symtab.h (Symbol::is_weak_undefined): New function.
16448 (Symbol::is_strong_undefined): New function.
16449 (Symbol::is_absolute): New function.
16450 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16451 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16452 absolute symbols.
16453 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16454 (weak_undef_test): New target.
16455 * testsuite/Makefile.in: Rebuild.
16456 * testsuite/weak_undef_file1.cc: New file.
16457 * testsuite/weak_undef_file2.cc: New file.
16458 * testsuite/weak_undef_test.cc: New file.
16459
126f3ece
ILT
164602008-04-03 Craig Silverstein <csilvers@google.com>
16461
16462 * compressed_output.h (class Output_compressed_section): Use
16463 unsigned buffer.
16464 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16465 add zlib header.
16466 (zlib_compressed_suffix): Removed.
16467 (Output_compressed_section::set_final_data_size): Use unsigned
16468 buffers.
16469 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16470 Fix linker invocation.
16471 (flagstest_o_specialfile_and_compress_debug_sections):
16472 Likewise.
16473 * testsuite/Makefile.in: Regenerated.
16474
deae2a14
DM
164752008-04-02 David S. Miller <davem@davemloft.net>
16476
16477 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16478 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16479
70752818
ILT
164802008-04-02 Craig Silverstein <csilvers@google.com>
16481
16482 * TODO: New file.
16483
39d0cb0e
ILT
164842008-04-02 Ian Lance Taylor <iant@google.com>
16485
16486 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16487 parameters. Update for new key type to views_. Change all
16488 callers.
16489 (File_read::read): Adjust for byteshift in returned view.
16490 (File_read::add_view): New function, broken out of
16491 find_and_make_view.
16492 (File_read::make_view): New function, broken out of
16493 find_and_make_view.
16494 (File_read::find_or_make_view): Add offset and aligned
16495 parameters. Rewrite accordingly. Change all callers.
16496 (File_read::get_view): Add offset and aligned parameters. Adjust
16497 for byteshift in return value.
16498 (File_read::get_lasting_view): Likewise.
16499 * fileread.h (class File_read): Update declarations.
16500 (class File_read::View): Add byteshift_ field. Add byteshift to
16501 constructor. Add byteshift method.
16502 * archive.h (Archive::clear_uncached_views): New function.
16503 (Archive::get_view): Add aligned parameter. Change all callers.
16504 * object.h (Object::get_view): Add aligned parameter. Change all
16505 callers.
16506 (Object::get_lasting_view): Likewise.
16507
16508 * fileread.cc (File_read::release): Don't call clear_views if
16509 there are multiple objects.
16510 * fileread.h (File_read::clear_uncached_views): New function.
16511 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16512 on the archive.
16513
a1207466
CC
165142008-03-31 Cary Coutant <ccoutant@google.com>
16515
16516 Add thin archive support.
16517 * archive.cc (Archive::armagt): New const.
16518 (Archive::setup): Remove task parameter and calls to unlock.
16519 (Archive::unlock_nested_archives): New function.
16520 (Archive::read_header): Add nested_off parameter. Change
16521 all callers.
16522 (Archive::interpret_header): Likewise.
16523 (Archive::include_all_members): Change to handle thin
16524 archives.
16525 (Archive::include_member): Likewise.
16526 * archive.h (Archive::Archive): Add new parameters and
16527 initializers.
16528 (Archive::armagt): New const.
16529 (Archive::setup): Remove task parameter.
16530 (Archive::unlock_nested_archives): New function.
16531 (Archive::read_header): Add nested_off parameter.
16532 (Archive::interpret_header): Likewise.
16533 (Archive::Nested_archive_table): New typedef.
16534 (Archive::is_thin_archive_): New field.
16535 (Archive::nested_archives_): New field.
16536 (Archive::options_): New field.
16537 (Archive::dirpath_): New field.
16538 (Archive::task_): New field.
16539 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16540 for thin archives. Pass additional parameters to
16541 Archive::Archive. Unlock the archive file after calling
16542 Archive::setup.
cd536b21 16543
479f6503
ILT
165442008-03-29 Ian Lance Taylor <iant@google.com>
16545
686c8caf
ILT
16546 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16547 version symbol to be local.
16548 * testsuite/ver_test_4.sh: New file.
16549 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16550 (check_DATA): Add ver_test_4.syms.
16551 (ver_test_4.syms): New target.
16552 * testsuite/Makefile.in: Rebuild.
16553
ab794b6b
ILT
16554 * output.cc
16555 (Output_section::Input_section_sort_entry::has_priority): New
16556 function.
16557 (Output_section::Input_section_sort_entry::match_file_name): New
16558 function.
16559 (Output_section::Input_section_sort_entry::match_section_name):
16560 Remove.
16561 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16562 Remove.
16563 (Output_section::Input_section_sort_entry::match_section_file):
16564 Remove.
16565 (Output_section::Input_section_sort_compare::operator()): Rewrite
16566 using new Input_section_sort_entry functions. Sort crtbegin and
16567 crtend first. Sort sections with no priority before sections with
16568 a priority.
16569 * testsuite/initpri1.c (d3): Check j != 4.
16570 (cd5): New constructor/destructor function.
16571 (main): Check j != 2.
16572
479f6503
ILT
16573 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16574 new symbol when resolving, don't call set_is_default.
16575 * testsuite/ver_test_7.cc: New file.
16576 * testsuite/ver_test_7.sh: New file.
16577 * testsuite/Makefile.am (ver_test_7.so): New target.
16578 (ver_test_7.o): New target.
16579 (check_SCRIPTS): Add ver_test_7.sh.
16580 (check_DATA): Add ver_test_7.syms.
16581 (ver_test_7.syms): New target.
16582
2fd32231
ILT
165832008-03-28 Ian Lance Taylor <iant@google.com>
16584
16585 * layout.cc (Layout::layout): If we see an input section with a
16586 name that needs sorting, set the must_sort flag for the output
16587 section.
16588 (Layout::make_output_section): If the name of the output section
16589 indicates that it might require sorting, set the may_sort flag.
16590 * output.h (Output_section::may_sort_attached_input_sections): New
16591 function.
16592 (Output_section::set_may_sort_attached_input_sections): New
16593 function.
16594 (Output_section::must_sort_attached_input_sections): New
16595 function.
16596 (Output_section::set_must_sort_attached_input_sections): New
16597 function.
16598 (class Output_section): Declare Input_section_sort_entry. Define
16599 Input_section_sort_compare. Declare
16600 sort_attached_input_sections. Add new fields:
16601 may_sort_attached_input_sections_,
16602 must_sort_attached_input_sections_,
16603 attached_input_sections_are_sorted_.
16604 * output.cc (Output_section::Output_section): Initialize new
16605 fields.
16606 (Output_section::add_input_section): Add an entry to
16607 input_sections_ if may_sort or must_sort are true.
16608 (Output_section::set_final_data_size): Call
16609 sort_attached_input_sections if necessary.
16610 (Output_section::Input_section_sort_entry): Define new class.
16611 (Output_section::Input_section_sort_compare::operator()): New
16612 function.
16613 (Output_section::sort_attached_input_sections): New function.
16614 * configure.ac: Check whether the compiler supports constructor
16615 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16616 * testsuite/initpri1.c: New file.
16617 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16618 CONSTRUCTOR_PRIORITY.
16619 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16620 (initpri1_LDFLAGS): New variable.
16621 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16622
18e6b24e
ILT
166232008-03-27 Ian Lance Taylor <iant@google.com>
16624
49bdd526
ILT
16625 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16626 * testsuite/common_test_1.c: New file.
16627 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16628 (common_test_1_SOURCES): New variable.
16629 (common_test_1_DEPENDENCIES): New variable.
16630 (common_test_1_LDFLAGS): New variable.
16631
18e6b24e
ILT
16632 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16633 and commons_ correctly when NAME/VERSION does not override
16634 NAME/NULL.
16635 * testsuite/ver_test_6.c: New file.
16636 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16637 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16638 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16639
04bf7072
ILT
166402008-03-26 Ian Lance Taylor <iant@google.com>
16641
5871526f
ILT
16642 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16643 of an undefined symbol from a version script.
16644 * testsuite/Makefile.am (ver_test_5.so): New target.
16645 (ver_test_5.o): New target.
16646 (check_SCRIPTS): Add ver_test_5.sh.
16647 (check_DATA): Add ver_test_5.syms.
16648 (ver_test_5.syms): New target.
16649 * testsuite/ver_test_5.cc: New file.
16650 * testsuite/ver_test_5.script: New file.
16651 * testsuite/ver_test_5.sh: New file.
16652 * Makefile.in, testsuite/Makefile.in: Rebuild.
16653
04bf7072
ILT
16654 PR gold/5986
16655 Fix problems building gold with gcc 4.3.0.
16656 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16657 (gold_error_at_location, gold_warning_at_location): Use it.
16658 * configure.ac: Check whether we can compile and use a template
16659 function with a printf attribute.
16660 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16661 when jumping over bytes.
16662 * object.cc: Instantiate Object::read_section_data.
16663 * debug.h: Include <cstring>
16664 * dwarf_reader.cc: Include <algorithm>
16665 * main.cc: Include <cstring>.
16666 * options.cc: Include <cstring>.
16667 * output.cc: Include <cstring>.
16668 * script.cc: Include <cstring>.
16669 * script.h: Include <string>.
16670 * symtab.cc: Include <cstring> and <algorithm>.
16671 * target-select.cc: Include <cstring>.
16672 * version.cc: Include <string>.
16673 * testsuite/testmain.cc: Include <cstdlib>.
16674 * configure, config.in: Rebuild.
16675
874c5b28
ILT
166762008-03-25 Ian Lance Taylor <iant@google.com>
16677
819d6c3a
ILT
16678 * options.cc: Include "../bfd/bfdver.h".
16679 (options::help): Print bug reporting address.
16680
f4b2c6f5
ILT
16681 * version.cc (print_version): Adjust output for current value of
16682 BFD_VERSION_STRING.
16683
16684 * NEWS: New file.
16685
e96caa79
ILT
16686 * options.cc (options::help): Print list of supported targets.
16687 * target-select.h: Include <vector>.
16688 (class Target_selector): Make machine_, size_, and is_big_endian_
16689 fields const. Add bfd_name_ and instantiated_target_ fields.
16690 (Target_selector::Target_selector): Add bfd_name parameter.
16691 (Target_selector::recognize): Make non-virtual, call
16692 do_recognize.
16693 (Target_selector::recognize_by_name): Make non-virtual, call
16694 do_recognize_by_name.
16695 (Target_selector::supported_names): New function.
16696 (Target_selector::bfd_name): New function.
16697 (Target_selector::do_instantiate_target): New pure virtual
16698 function.
16699 (Target_selector::do_recognize): New virtual function.
16700 (Target_selector::do_recognize_by_name): New virtual function.
16701 (Target_selector::instantiate_target): New private function.
16702 (supported_target_names): Declare.
16703 * target-select.cc (Target_selector::Target_selector): Update for
16704 new parameter and fields.
16705 (select_target_by_name): Check that the name matches before
16706 calling recognize_by_name.
16707 (supported_target_names): New function.
16708 * i386.cc (class Target_selector_i386): Update Target_selector
16709 constructor call. Remove recognize and recognize_by_name. Add
16710 do_instantiate_target.
16711 * x86_64.cc (class Target_selector_x86_64): Likewise.
16712 * testsuite/testfile.cc (class Target_selector_test): Update for
16713 changes to Target_selector.
16714
874c5b28
ILT
16715 * README: Rewrite, with some notes on unsupported features.
16716
0a65a3a7
CC
167172008-03-24 Cary Coutant <ccoutant@google.com>
16718
16719 * i386.cc (Target_i386::Got_type): New enum declaration.
16720 (Target_i386::Scan::local): Updated callers of Output_data_got
16721 member functions.
16722 (Target_i386::Scan::global): Likewise.
16723 (Target_i386::Relocate::relocate): Likewise.
16724 (Target_i386::Relocate::relocate_tls): Likewise.
16725 * object.h (Got_offset_list): New class.
16726 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16727 (Sized_relobj::local_got_offset): Likewise.
16728 (Sized_relobj::set_local_got_offset): Likewise.
16729 (Sized_relobj::local_has_tls_got_offset): Removed.
16730 (Sized_relobj::local_tls_got_offset): Removed.
16731 (Sized_relobj::set_local_tls_got_offset): Removed.
16732 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16733 * output.cc (Output_data_got::add_global): Added got_type parameter.
16734 (Output_data_got::add_global_with_rel): Likewise.
16735 (Output_data_got::add_global_with_rela): Likewise.
16736 (Output_data_got::add_global_pair_with_rel): New function.
16737 (Output_data_got::add_global_pair_with_rela): New function.
16738 (Output_data_got::add_local): Added got_type parameter.
16739 (Output_data_got::add_local_with_rel): Likewise.
16740 (Output_data_got::add_local_with_rela): Likewise.
16741 (Output_data_got::add_local_pair_with_rel): New function.
16742 (Output_data_got::add_local_pair_with_rela): New function.
16743 (Output_data_got::add_global_tls): Removed.
16744 (Output_data_got::add_global_tls_with_rel): Removed.
16745 (Output_data_got::add_global_tls_with_rela): Removed.
16746 (Output_data_got::add_local_tls): Removed.
16747 (Output_data_got::add_local_tls_with_rel): Removed.
16748 (Output_data_got::add_local_tls_with_rela): Removed.
16749 * output.h (Output_data_got::add_global): Added got_type parameter.
16750 (Output_data_got::add_global_with_rel): Likewise.
16751 (Output_data_got::add_global_with_rela): Likewise.
16752 (Output_data_got::add_global_pair_with_rel): New function.
16753 (Output_data_got::add_global_pair_with_rela): New function.
16754 (Output_data_got::add_local): Added got_type parameter.
16755 (Output_data_got::add_local_with_rel): Likewise.
16756 (Output_data_got::add_local_with_rela): Likewise.
16757 (Output_data_got::add_local_pair_with_rel): New function.
16758 (Output_data_got::add_local_pair_with_rela): New function.
16759 (Output_data_got::add_global_tls): Removed.
16760 (Output_data_got::add_global_tls_with_rel): Removed.
16761 (Output_data_got::add_global_tls_with_rela): Removed.
16762 (Output_data_got::add_local_tls): Removed.
16763 (Output_data_got::add_local_tls_with_rel): Removed.
16764 (Output_data_got::add_local_tls_with_rela): Removed.
16765 * resolve.cc (Symbol::override_base_with_special): Removed
16766 reference to has_got_offset_ field.
16767 * symtab.cc (Symbol::init_fields): Replaced initialization
16768 of got_offset_ with got_offsets_. Removed initialization
16769 of has_got_offset_
53fcba31 16770 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16771 (Symbol::got_offset): Likewise.
16772 (Symbol::set_got_offset): Likewise.
16773 (Symbol::has_tls_got_offset): Removed.
16774 (Symbol::tls_got_offset): Removed.
16775 (Symbol::set_tls_got_offset): Removed.
16776 (Symbol::got_offset_): Removed.
16777 (Symbol::tls_mod_got_offset_): Removed.
16778 (Symbol::tls_pair_got_offset_): Removed.
16779 (Symbol::got_offsets_): New field.
16780 (Symbol::has_got_offset): Removed.
16781 (Symbol::has_tls_mod_got_offset): Removed.
16782 (Symbol::has_tls_pair_got_offset): Removed.
16783 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16784 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16785 member functions.
16786 (Target_x86_64::Scan::global): Likewise.
16787 (Target_x86_64::Relocate::relocate): Likewise.
16788 (Target_x86_64::Relocate::relocate_tls): Likewise.
16789
bd52eafb
BE
167902008-03-25 Ben Elliston <bje@au.ibm.com>
16791
16792 * yyscript.y: Fix spelling error in comment.
16793
8b105e34
ILT
167942008-03-24 Ian Lance Taylor <iant@google.com>
16795
8ed814a9
ILT
16796 * options.h (class General_options): Define build_id option.
16797 * layout.h (class Layout): Declare write_build_id, create_note,
16798 create_build_id. Add build_id_note_ member.
16799 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16800 "libiberty.h", "md5.h", "sha1.h".
16801 (Layout::Layout): Initialize eh_frame_data_,
16802 eh_frame_hdr_section_, and build_id_note_.
16803 (Layout::finalize): Call create_build_id.
16804 (Layout::create_note): New function, broken out of
16805 Layout::create_gold_note.
16806 (Layout::create_gold_note): Call create_note.
16807 (Layout::create_build_id): New function.
16808 (Layout::write_build_id): New function.
16809 (Close_task_runner::run): Call write_build_id.
16810
8b105e34
ILT
16811 * x86_64.cc: Correct license to GPLv3.
16812
086a1841
ILT
168132008-03-23 Ian Lance Taylor <iant@google.com>
16814
16815 * options.cc: Include "demangle.h".
16816 (parse_optional_string): New function.
16817 (parse_long_option): Handle takes_optional_argument.
16818 (parse_short_option): Update dash_z initializer. Handle
16819 takes_optional_argument.
16820 (General_options::General_options): Initialize do_demangle_.
16821 (General_options::finalize): Set do_demangle_. Handle demangling
16822 style.
16823 * options.h (parse_optional_string): Declare.
16824 (struct One_option): Add optional_arg field. Update constructor.
16825 Update call constructor calls. Add takes_optional_argument
16826 function.
16827 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16828 (DEFINE_optional_string): Define.
16829 (General_options::demangle): Change from DEFINE_bool to
16830 DEFINE_optional_string.
16831 (General_options::no_demangle): New function.
16832 (General_options::do_demangle): New function.
16833 (General_options::set_do_demangle): New function.
16834 (General_options::execstack_status_): Move definition to end of
16835 class definition.
16836 (General_options::static_): Likewise.
16837 (General_options::do_demangle_): New field.
16838 * object.cc (big_endian>::get_symbol_location_info): Call
16839 Options::do_demangle, not Options::demangle.
16840 * symtab.cc (demangle): Likewise.
16841
cbb93e63
ILT
168422008-03-22 Ian Lance Taylor <iant@google.com>
16843
16844 * gold.h: Include <cstddef> and <sys/types.h>
16845 * options.h: Include <cstring>.
16846
ec531623
ILT
168472008-03-21 Ian Lance Taylor <iant@google.com>
16848
16849 * Added source code to GNU binutils.
752937aa 16850\f
b90efa5b 16851Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16852
16853Copying and distribution of this file, with or without modification,
16854are permitted in any medium without royalty provided the copyright
16855notice and this notice are preserved.
16856
16857Local Variables:
16858mode: change-log
16859left-margin: 8
16860fill-column: 74
16861version-control: never
16862End:
This page took 1.070018 seconds and 4 git commands to generate.